use of com.adaptris.core.services.conditional.conditions.ConditionFunction in project interlok by adaptris.
the class ConditionFunctionTest method testDefinition.
@Test
public void testDefinition() throws Exception {
ConditionFunction condition = new ConditionFunction();
assertNull(condition.getDefinition());
condition.setDefinition("function evaluateScript(message) { return true;}");
assertEquals("function evaluateScript(message) { return true;}", condition.getDefinition());
}
use of com.adaptris.core.services.conditional.conditions.ConditionFunction in project interlok by adaptris.
the class ConditionFunctionTest method testScriptCondition_True.
@Test
public void testScriptCondition_True() throws Exception {
ConditionFunction condition = new ConditionFunction("function evaluateScript(message) { return true;}");
try {
LifecycleHelper.initAndStart(condition);
assertTrue(condition.evaluate(createMessage()));
} finally {
LifecycleHelper.stopAndClose(condition);
}
}
Aggregations