use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class WorkflowsInterpreterVisitorTest method testForeachLoop.
@Test
public void testForeachLoop() {
IEntity foreachLoopTest = WorkflowsTestTemplateManager.instance().create("foreachLoopTest");
IBindingManager args = BindingManagerFactory.instance.createArguments();
InterpreterOperation.interpret(foreachLoopTest, args);
Assert.assertTrue(args.wIsSet("count"));
Assert.assertEquals(5, args.wIntValue("count"));
}
use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class WorkflowsInterpreterVisitorTest method testTask.
@Test
public void testTask() {
IEntity taskTest = WorkflowsTestTemplateManager.instance().create("taskTest");
IBindingManager args = BindingManagerFactory.instance.createArguments();
args.wDefValue("reader", new StringReader("yep!\n"));
try {
InterpreterOperation.interpret(taskTest, args, (Reader) null, (Writer) null);
} catch (VisitException e) {
Assert.fail();
}
args.wDefValue("reader", new StringReader("NO\n"));
try {
InterpreterOperation.interpret(taskTest, args, (Reader) null, (Writer) null);
Assert.fail();
} catch (VisitException e) {
}
}
use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class WorkflowsInterpreterVisitorTest method testCreateModel.
@Test
public void testCreateModel() {
IEntity createModelTest = WorkflowsTestTemplateManager.instance().create("createModelTest");
IBindingManager args = BindingManagerFactory.instance.createArguments();
InterpreterOperation.interpret(createModelTest, args);
ModelsEntityFactory mef = ModelsEntityFactory.instance;
SimpleEntity se = mef.createSimpleEntity(mef.createEntityModifiers(mef.createEntityModifier(EntityModifierEnum._abstract)), mef.createSimpleName("Entity1"), mef.createTypes(0), mef.createFeatures(mef.buildFeature().set(ModelsFeatureDescriptorEnum.type, mef.createSimpleName("FType")).set(ModelsFeatureDescriptorEnum.name, mef.createSimpleName("fname")).getResult()));
Assert.assertTrue(args.wIsSet("model"));
IEntity model = args.wGet("model");
Matcher.removeVars(model, false);
Assert.assertTrue(Matcher.match(se, model));
}
use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class WorkflowsInterpreterVisitorTest method testCreateEntity.
@Test
public void testCreateEntity() {
IEntity createEntityTest = WorkflowsTestTemplateManager.instance().create("createEntityTest");
IBindingManager args = BindingManagerFactory.instance.createArguments();
InterpreterOperation.interpret(createEntityTest, args);
ModelsEntityFactory mef = ModelsEntityFactory.instance(RegistryConfigurations.RESOLVER);
Assert.assertTrue(args.wIsSet("entity"));
Assert.assertTrue(Matcher.match(mef.buildSimpleEntity().set(ModelsFeatureDescriptorEnum.modifiers, mef.createEntityModifiers(0)).set(ModelsFeatureDescriptorEnum.name, mef.createSimpleName("EntityName")).set(ModelsFeatureDescriptorEnum.types, mef.createTypes(mef.createSimpleName("Type"))).set(ModelsFeatureDescriptorEnum.features, mef.createFeatures(mef.buildFeature().set(ModelsFeatureDescriptorEnum.type, mef.createSimpleName("FType")).set(ModelsFeatureDescriptorEnum.name, mef.createSimpleName("fname")).getResult())).getResult(), args.wGet("entity")));
}
use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class WorkflowsInterpreterVisitorTest method testCreateJavaClassInstance.
@Test
public void testCreateJavaClassInstance() {
IEntity createJavaClassInstanceTest = WorkflowsTestTemplateManager.instance().create("createJavaClassInstanceTest");
IBindingManager args = BindingManagerFactory.instance.createArguments();
InterpreterOperation.interpret(createJavaClassInstanceTest, args);
Assert.assertTrue(args.wIsSet("value"));
Assert.assertEquals(new BigDecimal("1231.84587345"), args.wGetValue("value"));
}
Aggregations