mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Fixing JBPMEngineUnitTest
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16035 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -85,28 +85,24 @@ public class JBPMEngineUnitTest extends AbstractTransactionalSpringContextTests
|
|||||||
|
|
||||||
public void testDeployWorkflow() throws Exception
|
public void testDeployWorkflow() throws Exception
|
||||||
{
|
{
|
||||||
ClassPathResource processDef = new ClassPathResource(
|
ClassPathResource processDef = new ClassPathResource("jbpmresources/test_processdefinition.xml");
|
||||||
"jbpmresources/test_processdefinition.xml");
|
|
||||||
List<WorkflowDefinition> workflowDefs = engine.getDefinitions();
|
List<WorkflowDefinition> workflowDefs = engine.getDefinitions();
|
||||||
assertFalse(engine.isDefinitionDeployed(processDef.getInputStream(),
|
assertFalse(engine.isDefinitionDeployed(processDef.getInputStream(), MimetypeMap.MIMETYPE_XML));
|
||||||
MimetypeMap.MIMETYPE_XML));
|
|
||||||
assertNotNull(workflowDefs);
|
assertNotNull(workflowDefs);
|
||||||
assertTrue(workflowDefs.size() == 0);
|
assertTrue(workflowDefs.size() == 0);
|
||||||
|
|
||||||
deployTestDefinition();
|
deployTestDefinition();
|
||||||
assertTrue(engine.isDefinitionDeployed(processDef.getInputStream(),
|
assertTrue(engine.isDefinitionDeployed(processDef.getInputStream(), MimetypeMap.MIMETYPE_XML));
|
||||||
MimetypeMap.MIMETYPE_XML));
|
|
||||||
workflowDefs = engine.getDefinitions();
|
workflowDefs = engine.getDefinitions();
|
||||||
assertNotNull(workflowDefs);
|
assertNotNull(workflowDefs);
|
||||||
assertTrue(workflowDefs.size() == 1);
|
assertTrue(workflowDefs.size() == 1);
|
||||||
|
|
||||||
assertNotNull(workflowDef);
|
assertNotNull(workflowDef);
|
||||||
assertEquals("jbpm_test$test", workflowDef.name);
|
assertEquals(TEST_JBPM_ENGINE + "$test", workflowDef.name);
|
||||||
assertEquals("1", workflowDef.version);
|
assertEquals("1", workflowDef.version);
|
||||||
|
|
||||||
deployTestDefinition();
|
deployTestDefinition();
|
||||||
assertTrue(engine.isDefinitionDeployed(processDef.getInputStream(),
|
assertTrue(engine.isDefinitionDeployed(processDef.getInputStream(), MimetypeMap.MIMETYPE_XML));
|
||||||
MimetypeMap.MIMETYPE_XML));
|
|
||||||
assertEquals("2", workflowDef.version);
|
assertEquals("2", workflowDef.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,7 +350,6 @@ public class JBPMEngineUnitTest extends AbstractTransactionalSpringContextTests
|
|||||||
engine.setDictionaryService(dictionaryService);
|
engine.setDictionaryService(dictionaryService);
|
||||||
engine.setEngineId(TEST_JBPM_ENGINE);
|
engine.setEngineId(TEST_JBPM_ENGINE);
|
||||||
engine.setBPMEngineRegistry(engineRegistry);
|
engine.setBPMEngineRegistry(engineRegistry);
|
||||||
engine.afterPropertiesSet();
|
|
||||||
|
|
||||||
// Need to register JBPMEngine with bean factory so WorflowTaskInstance
|
// Need to register JBPMEngine with bean factory so WorflowTaskInstance
|
||||||
// can load it.
|
// can load it.
|
||||||
@@ -384,13 +379,11 @@ public class JBPMEngineUnitTest extends AbstractTransactionalSpringContextTests
|
|||||||
// deploy test process definition
|
// deploy test process definition
|
||||||
private void deployTestDefinition() throws IOException
|
private void deployTestDefinition() throws IOException
|
||||||
{
|
{
|
||||||
ClassPathResource processDef = new ClassPathResource(
|
ClassPathResource processDef = new ClassPathResource("jbpmresources/test_processdefinition.xml");
|
||||||
"jbpmresources/test_processdefinition.xml");
|
WorkflowDeployment deployment = engine.deployDefinition(processDef.getInputStream(), MimetypeMap.MIMETYPE_XML);
|
||||||
WorkflowDeployment deployment = engine.deployDefinition(processDef.getInputStream(),
|
|
||||||
MimetypeMap.MIMETYPE_XML);
|
|
||||||
workflowDef = deployment.definition;
|
workflowDef = deployment.definition;
|
||||||
assertNotNull(workflowDef);
|
assertNotNull(workflowDef);
|
||||||
assertEquals(TEST_JBPM_ENGINE+"$test", workflowDef.name);
|
assertEquals(TEST_JBPM_ENGINE + "$test", workflowDef.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private NamespaceService makeNamespaceService()
|
private NamespaceService makeNamespaceService()
|
||||||
|
Reference in New Issue
Block a user