Compare commits

...

20 Commits

Author SHA1 Message Date
Ricky 3127b80b00 [maven-release-plugin] prepare release javafaker-0.17.1 2019-02-02 11:04:43 +11:00
Ricky eb66eb9385 fixing NPE 2019-02-02 10:52:09 +11:00
Ricky df8c46da88 [maven-release-plugin] prepare for next development iteration 2019-02-01 20:34:25 +11:00
Ricky 8684b65838 [maven-release-plugin] prepare release javafaker-0.17 2019-02-01 20:34:09 +11:00
Ricky Yim 364126bf65 Merge pull request #330 from alonhartman/he_additions
Some Heb additions
2019-01-30 06:23:53 +11:00
Ricky Yim 370d956289 Merge pull request #329 from matthewtraughber/master
Added ability to get county via zip (en-US locale only)
2019-01-30 06:19:40 +11:00
Ricky Yim f4c3fff71b Merge pull request #345 from longnguyen2306/master
Add more beer brand name of beer, add more adjectives and noun of commerce. Added more quotes to witcher
2019-01-30 06:14:01 +11:00
Ricky Yim 6986a53d9f Merge pull request #347 from valfirst/patch-1
Fix weather descriptions for Russian locale
2019-01-30 06:11:51 +11:00
Valery Yatsynovich e0963d6bbc Fix weather descriptions for Russian locale 2019-01-23 15:51:22 +03:00
Long Nguyen 4e78791a53 Added more quotes for witcher 2019-01-19 11:07:53 +01:00
Long Nguyen d78b7d029c Added more adjective and nouns to commerce 2019-01-19 10:53:54 +01:00
Long Nguyen 13a30260af Update beer brand. Added some popular german brands 2019-01-19 10:44:57 +01:00
Ricky Yim c175aabd16 Merge pull request #339 from codingricky/travis-jdk
Travis jdk
2018-12-20 21:28:42 +11:00
Ricky 3aaef1b527 fixing more asserts 2018-12-20 21:19:06 +11:00
Ricky 7d5c263d8e updated jdk and fixed assert 2018-12-20 21:07:51 +11:00
Ricky Yim ac6d4cdf6f removing jdk 2018-12-20 11:50:53 +11:00
Ricky Yim 9ff4d1647a added more jdk versions into travis 2018-12-20 11:39:51 +11:00
Ricky Yim 4c8b7406f1 Merge pull request #338 from DiUS/new-loading
New loading
2018-12-19 20:54:07 +11:00
alon f024d82908 Some Heb additions 2018-11-09 00:13:42 +02:00
Matthew Traughber f73dd19086 Added ability to get county via zip (en-US locale only) 2018-11-08 14:58:02 -05:00
13 changed files with 41156 additions and 97 deletions
+3
View File
@@ -3,6 +3,8 @@ dist: trusty
jdk:
- oraclejdk8
- openjdk7
- openjdk10
- oraclejdk11
script: "mvn verify failsafe:integration-test failsafe:verify"
branches:
except:
@@ -11,3 +13,4 @@ notifications:
email: false
after_success:
- mvn clean cobertura:cobertura coveralls:cobertura
+1 -1
View File
@@ -3,7 +3,7 @@
<groupId>com.github.javafaker</groupId>
<artifactId>javafaker</artifactId>
<packaging>jar</packaging>
<version>0.17-SNAPSHOT</version>
<version>0.17.1</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.
@@ -35,7 +35,13 @@ public class Address {
return faker.bothify(faker.fakeValuesService().resolve("address.postcode", this,faker));
}
public String zipCodeByState(String stateAbbr) { return faker.fakeValuesService().resolve("address.postcode_by_state." + stateAbbr, this, faker); }
public String zipCodeByState(String stateAbbr) {
return faker.fakeValuesService().resolve("address.postcode_by_state." + stateAbbr, this, faker);
}
public String countyByZipCode(String postCode) {
return faker.fakeValuesService().resolve("address.county_by_postcode." + postCode, this, faker);
}
public String streetSuffix() {
return faker.fakeValuesService().resolve("address.street_suffix", this, faker);
@@ -9,12 +9,16 @@ import org.apache.commons.lang3.StringUtils;
import org.yaml.snakeyaml.Yaml;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.JarURLConnection;
import java.net.URL;
import java.util.*;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
@@ -24,28 +28,29 @@ public class FakeValuesService {
private static final Pattern EXPRESSION_PATTERN = Pattern.compile("#\\{([a-z0-9A-Z_.]+)\\s?(?:'([^']+)')?(?:,'([^']+)')*\\}");
private final Logger log = Logger.getLogger("faker");
private final List<Map<String, Object>> fakeValuesMaps;
private final RandomService randomService;
/**
* <p>
* Resolves YAML file using the most specific path first based on language and country code.
* 'en_US' would resolve in the following order:
* <ol>
* <li>/en-US.yml</li>
* <li>/en.yml</li>
* </ol>
* The search is case-insensitive, so the following will all resolve correctly. Also, either a hyphen or
* an underscore can be used when constructing a {@link Locale} instance. This is legacy behavior and not
* condoned, but it will work.
* <ul>
* <li>EN_US</li>
* <li>En-Us</li>
* <li>eN_uS</li>
* </ul>
* Resolves YAML file using the most specific path first based on language and country code.
* 'en_US' would resolve in the following order:
* <ol>
* <li>/en-US.yml</li>
* <li>/en.yml</li>
* </ol>
* The search is case-insensitive, so the following will all resolve correctly. Also, either a hyphen or
* an underscore can be used when constructing a {@link Locale} instance. This is legacy behavior and not
* condoned, but it will work.
* <ul>
* <li>EN_US</li>
* <li>En-Us</li>
* <li>eN_uS</li>
* </ul>
* </p>
*
* @param locale
* @param randomService
*/
@@ -58,7 +63,7 @@ public class FakeValuesService {
locale = normalizeLocale(locale);
final List<Locale> locales = localeChain(locale);
final List<Map<String,Object>> all = new ArrayList(locales.size());
final List<Map<String, Object>> all = new ArrayList(locales.size());
final Set<Locale> loadedLocales = new HashSet<Locale>();
for (final Locale l : locales) {
@@ -67,25 +72,28 @@ public class FakeValuesService {
filename.append("-").append(l.getCountry());
}
// list the files on the classpath... so if we pass in "en"
// it will look for a folder "en" and list all the files underneath it
File[] files = listFilesInDirectoryOnClasspath(filename.toString());
for (File resourceFolderFile : files) {
String fileToLoad = filename + "/" + resourceFolderFile.getName();
final InputStream stream = getClass().getClassLoader().getResourceAsStream(fileToLoad);
// need to treat jar files differently
if (isJarFile(filename.toString())) {
loadFromJarFile(all, loadedLocales, l, filename);
} else {
// list the files on the classpath... so if we pass in "en"
// it will look for a folder "en" and list all the files underneath it
File[] files = listFilesInDirectoryOnClasspath(filename.toString());
for (File resourceFolderFile : files) {
String fileToLoad = filename + "/" + resourceFolderFile.getName();
final InputStream stream = getClass().getClassLoader().getResourceAsStream(fileToLoad);
if (stream != null) {
Map map = fakerFromStream(stream, filename.toString());
all.add(map);
loadedLocales.add(l);
}
}
final InputStream stream = findStream(filename.toString());
if (stream != null) {
Map map = fakerFromStream(stream, filename.toString());
all.add(map);
all.add(fakerFromStream(stream, filename.toString()));
loadedLocales.add(l);
}
}
final InputStream stream = findStream(filename.toString());
if (stream != null) {
all.add(fakerFromStream(stream, filename.toString()));
loadedLocales.add(l);
}
}
if (loadedLocales.size() == 1 && loadedLocales.contains(Locale.ENGLISH) && !locale.equals(Locale.ENGLISH)) {
@@ -101,10 +109,44 @@ public class FakeValuesService {
this.fakeValuesMaps = Collections.unmodifiableList(all);
}
private void loadFromJarFile(List<Map<String, Object>> all, Set<Locale> loadedLocales, Locale locale, StringBuilder filename) {
try {
ClassLoader loader = getClass().getClassLoader();
URL url = loader.getResource(filename.toString());
JarURLConnection connection = (JarURLConnection) url.openConnection();
JarFile jarFile = connection.getJarFile();
Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreElements()) {
JarEntry jarEntry = entries.nextElement();
String jarEntryName = jarEntry.getName();
if (jarEntryName.contains(filename.toString() + "/") && jarEntryName.endsWith(".yml")) {
InputStream inputStream = jarFile.getInputStream(jarEntry);
if (inputStream != null) {
Map map = fakerFromStream(inputStream, filename.toString());
all.add(map);
loadedLocales.add(locale);
}
}
}
} catch (IOException e) {
throw new LocaleDoesNotExistException(filename.toString());
}
}
private boolean isJarFile(String fileName) {
ClassLoader loader = getClass().getClassLoader();
URL url = loader.getResource(fileName);
return url != null && url.getProtocol().equals("jar");
}
private File[] listFilesInDirectoryOnClasspath(String dir) {
ClassLoader loader = getClass().getClassLoader();
URL url = loader.getResource(dir);
return (url != null) ? new File(url.getPath()).listFiles() : new File[0];
if (url == null) {
return new File[0];
} else {
return new File(url.getPath()).listFiles();
}
}
/**
@@ -119,7 +161,7 @@ public class FakeValuesService {
}
/**
* @return the embedded faker: clause from the loaded Yml by the localeName, so .yml > en-us: > faker:
* @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);
@@ -129,9 +171,9 @@ public class FakeValuesService {
/**
* Convert the specified locale into a chain of locales used for message resolution. For example:
*
* {@link Locale#FRANCE} (fr_FR) -> [ fr_FR, fr, en ]
*
* <p>
* {@link Locale#FRANCE} (fr_FR) -> [ fr_FR, anotherTest, en ]
*
* @return a list of {@link Locale} instances
*/
protected List<Locale> localeChain(Locale from) {
@@ -149,24 +191,24 @@ public class FakeValuesService {
chain.add(Locale.ENGLISH); // default
return chain;
}
/**
* @return a proper {@link Locale} instance with language and country code set regardless of how
* it was instantiated. new Locale("pt-br") will be normalized to a locale constructed
* with new Locale("pt","BR").
* it was instantiated. new Locale("pt-br") will be normalized to a locale constructed
* with new Locale("pt","BR").
*/
private Locale normalizeLocale(Locale locale) {
final String[] parts = locale.toString().split("[-\\_]");
if (parts.length == 1) {
return new Locale(parts[0]);
} else {
return new Locale(parts[0],parts[1]);
return new Locale(parts[0], parts[1]);
}
}
private InputStream findStream(String filename) {
String filenameWithExtension = "/" + filename + ".yml";
String filenameWithExtension = "/" + filename + ".yml";
InputStream streamOnClass = getClass().getResourceAsStream(filenameWithExtension);
if (streamOnClass != null) {
return streamOnClass;
@@ -286,7 +328,7 @@ public class FakeValuesService {
}
/**
* Applies both a {@link #numerify(String)} and a {@link #letterify(String,boolean)}
* Applies both a {@link #numerify(String)} and a {@link #letterify(String, boolean)}
* over the incoming string.
*
* @param string
@@ -326,7 +368,7 @@ public class FakeValuesService {
* For example, the string "12??34" could be replaced with a string like "12AB34".
*
* @param letterString
* @param isUpper specifies whether or not letters should be upper case
* @param isUpper specifies whether or not letters should be upper case
* @return
*/
public String letterify(String letterString, boolean isUpper) {
@@ -348,11 +390,10 @@ public class FakeValuesService {
/**
* Resolves a key to a method on an object.
*
* <p>
* #{hello} with result in a method call to current.hello();
*
* <p>
* #{Person.hello_someone} will result in a method call to person.helloSomeone();
*
*/
public String resolve(String key, Object current, Faker root) {
final String expression = safeFetch(key, null);
@@ -365,6 +406,7 @@ public class FakeValuesService {
/**
* resolves an expression using the current faker.
*
* @param expression
* @param faker
* @return
@@ -372,22 +414,23 @@ public class FakeValuesService {
public String expression(String expression, Faker faker) {
return resolveExpression(expression, null, faker);
}
/**
* <p>processes a expression in the style #{X.y} using the current objects as the 'current' location
* within the yml file (or the {@link Faker} object hierarchy as it were).
* </p>
* <p>
* #{Address.streetName} would get resolved to {@link Faker#address()}'s {@link Address#streetName()}
* #{Address.streetName} would get resolved to {@link Faker#address()}'s {@link Address#streetName()}
* </p>
* <p>
* #{address.street} would get resolved to the YAML > locale: faker: address: street:
* #{address.street} would get resolved to the YAML > locale: faker: address: street:
* </p>
* <p>
* Combinations are supported as well: "#{x} #{y}"
* Combinations are supported as well: "#{x} #{y}"
* </p>
* <p>
* Recursive templates are supported. if "#{x}" resolves to "#{Address.streetName}" then "#{x}" resolves to
* {@link Faker#address()}'s {@link Address#streetName()}.
* Recursive templates are supported. if "#{x}" resolves to "#{Address.streetName}" then "#{x}" resolves to
* {@link Faker#address()}'s {@link Address#streetName()}.
* </p>
*/
protected String resolveExpression(String expression, Object current, Faker root) {
@@ -398,10 +441,10 @@ public class FakeValuesService {
final String escapedDirective = matcher.group(0);
final String directive = matcher.group(1);
List<String> args = new ArrayList<String>();
for (int i=2;i < matcher.groupCount()+1 && matcher.group(i) != null;i++) {
for (int i = 2; i < matcher.groupCount() + 1 && matcher.group(i) != null; i++) {
args.add(matcher.group(i));
}
// resolve the expression and reprocess it to handle recursive templates
String resolved = resolveExpression(directive, args, current, root);
if (resolved == null) {
@@ -417,20 +460,21 @@ public class FakeValuesService {
/**
* <h1>Search Order</h1>
* <ul>
* <li>Search for methods on the current object</li>
* <li>local keys in Yaml File</li>
* <li>Search for methods on faker child objects</li>
* <li>Search for keys in yaml file by transforming object reference to yaml reference</li>
* <li>Search for methods on the current object</li>
* <li>local keys in Yaml File</li>
* <li>Search for methods on faker child objects</li>
* <li>Search for keys in yaml file by transforming object reference to yaml reference</li>
* </ul>
*
* @return null if unable to resolve
*/
private String resolveExpression(String directive, List<String> args, Object current, Faker root) {
// name.name (resolve locally)
// Name.first_name (resolve to faker.name().firstName())
final String simpleDirective = (isDotDirective(directive) || current == null)
? directive
final String simpleDirective = (isDotDirective(directive) || current == null)
? directive
: classNameToYamlName(current) + "." + directive;
String resolved = null;
// resolve method references on CURRENT object like #{number_between '1','10'} on Number or
// #{ssn_valid} on IdNumber
@@ -439,7 +483,7 @@ public class FakeValuesService {
}
// simple fetch of a value from the yaml file. the directive may have been mutated
// such that if the current yml object is car: and directive is #{wheel} then
// such that if the current yml object is car: and directive is #{wheel} then
// car.wheel will be looked up in the YAML file.
if (resolved == null) {
resolved = safeFetch(simpleDirective, null);
@@ -454,16 +498,16 @@ public class FakeValuesService {
if (resolved == null && isDotDirective(directive)) {
resolved = resolveFakerObjectAndMethod(root, directive, args);
}
// last ditch effort. Due to Ruby's dynamic nature, something like 'Address.street_title' will resolve
// because 'street_title' is a dynamic method on the Address object. We can't do this in Java so we go
// because 'street_title' is a dynamic method on the Address object. We can't do this in Java so we go
// thru the normal resolution above, but if we will can't resolve it, we once again do a 'safeFetch' as we
// did first but FIRST we change the Object reference Class.method_name with a yml style internal refernce ->
// class.method_name (lowercase)
if (resolved == null && isDotDirective(directive)) {
resolved = safeFetch(javaNameToYamlName(simpleDirective), null);
}
return resolved;
}
@@ -478,6 +522,7 @@ public class FakeValuesService {
/**
* Given a {@code slashDelimitedRegex} such as {@code /[ab]/}, removes the slashes and returns only {@code [ab]}
*
* @param slashDelimitedRegex a non null slash delimited regex (ex. {@code /[ab]/})
* @return the regex without the slashes (ex. {@code [ab]})
*/
@@ -490,14 +535,14 @@ public class FakeValuesService {
}
/**
* @return a yaml style name from the classname of the supplied object (PhoneNumber => phone_number)
* @return a yaml style name from the classname of the supplied object (PhoneNumber => phone_number)
*/
private String classNameToYamlName(Object current) {
return javaNameToYamlName(current.getClass().getSimpleName());
}
/**
* @return a yaml style name like 'phone_number' from a java style name like 'PhoneNumber'
* @return a yaml style name like 'phone_number' from a java style name like 'PhoneNumber'
*/
private String javaNameToYamlName(String expression) {
return expression.replaceAll("([A-Z])", "_$1")
@@ -506,7 +551,6 @@ public class FakeValuesService {
}
/**
* Given a directive like 'firstName', attempts to resolve it to a method. For example if obj is an instance of
* {@link Name} then this method would return {@link Name#firstName()}. Returns null if the directive is nested
@@ -526,15 +570,16 @@ public class FakeValuesService {
return null;
}
}
/**
* Accepts a {@link Faker} instance and a name.firstName style 'key' which is resolved to the return value of:
* {@link Faker#name()}'s {@link Name#firstName()} method.
*
* @throws RuntimeException if there's a problem invoking the method or it doesn't exist.
*/
private String resolveFakerObjectAndMethod(Faker faker, String key, List<String> args) {
final String[] classAndMethod = key.split("\\.", 2);
try {
String fakerMethodName = classAndMethod[0].replaceAll("_", "");
MethodAndCoercedArgs fakerAccessor = accessor(faker, fakerMethodName, Collections.<String>emptyList());
@@ -558,15 +603,15 @@ public class FakeValuesService {
}
}
/**
* Find an accessor by name ignoring case.
*/
private MethodAndCoercedArgs accessor(Object onObject, String name, List<String> args) {
log.log(Level.FINE, "Find accessor named " + name + " on " + onObject.getClass().getSimpleName() + " with args " + args);
for (Method m : onObject.getClass().getMethods()) {
if (m.getName().equalsIgnoreCase(name)
if (m.getName().equalsIgnoreCase(name)
&& m.getParameterTypes().length == args.size()) {
final List<Object> coercedArguments = coerceArguments(m, args);
if (coercedArguments != null) {
@@ -584,6 +629,7 @@ public class FakeValuesService {
/**
* Coerce arguments in <em>args</em> into the appropriate types (if possible) for the parameter arguments
* to <em>accessor</em>.
*
* @return array of coerced values if successful, null otherwise
* @throws Exception if unable to coerce
*/
@@ -604,7 +650,7 @@ public class FakeValuesService {
}
return coerced;
}
private String string(Object obj) {
return (obj == null) ? null : obj.toString();
}
@@ -617,14 +663,14 @@ public class FakeValuesService {
private class MethodAndCoercedArgs {
private final Method method;
private final List<Object> coerced;
private MethodAndCoercedArgs(Method m, List<Object> coerced) {
this.method = requireNonNull(m, "method cannot be null");
this.coerced = requireNonNull(coerced, "coerced arguments cannot be null");
}
private Object invoke(Object on) throws InvocationTargetException, IllegalAccessException {
return method.invoke(on, coerced.toArray());
}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
en:
faker:
beer:
brand: ['Corona Extra', 'Heineken', 'Budweiser', 'Becks', 'BudLight', 'Pabst Blue Ribbon', 'Dos Equis', 'Blue Moon', 'Stella Artois', 'Miller Draft', 'Coors lite' , 'Amstel', 'Guinness', 'Kirin Inchiban', 'Tsingtao', 'Sierra Nevada', 'Rolling Rock', 'Red Stripe', 'Paulaner', 'Patagonia', 'Delirium Tremens', 'Delirium Noctorum', 'Samuel Adams', 'Sapporo Premium', 'Carlsberg', 'Pacifico', 'Quimes', 'Murphys', 'Birra Moretti', 'Harp', 'Fosters', 'Hoegaarden', 'Leffe', 'Lowenbrau']
brand: ['Corona Extra', 'Heineken', 'Budweiser', 'Becks', 'BudLight', 'Pabst Blue Ribbon', 'Dos Equis', 'Blue Moon', 'Stella Artois', 'Miller Draft', 'Coors lite' , 'Amstel', 'Guinness', 'Kirin Inchiban', 'Tsingtao', 'Sierra Nevada', 'Rolling Rock', 'Red Stripe', 'Paulaner', 'Patagonia', 'Delirium Tremens', 'Delirium Noctorum', 'Samuel Adams', 'Sapporo Premium', 'Carlsberg', 'Pacifico', 'Quimes', 'Murphys', 'Birra Moretti', 'Harp', 'Fosters', 'Hoegaarden', 'Leffe', 'Lowenbrau', 'Becks', 'Bitburger', 'Koenig Pilsener', 'Vitamalz', 'Schluessel Alt', 'Charlottenburger Pilsener', 'Brinkhoffs', 'Oettinger', 'Krombacher', 'Veltins', 'Warsteiner']
name: ['Pliny The Elder', 'Founders Kentucky Breakfast', 'Trappistes Rochefort 10', 'HopSlam Ale', 'Stone Imperial Russian Stout', 'St. Bernardus Abt 12', 'Founders Breakfast Stout', 'Weihenstephaner Hefeweissbier', 'Péché Mortel', 'Celebrator Doppelbock', 'Duvel', 'Dreadnaught IPA', 'Nugget Nectar', 'La Fin Du Monde', 'Bourbon County Stout', 'Old Rasputin Russian Imperial Stout', 'Two Hearted Ale', 'Ruination IPA', 'Schneider Aventinus', 'Double Bastard Ale', '90 Minute IPA', 'Hop Rod Rye', 'Trappistes Rochefort 8', 'Chimay Grande Réserve', 'Stone IPA', 'Arrogant Bastard Ale', 'Edmund Fitzgerald Porter', 'Chocolate St', 'Oak Aged Yeti Imperial Stout', 'Ten FIDY', 'Storm King Stout', 'Shakespeare Oatmeal', 'Alpha King Pale Ale', 'Westmalle Trappist Tripel', 'Samuel Smiths Imperial IPA', 'Yeti Imperial Stout', 'Hennepin', 'Samuel Smiths Oatmeal Stout', 'Brooklyn Black', 'Oaked Arrogant Bastard Ale', 'Sublimely Self-Righteous Ale', 'Trois Pistoles', 'Bells Expedition', 'Sierra Nevada Celebration Ale', 'Sierra Nevada Bigfoot Barleywine Style Ale', 'Racer 5 India Pale Ale, Bear Republic Bre', 'Orval Trappist Ale', 'Hercules Double IPA', 'Maharaj', 'Maudite']
hop: ['Ahtanum', 'Amarillo', 'Bitter Gold', 'Bravo', 'Brewers Gold', 'Bullion', 'Cascade', 'Cashmere', 'Centennial', 'Chelan', 'Chinook', 'Citra', 'Cluster', 'Columbia', 'Columbus', 'Comet', 'Crystal', 'Equinox', 'Eroica', 'Fuggle', 'Galena', 'Glacier', 'Golding', 'Hallertau', 'Horizon', 'Liberty', 'Magnum', 'Millennium', 'Mosaic', 'Mt. Hood', 'Mt. Rainier', 'Newport', 'Northern Brewer', 'Nugget', 'Olympic', 'Palisade', 'Perle', 'Saaz', 'Santiam', 'Simcoe', 'Sorachi Ace', 'Sterling', 'Summit', 'Tahoma', 'Tettnang', 'TriplePearl', 'Ultra', 'Vanguard', 'Warrior', 'Willamette', 'Yakima Gol']
yeast: ['1007 - German Ale', '1010 - American Wheat', '1028 - London Ale', '1056 - American Ale', '1084 - Irish Ale', '1098 - British Ale', '1099 - Whitbread Ale', '1187 - Ringwood Ale', '1272 - American Ale II', '1275 - Thames Valley Ale', '1318 - London Ale III', '1332 - Northwest Ale', '1335 - British Ale II', '1450 - Dennys Favorite 50', '1469 - West Yorkshire Ale', '1728 - Scottish Ale', '1968 - London ESB Ale', '2565 - Kölsch', '1214 - Belgian Abbey', '1388 - Belgian Strong Ale', '1762 - Belgian Abbey II', '3056 - Bavarian Wheat Blend', '3068 - Weihenstephan Weizen', '3278 - Belgian Lambic Blend', '3333 - German Wheat', '3463 - Forbidden Fruit', '3522 - Belgian Ardennes', '3638 - Bavarian Wheat', '3711 - French Saison', '3724 - Belgian Saison', '3763 - Roeselare Ale Blend', '3787 - Trappist High Gravity', '3942 - Belgian Wheat', '3944 - Belgian Witbier', '2000 - Budvar Lager', '2001 - Urquell Lager', '2007 - Pilsen Lager', '2035 - American Lager', '2042 - Danish Lager', '2112 - California Lager', '2124 - Bohemian Lager', '2206 - Bavarian Lager', '2278 - Czech Pils', '2308 - Munich Lager', '2633 - Octoberfest Lager Blend', '5112 - Brettanomyces bruxellensis', '5335 - Lactobacillus', '5526 - Brettanomyces lambicus', '5733 - Pediococcus']
+2 -2
View File
@@ -7,5 +7,5 @@ en:
material: [Steel, Wooden, Concrete, Plastic, Cotton, Granite, Rubber, Leather, Silk, Wool, Linen, Marble, Iron, Bronze, Copper, Aluminum, Paper]
product: [Chair, Car, Computer, Gloves, Pants, Shirt, Table, Shoes, Hat, Plate, Knife, Bottle, Coat, Lamp, Keyboard, Bag, Bench, Clock, Watch, Wallet]
promotion_code:
adjective: ['Amazing', 'Awesome', 'Cool', 'Good', 'Great', 'Incredible', 'Killer', 'Premium', 'Special', 'Stellar', 'Sweet']
noun: ['Code', 'Deal', 'Discount', 'Price', 'Promo', 'Promotion', 'Sale', 'Savings']
adjective: ['Amazing', 'Awesome', 'Cool', 'Good', 'Great', 'Incredible', 'Special', 'Surprising', 'Wonderful', 'Marvelous', 'Unbelievable', 'Stunning', 'Spectacular', 'Breathtaking', 'Exciting', 'Impressive', 'Overwhelming', 'Thrilling', 'First-Class']
noun: ['Code', 'Deal', 'Discount', 'Price', 'Promo', 'Promotion', 'Sale', 'Savings', 'Rebate', 'Bonus', 'Benefit', 'Bounty', 'Perk', 'Reward', 'Winning']
+35 -1
View File
@@ -6,6 +6,40 @@ en:
witchers: ["Geralt of Rivia", "Coën", "Vesemir", "Eskel", "Lambert", "Letho of Gulet","Ciri","George of Kagen","Jerome Moreau","Auckes","Serrit","Kolgrim","Ivar Evil-Eye","Junod of Belhaven","Gerd"]
schools: ["Wolf", "Griffin", "Cat", "Viper", "Manticore", "Bear"]
locations: ["Aedd Gynvael","Aldersberg","Beauclair","Cidaris","Cintra","Gors Velen","Maribor","Novigrad","Oxenfurt","Tretogor","Vengerberg","Vizima","Ard Carraigh","Bremervoord","Brugge","Claremont","Creyden","Fen Aspra","Hengfors","Lan Exeter","Pont Vanis","Lyria","Maecht","Malleore","Metinna","Nilfgaard","Neunreuth","Rakverelin","Rivia","Thurn","Acorn Bay","Anchor","Assengard","Attre","Ban Ard","Ban Gleán","Barefield","Belhaven","Blaviken","Brenna","Breza","Burdorff","Caelf","Carreras","Craag An","Crinfrid","Daevon","Dillingen","Dorian","Druigh","Dudno","Duén Canell","Dun Dâre","Ellander","Eysenlaan","Fano","Foam","Forgeham","Fox Hollow","Ghelibol","Glyswen","Gulet","Hochebuz","Jealousy","Kaczan","Kagen","Kerack","Kernow","Klucz","Knotweed Meadow","Little Marsh","Lower Posada","Malhoun","Mirt","Murivel","New Ironworks","Porog","Riedbrune","Rinde","Roggeveen","Tegamo","Tigg","Tridam","Tyffi","Unicorn","Upper Posada","Vattweir","Vole","White Bridge","Zavada","Armeria","Baldhorn","Ban Gleán","Beauclair","Bodrog","Carcano","Castel Ravello","Darn Dyffra","Darn Rowan","Darn Ruach","Dillingen","Dorndal","Drakenborg","Fen Aspra","Glevitzingen","Gwendeith","Hagge","Houtborg","Kaer Morhen","Kaer Trolde","Leyda","Loc Grim","Mayena","Mirt","Montecalvo","Montsalvat","Nastrog","Razwan","Red Binduga","Rocayne","Rhys-Rhun","Riedbrune","Rozrog","Sarda","Scala","Schwemmland","Spalla","Stygga","Tigg","Vartburg","Vedette","Vidort","Winneburg","Zurbarran","Est Haemlet","Loc Muinne","Shaerrawedd"]
quotes: ["Just five more minutes… Is it 1358 yet? No? Then fuck off!","Finish all your business before you die. Bid loved ones farewell. Write your will. Apologize to those youve wronged. Otherwise, youll never truly leave this world.","Hide the wenches, Witcher's coming!!","Oh year... the Elder Blood can be fiery","Damn, Eskel... you got an hourglass figure","No Lollygagin'!","You get what you get and be happy with it","I'll stick me boot so far up yer arse your tongue'll taste like wench twat"]
quotes: [
"Just five more minutes… Is it 1358 yet? No? Then fuck off!",
"Finish all your business before you die. Bid loved ones farewell. Write your will. Apologize to those youve wronged. Otherwise, youll never truly leave this world.",
"Hide the wenches, Witcher's coming!!","Oh year... the Elder Blood can be fiery",
"Damn, Eskel... you got an hourglass figure","No Lollygagin'!",
"You get what you get and be happy with it","I'll stick me boot so far up yer arse your tongue'll taste like wench twat",
"Evil is evil, Stregobor. Lesser, greater, middling, it's all the same. Proportions are negotiated, boundaries blurred. I'm not a pious hermit, I haven't done only good in my life. But if I'm to choose between one evil and another, then I prefer not to choose at all.",
"One hand washes the other. Freedom and contempt have their limits. In the end, it is always the case that one is someone else's tool.",
"You cannot do it. You cannot do it, witcheress. In Kaer Morhen, they taught you to kill, so you kill like a machine. Instinctively. To kill yourself takes character, strength, determination and courage. But that, that they could not teach you.",
"Death, the final judgement. The Beast has met its end once. It doesn't fear death, it is death. How will you defeat human villainy? With your sword? You who died and still walk amongst the living?",
"Well, theres a war, so theres orphans. Didnt [you] know that?",
"Know when a legend becomes a prophecy? When it gains believers.",
"You dont need mutations to strip men of their humanity. Ive seen plenty of examples.",
"To be neutral does not mean to be indifferent or insensitive. You don't have to kill your feelings. It's enough to kill hatred within yourself.",
"There is never a second opportunity to make a first impression.",
"People”—Geralt turned his head—“like to invent monsters and monstrosities. Then they seem less monstrous themselves.",
"A mother, you son-of-a-bitch, is sacred!",
"Only Evil and Greater Evil exist and beyond them, in the shadows, lurks True Evil. True Evil, Geralt, is something you can barely imagine, even if you believe nothing can still surprise you. And sometimes True Evil seizes you by the throat and demands that you choose between it and another, slightly lesser, Evil.",
"Only death can finish the fight, everything else only interrupts the fighting.",
"Mistakes, he said with effort, are also important to me. I dont cross them out of my life, or memory. And I never blame others for them.",
"What is truth? The negation of lies? Or the statement of a fact? And if the fact is a lie, what then is the truth?",
"They weren't lying. They firmly believed it all. Which doesn't change the facts.",
"There's a grain of truth in every fairy tale.",
"I need this conversation. They say silence is golden. Maybe it is, although I'm not sure it's worth that much. It has its price certainly; you have to pay for it.",
"Youve mistaken the stars reflected on the surface of the lake at night for the heavens.",
"It is easy to kill with a bow, girl. How easy it is to release the bowstring and think, it is not I, it is the arrow. The blood of that boy is not on my hands. The arrow killed him, not I. But the arrow does not dream anything in the night.",
"The sword of destiny has two edges. You are one of them.",
"When you know about something it stops being a nightmare. When you know how to fight something, it stops being so threatening.",
"As usual, cats and children noticed him first.",
"Thats the role of poetry, Ciri. To say what others cannot utter.",
"No one wants to suffer. But that is the fate of each. And some suffer more. Not necessarily of their own volition. It's not about to enduring the suffering. It's about how you endure it.",
"Destiny has many faces. Mine is beautiful on the outside and hideous on the inside. She has stretched her bloody talons toward me—",
"A coward,' he declared with dignity, when he'd stopped coughing and had got his breath back, 'dies a hundred times. A brave man dies but once. But Dame Fortune favours the brave and holds the coward in contempt.'",
"I thought I was choosing the lesser evil. I chose the lesser evil. Lesser evil! Im Geralt! Witcher…Im the Butcher of Blaviken—"
]
monsters: ["Archespore","Berserker","Botchling","Lubberkin","Ulfhedinn","Werewolf","The Toad Prince","Basilisk","Cockatrice","Forktail","Royal Wyvern","Shrieker","Silver Basilisk","Slyzard Matriarch","Slyzard","Dragon of Fyresdal","Wyvern","Djinn","Earth Elemental","Fire Elemental","Gargoyle","Golem","Hound of the Wild Hunt","Ice Elemental","Pixie","Apiarian Phantom","Therazane","Ekhidnae","Erynias","Griffin","Harpy","Melusine","Opinicus","Salma","Siren","Succubus","Arachas","Arachnomorph","Endrega Drone","Endrega Warrior","Endrega Worker","Giant Centipede","Kikimore","Kikimore Worker","Pale Widow","Abaya","Alghoul","Drowner","Foglet","Ghoul","Grave Hag","Ignis Fatuus","Mourntart","Mucknixer","Rotfiend","Scurver","Spotted Wight","Water Hag","Wight","Cloud Giant","Cyclopse","Golyat","Hagubman","Ice Giant","Ice Troll","Nekker","Rock Troll","Wham-a-Wham","Chort","Crone","Doppler","Fiend","Fugas","Godling","Grottore","Howler","Imp","Kernun","Leshen","Morvudd","Shaelmaar","Spriggan","Sylvan","The Caretaker","Barghests","Ethereal","Hym","Longlocks","Nightwraith","Noonwraith","Penitent","Plague Maiden","Umbra","Wraith","Alp","Bruxa","Ekimmara","Gael","Garkain","Higher Vampire","Katakan"]
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -74,7 +74,7 @@ ru:
- "#{prefix} #{Address.city_name}#{suffix}#{suffix}#{suffix}"
weather:
description: ["Ясно","Солнечно","Хмарно з проясненнями","Мінлива хмарність","Переважно хмарно","Пасмурно","Злива","Дощ","Мряка","Грози","Сніг","Мокрий сніг","Град"]
description: ["Ясно","Солнечно","Облачно с прояснениями","Переменная облачность","Облачно","Пасмурно","Ливень","Дождь","Туман","Грозы","Снег","Мокрый снег","Град"]
temperature:
celsius: °C
fahrenheit: °F
@@ -106,4 +106,10 @@ public class AddressTest extends AbstractFakerTest {
faker = new Faker(new Locale("en-US"));
assertThat(faker.address().zipCodeByState(faker.address().stateAbbr()), matchesRegularExpression("[0-9]{5}"));
}
@Test
public void testCountyByZipCode() {
faker = new Faker(new Locale("en-US"));
assertThat(faker.address().countyByZipCode(faker.address().zipCodeByState(faker.address().stateAbbr())), not(isEmptyOrNullString()));
}
}
@@ -11,7 +11,7 @@ public class FriendsTest extends AbstractFakerTest {
@Test
public void character() {
assertThat(faker.friends().character(), matchesRegularExpression("[A-Za-z ]+"));
assertThat(faker.friends().character(), matchesRegularExpression("[A-Za-z .,]+"));
}
@Test
@@ -24,6 +24,6 @@ public class TeamTest extends AbstractFakerTest {
@Test
public void testSport() {
assertThat(faker.team().sport(), matchesRegularExpression("(\\w|\\s)+"));
assertThat(faker.team().sport(), matchesRegularExpression("(\\p{L}|\\s)+"));
}
}