]> git.argeo.org Git - gpl/argeo-slc.git/blob - parameterRef.xml
5aa9d6aa7408336c64d6f01ad00f21727026967f
[gpl/argeo-slc.git] / parameterRef.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4 Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
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
20 <beans xmlns="http://www.springframework.org/schema/beans"
21 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
22 xmlns:aop="http://www.springframework.org/schema/aop"
23 xsi:schemaLocation="
24 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
25 http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
26 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
27
28 <import resource="imports.xml" />
29
30 <!-- DEFINITIONS -->
31 <bean id="parameterRef.spec" parent="slcTemplate.simpleSpec">
32 <property name="attributes">
33 <map>
34 <entry key="exceptionIfInitCalledTwice">
35 <bean parent="specAttr.ref"
36 p:targetClass="org.argeo.slc.core.execution.ExceptionIfInitCalledTwice"
37 p:isParameter="true" p:isFrozen="true" />
38 </entry>
39 <entry key="testData1">
40 <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"
41 p:isParameter="true" p:isFrozen="true" />
42 </entry>
43 <entry key="testData2">
44 <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"
45 p:isParameter="true" p:isFrozen="true" />
46 </entry>
47 <entry key="testedComponentId">
48 <bean parent="specAttr.primitive" p:value="100" p:isParameter="true"
49 p:type="integer" />
50 </entry>
51 </map>
52 </property>
53 </bean>
54
55 <bean id="parameterRef.flowTemplate" parent="slcTemplate.simpleFlow"
56 abstract="true">
57 <constructor-arg ref="parameterRef.spec" />
58 <property name="executables">
59 <list>
60 <!-- Primitive -->
61 <bean parent="task.echo" scope="execution">
62 <property name="message" value="testedComponentId=@{testedComponentId}" />
63 </bean>
64
65 <!-- Exception if init called twice -->
66 <bean parent="parameterRef">
67 <constructor-arg value="exceptionIfInitCalledTwice" />
68 </bean>
69 <bean parent="parameterRef">
70 <property name="name" value="exceptionIfInitCalledTwice" />
71 </bean>
72
73 <!-- Basic tests -->
74 <bean parent="parameterRef.testRun">
75 <property name="testData">
76 <bean parent="parameterRef">
77 <constructor-arg value="testData1" />
78 </bean>
79 </property>
80 </bean>
81 <bean parent="parameterRef.testRun">
82 <property name="testData" ref="ref1" />
83 </bean>
84 </list>
85 </property>
86 </bean>
87
88 <!-- TEST CASES -->
89 <bean id="parameterRef.001" parent="parameterRef.flowTemplate">
90 <constructor-arg>
91 <map>
92 <entry key="exceptionIfInitCalledTwice">
93 <bean class="org.argeo.slc.core.execution.ExceptionIfInitCalledTwice" />
94 </entry>
95 <entry key="testData1">
96 <bean class="org.argeo.slc.core.test.BasicTestData">
97 <property name="expected" value="toto" />
98 <property name="reached" value="toto" />
99 </bean>
100 </entry>
101 <entry key="testData2">
102 <bean class="org.argeo.slc.core.test.BasicTestData">
103 <property name="expected" value="tata" />
104 <property name="reached" value="toto" />
105 </bean>
106 </entry>
107 </map>
108 </constructor-arg>
109 </bean>
110
111 <!-- UTILITIES -->
112
113 <bean id="ref1" parent="parameterRef">
114 <constructor-arg value="testData2" />
115 </bean>
116
117 <bean id="parameterRef.testResult" class="org.argeo.slc.core.test.SimpleTestResult" />
118
119 <bean id="parameterRef.testRun" class="org.argeo.slc.core.test.SimpleTestRun"
120 abstract="true">
121 <property name="testResult" ref="parameterRef.testResult" />
122 <property name="testDefinition">
123 <bean class="org.argeo.slc.core.test.BasicTestDefinition" />
124 </property>
125 </bean>
126
127 </beans>