2 * Copyright (C) 2007-2012 Argeo GmbH
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org
.argeo
.slc
.core
.execution
.xml
;
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
;
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();
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();
37 validateTestResult((SimpleTestResult
) applicationContext
38 .getBean("testResult"));
41 public void testAdvancedExecution() throws Exception
{
42 ConfigurableApplicationContext applicationContext
= createApplicationContext("advanced.xml");
44 ExecutionContext executionContext
= (ExecutionContext
) applicationContext
45 .getBean("executionContext");
46 executionContext
.setVariable("param2", 4);
48 ((ExecutionFlow
) applicationContext
.getBean("flow4")).run();
50 validateTestResult((SimpleTestResult
) applicationContext
51 .getBean("testResult"));
54 // These tests causes pb when using Spring 3
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();
62 // validateTestResult((SimpleTestResult) applicationContext
63 // .getBean("testResult"));