use of org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject in project jbpm by kiegroup.
the class ReflectionObjectModelResolverTest method testSimpleNestedObjectArgObjectModel.
@Test
public void testSimpleNestedObjectArgObjectModel() {
ObjectModel model = new ObjectModel("org.jbpm.runtime.manager.impl.deploy.testobject.ThirdLevelCustomObject", new Object[] { new ObjectModel("org.jbpm.runtime.manager.impl.deploy.testobject.EmbedingCustomObject", new Object[] { new ObjectModel("org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject", new Object[] { "john" }), "testing object model" }) });
ObjectModelResolver resolver = new ReflectionObjectModelResolver();
Object result = resolver.getInstance(model, this.getClass().getClassLoader(), new HashMap<String, Object>());
assertNotNull(result);
assertTrue(result instanceof ThirdLevelCustomObject);
assertEquals("testing object model", ((ThirdLevelCustomObject) result).getEmbeddedObject().getDescription());
SimpleCustomObject customObject = ((ThirdLevelCustomObject) result).getEmbeddedObject().getCustomObject();
assertNotNull(customObject);
assertEquals("john", customObject.getName());
}
use of org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject in project jbpm by kiegroup.
the class ReflectionObjectModelResolverTest method testSimpleContextValueObjectModel.
@Test
public void testSimpleContextValueObjectModel() {
ObjectModel model = new ObjectModel("org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject", new Object[] { "context" });
ObjectModelResolver resolver = new ReflectionObjectModelResolver();
Map<String, Object> contextParam = new HashMap<String, Object>();
contextParam.put("context", "value from the context");
Object result = resolver.getInstance(model, this.getClass().getClassLoader(), contextParam);
assertNotNull(result);
assertTrue(result instanceof SimpleCustomObject);
assertEquals("value from the context", ((SimpleCustomObject) result).getName());
}
Aggregations