From 36c937aec7cb71a4520078d5c2337ce5ff4b2292 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 18 Oct 2019 10:51:32 +0200 Subject: add jUnit test for process-definition post-validation --- .../core/impl/idp/process/test/ProcessEngineTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'eaaf_core/src/test/java/at/gv/egiz/eaaf/core') 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; @@ -101,6 +102,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 { -- cgit v1.2.3