Search in sources :

Example 1 with JsonRuleDefinitionReader

use of org.jeasy.rules.support.reader.JsonRuleDefinitionReader in project easy-rules by j-easy.

the class JexlRuleFactoryTest method params.

@Parameters
public static Collection<Object[]> params() {
    Map<String, Object> namespaces = new HashMap<>();
    namespaces.put("sout", System.out);
    JexlEngine jexlEngine = new JexlBuilder().namespaces(namespaces).strict(false).create();
    return Arrays.asList(new Object[][] { { new JexlRuleFactory(new YamlRuleDefinitionReader(), jexlEngine), "yml" }, { new JexlRuleFactory(new JsonRuleDefinitionReader(), jexlEngine), "json" } });
}
Also used : JexlEngine(org.apache.commons.jexl3.JexlEngine) HashMap(java.util.HashMap) JexlBuilder(org.apache.commons.jexl3.JexlBuilder) YamlRuleDefinitionReader(org.jeasy.rules.support.reader.YamlRuleDefinitionReader) JsonRuleDefinitionReader(org.jeasy.rules.support.reader.JsonRuleDefinitionReader) Parameters(org.junit.runners.Parameterized.Parameters)

Aggregations

HashMap (java.util.HashMap)1 JexlBuilder (org.apache.commons.jexl3.JexlBuilder)1 JexlEngine (org.apache.commons.jexl3.JexlEngine)1 JsonRuleDefinitionReader (org.jeasy.rules.support.reader.JsonRuleDefinitionReader)1 YamlRuleDefinitionReader (org.jeasy.rules.support.reader.YamlRuleDefinitionReader)1 Parameters (org.junit.runners.Parameterized.Parameters)1