public class ExecutionFlowTest extends TestCase {\r
\r
protected final Log log = LogFactory.getLog(getClass());\r
+ \r
\r
-\r
- public void testRecursive() throws Exception {\r
- ConfigurableApplicationContext applicationContext = createApplicationContext("test.xml");\r
- ExecutionFlow executionFlow = (ExecutionFlow) applicationContext.getBean("second");\r
- executionFlow.execute(); \r
- \r
- BasicTestData res = (BasicTestData) applicationContext.getBean("basic.testData");\r
- \r
- log.info("res=" + res.getReached().toString());\r
- \r
- applicationContext.close(); \r
- } \r
+// to test: case with listener \r
\r
+// public void testMyTest() throws Exception {\r
+// ConfigurableApplicationContext applicationContext = createApplicationContext("test.xml");\r
+// log.info("Start Execution");\r
+// ((ExecutionFlow) applicationContext.getBean("fileDiff.SimulationView_Risk")).execute();\r
+// applicationContext.close(); \r
+// }\r
+// \r
+ public void testMultipleFlows() throws Exception {\r
+ ConfigurableApplicationContext applicationContext = createApplicationContext("multipleFlow.xml");\r
+ log.info("Start Execution");\r
+ ((ExecutionFlow) applicationContext.getBean("flow1")).execute();\r
+ ((ExecutionFlow) applicationContext.getBean("flow2")).execute();\r
+ applicationContext.close();\r
+ } \r
\r
/**\r
* Test placeholder resolution in a context without scope execution or proxy\r
applicationContext.close();\r
} \r
\r
- public void testSimpleExecution() throws Exception {\r
-// configureAndExecuteSlcFlow("applicationContext.xml", "main");\r
- }\r
- \r
public void testCanonicFlowParameters() throws Exception {\r
configureAndExecuteSlcFlow("canonic-001.xml", "canonic.001");\r
}\r
} \r
} \r
\r
- \r
-\r
+ public void testListSetMap() throws Exception {\r
+ ConfigurableApplicationContext applicationContext = createApplicationContext("listSetMap.xml");\r
+ ExecutionFlow executionFlow = (ExecutionFlow) applicationContext.getBean("myFlow");\r
+ executionFlow.execute(); \r
+ \r
+ validateTestResult((SimpleTestResult) applicationContext.getBean("myTestResult"));\r
+ \r
+// BasicTestData res = (BasicTestData) applicationContext.getBean("cascadingComplex.testData");\r
+// log.info("res=" + res.getReached().toString());\r
+ \r
+ applicationContext.close(); \r
+ } \r
\r
+// public void testListSetMapMultipleFlows() throws Exception {\r
+// ConfigurableApplicationContext applicationContext = createApplicationContext("listSetMapMultipleFlow.xml");\r
+// ((ExecutionFlow) applicationContext.getBean("flow1")).execute();\r
+// SimpleTestResult res = (SimpleTestResult) applicationContext.getBean("myTestResult");\r
+// validateTestResult(res); \r
+// res.getParts().clear();\r
+// ((ExecutionFlow) applicationContext.getBean("flow2")).execute();\r
+// validateTestResult(res, TestStatus.FAILED);\r
+// applicationContext.close(); \r
+// } \r
+ \r
protected void logException(Throwable ex) {\r
log.info("Got Exception of class " + ex.getClass().toString()\r
+ " with message '" + ex.getMessage() + "'.");\r
}\r
\r
protected void validateTestResult(SimpleTestResult testResult) {\r
+ validateTestResult(testResult, TestStatus.PASSED);\r
+ }\r
+ \r
+ protected void validateTestResult(SimpleTestResult testResult, int expectedStatus) {\r
for(TestResultPart part : testResult.getParts()) {\r
- if(part.getStatus() != TestStatus.PASSED) {\r
+ if(part.getStatus() != expectedStatus) {\r
fail("Error found in TestResult: " + part.getMessage());\r
}\r
} \r
- }\r
+ } \r
\r
protected ConfigurableApplicationContext createApplicationContext(String applicationContextSuffix) {\r
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(inPackage(applicationContextSuffix));\r