Skip to content

Commit

Permalink
refactoring Plguins, changed junit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Jun 7, 2018
1 parent a8fe8c2 commit 1fd5e27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ protected void updateSubprocesses(final List<String> subProcessDefinitions, fina

// test if process matches
String subModelVersion = workitemSubProcess.getModelVersion();
String subProcessID = "" + workitemSubProcess.getProcessID();
String subProcessID = "" + workitemSubProcess.getTaskID();

if (Pattern.compile(model_pattern).matcher(subModelVersion).find()
&& Pattern.compile(process_pattern).matcher(subProcessID).find()) {
Expand Down Expand Up @@ -380,7 +380,7 @@ protected void updateOrigin(final String originProcessDefinition, final ItemColl

// test if process matches
String subModelVersion = originWorkitem.getModelVersion();
String subProcessID = "" + originWorkitem.getProcessID();
String subProcessID = "" + originWorkitem.getTaskID();

if (Pattern.compile(model_pattern).matcher(subModelVersion).find()
&& Pattern.compile(process_pattern).matcher(subProcessID).find()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void testCreateSubProcess() throws ModelException {
Assert.assertEquals("/pages/workitems/workitem.jsf?id=" + subprocessUniqueid,
documentContext.getItemValueString("action"));

Assert.assertEquals(100, subprocess.getProcessID());
Assert.assertEquals(100, subprocess.getTaskID());

logger.info("Created Subprocess UniqueID=" + subprocess.getUniqueID());

Expand Down Expand Up @@ -153,7 +153,7 @@ public void testCreateSubProcessTargetFieldName() throws ModelException {
// test data in subprocess
Assert.assertNotNull(subprocess);

Assert.assertEquals(100, subprocess.getProcessID());
Assert.assertEquals(100, subprocess.getTaskID());

logger.info("Created Subprocess UniqueID=" + subprocess.getUniqueID());

Expand Down Expand Up @@ -195,14 +195,14 @@ public void testCreateMultiSubProcess() throws ModelException {
String subprocessUniqueid = workitemRefList.get(0);
ItemCollection subprocess = workflowMockEnvironment.getDocumentService().load(subprocessUniqueid);
Assert.assertNotNull(subprocess);
Assert.assertEquals(100, subprocess.getProcessID());
Assert.assertEquals(100, subprocess.getTaskID());
logger.info("Created Subprocess UniqueID=" + subprocess.getUniqueID());

// test second subprocess instance... 100.20 -> $processId=200
subprocessUniqueid = workitemRefList.get(1);
subprocess = workflowMockEnvironment.getDocumentService().load(subprocessUniqueid);
Assert.assertNotNull(subprocess);
Assert.assertEquals(100, subprocess.getProcessID());
Assert.assertEquals(100, subprocess.getTaskID());
logger.info("Created Subprocess UniqueID=" + subprocess.getUniqueID());

}
Expand Down Expand Up @@ -265,7 +265,7 @@ public void testUpdateOriginProcess() throws ModelException {

// test data in subprocess
Assert.assertNotNull(subprocess);
Assert.assertEquals(100, subprocess.getProcessID());
Assert.assertEquals(100, subprocess.getTaskID());

/*
* 2.) process the subprocess to test if the origin process will be updated
Expand All @@ -291,7 +291,7 @@ public void testUpdateOriginProcess() throws ModelException {
Assert.assertNotNull(documentContext);

// test data.... (new $processId=200 and _sub_data from subprocess
Assert.assertEquals(100, documentContext.getProcessID());
Assert.assertEquals(100, documentContext.getTaskID());
Assert.assertEquals("some test data", documentContext.getItemValueString("_sub_data"));

}
Expand Down Expand Up @@ -323,7 +323,7 @@ public void testUpdateSubProcess() throws ModelException {
String subprocessUniqueid = workitemRefList.get(0);
ItemCollection subprocess = workflowMockEnvironment.getDocumentService().load(subprocessUniqueid);
Assert.assertNotNull(subprocess);
Assert.assertEquals(100, subprocess.getProcessID());
Assert.assertEquals(100, subprocess.getTaskID());

// 2.) now update the subprocess
try {
Expand All @@ -344,7 +344,7 @@ public void testUpdateSubProcess() throws ModelException {

subprocess = workflowMockEnvironment.getDocumentService().load(subprocessUniqueid);
Assert.assertNotNull(subprocess);
Assert.assertEquals(100, subprocess.getProcessID());
Assert.assertEquals(100, subprocess.getTaskID());
Assert.assertEquals("Walter", subprocess.getItemValueString("namTEAM"));

}
Expand Down

0 comments on commit 1fd5e27

Please sign in to comment.