summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessEngineTest.java15
-rw-r--r--eaaf_core/src/test/resources/process/test/SampleProcessDefinition3.xml24
2 files changed, 39 insertions, 0 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessEngineTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessEngineTest.java
index 6b59925e..78fdde61 100644
--- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessEngineTest.java
+++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessEngineTest.java
@@ -33,6 +33,7 @@ import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.io.InputStream;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -102,6 +103,20 @@ public class ProcessEngineTest {
}
@Test
+ public void wrongProcessDefinition() throws IOException {
+ try (InputStream in = ProcessEngineTest.class.getResourceAsStream("/process/test/SampleProcessDefinition3.xml")) {
+ try {
+ ((ProcessEngineImpl) pe).registerProcessDefinition(in);
+ Assert.fail();
+
+ } catch (ProcessDefinitionParserException e) {
+ Assert.assertTrue(e.getMessage().contains("Post-validation find an error in process definition"));
+ }
+ }
+
+ }
+
+ @Test
public void testSampleProcess1() throws IOException, ProcessDefinitionParserException, ProcessExecutionException {
TestRequestImpl testReq = new TestRequestImpl();
diff --git a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition3.xml b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition3.xml
new file mode 100644
index 00000000..ef6999cf
--- /dev/null
+++ b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition3.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ -->
+
+<tns:ProcessDefinition
+ id="SampleProcess3"
+ xmlns:tns="http://reference.e-government.gv.at/namespace/moa/process/definition/v1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://reference.e-government.gv.at/namespace/moa/process/definition/v1 ../../main/resources/process/ProcessDefinition.xsd ">
+
+ <tns:StartEvent id="start" />
+
+ <tns:Task id="task1" class="NotExistTaskdTask" />
+ <tns:Task id="task2" async="true" class="HelloWorldTask" />
+ <tns:Task id="task3" />
+
+ <tns:EndEvent id="end" />
+
+ <tns:Transition id="fromStart" from="start" to="task1" conditionExpression="true" />
+ <tns:Transition from="task1" to="task2" />
+ <tns:Transition from="task2" to="task3" />
+ <tns:Transition from="task3" to="end" />
+
+</tns:ProcessDefinition>