Search in sources :

Example 1 with SimpleCustomObject

use of org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject in project jbpm by kiegroup.

the class ReflectionObjectModelResolverTest method testSimpleSingleObjectArgObjectModel.

@Test
public void testSimpleSingleObjectArgObjectModel() {
    ObjectModel model = 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 EmbedingCustomObject);
    assertEquals("testing object model", ((EmbedingCustomObject) result).getDescription());
    SimpleCustomObject customObject = ((EmbedingCustomObject) result).getCustomObject();
    assertNotNull(customObject);
    assertEquals("john", customObject.getName());
}
Also used : EmbedingCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.EmbedingCustomObject) ObjectModel(org.kie.internal.runtime.conf.ObjectModel) NamedObjectModel(org.kie.internal.runtime.conf.NamedObjectModel) ObjectModelResolver(org.kie.internal.runtime.conf.ObjectModelResolver) ThirdLevelCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.ThirdLevelCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) EmbedingCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.EmbedingCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) Test(org.junit.Test)

Example 2 with SimpleCustomObject

use of org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject in project jbpm by kiegroup.

the class ReflectionObjectModelResolverTest method testSimpleNoArgNamedObjectModel.

@Test
public void testSimpleNoArgNamedObjectModel() {
    NamedObjectModel model = new NamedObjectModel("CustomObject", "org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject");
    assertEquals("CustomObject", model.getName());
    ObjectModelResolver resolver = new ReflectionObjectModelResolver();
    Object result = resolver.getInstance(model, this.getClass().getClassLoader(), new HashMap<String, Object>());
    assertNotNull(result);
    assertTrue(result instanceof SimpleCustomObject);
    assertEquals("default", ((SimpleCustomObject) result).getName());
}
Also used : NamedObjectModel(org.kie.internal.runtime.conf.NamedObjectModel) ObjectModelResolver(org.kie.internal.runtime.conf.ObjectModelResolver) ThirdLevelCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.ThirdLevelCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) EmbedingCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.EmbedingCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) Test(org.junit.Test)

Example 3 with SimpleCustomObject

use of org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject in project jbpm by kiegroup.

the class ReflectionObjectModelResolverTest method testSimpleNoArgObjectModel.

@Test
public void testSimpleNoArgObjectModel() {
    ObjectModel model = new ObjectModel("org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject");
    ObjectModelResolver resolver = new ReflectionObjectModelResolver();
    Object result = resolver.getInstance(model, this.getClass().getClassLoader(), new HashMap<String, Object>());
    assertNotNull(result);
    assertTrue(result instanceof SimpleCustomObject);
    assertEquals("default", ((SimpleCustomObject) result).getName());
}
Also used : ObjectModel(org.kie.internal.runtime.conf.ObjectModel) NamedObjectModel(org.kie.internal.runtime.conf.NamedObjectModel) ObjectModelResolver(org.kie.internal.runtime.conf.ObjectModelResolver) ThirdLevelCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.ThirdLevelCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) EmbedingCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.EmbedingCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) Test(org.junit.Test)

Example 4 with SimpleCustomObject

use of org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject 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());
}
Also used : ObjectModel(org.kie.internal.runtime.conf.ObjectModel) ObjectModelResolver(org.kie.internal.runtime.conf.ObjectModelResolver) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) Test(org.junit.Test)

Example 5 with SimpleCustomObject

use of org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject 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());
}
Also used : ObjectModel(org.kie.internal.runtime.conf.ObjectModel) NamedObjectModel(org.kie.internal.runtime.conf.NamedObjectModel) ObjectModelResolver(org.kie.internal.runtime.conf.ObjectModelResolver) ThirdLevelCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.ThirdLevelCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) EmbedingCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.EmbedingCustomObject) SimpleCustomObject(org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject) Test(org.junit.Test)

Aggregations

SimpleCustomObject (org.jbpm.runtime.manager.impl.deploy.testobject.SimpleCustomObject)7 Test (org.junit.Test)7 ObjectModelResolver (org.kie.internal.runtime.conf.ObjectModelResolver)7 EmbedingCustomObject (org.jbpm.runtime.manager.impl.deploy.testobject.EmbedingCustomObject)6 ThirdLevelCustomObject (org.jbpm.runtime.manager.impl.deploy.testobject.ThirdLevelCustomObject)6 NamedObjectModel (org.kie.internal.runtime.conf.NamedObjectModel)6 ObjectModel (org.kie.internal.runtime.conf.ObjectModel)6 HashMap (java.util.HashMap)1