]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/test/java/org/argeo/slc/core/execution/xml/FlowNamespaceTest.java
Remove license header check
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / test / java / org / argeo / slc / core / execution / xml / FlowNamespaceTest.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.slc.core.execution.xml;
18
19 import org.argeo.slc.core.execution.AbstractExecutionFlowTestCase;
20 import org.argeo.slc.core.test.SimpleTestResult;
21 import org.argeo.slc.execution.ExecutionContext;
22 import org.argeo.slc.execution.ExecutionFlow;
23 import org.springframework.context.ConfigurableApplicationContext;
24
25 public class FlowNamespaceTest extends AbstractExecutionFlowTestCase {
26 public void testCanonical() throws Exception {
27 ConfigurableApplicationContext applicationContext = createApplicationContext("canonic-ns.xml");
28 ((ExecutionFlow) applicationContext.getBean("canonic-ns.001")).run();
29 ((ExecutionFlow) applicationContext.getBean("canonic-ns.002")).run();
30 }
31
32 public void testAdvanced() throws Exception {
33 ConfigurableApplicationContext applicationContext = createApplicationContext("advanced.xml");
34 ((ExecutionFlow) applicationContext.getBean("flow1")).run();
35 ((ExecutionFlow) applicationContext.getBean("flow2")).run();
36 ((ExecutionFlow) applicationContext.getBean("flow3")).run();
37
38 validateTestResult((SimpleTestResult) applicationContext
39 .getBean("testResult"));
40 }
41
42 public void testAdvancedExecution() throws Exception {
43 ConfigurableApplicationContext applicationContext = createApplicationContext("advanced.xml");
44
45 ExecutionContext executionContext = (ExecutionContext) applicationContext
46 .getBean("executionContext");
47 executionContext.setVariable("param2", 4);
48
49 ((ExecutionFlow) applicationContext.getBean("flow4")).run();
50
51 validateTestResult((SimpleTestResult) applicationContext
52 .getBean("testResult"));
53 }
54
55 public void testContainers() throws Exception {
56 ConfigurableApplicationContext applicationContext = createApplicationContext("containers.xml");
57 ((ExecutionFlow) applicationContext.getBean("test.list.flow1")).run();
58 ((ExecutionFlow) applicationContext.getBean("test.list.flow2")).run();
59
60 validateTestResult((SimpleTestResult) applicationContext
61 .getBean("testResult"));
62 }
63 }