aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/test/java/at
diff options
context:
space:
mode:
authorChristian Wagner <c.wagner@datentechnik-innovation.com>2015-01-29 14:39:11 +0100
committerChristian Wagner <c.wagner@datentechnik-innovation.com>2015-01-29 14:39:11 +0100
commitc6f543e06c02c0a2635eac2e9b99c2554e6e27bd (patch)
tree594d6ef54012a01737a77d40676da8f39e17d5bc /id/server/idserverlib/src/test/java/at
parent90c4f8e9a6140b97469357deb906b8816f5f680c (diff)
downloadmoa-id-spss-c6f543e06c02c0a2635eac2e9b99c2554e6e27bd.tar.gz
moa-id-spss-c6f543e06c02c0a2635eac2e9b99c2554e6e27bd.tar.bz2
moa-id-spss-c6f543e06c02c0a2635eac2e9b99c2554e6e27bd.zip
integrate process engine from project 'dti-process-engine'
- fix unit tests - correct namespaces - refactor package name
Diffstat (limited to 'id/server/idserverlib/src/test/java/at')
-rw-r--r--id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/spring/test/SpringExpressionAwareProcessEngineTest.java25
-rw-r--r--id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/BooleanStringExpressionEvaluator.java (renamed from id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/BooleanStringExpressionEvaluator.java)2
-rw-r--r--id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/HalloWeltTask.java (renamed from id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/HalloWeltTask.java)2
-rw-r--r--id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/HelloWorldTask.java (renamed from id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/HelloWorldTask.java)2
-rw-r--r--id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/ProcessDefinitionParserTest.java (renamed from id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/ProcessDefinitionParserTest.java)2
-rw-r--r--id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/ProcessEngineTest.java (renamed from id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/ProcessEngineTest.java)2
6 files changed, 27 insertions, 8 deletions
diff --git a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/spring/test/SpringExpressionAwareProcessEngineTest.java b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/spring/test/SpringExpressionAwareProcessEngineTest.java
index 4022a7a15..8752aa7b8 100644
--- a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/spring/test/SpringExpressionAwareProcessEngineTest.java
+++ b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/spring/test/SpringExpressionAwareProcessEngineTest.java
@@ -6,18 +6,22 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
+import java.io.InputStream;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import at.gv.egovernment.moa.id.process.ProcessDefinitionParser;
import at.gv.egovernment.moa.id.process.ProcessDefinitionParserException;
import at.gv.egovernment.moa.id.process.ProcessEngine;
+import at.gv.egovernment.moa.id.process.ProcessEngineImpl;
import at.gv.egovernment.moa.id.process.ProcessExecutionException;
import at.gv.egovernment.moa.id.process.ProcessInstance;
import at.gv.egovernment.moa.id.process.api.ExecutionContext;
+import at.gv.egovernment.moa.id.process.spring.SpringExpressionEvaluator;
/**
* Tests the process engine using processes based on Spring EL referencing the process context and further Spring beans.
@@ -29,12 +33,27 @@ import at.gv.egovernment.moa.id.process.api.ExecutionContext;
@ContextConfiguration
public class SpringExpressionAwareProcessEngineTest {
- @Autowired
- private ProcessEngine pe;
+
+ private static ProcessEngine pe;
+ @BeforeClass
+ public static void init() throws IOException, ProcessDefinitionParserException {
+
+ pe = new ProcessEngineImpl();
+ ((ProcessEngineImpl) pe).setTransitionConditionExpressionEvaluator(new SpringExpressionEvaluator());
+ try (InputStream in = SpringExpressionAwareProcessEngineTest.class.getResourceAsStream("SampleProcessDefinitionWithExpression1.xml")) {
+ ((ProcessEngineImpl) pe).registerProcessDefinition(in);
+ }
+ try (InputStream in = SpringExpressionAwareProcessEngineTest.class.getResourceAsStream("SampleProcessDefinitionForSAML1Authentication.xml")) {
+ ((ProcessEngineImpl) pe).registerProcessDefinition(in);
+ }
+ }
+
@Test
public void testSampleProcessDefinitionWithExpression1() throws IOException, ProcessDefinitionParserException,
ProcessExecutionException {
+
+
ProcessInstance pi = pe.createProcessInstance("SampleProcessWithExpression1");
assertEquals(NOT_STARTED, pi.getState());
// start process
diff --git a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/BooleanStringExpressionEvaluator.java b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/BooleanStringExpressionEvaluator.java
index c51f5fe66..20dfc50ef 100644
--- a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/BooleanStringExpressionEvaluator.java
+++ b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/BooleanStringExpressionEvaluator.java
@@ -1,4 +1,4 @@
-package at.gv.egovernment.moa.id.process.process_engine.test;
+package at.gv.egovernment.moa.id.process.test;
import java.util.Objects;
diff --git a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/HalloWeltTask.java b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/HalloWeltTask.java
index 1a8de811b..d05200ee8 100644
--- a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/HalloWeltTask.java
+++ b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/HalloWeltTask.java
@@ -1,4 +1,4 @@
-package at.gv.egovernment.moa.id.process.process_engine.test;
+package at.gv.egovernment.moa.id.process.test;
import at.gv.egovernment.moa.id.process.api.ExecutionContext;
import at.gv.egovernment.moa.id.process.api.Task;
diff --git a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/HelloWorldTask.java b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/HelloWorldTask.java
index 6ce3091dd..e79bb8198 100644
--- a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/HelloWorldTask.java
+++ b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/HelloWorldTask.java
@@ -1,4 +1,4 @@
-package at.gv.egovernment.moa.id.process.process_engine.test;
+package at.gv.egovernment.moa.id.process.test;
import at.gv.egovernment.moa.id.process.api.ExecutionContext;
import at.gv.egovernment.moa.id.process.api.Task;
diff --git a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/ProcessDefinitionParserTest.java b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/ProcessDefinitionParserTest.java
index e20f4bfe8..df13f064b 100644
--- a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/ProcessDefinitionParserTest.java
+++ b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/ProcessDefinitionParserTest.java
@@ -1,4 +1,4 @@
-package at.gv.egovernment.moa.id.process.process_engine.test;
+package at.gv.egovernment.moa.id.process.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
diff --git a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/ProcessEngineTest.java b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/ProcessEngineTest.java
index 04a7a659d..8c718a9e4 100644
--- a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/process_engine/test/ProcessEngineTest.java
+++ b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/process/test/ProcessEngineTest.java
@@ -1,4 +1,4 @@
-package at.gv.egovernment.moa.id.process.process_engine.test;
+package at.gv.egovernment.moa.id.process.test;
import static at.gv.egovernment.moa.id.process.ProcessInstanceState.ENDED;
import static at.gv.egovernment.moa.id.process.ProcessInstanceState.NOT_STARTED;