]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/test/resources/org/argeo/slc/core/execution/parameterRef.xml
Update licence headers
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / test / resources / org / argeo / slc / core / execution / parameterRef.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4 Copyright (C) 2007-2012 Argeo GmbH
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17
18 -->
19 <beans xmlns="http://www.springframework.org/schema/beans"
20 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
21 xmlns:aop="http://www.springframework.org/schema/aop"
22 xsi:schemaLocation="
23 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
24 http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
25 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
26
27 <import resource="imports.xml" />
28
29 <!-- DEFINITIONS -->
30 <bean id="parameterRef.spec" parent="slcTemplate.simpleSpec">
31 <property name="attributes">
32 <map>
33 <entry key="exceptionIfInitCalledTwice">
34 <bean parent="specAttr.ref"
35 p:targetClass="org.argeo.slc.core.execution.ExceptionIfInitCalledTwice"
36 p:isParameter="true" p:isFrozen="true" />
37 </entry>
38 <entry key="testData1">
39 <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"
40 p:isParameter="true" p:isFrozen="true" />
41 </entry>
42 <entry key="testData2">
43 <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"
44 p:isParameter="true" p:isFrozen="true" />
45 </entry>
46 <entry key="testedComponentId">
47 <bean parent="specAttr.primitive" p:value="100" p:isParameter="true"
48 p:type="integer" />
49 </entry>
50 </map>
51 </property>
52 </bean>
53
54 <bean id="parameterRef.flowTemplate" parent="slcTemplate.simpleFlow"
55 abstract="true">
56 <constructor-arg ref="parameterRef.spec" />
57 <property name="executables">
58 <list>
59 <!-- Primitive -->
60 <bean parent="task.echo" scope="execution">
61 <property name="message" value="testedComponentId=@{testedComponentId}" />
62 </bean>
63
64 <!-- Exception if init called twice -->
65 <bean parent="parameterRef">
66 <constructor-arg value="exceptionIfInitCalledTwice" />
67 </bean>
68 <bean parent="parameterRef">
69 <property name="name" value="exceptionIfInitCalledTwice" />
70 </bean>
71
72 <!-- Basic tests -->
73 <bean parent="parameterRef.testRun">
74 <property name="testData">
75 <bean parent="parameterRef">
76 <constructor-arg value="testData1" />
77 </bean>
78 </property>
79 </bean>
80 <bean parent="parameterRef.testRun">
81 <property name="testData" ref="ref1" />
82 </bean>
83 </list>
84 </property>
85 </bean>
86
87 <!-- TEST CASES -->
88 <bean id="parameterRef.001" parent="parameterRef.flowTemplate">
89 <constructor-arg>
90 <map>
91 <entry key="exceptionIfInitCalledTwice">
92 <bean class="org.argeo.slc.core.execution.ExceptionIfInitCalledTwice" />
93 </entry>
94 <entry key="testData1">
95 <bean class="org.argeo.slc.core.test.BasicTestData">
96 <property name="expected" value="toto" />
97 <property name="reached" value="toto" />
98 </bean>
99 </entry>
100 <entry key="testData2">
101 <bean class="org.argeo.slc.core.test.BasicTestData">
102 <property name="expected" value="tata" />
103 <property name="reached" value="toto" />
104 </bean>
105 </entry>
106 </map>
107 </constructor-arg>
108 </bean>
109
110 <!-- UTILITIES -->
111
112 <bean id="ref1" parent="parameterRef">
113 <constructor-arg value="testData2" />
114 </bean>
115
116 <bean id="parameterRef.testResult" class="org.argeo.slc.core.test.SimpleTestResult" />
117
118 <bean id="parameterRef.testRun" class="org.argeo.slc.core.test.SimpleTestRun"
119 abstract="true">
120 <property name="testResult" ref="parameterRef.testResult" />
121 <property name="testDefinition">
122 <bean class="org.argeo.slc.core.test.BasicTestDefinition" />
123 </property>
124 </bean>
125
126 </beans>