Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 056e67f5d7 | |||
| 381501666c | |||
| 381879331f | |||
| 85a3464e71 | |||
| 154335e4a9 | |||
| 45a5315cd4 | |||
| 4296a648a4 | |||
| b18526f360 | |||
| 99bcbd4e74 | |||
| 0da6663c1e | |||
| 8013b21745 | |||
| 1f75676a77 | |||
| d10a91628c | |||
| f377b486e3 | |||
| 1031135026 | |||
| 6e06c52b7a | |||
| 5264f3c8a9 |
@@ -17,19 +17,15 @@ In pom.xml, add the following xml stanza between `<dependencies> ... </dependenc
|
||||
<dependency>
|
||||
<groupId>com.github.javafaker</groupId>
|
||||
<artifactId>javafaker</artifactId>
|
||||
<version>0.16</version>
|
||||
<version>0.17.2</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
For gradle users, add the following to your build.gradle file.
|
||||
|
||||
```groovy
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile group: 'com.github.javafaker', name: 'javafaker', version: '0.16'
|
||||
implementation 'com.github.javafaker:javafaker:0.17.2'
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<groupId>com.github.javafaker</groupId>
|
||||
<artifactId>javafaker</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>0.17.2</version>
|
||||
<version>0.17.3-SNAPSHOT</version>
|
||||
<name>Java Faker</name>
|
||||
<description>
|
||||
This library is a port of Ruby's stympy/faker gem (as well as Perl's Data::Faker library) that generates fake data.
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.github.javafaker;
|
||||
|
||||
public class Country {
|
||||
private final Faker faker;
|
||||
private final String flagUrl;
|
||||
|
||||
protected Country(Faker faker) {
|
||||
this.faker = faker;
|
||||
this.flagUrl = "http://flags.fmcdn.net/data/flags/w580/";
|
||||
}
|
||||
|
||||
public String flag() {
|
||||
return flagUrl + faker.fakeValuesService().resolve("country.code2", this, faker) + ".png";
|
||||
}
|
||||
|
||||
public String countryCode2() {
|
||||
return faker.fakeValuesService().resolve("country.code2", this, faker);
|
||||
}
|
||||
|
||||
public String countryCode3() {
|
||||
return faker.fakeValuesService().resolve("country.code3", this, faker);
|
||||
}
|
||||
|
||||
public String capital() {
|
||||
return faker.fakeValuesService().resolve("country.capital", this, faker);
|
||||
}
|
||||
|
||||
public String currency() {
|
||||
return faker.fakeValuesService().resolve("country.currency", this, faker);
|
||||
}
|
||||
|
||||
public String currencyCode() {
|
||||
return faker.fakeValuesService().resolve("country.currency_code", this, faker);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,6 +33,7 @@ public class Faker {
|
||||
private final ChuckNorris chuckNorris;
|
||||
private final Color color;
|
||||
private final Commerce commerce;
|
||||
private final Country country;
|
||||
private final Currency currency;
|
||||
private final Company company;
|
||||
private final Crypto crypto;
|
||||
@@ -167,6 +168,7 @@ public class Faker {
|
||||
this.weather = new Weather(this);
|
||||
this.lebowski = new Lebowski(this);
|
||||
this.medical = new Medical(this);
|
||||
this.country = new Country(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -553,6 +555,8 @@ public class Faker {
|
||||
|
||||
public Medical medical(){return medical;}
|
||||
|
||||
public Country country(){ return country;}
|
||||
|
||||
public String resolve(String key) {
|
||||
return this.fakeValuesService.resolve(key, this, this);
|
||||
}
|
||||
|
||||
@@ -297,4 +297,47 @@ public class Internet {
|
||||
private <T> T random(T[] src) {
|
||||
return src[faker.random().nextInt(src.length)];
|
||||
}
|
||||
|
||||
public String userAgent(UserAgent userAgent) {
|
||||
UserAgent agent = userAgent;
|
||||
|
||||
if(agent == null) {
|
||||
agent = UserAgent.any();
|
||||
}
|
||||
|
||||
String userAgentKey = "internet.user_agent." + agent.toString();
|
||||
return faker.fakeValuesService().resolve(userAgentKey, this, faker);
|
||||
}
|
||||
|
||||
public String userAgentAny() {
|
||||
return userAgent(null);
|
||||
}
|
||||
|
||||
public enum UserAgent {
|
||||
AOL("aol"),
|
||||
CHROME("chrome"),
|
||||
FIREFOX("firefox"),
|
||||
INTERNET_EXPLORER("internet_explorer"),
|
||||
NETSCAPE("netscape"),
|
||||
OPERA("opera"),
|
||||
SAFARI("safari");
|
||||
|
||||
//Browser's name in corresponding yaml (internet.yml) file.
|
||||
private String browserName;
|
||||
|
||||
UserAgent(String browserName) {
|
||||
this.browserName = browserName;
|
||||
}
|
||||
|
||||
private static UserAgent any() {
|
||||
UserAgent[] agents = UserAgent.values();
|
||||
int randomIndex = (int)(Math.random() * agents.length);
|
||||
return agents[randomIndex];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return browserName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.github.javafaker.service;
|
||||
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
public class FakeValues implements FakeValuesInterface {
|
||||
private final Locale locale;
|
||||
private final String filename;
|
||||
private final String path;
|
||||
private Map values;
|
||||
|
||||
FakeValues(Locale locale) {
|
||||
this(locale, getFilename(locale), getFilename(locale));
|
||||
}
|
||||
|
||||
private static String getFilename(Locale locale) {
|
||||
final StringBuilder filename = new StringBuilder(language(locale));
|
||||
if (!"".equals(locale.getCountry())) {
|
||||
filename.append("-").append(locale.getCountry());
|
||||
}
|
||||
return filename.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* If you new up a locale with "he", it gets converted to "iw" which is old.
|
||||
* This addresses that unfortunate condition.
|
||||
*/
|
||||
private static String language(Locale l) {
|
||||
if (l.getLanguage().equals("iw")) {
|
||||
return "he";
|
||||
}
|
||||
return l.getLanguage();
|
||||
}
|
||||
|
||||
FakeValues(Locale locale, String filename, String path) {
|
||||
this.locale = locale;
|
||||
this.filename = filename;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map get(String key) {
|
||||
if (values == null) {
|
||||
values = loadValues();
|
||||
}
|
||||
|
||||
return values == null ? null : (Map) values.get(key);
|
||||
}
|
||||
|
||||
private Map loadValues() {
|
||||
String pathWithLocaleAndFilename = "/" + locale.getLanguage() + "/" + this.filename;
|
||||
String pathWithFilename = "/" + filename + ".yml";
|
||||
String pathWithLocale = "/" + locale.getLanguage() + ".yml";
|
||||
|
||||
List<String> paths = Arrays.asList(pathWithLocaleAndFilename, pathWithFilename, pathWithLocale);
|
||||
InputStream stream = null;
|
||||
for (String path : paths) {
|
||||
stream = findStream(path);
|
||||
if (stream != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (stream == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final Map valuesMap = new Yaml().loadAs(stream, Map.class);
|
||||
Map localeBased = (Map) valuesMap.get(locale.getLanguage());
|
||||
if (localeBased == null) {
|
||||
localeBased = (Map) valuesMap.get(filename);
|
||||
}
|
||||
return (Map) localeBased.get("faker");
|
||||
}
|
||||
|
||||
private InputStream findStream(String filename) {
|
||||
InputStream streamOnClass = getClass().getResourceAsStream(filename);
|
||||
if (streamOnClass != null) {
|
||||
return streamOnClass;
|
||||
}
|
||||
return getClass().getClassLoader().getResourceAsStream(filename);
|
||||
}
|
||||
|
||||
boolean supportsPath(String path) {
|
||||
return this.path.equals(path);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.github.javafaker.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class FakeValuesGrouping implements FakeValuesInterface {
|
||||
|
||||
private List<FakeValues> fakeValuesList = new ArrayList<FakeValues>();
|
||||
|
||||
public void add(FakeValues fakeValues) {
|
||||
fakeValuesList.add(fakeValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public Map get(String key) {
|
||||
Map result = null;
|
||||
for (FakeValues fakeValues : fakeValuesList) {
|
||||
if (fakeValues.supportsPath(key)) {
|
||||
if (result != null) {
|
||||
final Map newResult = fakeValues.get(key);
|
||||
result.putAll(newResult);
|
||||
} else {
|
||||
result = fakeValues.get(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.github.javafaker.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface FakeValuesInterface {
|
||||
Map get(String key);
|
||||
}
|
||||
@@ -3,17 +3,21 @@ package com.github.javafaker.service;
|
||||
import com.github.javafaker.Address;
|
||||
import com.github.javafaker.Faker;
|
||||
import com.github.javafaker.Name;
|
||||
import com.github.javafaker.service.files.En;
|
||||
import com.github.javafaker.service.files.EnFile;
|
||||
import com.mifmif.common.regex.Generex;
|
||||
import org.apache.commons.lang3.ClassUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -24,8 +28,7 @@ public class FakeValuesService {
|
||||
|
||||
private final Logger log = Logger.getLogger("faker");
|
||||
|
||||
private final List<Map<String, Object>> fakeValuesMaps;
|
||||
|
||||
private final List<FakeValuesInterface> fakeValuesList;
|
||||
private final RandomService randomService;
|
||||
|
||||
/**
|
||||
@@ -58,64 +61,22 @@ public class FakeValuesService {
|
||||
locale = normalizeLocale(locale);
|
||||
|
||||
final List<Locale> locales = localeChain(locale);
|
||||
final List<Map<String, Object>> all = new ArrayList(locales.size());
|
||||
final Set<Locale> loadedLocales = new HashSet<Locale>();
|
||||
final List<FakeValuesInterface> all = new ArrayList(locales.size());
|
||||
|
||||
for (final Locale l : locales) {
|
||||
final StringBuilder filename = new StringBuilder(language(l));
|
||||
if (!"".equals(l.getCountry())) {
|
||||
filename.append("-").append(l.getCountry());
|
||||
}
|
||||
|
||||
boolean isEnglish = l.equals(Locale.ENGLISH);
|
||||
if (isEnglish) {
|
||||
for (String file : En.FILES) {
|
||||
final InputStream stream = findStream("/en/" + file.toString());
|
||||
if (stream != null) {
|
||||
all.add(fakerFromStream(stream, filename.toString()));
|
||||
}
|
||||
FakeValuesGrouping fakeValuesGrouping = new FakeValuesGrouping();
|
||||
for (EnFile file : EnFile.getFiles()) {
|
||||
fakeValuesGrouping.add(new FakeValues(l, file.getFile(), file.getPath()));
|
||||
}
|
||||
loadedLocales.add(l);
|
||||
all.add(fakeValuesGrouping);
|
||||
} else {
|
||||
final InputStream stream = findStream("/" + filename.toString() + ".yml");
|
||||
if (stream != null) {
|
||||
all.add(fakerFromStream(stream, filename.toString()));
|
||||
loadedLocales.add(l);
|
||||
}
|
||||
all.add(new FakeValues(locale));
|
||||
}
|
||||
}
|
||||
|
||||
if (loadedLocales.size() == 1 && loadedLocales.contains(Locale.ENGLISH) && !locale.equals(Locale.ENGLISH)) {
|
||||
// if we have only successfully loaded ENGLISH and the requested locale
|
||||
// wasn't english that means we were unable to load the requested locale
|
||||
// in that case we vomit.
|
||||
// If someone requests FRANCE ("fr","FR") and we can't load fr_FR but we
|
||||
// load "fr", then that's ok. we picked up a variant. only if we ONLY pick up
|
||||
// the default do we throw that exception.
|
||||
throw new LocaleDoesNotExistException(locale.toString() + " does not exist");
|
||||
}
|
||||
|
||||
this.fakeValuesMaps = Collections.unmodifiableList(all);
|
||||
}
|
||||
|
||||
/**
|
||||
* If you new up a locale with "he", it gets converted to "iw" which is old.
|
||||
* This addresses that unfortunate condition.
|
||||
*/
|
||||
private String language(Locale l) {
|
||||
if (l.getLanguage().equals("iw")) {
|
||||
return "he";
|
||||
}
|
||||
return l.getLanguage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the embedded faker: clause from the loaded Yml by the localeName, so .yml > en-us: > faker:
|
||||
*/
|
||||
protected Map fakerFromStream(InputStream stream, String localeName) {
|
||||
final Map valuesMap = new Yaml().loadAs(stream, Map.class);
|
||||
final Map localeBased = (Map) valuesMap.get(localeName);
|
||||
return (Map) localeBased.get("faker");
|
||||
this.fakeValuesList = Collections.unmodifiableList(all);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,14 +117,6 @@ public class FakeValuesService {
|
||||
}
|
||||
}
|
||||
|
||||
private InputStream findStream(String filename) {
|
||||
InputStream streamOnClass = getClass().getResourceAsStream(filename);
|
||||
if (streamOnClass != null) {
|
||||
return streamOnClass;
|
||||
}
|
||||
return getClass().getClassLoader().getResourceAsStream(filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a random value from an array item specified by the key
|
||||
*
|
||||
@@ -230,10 +183,15 @@ public class FakeValuesService {
|
||||
String[] path = key.split("\\.");
|
||||
|
||||
Object result = null;
|
||||
for (Map<String, Object> fakeValuesMap : fakeValuesMaps) {
|
||||
Object currentValue = fakeValuesMap;
|
||||
for (FakeValuesInterface fakeValuesInterface : fakeValuesList) {
|
||||
Object currentValue = fakeValuesInterface;
|
||||
for (int p = 0; currentValue != null && p < path.length; p++) {
|
||||
currentValue = ((Map<String, Object>) currentValue).get(path[p]);
|
||||
String currentPath = path[p];
|
||||
if (currentValue instanceof Map) {
|
||||
currentValue = ((Map) currentValue).get(currentPath);
|
||||
} else {
|
||||
currentValue = ((FakeValuesInterface) currentValue).get(currentPath);
|
||||
}
|
||||
}
|
||||
result = currentValue;
|
||||
if (result != null) {
|
||||
@@ -345,6 +303,7 @@ public class FakeValuesService {
|
||||
*/
|
||||
public String resolve(String key, Object current, Faker root) {
|
||||
final String expression = safeFetch(key, null);
|
||||
|
||||
if (expression == null) {
|
||||
throw new RuntimeException(key + " resulted in null expression");
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.github.javafaker.service;
|
||||
|
||||
public class LocaleDoesNotExistException extends RuntimeException {
|
||||
public LocaleDoesNotExistException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
+47
-5
@@ -1,10 +1,32 @@
|
||||
package com.github.javafaker.service.files;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class En {
|
||||
public static List<String> FILES = Arrays.asList("address.yml",
|
||||
public class EnFile {
|
||||
private final String file;
|
||||
private final String path;
|
||||
|
||||
private EnFile(String file) {
|
||||
this(file, file.replaceFirst(".yml", ""));
|
||||
}
|
||||
|
||||
private EnFile(String file, String path) {
|
||||
this.file = file;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
|
||||
public String getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
private static List<String> FILES = Arrays.asList("address.yml",
|
||||
"ancient.yml",
|
||||
"animal.yml",
|
||||
"app.yml",
|
||||
@@ -21,7 +43,6 @@ public class En {
|
||||
"buffy.yml",
|
||||
"business.yml",
|
||||
"cannabis.yml",
|
||||
"cat.yml",
|
||||
"chuck_norris.yml",
|
||||
"code.yml",
|
||||
"coffee.yml",
|
||||
@@ -33,13 +54,13 @@ public class En {
|
||||
"compass.yml",
|
||||
"construction.yml",
|
||||
"cosmere.yml",
|
||||
"country.yml",
|
||||
"crypto_coin.yml",
|
||||
"currency.yml",
|
||||
"dc_comics.yml",
|
||||
"demographic.yml",
|
||||
"dessert.yml",
|
||||
"device.yml",
|
||||
"dog.yml",
|
||||
"dota.yml",
|
||||
"dr_who.yml",
|
||||
"dragon_ball.yml",
|
||||
@@ -81,7 +102,6 @@ public class En {
|
||||
"invoice.yml",
|
||||
"job.yml",
|
||||
"kpop.yml",
|
||||
"league_of_legends.yml",
|
||||
"lebowski.yml",
|
||||
"lord_of_the_rings.yml",
|
||||
"lorem.yml",
|
||||
@@ -153,4 +173,26 @@ public class En {
|
||||
"world_of_warcraft.yml",
|
||||
"yoda.yml",
|
||||
"zelda.yml");
|
||||
|
||||
// files where the search path can't be derived from the filename
|
||||
private static List<EnFile> FILES_WITH_A_DIFFERENT_PATH = Arrays.asList(
|
||||
new EnFile("cat.yml", "creature"),
|
||||
new EnFile("dog.yml", "creature"),
|
||||
new EnFile("league_of_legends.yml", "games"),
|
||||
new EnFile("overwatch.yml", "games"),
|
||||
new EnFile("pokemon.yml", "games"),
|
||||
new EnFile("witcher.yml", "games"),
|
||||
new EnFile("zelda.yml", "games"),
|
||||
new EnFile("phone_number.yml", "cell_phone")); // load phone number again with a differen path
|
||||
|
||||
|
||||
public static List<EnFile> getFiles() {
|
||||
List<EnFile> files = new ArrayList<EnFile>();
|
||||
for (String file : FILES) {
|
||||
files.add(new EnFile(file));
|
||||
}
|
||||
files.addAll(FILES_WITH_A_DIFFERENT_PATH);
|
||||
|
||||
return files;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
en:
|
||||
faker:
|
||||
country:
|
||||
code2: ['af', 'al', 'dz', 'ad', 'ao', 'ag', 'ar', 'am', 'au', 'at', 'az', 'bs', 'bh', 'bd', 'bb', 'by', 'be', 'bz', 'bj', 'bt', 'bo', 'ba', 'bw', 'br', 'bn', 'bg', 'bf', 'bi', 'cv', 'kh', 'cm', 'ca', 'cf', 'td', 'cl', 'cn', 'co', 'km', 'cg', 'cd', 'cr', 'ci', 'hr', 'cu', 'cy', 'cz', 'dk', 'dj', 'dm', 'do', 'ec', 'eg', 'sv', 'gq', 'er', 'ee', 'sz', 'et', 'fj', 'fi', 'fr', 'ga', 'gm', 'ge', 'de', 'gh', 'gr', 'gd', 'gt', 'gn', 'gw', 'gy', 'ht', 'hn', 'hu', 'is', 'in', 'id', 'ir', 'iq', 'ie', 'il', 'it', 'jm', 'jp', 'jo', 'kz', 'ke', 'ki', 'kp', 'kr', 'kw', 'kg', 'la', 'lv', 'lb', 'ls', 'lr', 'ly', 'li', 'lt', 'lu', 'mk', 'mg', 'mw', 'my', 'mv', 'ml', 'mt', 'mh', 'mr', 'mu', 'mx', 'fm', 'md', 'mc', 'mn', 'me', 'ma', 'mz', 'mm', 'na', 'nr', 'np', 'nl', 'nz', 'ni', 'ne', 'ng', 'no', 'om', 'pk', 'pw', 'pa', 'pg', 'py', 'pe', 'ph', 'pl', 'pt', 'qa', 'ro', 'ru', 'rw', 'kn', 'lc', 'vc', 'ws', 'sm', 'st', 'sa', 'sn', 'rs', 'sc', 'sl', 'sg', 'sk', 'si', 'sb', 'so', 'za', 'ss', 'es', 'lk', 'sd', 'sr', 'se', 'ch', 'sy', 'tj', 'tz', 'th', 'tl', 'tg', 'to', 'tt', 'tn', 'tr', 'tm', 'tv', 'ug', 'ua', 'ae', 'gb', 'us', 'uy', 'uz', 'vu', 've', 'vn', 'ye', 'zm', 'zw']
|
||||
code3: ['afg', 'alb', 'dza', 'and', 'ago', 'atg', 'arg', 'arm', 'aus', 'aut', 'aze', 'bhs', 'bhr', 'bgd', 'brb', 'blr', 'bel', 'blz', 'ben', 'btn', 'bol', 'bih', 'bwa', 'bra', 'brn', 'bgr', 'bfa', 'bdi', 'cpv', 'khm', 'cmr', 'can', 'caf', 'tcd', 'chl', 'chn', 'col', 'com', 'cog', 'cod', 'cri', 'civ', 'hrv', 'cub', 'cyp', 'cze', 'dnk', 'dji', 'dma', 'dom', 'ecu', 'egy', 'slv', 'gnq', 'eri', 'est', 'swz', 'eth', 'fji', 'fin', 'fra', 'gab', 'gmb', 'geo', 'deu', 'gha', 'grc', 'grd', 'gtm', 'gin', 'gnb', 'guy', 'hti', 'hnd', 'hun', 'isl', 'ind', 'idn', 'irn', 'irq', 'irl', 'isr', 'ita', 'jam', 'jpn', 'jor', 'kaz', 'ken', 'kir', 'prk', 'kor', 'kwt', 'kgz', 'lao', 'lva', 'lbn', 'lso', 'lbr', 'lby', 'lie', 'ltu', 'lux', 'mkd', 'mdg', 'mwi', 'mys', 'mdv', 'mli', 'mlt', 'mhl', 'mrt', 'mus', 'mex', 'fsm', 'mda', 'mco', 'mng', 'mne', 'mar', 'moz', 'mmr', 'nam', 'nru', 'npl', 'nld', 'nzl', 'nic', 'ner', 'nga', 'nor', 'omn', 'pak', 'plw', 'pan', 'png', 'pry', 'per', 'phl', 'pol', 'prt', 'qat', 'rou', 'rus', 'rwa', 'kna', 'lca', 'vct', 'wsm', 'smr', 'stp', 'sau', 'sen', 'srb', 'syc', 'sle', 'sgp', 'svk', 'svn', 'slb', 'som', 'zaf', 'ssd', 'esp', 'lka', 'sdn', 'sur', 'swe', 'che', 'syr', 'tjk', 'tza', 'tha', 'tls', 'tgo', 'ton', 'tto', 'tun', 'tur', 'tkm', 'tuv', 'uga', 'ukr', 'are', 'gbr', 'usa', 'ury', 'uzb', 'vut', 'ven', 'vnm', 'yem', 'zmb', 'zwe']
|
||||
name: ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia (Plurinational State of)", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cabo Verde", "Cambodia", "Cameroon", "Canada", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo", "Congo, Democratic Republic of the", "Costa Rica", "Côte d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czechia", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Eswatini", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea (Democratic People's Republic of)", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia, the former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia (Federated States of)", "Moldova, Republic of", "Monaco", "Mongolia", "Montenegro", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Sudan", "Spain", "Sri Lanka", "Sudan", "Suriname", "Sweden", "Switzerland", "Syrian Arab Republic", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Timor-Leste", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom of Great Britain and Northern Ireland", "United States of America", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela (Bolivarian Republic of)", "Viet Nam", "Yemen", "Zambia", "Zimbabwe"]
|
||||
capital: ["Hargeisa", "King Edward Point", "Port-aux-Français", "Jerusalem", "Mariehamn", "Yaren", "Marigot", "Atafu", "El-Aaiún", "Kabul", "Tirana", "Algiers", "Pago Pago", "Andorra la Vella", "Luanda", "The Valley", "Saint John's", "Buenos Aires", "Yerevan", "Oranjestad", "Canberra", "Vienna", "Baku", "Nassau", "Manama", "Dhaka", "Bridgetown", "Minsk", "Brussels", "Belmopan", "Porto-Novo", "Hamilton", "Thimphu", "La Paz", "Sarajevo", "Gaborone", "Brasilia", "Road Town", "Bandar Seri Begawan", "Sofia", "Ouagadougou", "Rangoon", "Bujumbura", "Phnom Penh", "Yaounde", "Ottawa", "Praia", "George Town", "Bangui", "N'Djamena", "Santiago", "Beijing", "The Settlement", "West Island", "Bogota", "Moroni", "Kinshasa", "Brazzaville", "Avarua", "San Jose", "Yamoussoukro", "Zagreb", "Havana", "Willemstad", "Nicosia", "Prague", "Copenhagen", "Djibouti", "Roseau", "Santo Domingo", "Quito", "Cairo", "San Salvador", "Malabo", "Asmara", "Tallinn", "Addis Ababa", "Stanley", "Torshavn", "Suva", "Helsinki", "Paris", "Papeete", "Libreville", "Banjul", "Tbilisi", "Berlin", "Accra", "Gibraltar", "Athens", "Nuuk", "Saint George's", "Hagatna", "Guatemala City", "Saint Peter Port", "Conakry", "Bissau", "Georgetown", "Port-au-Prince", "Vatican City", "Tegucigalpa", "Budapest", "Reykjavik", "New Delhi", "Jakarta", "Tehran", "Baghdad", "Dublin", "Douglas", "Jerusalem", "Rome", "Kingston", "Tokyo", "Saint Helier", "Amman", "Astana", "Nairobi", "Tarawa", "Pyongyang", "Seoul", "Pristina", "Kuwait City", "Bishkek", "Vientiane", "Riga", "Beirut", "Maseru", "Monrovia", "Tripoli", "Vaduz", "Vilnius", "Luxembourg", "Skopje", "Antananarivo", "Lilongwe", "Kuala Lumpur", "Male", "Bamako", "Valletta", "Majuro", "Nouakchott", "Port Louis", "Mexico City", "Palikir", "Chisinau", "Monaco", "Ulaanbaatar", "Podgorica", "Plymouth", "Rabat", "Maputo", "Windhoek", "Kathmandu", "Amsterdam", "Noumea", "Wellington", "Managua", "Niamey", "Abuja", "Alofi", "Kingston", "Saipan", "Oslo", "Muscat", "Islamabad", "Melekeok", "Panama City", "Port Moresby", "Asuncion", "Lima", "Manila", "Adamstown", "Warsaw", "Lisbon", "San Juan", "Doha", "Bucharest", "Moscow", "Kigali", "Gustavia", "Jamestown", "Basseterre", "Castries", "Saint-Pierre", "Kingstown", "Apia", "San Marino", "Sao Tome", "Riyadh", "Dakar", "Belgrade", "Victoria", "Freetown", "Singapore", "Philipsburg", "Bratislava", "Ljubljana", "Honiara", "Mogadishu", "Pretoria", "Juba", "Madrid", "Colombo", "Khartoum", "Paramaribo", "Longyearbyen", "Mbabane", "Stockholm", "Bern", "Damascus", "Taipei", "Dushanbe", "Dar es Salaam", "Bangkok", "Dili", "Lome", "Nuku'alofa", "Port of Spain", "Tunis", "Ankara", "Ashgabat", "Grand Turk", "Funafuti", "Kampala", "Kyiv", "Abu Dhabi", "London", "Washington", "Montevideo", "Tashkent", "Port-Vila", "Caracas", "Hanoi", "Charlotte Amalie", "Mata-Utu", "Sanaa", "Lusaka", "Harare", "Washington", "North Nicosia", "Diego Garcia"]
|
||||
currency: ["Afghani", "Euro", "Lek", "Algerian Dinar", "US Dollar", "Euro", "Kwanza", "East Caribbean Dollar", "No universal currency", "East Caribbean Dollar", "Argentine Peso", "Armenian Dram", "Aruban Florin", "Australian Dollar", "Euro", "Azerbaijan Manat", "Bahamian Dollar", "Bahraini Dinar", "Taka", "Barbados Dollar", "Belarusian Ruble", "Euro", "Belize Dollar", "CFA Franc BCEAO", "Bermudian Dollar", "Indian Rupee", "Ngultrum", "Boliviano", "Mvdol", "US Dollar", "Convertible Mark", "Pula", "Norwegian Krone", "Brazilian Real", "US Dollar", "Brunei Dollar", "Bulgarian Lev", "CFA Franc BCEAO", "Burundi Franc", "Cabo Verde Escudo", "Riel", "CFA Franc BEAC", "Canadian Dollar", "Cayman Islands Dollar", "CFA Franc BEAC", "CFA Franc BEAC", "Chilean Peso", "Unidad de Fomento", "Yuan Renminbi", "Australian Dollar", "Australian Dollar", "Colombian Peso", "Unidad de Valor Real", "Comorian Franc ", "Congolese Franc", "CFA Franc BEAC", "New Zealand Dollar", "Costa Rican Colon", "CFA Franc BCEAO", "Kuna", "Cuban Peso", "Peso Convertible", "Netherlands Antillean Guilder", "Euro", "Czech Koruna", "Danish Krone", "Djibouti Franc", "East Caribbean Dollar", "Dominican Peso", "US Dollar", "Egyptian Pound", "El Salvador Colon", "US Dollar", "CFA Franc BEAC", "Nakfa", "Euro", "Ethiopian Birr", "Euro", "Falkland Islands Pound", "Danish Krone", "Fiji Dollar", "Euro", "Euro", "Euro", "CFP Franc", "Euro", "CFA Franc BEAC", "Dalasi", "Lari", "Euro", "Ghana Cedi", "Gibraltar Pound", "Euro", "Danish Krone", "East Caribbean Dollar", "Euro", "US Dollar", "Quetzal", "Pound Sterling", "Guinean Franc", "CFA Franc BCEAO", "Guyana Dollar", "Gourde", "US Dollar", "Australian Dollar", "Euro", "Lempira", "Hong Kong Dollar", "Forint", "Iceland Krona", "Indian Rupee", "Rupiah", "SDR (Special Drawing Right)", "Iranian Rial", "Iraqi Dinar", "Euro", "Pound Sterling", "New Israeli Sheqel", "Euro", "Jamaican Dollar", "Yen", "Pound Sterling", "Jordanian Dinar", "Tenge", "Kenyan Shilling", "Australian Dollar", "North Korean Won", "Won", "Kuwaiti Dinar", "Som", "Lao Kip", "Euro", "Lebanese Pound", "Loti", "Rand", "Liberian Dollar", "Libyan Dinar", "Swiss Franc", "Euro", "Euro", "Pataca", "Denar", "Malagasy Ariary", "Malawi Kwacha", "Malaysian Ringgit", "Rufiyaa", "CFA Franc BCEAO", "Euro", "US Dollar", "Euro", "Ouguiya", "Mauritius Rupee", "Euro", "ADB Unit of Account", "Mexican Peso", "Mexican Unidad de Inversion (UDI)", "US Dollar", "Moldovan Leu", "Euro", "Tugrik", "Euro", "East Caribbean Dollar", "Moroccan Dirham", "Mozambique Metical", "Kyat", "Namibia Dollar", "Rand", "Australian Dollar", "Nepalese Rupee", "Euro", "CFP Franc", "New Zealand Dollar", "Cordoba Oro", "CFA Franc BCEAO", "Naira", "New Zealand Dollar", "Australian Dollar", "US Dollar", "Norwegian Krone", "Rial Omani", "Pakistan Rupee", "US Dollar", "No universal currency", "Balboa", "US Dollar", "Kina", "Guarani", "Sol", "Philippine Peso", "New Zealand Dollar", "Zloty", "Euro", "US Dollar", "Qatari Rial", "Euro", "Romanian Leu", "Russian Ruble", "Rwanda Franc", "Euro", "Saint Helena Pound", "East Caribbean Dollar", "East Caribbean Dollar", "Euro", "Euro", "East Caribbean Dollar", "Tala", "Euro", "Dobra", "Saudi Riyal", "CFA Franc BCEAO", "Serbian Dinar", "Seychelles Rupee", "Leone", "Singapore Dollar", "Netherlands Antillean Guilder", "Sucre", "Euro", "Euro", "Solomon Islands Dollar", "Somali Shilling", "Rand", "No universal currency", "South Sudanese Pound", "Euro", "Sri Lanka Rupee", "Sudanese Pound", "Surinam Dollar", "Norwegian Krone", "Lilangeni", "Swedish Krona", "Swiss Franc", "WIR Euro", "WIR Franc", "Syrian Pound", "New Taiwan Dollar", "Somoni", "Tanzanian Shilling", "Baht", "US Dollar", "CFA Franc BCEAO", "New Zealand Dollar", "Pa’anga", "Trinidad and Tobago Dollar", "Tunisian Dinar", "Turkish Lira", "Turkmenistan New Manat", "US Dollar", "Australian Dollar", "Uganda Shilling", "Hryvnia", "UAE Dirham", "Pound Sterling", "US Dollar", "US Dollar", "US Dollar (Next day)", "Peso Uruguayo", "Uruguay Peso en Unidades Indexadas (UI)", "Unidad Previsional", "Uzbekistan Sum", "Vatu", "Bolívar Soberano", "Dong", "US Dollar", "US Dollar", "CFP Franc", "Moroccan Dirham", "Yemeni Rial", "Zambian Kwacha", "Zimbabwe Dollar"]
|
||||
currency_code: ["AFN", "EUR", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "XCD", "ARS", "AMD", "AWG", "AUD", "EUR", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "EUR", "BZD", "XOF", "BMD", "INR", "BTN", "BOB", "BOV", "USD", "BAM", "BWP", "NOK", "BRL", "USD", "BND", "BGN", "XOF", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "XAF", "XAF", "CLP", "CLF", "CNY", "AUD", "AUD", "COP", "COU", "KMF", "CDF", "XAF", "NZD", "CRC", "XOF", "HRK", "CUP", "CUC", "ANG", "EUR", "CZK", "DKK", "DJF", "XCD", "DOP", "USD", "EGP", "SVC", "USD", "XAF", "ERN", "EUR", "ETB", "EUR", "FKP", "DKK", "FJD", "EUR", "EUR", "EUR", "XPF", "EUR", "XAF", "GMD", "GEL", "EUR", "GHS", "GIP", "EUR", "DKK", "XCD", "EUR", "USD", "GTQ", "GBP", "GNF", "XOF", "GYD", "HTG", "USD", "AUD", "EUR", "HNL", "HKD", "HUF", "ISK", "INR", "IDR", "XDR", "IRR", "IQD", "EUR", "GBP", "ILS", "EUR", "JMD", "JPY", "GBP", "JOD", "KZT", "KES", "AUD", "KPW", "KRW", "KWD", "KGS", "LAK", "EUR", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "EUR", "EUR", "MOP", "MKD", "MGA", "MWK", "MYR", "MVR", "XOF", "EUR", "USD", "EUR", "MRU", "MUR", "EUR", "XUA", "MXN", "MXV", "USD", "MDL", "EUR", "MNT", "EUR", "XCD", "MAD", "MZN", "MMK", "NAD", "ZAR", "AUD", "NPR", "EUR", "XPF", "NZD", "NIO", "XOF", "NGN", "NZD", "AUD", "USD", "NOK", "OMR", "PKR", "USD", "PAB", "USD", "PGK", "PYG", "PEN", "PHP", "NZD", "PLN", "EUR", "USD", "QAR", "EUR", "RON", "RUB", "RWF", "EUR", "SHP", "XCD", "XCD", "EUR", "EUR", "XCD", "WST", "EUR", "STN", "SAR", "XOF", "RSD", "SCR", "SLL", "SGD", "ANG", "XSU", "EUR", "EUR", "SBD", "SOS", "ZAR", "SSP", "EUR", "LKR", "SDG", "SRD", "NOK", "SZL", "SEK", "CHF", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "USD", "XOF", "NZD", "TOP", "TTD", "TND", "TRY", "TMT", "USD", "AUD", "UGX", "UAH", "AED", "GBP", "USD", "USD", "USN", "UYU", "UYI", "UYW", "UZS", "VUV", "VES", "VND", "USD", "USD", "XPF", "MAD", "YER", "ZMW", "ZWL"]
|
||||
@@ -10,16 +10,79 @@ en:
|
||||
user_agent:
|
||||
aol:
|
||||
- Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1; SV1)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1; .NET CLR 1.1.4322)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322)
|
||||
- Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.0; Windows NT 5.1; .NET CLR 1.1.4322)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows 98)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1; .NET CLR 1.0.3705)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)
|
||||
chrome:
|
||||
- Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36
|
||||
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
|
||||
- Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
|
||||
- Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36
|
||||
- Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36
|
||||
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
|
||||
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
|
||||
- Mozilla/5.0 (Windows NT 5.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
|
||||
- Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
|
||||
- Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
|
||||
firefox:
|
||||
- Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0) Gecko/20100101 Firefox/10.0
|
||||
- Mozilla/5.0 (Windows NT 5.1; rv:36.0) Gecko/20100101 Firefox/36.0
|
||||
- Mozilla/5.0 (Windows NT 5.1; rv:33.0) Gecko/20100101 Firefox/33.0
|
||||
- Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
|
||||
- Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
|
||||
- Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
|
||||
- Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
|
||||
- Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0
|
||||
- Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1
|
||||
- Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
|
||||
internet_explorer:
|
||||
- Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
|
||||
- Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
|
||||
- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
|
||||
- Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; 125LA; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
|
||||
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
|
||||
netscape:
|
||||
- Mozilla/5.0 (Windows; U; Win 9x 4.90; SG; rv:1.9.2.4) Gecko/20101104 Netscape/9.1.0285
|
||||
- Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)
|
||||
- Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)
|
||||
- Mozilla/5.0 (compatible; Linux x86_64; Mail.RU_Bot/2.0; +http://go.mail.ru/help/robots)
|
||||
- Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
|
||||
- Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
|
||||
- Mozilla/5.001 (windows; U; NT4.0; en-US; rv:1.0) Gecko/25250101
|
||||
- Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
|
||||
- Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko GranParadiso/3.0.11
|
||||
- Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201
|
||||
opera:
|
||||
- Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16
|
||||
- Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.18
|
||||
- Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 OPR/43.0.2442.991
|
||||
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 OPR/56.0.3051.52
|
||||
- Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36 OPR/36.0.2130.32
|
||||
- Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 OPR/43.0.2442.991
|
||||
- Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14
|
||||
- Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 OPR/42.0.2393.94
|
||||
- Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3198.0 Safari/537.36 OPR/49.0.2711.0
|
||||
- Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 OPR/42.0.2393.94
|
||||
safari:
|
||||
- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A
|
||||
- Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1
|
||||
- Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-en) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
|
||||
- Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1
|
||||
- Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1
|
||||
- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.1 Safari/605.1.15
|
||||
- Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.0 Mobile/14G60 Safari/602.1
|
||||
- Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1
|
||||
- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.59.10 (KHTML, like Gecko) Version/5.1.9 Safari/534.59.10
|
||||
- Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13G36 Safari/601.1
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@ public class CommerceTest extends AbstractFakerTest {
|
||||
|
||||
private static final char decimalSeparator = new DecimalFormatSymbols().getDecimalSeparator();
|
||||
|
||||
private static final String CAPITALIZED_WORD_REGEX = "[A-Z][a-z]+";
|
||||
|
||||
private static final String PROMOTION_CODE_REGEX = CAPITALIZED_WORD_REGEX + "(-" + CAPITALIZED_WORD_REGEX + ")*";
|
||||
|
||||
@Test
|
||||
public void testColor() {
|
||||
assertThat(faker.commerce().color(), matchesRegularExpression("(\\w+ ?){1,2}"));
|
||||
@@ -43,11 +47,11 @@ public class CommerceTest extends AbstractFakerTest {
|
||||
|
||||
@Test
|
||||
public void testPromotionCode() {
|
||||
assertThat(faker.commerce().promotionCode(), matchesRegularExpression("[A-Z][a-z]+[A-Z][a-z]+\\d{6}"));
|
||||
assertThat(faker.commerce().promotionCode(), matchesRegularExpression(PROMOTION_CODE_REGEX + PROMOTION_CODE_REGEX + "\\d{6}"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPromotionCodeDigits() {
|
||||
assertThat(faker.commerce().promotionCode(3), matchesRegularExpression("[A-Z][a-z]+[A-Z][a-z]+\\d{3}"));
|
||||
assertThat(faker.commerce().promotionCode(3), matchesRegularExpression(PROMOTION_CODE_REGEX + PROMOTION_CODE_REGEX + "\\d{3}"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.github.javafaker;
|
||||
|
||||
import com.github.javafaker.repeating.Repeat;
|
||||
import org.junit.Test;
|
||||
|
||||
import static com.github.javafaker.matchers.MatchesRegularExpression.matchesRegularExpression;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
public class CountryTest extends AbstractFakerTest {
|
||||
|
||||
@Test
|
||||
@Repeat(times=10)
|
||||
public void testFlag() {
|
||||
String flag = faker.country().flag();
|
||||
assertThat(flag, matchesRegularExpression("^http:\\/\\/flags.fmcdn\\.net\\/data\\/flags\\/w580\\/[a-zA-Z0-9_]+\\.png$"));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testCode2() {
|
||||
assertThat(faker.country().countryCode2(), matchesRegularExpression("([a-z]{2})"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCode3() {
|
||||
assertThat(faker.country().countryCode3(), matchesRegularExpression("([a-z]{3})"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCapital() {
|
||||
assertThat(faker.country().capital(), matchesRegularExpression("([\\w'-]+ ?)+"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurrency() {
|
||||
assertThat(faker.country().currency(), matchesRegularExpression("([\\w-]+ ?)+"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurrencyCode() {
|
||||
assertThat(faker.country().currencyCode(), matchesRegularExpression("([\\w-]+ ?)+"));
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.validator.routines.EmailValidator;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.hamcrest.core.IsNot;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
@@ -276,4 +277,15 @@ public class InternetTest extends AbstractFakerTest {
|
||||
assertThat(f.internet().safeEmailAddress(), not(isEmptyOrNullString()));
|
||||
assertThat(f.internet().url(), not(isEmptyOrNullString()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUserAgent() {
|
||||
Internet.UserAgent[] agents = Internet.UserAgent.values();
|
||||
for(Internet.UserAgent agent : agents) {
|
||||
assertThat(faker.internet().userAgent(agent), not(isEmptyOrNullString()));
|
||||
}
|
||||
|
||||
//Test faker.internet().userAgentAny() for random user_agent retrieval.
|
||||
assertThat(faker.internet().userAgentAny(), not(isEmptyOrNullString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class WitcherTest extends AbstractFakerTest {
|
||||
|
||||
@Test
|
||||
public void testQuote() {
|
||||
assertThat(faker.witcher().quote(), matchesRegularExpression("[A-Za-z0-9 …\\?\\!\\.’',]+"));
|
||||
assertThat(faker.witcher().quote(), matchesRegularExpression("[-A-Za-z0-9 —;…\\?\\!\\.’‘'”“,\\[\\]]+"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -100,6 +100,7 @@ public class FakerIT {
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.color());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.commerce());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.company());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.country());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.crypto());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.demographic());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.dragonBall());
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.github.javafaker.service;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
public class FakeValuesGroupingTest {
|
||||
|
||||
private FakeValuesGrouping fakeValuesGrouping;
|
||||
private FakeValues addressValues;
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
fakeValuesGrouping = new FakeValuesGrouping();
|
||||
addressValues = new FakeValues(Locale.ENGLISH, "address.yml", "address");
|
||||
fakeValuesGrouping.add(addressValues);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handlesOneFakeValue() {
|
||||
assertThat(fakeValuesGrouping.get("address"), is(addressValues.get("address")));
|
||||
assertThat(fakeValuesGrouping.get("address"), is(notNullValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handlesMultipleFakeValues() {
|
||||
FakeValues catValues = new FakeValues(Locale.ENGLISH, "cat.yml", "creature");
|
||||
fakeValuesGrouping.add(catValues);
|
||||
|
||||
assertThat(fakeValuesGrouping.get("address"), is(addressValues.get("address")));
|
||||
assertThat(fakeValuesGrouping.get("address"), is(notNullValue()));
|
||||
|
||||
assertThat(fakeValuesGrouping.get("creature"), is(catValues.get("creature")));
|
||||
assertThat(fakeValuesGrouping.get("creature"), is(notNullValue()));
|
||||
}
|
||||
}
|
||||
@@ -38,11 +38,6 @@ public class FakeValuesServiceTest extends AbstractFakerTest {
|
||||
fakeValuesService = spy(new FakeValuesService(new Locale("test"), randomService));
|
||||
}
|
||||
|
||||
@Test(expected = LocaleDoesNotExistException.class)
|
||||
public void localeShouldThrowException() {
|
||||
new FakeValuesService(new Locale("Does not exist"), randomService);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fetchStringShouldReturnValue() {
|
||||
assertThat(fakeValuesService.fetchString("property.dummy"), is("x"));
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.github.javafaker.service;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
|
||||
public class FakeValuesTest {
|
||||
|
||||
private static final String PATH = "address";
|
||||
private FakeValues fakeValues;
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
fakeValues = new FakeValues(Locale.ENGLISH, "address.yml", PATH);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void supportsPathIsTrueWithTheSameValueAsThePath() {
|
||||
assertThat(fakeValues.supportsPath(PATH), is(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void supportsPathIsFalseWhenValueIsNotTheSame() {
|
||||
assertThat(fakeValues.supportsPath("dog"), is(false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAValueReturnsAValue() {
|
||||
assertThat(fakeValues.get(PATH), is(notNullValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAValueDoesNotReturnAValue() {
|
||||
assertThat(fakeValues.get("dog"), is(nullValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAValueWithANonEnglishFile() {
|
||||
FakeValues frenchFakeValues = new FakeValues(Locale.FRENCH);
|
||||
assertThat(frenchFakeValues.get(PATH), is(notNullValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAValueForHebrewLocale() {
|
||||
FakeValues hebrew = new FakeValues(new Locale("iw"));
|
||||
assertThat(hebrew.get(PATH), is(notNullValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAValueFromALocaleThatCantBeLoaded() {
|
||||
FakeValues fakeValues = new FakeValues(new Locale("nothing"));
|
||||
assertThat(fakeValues.get(PATH), is(nullValue()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user