// 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";
//     public static final String EXPR = "expr";
//     public static final String FILE = "file";
//     public static final String DELIMITER = "delimiter";
//     public static final String ITEMS = "items";
//     public static final String INDEX = "index";
//     public static final String HOST = "host";
//     public static final String PORT = "port";
//     public static final String CLUSTER_NAME = "clusterName";
//     public static final String CONNECTION_URL = "connectionUrl";
//     public static final String JDBC_DRIVER = "jdbcDriver";
//     public static final String DEPTH = "depth";
//     public static final String FIELD = "field";
//     public static final String VAR = "var";
//     public static final String OP = "op";
//     public static final String FORMAT = "format";
//     public static final String HEADER = "header";
//     public static final String SUFFIX = "suffix";
//     public static final String PREFIX = "prefix";
//     public static final String PATH_PROVIDER = "pathProvider";
//     public static final String BROKER_LIST = "brokerList";
//     public static final String GENDER = "gender";
// 
// }
// 
// 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";
// 
// }
// 
// 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> templates, Map<String, Object> variables, Sink sink) {
//         this.templates = templates;
//         this.variables = variables;
//         this.sink = sink;
//     }
// 
//     public Context(Context parentContext, Map<String, Object> entity) {
//         parent = new Parent(entity, parentContext.getParent());
//         templates = parentContext.getTemplates();
//         variables = parentContext.getVariables();
//         sink = parentContext.getSink();
//     }
// 
//     public Parent getParent() {
//         return parent;
//     }
// 
//     public Map<String, Object> getVariables() {
//         return variables;
//     }
// 
//     public Sink getSink() {
//         return sink;
//     }
// 
//     public Map<String, Template> getTemplates() {
//         return templates;
//     }
// 
// }
// 
// Path: src/main/java/com/presidentio/testdatagenerator/model/Field.java
// public class Field {
// 
//     private String name;
// 
//     private String type;
// 
//     private Provider provider;
// 
//     public Field() {
//     }
// 
//     public Field(String name, String type, Provider provider) {
//         this.name = name;
//         this.type = type;
//         this.provider = provider;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getType() {
//         return type;
//     }
// 
//     public void setType(String type) {
//         this.type = type;
//     }
// 
//     public Provider getProvider() {
//         return provider;
//     }
// 
//     public void setProvider(Provider provider) {
//         this.provider = provider;
//     }
// }


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.HashMap;
import java.util.Map;
    public void testNextValueCounter() throws Exception {
        Map<String, String> props = new HashMap<>();
        String propExpr = "a++";
        props.put(PropConst.EXPR, propExpr);
        ValueProvider provider = new ExpressionProxyProvider();
        provider.init(props);
        Map<String, Object> variables = new HashMap<>();
        variables.put("a", 5);
        variables.put("b", 2);
        Context context = new Context(null, variables, null);
        Object result = provider.nextValue(context, new Field(null, TypeConst.INT, null));
        Assert.assertEquals(5, result);
        Assert.assertEquals(6L, variables.get("a"));
    }

    @Test
    public void testNextValueParent() throws Exception {
        Map<String, String> props = new HashMap<>();
        String propExpr = "parent.parent.id";
        props.put(PropConst.EXPR, propExpr);
        ValueProvider provider = new ExpressionProxyProvider();
        provider.init(props);
        Map<String, Object> variables = new HashMap<>();
        variables.put("a", 5);
        variables.put("b", 2);
        Context context = new Context(new Context(new Context(null, variables, null), Collections.<String, Object>singletonMap("id", "abc")), Collections.<String, Object>emptyMap());
        Object result = provider.nextValue(context, new Field(null, TypeConst.STRING, null));
        Assert.assertEquals("abc", result);
    }

// 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";
//     public static final String EXPR = "expr";
//     public static final String FILE = "file";
//     public static final String DELIMITER = "delimiter";
//     public static final String ITEMS = "items";
//     public static final String INDEX = "index";
//     public static final String HOST = "host";
//     public static final String PORT = "port";
//     public static final String CLUSTER_NAME = "clusterName";
//     public static final String CONNECTION_URL = "connectionUrl";
//     public static final String JDBC_DRIVER = "jdbcDriver";
//     public static final String DEPTH = "depth";
//     public static final String FIELD = "field";
//     public static final String VAR = "var";
//     public static final String OP = "op";
//     public static final String FORMAT = "format";
//     public static final String HEADER = "header";
//     public static final String SUFFIX = "suffix";
//     public static final String PREFIX = "prefix";
//     public static final String PATH_PROVIDER = "pathProvider";
//     public static final String BROKER_LIST = "brokerList";
//     public static final String GENDER = "gender";
// 
// }
// 
// 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";
// 
// }
// 
// 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> templates, Map<String, Object> variables, Sink sink) {
//         this.templates = templates;
//         this.variables = variables;
//         this.sink = sink;
//     }
// 
//     public Context(Context parentContext, Map<String, Object> entity) {
//         parent = new Parent(entity, parentContext.getParent());
//         templates = parentContext.getTemplates();
//         variables = parentContext.getVariables();
//         sink = parentContext.getSink();
//     }
// 
//     public Parent getParent() {
//         return parent;
//     }
// 
//     public Map<String, Object> getVariables() {
//         return variables;
//     }
// 
//     public Sink getSink() {
//         return sink;
//     }
// 
//     public Map<String, Template> getTemplates() {
//         return templates;
//     }
// 
// }
// 
// Path: src/main/java/com/presidentio/testdatagenerator/model/Field.java
// public class Field {
// 
//     private String name;
// 
//     private String type;
// 
//     private Provider provider;
// 
//     public Field() {
//     }
// 
//     public Field(String name, String type, Provider provider) {
//         this.name = name;
//         this.type = type;
//         this.provider = provider;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getType() {
//         return type;
//     }
// 
//     public void setType(String type) {
//         this.type = type;
//     }
// 
//     public Provider getProvider() {
//         return provider;
//     }
// 
//     public void setProvider(Provider provider) {
//         this.provider = provider;
//     }
// }


// Path: src/test/java/com/presidentio/testdatagenerator/provider/ExpressionProxyProviderTest.java
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.HashMap;
import java.util.Map;

    public void testNextValueCounter() throws Exception {
        Map<String, String> props = new HashMap<>();
        String propExpr = "a++";
        props.put(PropConst.EXPR, propExpr);
        ValueProvider provider = new ExpressionProxyProvider();
        provider.init(props);
        Map<String, Object> variables = new HashMap<>();
        variables.put("a", 5);
        variables.put("b", 2);
        Context context = new Context(null, variables, null);
        Object result = provider.nextValue(context, new Field(null, TypeConst.INT, null));
        Assert.assertEquals(5, result);
        Assert.assertEquals(6L, variables.get("a"));
    }

    @Test
    public void testNextValueParent() throws Exception {
        Map<String, String> props = new HashMap<>();
        String propExpr = "parent.parent.id";
        props.put(PropConst.EXPR, propExpr);
        ValueProvider provider = new ExpressionProxyProvider();
        provider.init(props);
        Map<String, Object> variables = new HashMap<>();
        variables.put("a", 5);
        variables.put("b", 2);
        Context context = new Context(new Context(new Context(null, variables, null), Collections.<String, Object>singletonMap("id", "abc")), Collections.<String, Object>emptyMap());
        Object result = provider.nextValue(context, new Field(null, TypeConst.STRING, null));
        Assert.assertEquals("abc", result);
    }

    @Test