]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.core/ext/test/org/argeo/slc/core/execution/xml/FlowNamespaceTest.java
Disable trace logging
[gpl/argeo-slc.git] / org.argeo.slc.core / ext / test / org / argeo / slc / core / execution / xml / FlowNamespaceTest.java
1 /*
2 * Copyright (C) 2007-2012 Argeo GmbH
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 package org.argeo.slc.core.execution.xml;
17
18 import org.argeo.slc.core.execution.AbstractExecutionFlowTestCase;
19 import org.argeo.slc.core.test.SimpleTestResult;
20 import org.argeo.slc.execution.ExecutionContext;
21 import org.argeo.slc.execution.ExecutionFlow;
22 import org.springframework.context.ConfigurableApplicationContext;
23
24 public class FlowNamespaceTest extends AbstractExecutionFlowTestCase {
25 public void testCanonical() throws Exception {
26 ConfigurableApplicationContext applicationContext = createApplicationContext("canonic-ns.xml");
27 ((ExecutionFlow) applicationContext.getBean("canonic-ns.001")).run();
28 ((ExecutionFlow) applicationContext.getBean("canonic-ns.002")).run();
29 }
30
31 public void testAdvanced() throws Exception {
32 ConfigurableApplicationContext applicationContext = createApplicationContext("advanced.xml");
33 ((ExecutionFlow) applicationContext.getBean("flow1")).run();
34 ((ExecutionFlow) applicationContext.getBean("flow2")).run();
35 ((ExecutionFlow) applicationContext.getBean("flow3")).run();
36
37 validateTestResult((SimpleTestResult) applicationContext
38 .getBean("testResult"));
39 }
40
41 public void testAdvancedExecution() throws Exception {
42 ConfigurableApplicationContext applicationContext = createApplicationContext("advanced.xml");
43
44 ExecutionContext executionContext = (ExecutionContext) applicationContext
45 .getBean("executionContext");
46 executionContext.setVariable("param2", 4);
47
48 ((ExecutionFlow) applicationContext.getBean("flow4")).run();
49
50 validateTestResult((SimpleTestResult) applicationContext
51 .getBean("testResult"));
52 }
53
54 // These tests causes pb when using Spring 3
55
56 // public void testContainers() throws Exception {
57 // ConfigurableApplicationContext applicationContext =
58 // createApplicationContext("containers.xml");
59 // ((ExecutionFlow) applicationContext.getBean("test.list.flow1")).run();
60 // ((ExecutionFlow) applicationContext.getBean("test.list.flow2")).run();
61 //
62 // validateTestResult((SimpleTestResult) applicationContext
63 // .getBean("testResult"));
64 // }
65 }