repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/OneTimeGenerator.java
// Path: src/main/java/com/presidentio/testdatagenerator/context/Context.java // public class Context { // // private Parent parent; // // private Map<String, Template> templates; // // private Map<String, Object> variables; // // private Sink sink; // // public Context(Map<String, Template> te...
import com.presidentio.testdatagenerator.model.Schema; import java.util.concurrent.ForkJoinPool; import com.presidentio.testdatagenerator.context.Context;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * dist...
// Path: src/main/java/com/presidentio/testdatagenerator/context/Context.java // public class Context { // // private Parent parent; // // private Map<String, Template> templates; // // private Map<String, Object> variables; // // private Sink sink; // // public Context(Map<String, Template> te...
public void generate(Context context, Schema schema) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/parser/StringDeserializer.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/StringPlaceholderConst.java // public class StringPlaceholderConst { // // public static final String TMP = "tmp"; // // }
import com.presidentio.testdatagenerator.cons.StringPlaceholderConst; import org.codehaus.jackson.JsonParser; import org.codehaus.jackson.map.DeserializationContext; import org.codehaus.jackson.map.JsonDeserializer; import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern;
package com.presidentio.testdatagenerator.parser; public class StringDeserializer extends JsonDeserializer<String> { private static final Pattern REGEX = Pattern.compile("\\$\\{(\\w+)}"); @Override public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/StringPlaceholderConst.java // public class StringPlaceholderConst { // // public static final String TMP = "tmp"; // // } // Path: src/main/java/com/presidentio/testdatagenerator/parser/StringDeserializer.java import com.presidentio.testdatagenerato...
case StringPlaceholderConst.TMP:
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ConstValueProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
props.put(PropConst.VALUE, propValue);
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ConstValueProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = constValueProvider.nextValue(new Context(null, null, null), new Field("testField", TypeConst.STRING, null));
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ConstValueProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = constValueProvider.nextValue(new Context(null, null, null), new Field("testField", TypeConst.STRING, null));
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ConstValueProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = constValueProvider.nextValue(new Context(null, null, null), new Field("testField", TypeConst.STRING, null));
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/EsDirectTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
import com.presidentio.testdatagenerator.model.Output; import org.elasticsearch.action.count.CountResponse; import org.elasticsearch.client.Client; import org.elasticsearch.index.query.QueryBuilders; import org.junit.Assert; import java.util.Arrays; import java.util.List;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
protected void testResult(Output output) {
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/RandomProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
Assert.assertNotNull(randomProvider.nextValue(new Context(null, null, null), new Field(null, TypeConst.BOOLEAN, null)));
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/RandomProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
Assert.assertNotNull(randomProvider.nextValue(new Context(null, null, null), new Field(null, TypeConst.BOOLEAN, null)));
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/RandomProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
Assert.assertNotNull(randomProvider.nextValue(new Context(null, null, null), new Field(null, TypeConst.BOOLEAN, null)));
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ConstValueProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
value = propsCopy.remove(PropConst.VALUE);
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ConstValueProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ConstValueProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ConstValueProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
case TypeConst.STRING:
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ExpressionProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.mvel2.MVEL; import java.io.Serializable; import java.util.HashMap; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
expr = propsCopy.remove(PropConst.EXPR);
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ExpressionProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.mvel2.MVEL; import java.io.Serializable; import java.util.HashMap; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ExpressionProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.mvel2.MVEL; import java.io.Serializable; import java.util.HashMap; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ExpressionProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.mvel2.MVEL; import java.io.Serializable; import java.util.HashMap; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
case TypeConst.STRING:
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/RandomBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.RandomProvider; import com.presidentio.testdatagenerator.provider.ValueProvider; import org.openjdk.j...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class RandomBenchmark {
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
private Context context;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/RandomBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.RandomProvider; import com.presidentio.testdatagenerator.provider.ValueProvider; import org.openjdk.j...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class RandomBenchmark { private Context context;
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
private ValueProvider valueProvider;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/RandomBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.RandomProvider; import com.presidentio.testdatagenerator.provider.ValueProvider; import org.openjdk.j...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class RandomBenchmark { private Context context; private ValueProvider ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
private Field field;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/RandomBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.RandomProvider; import com.presidentio.testdatagenerator.provider.ValueProvider; import org.openjdk.j...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class RandomBenchmark { private Context context; private ValueProvider ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
valueProvider = new RandomProvider();
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/RandomBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.RandomProvider; import com.presidentio.testdatagenerator.provider.ValueProvider; import org.openjdk.j...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class RandomBenchmark { private Context context; private ValueProvider ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
field = new Field(null, TypeConst.BOOLEAN, null);
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/ExtendTemplateTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
import com.presidentio.testdatagenerator.model.Output; import org.elasticsearch.action.count.CountResponse; import org.elasticsearch.client.Client; import org.elasticsearch.index.query.QueryBuilders; import org.junit.Assert; import java.util.Arrays; import java.util.List;
package com.presidentio.testdatagenerator; /** * Created by Vitalii_Gergel on 3/2/2015. */ public class ExtendTemplateTest extends AbstractEsTest { private String indexName = "test_data_generator"; @Override protected List<String> getSchemaResource() { return Arrays.asList("extend-template-te...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
protected void testResult(Output output) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/RandomProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map; import java.util.Random;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
if (propsCopy.containsKey(PropConst.SIZE)) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/RandomProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map; import java.util.Random;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/RandomProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map; import java.util.Random;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/RandomProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map; import java.util.Random;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
case TypeConst.STRING:
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/CountryProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import org.apache.commons.io.IOUtils; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map;
package com.presidentio.testdatagenerator.provider; /** * Created by Vitalii_Gergel on 2/11/2015. */ public class CountryProvider extends SelectProvider { private static String COUNTRIES; public static final String DELIMITER = "\r?\n"; private String getCountries() { if (COUNTRIES == null) { ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
propsCopy.put(PropConst.ITEMS, getCountries());
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ExpressionProxyProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
props.put(PropConst.EXPR, propExpr);
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ExpressionProxyProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Context context = new Context(null, new HashMap<String, Object>(), null);
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ExpressionProxyProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = provider.nextValue(context, new Field(null, TypeConst.INT, null));
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ExpressionProxyProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.Collections; import java.util...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = provider.nextValue(context, new Field(null, TypeConst.INT, null));
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/formatter/EsFormatter.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
import com.presidentio.testdatagenerator.cons.DelimiterConst; import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.model.Template; import org.codehaus.jackson.map.ObjectMapper; import java.io.IOException; import java.util.List; import java.util.Map;
package com.presidentio.testdatagenerator.output.formatter; /** * Created by Vitalii_Gergel on 2/19/2015. */ public class EsFormatter implements Formatter { private static final String INDEX = "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\"} }"; private ObjectMapper objectMapper = new ObjectMapp...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
index = props.get(PropConst.INDEX);
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/formatter/EsFormatter.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
import com.presidentio.testdatagenerator.cons.DelimiterConst; import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.model.Template; import org.codehaus.jackson.map.ObjectMapper; import java.io.IOException; import java.util.List; import java.util.Map;
package com.presidentio.testdatagenerator.output.formatter; /** * Created by Vitalii_Gergel on 2/19/2015. */ public class EsFormatter implements Formatter { private static final String INDEX = "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\"} }"; private ObjectMapper objectMapper = new ObjectMapp...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
public String format(Map<String, Object> map, Template template) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/formatter/EsFormatter.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
import com.presidentio.testdatagenerator.cons.DelimiterConst; import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.model.Template; import org.codehaus.jackson.map.ObjectMapper; import java.io.IOException; import java.util.List; import java.util.Map;
package com.presidentio.testdatagenerator.output.formatter; /** * Created by Vitalii_Gergel on 2/19/2015. */ public class EsFormatter implements Formatter { private static final String INDEX = "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\"} }"; private ObjectMapper objectMapper = new ObjectMapp...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
result += DelimiterConst.NEW_LINE;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/formatter/SvFormatter.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
import com.presidentio.testdatagenerator.cons.DelimiterConst; import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.model.Template; import java.util.List; import java.util.Map; import java.util.Set;
package com.presidentio.testdatagenerator.output.formatter; /** * Created by presidentio on 23.04.15. */ public class SvFormatter implements Formatter { private String defaultDelimiter = DelimiterConst.COMMA; private boolean printHeader; private Set<String> header; private String delimiter; ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
String headerStr = props.get(PropConst.HEADER);
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/formatter/SvFormatter.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
import com.presidentio.testdatagenerator.cons.DelimiterConst; import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.model.Template; import java.util.List; import java.util.Map; import java.util.Set;
package com.presidentio.testdatagenerator.output.formatter; /** * Created by presidentio on 23.04.15. */ public class SvFormatter implements Formatter { private String defaultDelimiter = DelimiterConst.COMMA; private boolean printHeader; private Set<String> header; private String delimiter; ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/DelimiterConst.java // public class DelimiterConst { // // public static final String COMMA = ","; // public static final String TAB = "\t"; // public static final String NEW_LINE = "\n"; // public static final String SPACE = " "; // // } /...
public String format(Map<String, Object> map, Template template) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/CompositeValueProviderFactory.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Provider.java // public class Provider { // // private String name; // // private HashMap<String, String> props; // // public Provider() { // } // // public Provider(String name, HashMap<String, String> props) { // this.name ...
import java.util.ArrayList; import java.util.List; import com.presidentio.testdatagenerator.model.Provider;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Provider.java // public class Provider { // // private String name; // // private HashMap<String, String> props; // // public Provider() { // } // // public Provider(String name, HashMap<String, String> props) { // this.name ...
public ValueProvider buildValueProvider(Provider provider) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/Starter.java
// Path: src/main/java/com/presidentio/testdatagenerator/parser/JsonSchemaSerializer.java // public class JsonSchemaSerializer implements SchemaSerializer { // // private ObjectMapper objectMapper; // // public JsonSchemaSerializer() { // objectMapper = new ObjectMapper(); // SimpleDeserialize...
import com.beust.jcommander.JCommander; import com.beust.jcommander.Parameter; import com.beust.jcommander.ParameterException; import com.presidentio.testdatagenerator.model.*; import com.presidentio.testdatagenerator.parser.JsonSchemaSerializer; import com.presidentio.testdatagenerator.parser.SchemaSerializer; import ...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * dist...
// Path: src/main/java/com/presidentio/testdatagenerator/parser/JsonSchemaSerializer.java // public class JsonSchemaSerializer implements SchemaSerializer { // // private ObjectMapper objectMapper; // // public JsonSchemaSerializer() { // objectMapper = new ObjectMapper(); // SimpleDeserialize...
SchemaSerializer schemaSerializer = new JsonSchemaSerializer();
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/Starter.java
// Path: src/main/java/com/presidentio/testdatagenerator/parser/JsonSchemaSerializer.java // public class JsonSchemaSerializer implements SchemaSerializer { // // private ObjectMapper objectMapper; // // public JsonSchemaSerializer() { // objectMapper = new ObjectMapper(); // SimpleDeserialize...
import com.beust.jcommander.JCommander; import com.beust.jcommander.Parameter; import com.beust.jcommander.ParameterException; import com.presidentio.testdatagenerator.model.*; import com.presidentio.testdatagenerator.parser.JsonSchemaSerializer; import com.presidentio.testdatagenerator.parser.SchemaSerializer; import ...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * dist...
// Path: src/main/java/com/presidentio/testdatagenerator/parser/JsonSchemaSerializer.java // public class JsonSchemaSerializer implements SchemaSerializer { // // private ObjectMapper objectMapper; // // public JsonSchemaSerializer() { // objectMapper = new ObjectMapper(); // SimpleDeserialize...
SchemaSerializer schemaSerializer = new JsonSchemaSerializer();
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/output/path/ConstPathProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import junit.framework.TestCase; import org.junit.Assert; import org.junit.Test; import java.util.HashMap; import java.util.Map;
package com.presidentio.testdatagenerator.output.path; /** * Created by presidentio on 24.04.15. */ public class ConstPathProviderTest extends TestCase { @Test public void testGetFilePath() throws Exception { String expected = "a.sql"; Map<String, String> props = new HashMap<>();
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
props.put(PropConst.FILE, expected);
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/KafkaTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
import com.presidentio.testdatagenerator.model.Output; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import java.util.Arrays; import java.util.List;
package com.presidentio.testdatagenerator; /** * Created by presidentio on 24.04.15. */ @Ignore public class KafkaTest extends AbstractGeneratorTest { @Before public void setUp() throws Exception { } @After public void tearDown() throws Exception { } @Override protected List<St...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
protected void testResult(Output output) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/TypeConverter.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
import com.presidentio.testdatagenerator.cons.TypeConst;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/TypeConst.java // public class TypeConst { // // public static final String STRING = "string"; // public static final String LONG = "long"; // public static final String INT = "int"; // public static final String BOOLEAN = "boolean"; // // ...
case TypeConst.STRING:
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/parser/SchemaBuilder.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Schema.java // public class Schema { // // private List<Template> templates = new ArrayList<>(); // // private List<String> root = new ArrayList<>(); // // private List<Variable> variables = new ArrayList<>(); // // private Output output...
import com.presidentio.testdatagenerator.model.Schema; import com.presidentio.testdatagenerator.model.Template; import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List;
Schema schema = schemaSerializer.deserialize( SchemaBuilder.class.getClassLoader().getResourceAsStream(resource)); schemas.add(schema); return this; } catch (IOException e) { throw new IllegalStateException(e); } } public Schem...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Schema.java // public class Schema { // // private List<Template> templates = new ArrayList<>(); // // private List<String> root = new ArrayList<>(); // // private List<Variable> variables = new ArrayList<>(); // // private Output output...
for (Template template : schema.getTemplates()) {
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/MergeSchemaTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
import com.presidentio.testdatagenerator.model.Output; import org.elasticsearch.action.count.CountResponse; import org.elasticsearch.client.Client; import org.elasticsearch.index.query.QueryBuilders; import org.junit.Assert; import java.util.Arrays; import java.util.List;
package com.presidentio.testdatagenerator; /** * Created by Vitalii_Gergel on 3/2/2015. */ public class MergeSchemaTest extends AbstractEsTest { private String indexName = "test_data_generator"; @Override protected List<String> getSchemaResource() { return Arrays.asList("merge-1-test-schema.j...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
protected void testResult(Output output) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/AbstractBufferedSink.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
import com.presidentio.testdatagenerator.output.formatter.Formatter; import java.util.*; import com.presidentio.testdatagenerator.model.Template;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * dist...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
private Map<Template, Map<Object, List<Map<String, Object>>>> buffer = new HashMap<>();
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/AbstractBufferedSink.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
import com.presidentio.testdatagenerator.output.formatter.Formatter; import java.util.*; import com.presidentio.testdatagenerator.model.Template;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * dist...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
private Formatter formatter;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/model/Output.java
// Path: src/main/java/com/presidentio/testdatagenerator/parser/StringDeserializer.java // public class StringDeserializer extends JsonDeserializer<String> { // // private static final Pattern REGEX = Pattern.compile("\\$\\{(\\w+)}"); // // @Override // public String deserialize(JsonParser jsonParser, Des...
import org.codehaus.jackson.map.annotate.JsonDeserialize; import java.util.Map; import com.presidentio.testdatagenerator.parser.StringDeserializer;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/parser/StringDeserializer.java // public class StringDeserializer extends JsonDeserializer<String> { // // private static final Pattern REGEX = Pattern.compile("\\$\\{(\\w+)}"); // // @Override // public String deserialize(JsonParser jsonParser, Des...
@JsonDeserialize(contentUsing = StringDeserializer.class)
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/AbstractEsSink.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
String host = props.get(PropConst.HOST);
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ParentProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.context.Parent; import com.presidentio.testdatagenerator.model.Field; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
if (props.containsKey(PropConst.DEPTH)) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ParentProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.context.Parent; import com.presidentio.testdatagenerator.model.Field; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ParentProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.context.Parent; import com.presidentio.testdatagenerator.model.Field; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/ParentProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.context.Parent; import com.presidentio.testdatagenerator.model.Field; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Parent parent = context.getParent();
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/SelectProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map; import java.util.Random;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
if (propsCopy.containsKey(PropConst.DELIMITER)) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/SelectProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map; import java.util.Random;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/SelectProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.HashMap; import java.util.Map; import java.util.Random;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/CsvFileTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
import com.presidentio.testdatagenerator.model.Output; import org.apache.commons.io.IOUtils; import org.junit.Assert; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Arrays; import java.util.List;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * dist...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Output.java // public class Output { // // private String type; // // @JsonDeserialize(contentUsing = StringDeserializer.class) // private Map<String, String> props; // // public String getType() { // return type; // } // // ...
protected void testResult(Output output) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/formatter/Formatter.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
import java.util.List; import java.util.Map; import com.presidentio.testdatagenerator.model.Template;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
String format(Map<String, Object> map, Template template);
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/TimeProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/context/Context.java // public class Context { // // private Parent parent; // // private Map<String, Template> templates; // // private Map<String, Object> variables; // // private Sink sink; // // public Context(Map<String, Template> te...
import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.Map;
package com.presidentio.testdatagenerator.provider; /** * Created by Vitaliy on 23.04.2015. */ public class TimeProvider implements ValueProvider { @Override public void init(Map<String, String> props) { } @Override
// Path: src/main/java/com/presidentio/testdatagenerator/context/Context.java // public class Context { // // private Parent parent; // // private Map<String, Template> templates; // // private Map<String, Object> variables; // // private Sink sink; // // public Context(Map<String, Template> te...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/TimeProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/context/Context.java // public class Context { // // private Parent parent; // // private Map<String, Template> templates; // // private Map<String, Object> variables; // // private Sink sink; // // public Context(Map<String, Template> te...
import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.Map;
package com.presidentio.testdatagenerator.provider; /** * Created by Vitaliy on 23.04.2015. */ public class TimeProvider implements ValueProvider { @Override public void init(Map<String, String> props) { } @Override
// Path: src/main/java/com/presidentio/testdatagenerator/context/Context.java // public class Context { // // private Parent parent; // // private Map<String, Template> templates; // // private Map<String, Object> variables; // // private Sink sink; // // public Context(Map<String, Template> te...
public Object nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/EmailProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.Collections; import java.util.HashMap; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
if (propsCopy.containsKey(PropConst.DOMAIN)) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/EmailProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.Collections; import java.util.HashMap; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public String nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/EmailProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.Collections; import java.util.HashMap; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public String nextValue(Context context, Field field) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/provider/EmailProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import java.util.Collections; import java.util.HashMap; import java.util.Map;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
if (!field.getType().equals(TypeConst.STRING)) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/EsDirectSink.java
// Path: src/main/java/com/presidentio/testdatagenerator/output/formatter/EsFormatter.java // public class EsFormatter implements Formatter { // // private static final String INDEX = "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\"} }"; // // private ObjectMapper objectMapper = new ObjectMapper(); //...
import com.presidentio.testdatagenerator.output.formatter.Formatter; import java.util.Map; import com.presidentio.testdatagenerator.output.formatter.EsFormatter;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/output/formatter/EsFormatter.java // public class EsFormatter implements Formatter { // // private static final String INDEX = "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\"} }"; // // private ObjectMapper objectMapper = new ObjectMapper(); //...
Formatter formatter = new EsFormatter();
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/EsDirectSink.java
// Path: src/main/java/com/presidentio/testdatagenerator/output/formatter/EsFormatter.java // public class EsFormatter implements Formatter { // // private static final String INDEX = "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\"} }"; // // private ObjectMapper objectMapper = new ObjectMapper(); //...
import com.presidentio.testdatagenerator.output.formatter.Formatter; import java.util.Map; import com.presidentio.testdatagenerator.output.formatter.EsFormatter;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/output/formatter/EsFormatter.java // public class EsFormatter implements Formatter { // // private static final String INDEX = "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\"} }"; // // private ObjectMapper objectMapper = new ObjectMapper(); //...
Formatter formatter = new EsFormatter();
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ExpressionProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.HashMap; import java.util.Map...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
props.put(PropConst.EXPR, propExpr);
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ExpressionProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.HashMap; import java.util.Map...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Context context = new Context(null, new HashMap<String, Object>(), null);
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ExpressionProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.HashMap; import java.util.Map...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = expressionProvider.nextValue(context, new Field(null, TypeConst.INT, null));
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/ExpressionProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.HashMap; import java.util.Map...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = expressionProvider.nextValue(context, new Field(null, TypeConst.INT, null));
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/path/TimeBasedPathProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.model.Template; import java.text.SimpleDateFormat; import java.util.*;
package com.presidentio.testdatagenerator.output.path; /** * Created by presidentio on 24.04.15. */ public class TimeBasedPathProvider implements PathProvider { private String suffix = ""; private String prefix = ""; private SimpleDateFormat format = new SimpleDateFormat("/yyyy/MM/dd/HH/"); @Ove...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
if (props.containsKey(PropConst.SUFFIX)) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/output/path/TimeBasedPathProvider.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.model.Template; import java.text.SimpleDateFormat; import java.util.*;
package com.presidentio.testdatagenerator.output.path; /** * Created by presidentio on 24.04.15. */ public class TimeBasedPathProvider implements PathProvider { private String suffix = ""; private String prefix = ""; private SimpleDateFormat format = new SimpleDateFormat("/yyyy/MM/dd/HH/"); @Ove...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
public String getFilePath(Template template, Map<String, Object> map) {
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/context/Context.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
import com.presidentio.testdatagenerator.output.Sink; import java.util.Map; import com.presidentio.testdatagenerator.model.Template;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
private Map<String, Template> templates;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/context/Context.java
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
import com.presidentio.testdatagenerator.output.Sink; import java.util.Map; import com.presidentio.testdatagenerator.model.Template;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/model/Template.java // public class Template { // // private String id; // // private String extend; // // @JsonIgnore // private Template extendTemplate; // // private Integer count; // // private String name; // // private List...
private Sink sink;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/ConstBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.ConstValueProvider; import com.presidentio.t...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class ConstBenchmark {
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
private Context context;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/ConstBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.ConstValueProvider; import com.presidentio.t...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class ConstBenchmark { private Context context;
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
private ValueProvider valueProvider;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/ConstBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.ConstValueProvider; import com.presidentio.t...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class ConstBenchmark { private Context context; private ValueProvider v...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
private Field field;
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/ConstBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.ConstValueProvider; import com.presidentio.t...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class ConstBenchmark { private Context context; private ValueProvider v...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
props.put(PropConst.VALUE, propValue);
presidentio/test-data-generator
src/main/java/com/presidentio/testdatagenerator/benchmark/ConstBenchmark.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import com.presidentio.testdatagenerator.provider.ConstValueProvider; import com.presidentio.t...
package com.presidentio.testdatagenerator.benchmark; /** * Created by Vitalii_Gergel on 3/19/2015. */ @Fork(1) @Warmup(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Measurement(iterations = 10) @State(Scope.Benchmark) public class ConstBenchmark { private Context context; private ValueProvider v...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
valueProvider = new ConstValueProvider();
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/SelectProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.*;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
props.put(PropConst.ITEMS, propItems);
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/SelectProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.*;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = selectProvider.nextValue(new Context(null, null, null), new Field("testField", TypeConst.STRING, null));
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/SelectProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.*;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = selectProvider.nextValue(new Context(null, null, null), new Field("testField", TypeConst.STRING, null));
presidentio/test-data-generator
src/test/java/com/presidentio/testdatagenerator/provider/SelectProviderTest.java
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
import com.presidentio.testdatagenerator.cons.PropConst; import com.presidentio.testdatagenerator.cons.TypeConst; import com.presidentio.testdatagenerator.context.Context; import com.presidentio.testdatagenerator.model.Field; import org.junit.Assert; import org.junit.Test; import java.util.*;
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java // public class PropConst { // // public static final String TYPE = "type"; // public static final String VALUE = "value"; // public static final String SIZE = "size"; // public static final String DOMAIN = "domain"; // pu...
Object result = selectProvider.nextValue(new Context(null, null, null), new Field("testField", TypeConst.STRING, null));
crawler-commons/crawler-commons
src/main/java/crawlercommons/sitemaps/SiteMapURL.java
// Path: src/main/java/crawlercommons/sitemaps/extension/Extension.java // public enum Extension { // /** // * Google News sitemaps, see // * https://support.google.com/news/publisher-center/answer/74288 // */ // NEWS, // /** // * Google Image sitemaps, see // * https://support.goog...
import crawlercommons.sitemaps.extension.ExtensionMetadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Serializable; import java.net.MalformedURLException; import java.net.URL; import java.time.ZonedDateTime; import java.util.Date; import java.util.Locale; import java.util.Map; import java....
/** * Copyright 2016 Crawler-Commons * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
// Path: src/main/java/crawlercommons/sitemaps/extension/Extension.java // public enum Extension { // /** // * Google News sitemaps, see // * https://support.google.com/news/publisher-center/answer/74288 // */ // NEWS, // /** // * Google Image sitemaps, see // * https://support.goog...
private Map<Extension, ExtensionMetadata[]> attributes;
crawler-commons/crawler-commons
src/main/java/crawlercommons/sitemaps/SiteMapURL.java
// Path: src/main/java/crawlercommons/sitemaps/extension/Extension.java // public enum Extension { // /** // * Google News sitemaps, see // * https://support.google.com/news/publisher-center/answer/74288 // */ // NEWS, // /** // * Google Image sitemaps, see // * https://support.goog...
import crawlercommons.sitemaps.extension.ExtensionMetadata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Serializable; import java.net.MalformedURLException; import java.net.URL; import java.time.ZonedDateTime; import java.util.Date; import java.util.Locale; import java.util.Map; import java....
/** * Copyright 2016 Crawler-Commons * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
// Path: src/main/java/crawlercommons/sitemaps/extension/Extension.java // public enum Extension { // /** // * Google News sitemaps, see // * https://support.google.com/news/publisher-center/answer/74288 // */ // NEWS, // /** // * Google Image sitemaps, see // * https://support.goog...
private Map<Extension, ExtensionMetadata[]> attributes;
crawler-commons/crawler-commons
src/test/java/crawlercommons/domains/EffectiveTldFinderTest.java
// Path: src/main/java/crawlercommons/domains/EffectiveTldFinder.java // public static class EffectiveTLD { // // private boolean exception = false; // private boolean wild = false; // private boolean isPrivate = false; // private String domain = null; // private String idn = null; // // /** /...
import crawlercommons.domains.EffectiveTldFinder.EffectiveTLD; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*;
/** * Copyright 2016 Crawler-Commons * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
// Path: src/main/java/crawlercommons/domains/EffectiveTldFinder.java // public static class EffectiveTLD { // // private boolean exception = false; // private boolean wild = false; // private boolean isPrivate = false; // private String domain = null; // private String idn = null; // // /** /...
EffectiveTLD etld = null;
crawler-commons/crawler-commons
src/main/java/crawlercommons/filters/basic/BasicURLNormalizer.java
// Path: src/main/java/crawlercommons/utils/Strings.java // public class Strings { // // public static boolean isBlank(final String cs) { // if (cs == null || cs.isEmpty()) { // return true; // } // for (int i = 0; i < cs.length(); i++) { // if (Character.isWhitespac...
import java.util.regex.Matcher; import java.util.regex.Pattern; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import crawlercommons.filters.URLFilter; import static java.nio.charset.StandardCharsets.UTF_8; import crawlercommons.utils.Strings; import java.io.BufferedReader; import java.io.IOException; import ...
/** * Parses the URL file and applies normalizations to the path and query components. * * @param file the URL file (as in java.net.URL.getFile()). * @return a normalized URL file */ private String normalizeUrlFile(String file) { // find the beginning of the query parameters ...
// Path: src/main/java/crawlercommons/utils/Strings.java // public class Strings { // // public static boolean isBlank(final String cs) { // if (cs == null || cs.isEmpty()) { // return true; // } // for (int i = 0; i < cs.length(); i++) { // if (Character.isWhitespac...
if (!Strings.isBlank(path)) {
crawler-commons/crawler-commons
src/main/java/crawlercommons/robots/SimpleRobotRulesParser.java
// Path: src/main/java/crawlercommons/robots/SimpleRobotRules.java // public enum RobotRulesMode { // ALLOW_ALL, ALLOW_NONE, ALLOW_SOME // }
import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import crawlercommons.robots.SimpleRobotRules.RobotRulesMode; import java.io.IOException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import ja...
// number of warnings found in the latest processed robots.txt file private ThreadLocal<Integer> _numWarningsDuringLastParse = new ThreadLocal<>(); private int _maxWarnings; private long _maxCrawlDelay; public SimpleRobotRulesParser() { this(DEFAULT_MAX_CRAWL_DELAY, DEFAULT_MAX_WARNINGS); ...
// Path: src/main/java/crawlercommons/robots/SimpleRobotRules.java // public enum RobotRulesMode { // ALLOW_ALL, ALLOW_NONE, ALLOW_SOME // } // Path: src/main/java/crawlercommons/robots/SimpleRobotRulesParser.java import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; impor...
result = new SimpleRobotRules(RobotRulesMode.ALLOW_NONE);
crawler-commons/crawler-commons
src/main/java/crawlercommons/sitemaps/Namespace.java
// Path: src/main/java/crawlercommons/sitemaps/extension/Extension.java // public enum Extension { // /** // * Google News sitemaps, see // * https://support.google.com/news/publisher-center/answer/74288 // */ // NEWS, // /** // * Google Image sitemaps, see // * https://support.goog...
import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeMap; import crawlercommons.sitemaps.extension.Extension;
* RSS and Atom sitemap formats do not have strict definition. But if we do * not parse as namespace aware, then RSS/Atom files that choose to use * namespaces will break. The relaxed compromise for RSS/Atom is to always * parse as "namespace aware", but we will only match elements by the * loca...
// Path: src/main/java/crawlercommons/sitemaps/extension/Extension.java // public enum Extension { // /** // * Google News sitemaps, see // * https://support.google.com/news/publisher-center/answer/74288 // */ // NEWS, // /** // * Google Image sitemaps, see // * https://support.goog...
public static final Map<Extension, List<String>> SITEMAP_EXTENSION_NAMESPACES = new TreeMap<>();
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/anim/ControlViewPagerSpeed.java
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
import java.lang.reflect.Field; import com.gotech.tv.launcher.util.Constant; import android.support.v4.view.ViewPager; import android.view.animation.AccelerateInterpolator;
package com.gotech.tv.launcher.anim; /** * @version 1.0 * @author: john * @date:Nov 30, 2015 10:09:46 AM * @description: fix speed scroller */ public class ControlViewPagerSpeed { private ViewPager mViewPager = null; public ControlViewPagerSpeed(ViewPager vp) { mViewPager = vp; } publ...
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
mScroller.setmDuration(Constant.VIEW_PAGER_DURATION);
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/view/FlyBorderView.java
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
import com.gotech.tv.launcher.util.Constant; import com.gotech.tv.launcher.util.DensityUtil; import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.animation.DecelerateInterpolator;
} /** * 设置焦点框的移动. */ public void setFocusView(View view, float scale) { if (mFocusView != view) { mFocusView = view; runTranslateAnimation(mFocusView, scale, scale); } } public void setSelectView(View view) { if (mSelectView != view) { ...
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
x = DensityUtil.dip2px(this.getContext(), x + deltaX);
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/view/FlyBorderView.java
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
import com.gotech.tv.launcher.util.Constant; import com.gotech.tv.launcher.util.DensityUtil; import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.animation.DecelerateInterpolator;
public void setSelectView(View view) { if (mSelectView != view) { mSelectView = view; runTranslateAnimation(mSelectView); } } private void runTranslateAnimation(View toView) { Rect fromRect = findLocationWithView(this); Rect toRect = findLocationWith...
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
animate().translationX(x).translationY(y).setDuration(Constant.TRAN_DUR_ANIM).setInterpolator(new DecelerateInterpolator()).start();
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/util/FileUtils.java
// Path: src/com/gotech/tv/launcher/service/ContextManager.java // public class ContextManager { // //private static final String TAG = ContextManager.class.getSimpleName(); // // private static ContextManager instance = null; // // public static String ACTION_SN_ACTIVATE_RESULT = "action.sn.activate.resu...
import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.util.Log; import android.view.View; import com.gotech.tv.launcher.service.ContextManager; import java.io.BufferedOutputStream; import java.io.Buffere...
package com.gotech.tv.launcher.util; public class FileUtils { public static String TAG = "FileUtils"; private static FileUtils instance; /** * singleton * * @return */ public static FileUtils getInstance() { if (instance == null) instance = new FileUtils();...
// Path: src/com/gotech/tv/launcher/service/ContextManager.java // public class ContextManager { // //private static final String TAG = ContextManager.class.getSimpleName(); // // private static ContextManager instance = null; // // public static String ACTION_SN_ACTIVATE_RESULT = "action.sn.activate.resu...
fileName = ContextManager.LOCAL_CONFIG_PATH + fileName;
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/view/PageIndicator.java
// Path: src/com/gotech/tv/launcher/util/DensityUtil.java // public class DensityUtil { // // public static int dip2px(Context context, float dpValue) { // final float scale = context.getResources().getDisplayMetrics().density; // return (int) (dpValue * scale + 0.5f); // } // // public st...
import android.content.Context; import android.content.res.TypedArray; import android.graphics.Color; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.Gravity; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; import android...
default: return UNKNOWN; } } } public static final int DEFAULT_INDICATOR_SPACING = 5; private int mActivePosition = -1; private int mIndicatorSpacing; private boolean mIndicatorTypeChanged = false; private IndicatorType mIndicatorType ...
// Path: src/com/gotech/tv/launcher/util/DensityUtil.java // public class DensityUtil { // // public static int dip2px(Context context, float dpValue) { // final float scale = context.getResources().getDisplayMetrics().density; // return (int) (dpValue * scale + 0.5f); // } // // public st...
mIndicatorSpacing = a.getDimensionPixelSize(R.styleable.PageIndicator_indicator_spacing, DensityUtil.dip2px(context, (float) DEFAULT_INDICATOR_SPACING));
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/view/CustomDialog.java
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
import com.gotech.tv.launcher.R; import com.gotech.tv.launcher.util.Constant; import android.app.Dialog; import android.content.Context; import android.os.Handler; import android.os.Message; import android.view.KeyEvent; import android.widget.ImageButton;
package com.gotech.tv.launcher.view; /** * @version 1.0 * @author:john * @date:Dec 1, 2015 7:30:10 PM * @description: custom dialog */ public class CustomDialog extends Dialog { private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { switch ...
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
case Constant.DIALOG_AUTO_DISMISS:
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/parser/ParserSet.java
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
import com.gotech.tv.launcher.util.Constant; import com.gotech.tv.launcher.vo.ParseResultVo; import com.gotech.tv.launcher.vo.UserInfoVo; import org.json.JSONObject;
package com.gotech.tv.launcher.parser; public class ParserSet { public static class StateParser extends BaseJsonParser<Integer> { public static final String KEY_STATE = "returnCode"; @Override public Integer parse(JSONObject data) throws DataParseException { int state = data....
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
public static class UserInfoParser extends BaseJsonParser<ParseResultVo> {
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/parser/ParserSet.java
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
import com.gotech.tv.launcher.util.Constant; import com.gotech.tv.launcher.vo.ParseResultVo; import com.gotech.tv.launcher.vo.UserInfoVo; import org.json.JSONObject;
package com.gotech.tv.launcher.parser; public class ParserSet { public static class StateParser extends BaseJsonParser<Integer> { public static final String KEY_STATE = "returnCode"; @Override public Integer parse(JSONObject data) throws DataParseException { int state = data....
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
vo.obj = new UserInfoVo(data.optString("accountid", ""), data.optString("accountid", "password"));
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/parser/ParserSet.java
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
import com.gotech.tv.launcher.util.Constant; import com.gotech.tv.launcher.vo.ParseResultVo; import com.gotech.tv.launcher.vo.UserInfoVo; import org.json.JSONObject;
public static class TokenUpdateParser extends BaseJsonParser<String> { @Override public String parse(JSONObject data) throws DataParseException { return data.optString("newUserToken"); } } public static class HeartRunParser extends BaseJsonParser<Integer> { @Ove...
// Path: src/com/gotech/tv/launcher/util/Constant.java // public class Constant { // // public static final int VIEW_PAGER_DURATION = 500; // public static final int MENU_HOME = 0; // public static final int MENU_APP = 1; // public static final int MENU_SETTING = 2; // public static final int TRAN_...
vo.result = Constant.ParseData_TimeOut;
coderJohnZhang/TvLauncher
src/com/gotech/tv/launcher/adapter/AppGridAdapter.java
// Path: src/com/gotech/tv/launcher/vo/AppInfoVo.java // public class AppInfoVo { // // public String mAppName; // public String mAppPackageName; // public Drawable mAppIcon; // public Intent mAppIntent; // public Integer[] mAppPanelId = {R.drawable.color_01, R.drawable.color_02, R.drawable.color_0...
import java.util.ArrayList; import java.util.List; import com.gotech.tv.launcher.R; import com.gotech.tv.launcher.vo.AppInfoVo; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView;...
package com.gotech.tv.launcher.adapter; public class AppGridAdapter extends BaseAdapter { private int mPage = 0; private int mPageSize = 0;
// Path: src/com/gotech/tv/launcher/vo/AppInfoVo.java // public class AppInfoVo { // // public String mAppName; // public String mAppPackageName; // public Drawable mAppIcon; // public Intent mAppIntent; // public Integer[] mAppPanelId = {R.drawable.color_01, R.drawable.color_02, R.drawable.color_0...
private List<AppInfoVo> mData = null;