use of org.kie.internal.runtime.conf.ObjectModel in project jbpm by kiegroup.
the class JaxbMarshalingTest method testJaxbDeploymentDescriptorSerialization.
@Test
public void testJaxbDeploymentDescriptorSerialization() throws Exception {
DeploymentDescriptor descriptor = new DeploymentDescriptorImpl();
descriptor.getBuilder().addTaskEventListener(new ObjectModel("org.jbpm.task.Listener", new Object[] { "test", "another" }));
String output = convertJaxbObjectToString(descriptor);
logger.debug(output);
assertNotNull(output);
}
use of org.kie.internal.runtime.conf.ObjectModel in project jbpm by kiegroup.
the class MVELObjectModelResolverTest method testComplexStaticObjectModel.
@Test
public void testComplexStaticObjectModel() {
ObjectModel model = new ObjectModel("String.valueOf(10).substring(1)");
ObjectModelResolver resolver = new MVELObjectModelResolver();
Object result = resolver.getInstance(model, this.getClass().getClassLoader(), new HashMap<String, Object>());
assertNotNull(result);
assertTrue(result instanceof String);
assertEquals("0", ((String) result));
}
use of org.kie.internal.runtime.conf.ObjectModel in project jbpm by kiegroup.
the class MVELObjectModelResolverTest method testSimpleNoArgObjectModel.
@Test
public void testSimpleNoArgObjectModel() {
ObjectModel model = new ObjectModel("new org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject()");
ObjectModelResolver resolver = new MVELObjectModelResolver();
Object result = resolver.getInstance(model, this.getClass().getClassLoader(), new HashMap<String, Object>());
assertNotNull(result);
assertTrue(result instanceof SimpleCustomObject);
assertEquals("default", ((SimpleCustomObject) result).getName());
}
use of org.kie.internal.runtime.conf.ObjectModel in project jbpm by kiegroup.
the class ReflectionObjectModelResolverTest method testSimpleSingleStringArgObjectModel.
@Test
public void testSimpleSingleStringArgObjectModel() {
ObjectModel model = new ObjectModel("org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject", new Object[] { "john" });
ObjectModelResolver resolver = new ReflectionObjectModelResolver();
Object result = resolver.getInstance(model, this.getClass().getClassLoader(), new HashMap<String, Object>());
assertNotNull(result);
assertTrue(result instanceof SimpleCustomObject);
assertEquals("john", ((SimpleCustomObject) result).getName());
}
use of org.kie.internal.runtime.conf.ObjectModel 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());
}
Aggregations