]> git.argeo.org Git - gpl/argeo-slc.git/blob - demo/org.argeo.slc.demo.basic/src/test/java/org/argeo/slc/demo/basic/BasicExecutionTest.java
Improve execution specs
[gpl/argeo-slc.git] / demo / org.argeo.slc.demo.basic / src / test / java / org / argeo / slc / demo / basic / BasicExecutionTest.java
1 package org.argeo.slc.demo.basic;
2
3 import java.util.Map;
4
5 import junit.framework.TestCase;
6
7 import org.argeo.slc.core.execution.ExecutionContext;
8 import org.argeo.slc.execution.ExecutionFlow;
9 import org.springframework.beans.factory.generic.GenericBeanFactoryAccessor;
10 import org.springframework.context.support.ClassPathXmlApplicationContext;
11
12 public class BasicExecutionTest extends TestCase {
13 public void testExecution() throws Exception {
14 String[] files = { "conf/imports.xml", "conf/common.xml",
15 "conf/basic.xml", "conf/canonic.xml",
16 "conf/testCases/basic-001.xml", "conf/testCases/basic-002.xml",
17 "conf/testCases/canonic-001.xml",
18 "conf/testCases/canonic-002.xml", "conf/main.xml" };
19 ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
20 files);
21 applicationContext.start();
22
23 // GenericBeanFactoryAccessor accessor = new
24 // GenericBeanFactoryAccessor(applicationContext);
25 // Map<String, Execut>
26
27 String bean = "main";
28 ExecutionContext.registerExecutionContext(new ExecutionContext());
29 ExecutionContext.getVariables().put("slc.flows", bean);
30 ExecutionFlow executionFlow = (ExecutionFlow) applicationContext
31 .getBean(bean);
32 executionFlow.execute();
33
34 // SlcExecution slcExecution = new SlcExecution();
35 // slcExecution.getAttributes().put("slc.flows", "main");
36 // applicationContext.publishEvent(new NewExecutionEvent(this,
37 // slcExecution));
38 //
39 // Thread.sleep(5000);
40
41 applicationContext.close();
42 }
43 }