]> 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
fc914a16e54dfa04cdc2f795481664728d4e9d4c
[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 junit.framework.TestCase;
4
5 import org.argeo.slc.core.execution.ExecutionContext;
6 import org.argeo.slc.core.execution.NewExecutionEvent;
7 import org.argeo.slc.execution.ExecutionFlow;
8 import org.argeo.slc.process.SlcExecution;
9 import org.springframework.context.support.ClassPathXmlApplicationContext;
10
11 public class BasicExecutionTest extends TestCase {
12 public void testExecution() throws Exception {
13 String[] files = { "conf/main.xml", "conf/imports.xml",
14 "conf/common.xml", "conf/basic.xml",
15 "conf/testCases/basic-001.xml", "conf/testCases/basic-002.xml" };
16 ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
17 files);
18 applicationContext.start();
19
20 String bean = "main";
21 ExecutionContext.registerExecutionContext(new ExecutionContext());
22 ExecutionContext.getVariables().put("slc.flows", bean);
23 ExecutionFlow executionFlow = (ExecutionFlow) applicationContext
24 .getBean(bean);
25 executionFlow.execute();
26
27 // SlcExecution slcExecution = new SlcExecution();
28 // slcExecution.getAttributes().put("slc.flows", "main");
29 // applicationContext.publishEvent(new NewExecutionEvent(this,
30 // slcExecution));
31 //
32 // Thread.sleep(5000);
33
34 applicationContext.close();
35 }
36 }