587
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : test_signaltask.ant.xml
|
|
5 |
Part of : Helium AntLib
|
|
6 |
|
|
7 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
8 |
All rights reserved.
|
|
9 |
This component and the accompanying materials are made available
|
|
10 |
under the terms of the License "Eclipse Public License v1.0"
|
|
11 |
which accompanies this distribution, and is available
|
|
12 |
at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
13 |
|
|
14 |
Initial Contributors:
|
|
15 |
Nokia Corporation - initial contribution.
|
|
16 |
|
|
17 |
Contributors:
|
|
18 |
|
|
19 |
Description:
|
|
20 |
|
|
21 |
============================================================================
|
|
22 |
-->
|
|
23 |
<project name="test-stage" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
|
|
24 |
<description>Helium Antlib Signal unittests.</description>
|
|
25 |
<import file="run-scenario.ant.xml" />
|
|
26 |
<property environment="env"/>
|
628
|
27 |
|
587
|
28 |
<target name="test-scenario-valid-build">
|
|
29 |
<runScenario scenario="valid_build" target="build" />
|
|
30 |
</target>
|
|
31 |
|
|
32 |
<target name="test-override-scenario">
|
|
33 |
<runScenario scenario="override_scenario" target="build" />
|
|
34 |
<au:assertFileDoesntExist file="${temp.dir}/main.ant.log" />
|
|
35 |
<au:assertFileDoesntExist file="${temp.dir}/stage2.ant.log" />
|
|
36 |
<au:assertFileExists file="${temp.dir}/main_override.ant.log" />
|
|
37 |
<au:assertFileExists file="${temp.dir}/stage1.ant.log" />
|
|
38 |
<au:assertFileExists file="${temp.dir}/stage2_override.ant.log" />
|
|
39 |
|
|
40 |
<loadfile property="main.log" srcFile="${temp.dir}/main_override.ant.log" />
|
|
41 |
<au:assertTrue message="main_override.ant.log content is invalid: Main log start step1">
|
|
42 |
<contains string="${main.log}" substring="Main log start step1" />
|
|
43 |
</au:assertTrue>
|
|
44 |
<au:assertTrue message="main_override.ant.log content is invalid: Main log start step2">
|
|
45 |
<contains string="${main.log}" substring="Main log start step2" />
|
|
46 |
</au:assertTrue>
|
|
47 |
<au:assertTrue message="main_override.ant.log content is invalid: Main log start step3">
|
|
48 |
<contains string="${main.log}" substring="Main log start step3" />
|
|
49 |
</au:assertTrue>
|
|
50 |
<au:assertTrue message="main_override.ant.log content is invalid: Main log start step4">
|
|
51 |
<contains string="${main.log}" substring="Main log start step4" />
|
|
52 |
</au:assertTrue>
|
|
53 |
<au:assertTrue message="main_override.ant.log content is invalid: Main log start step5">
|
|
54 |
<contains string="${main.log}" substring="Main log start step5" />
|
|
55 |
</au:assertTrue>
|
|
56 |
|
|
57 |
<loadfile property="stage1.log" srcFile="${temp.dir}/stage1.ant.log" />
|
|
58 |
<au:assertTrue message="stage1.ant.log content is invalid: In stage1">
|
|
59 |
<contains string="${stage1.log}" substring="In stage1 (1)" />
|
|
60 |
</au:assertTrue>
|
|
61 |
<au:assertTrue message="stage1.ant.log content is invalid: In stage1">
|
|
62 |
<contains string="${stage1.log}" substring="In stage1 (2)" />
|
|
63 |
</au:assertTrue>
|
|
64 |
<loadfile property="stage2.log" srcFile="${temp.dir}/stage2_override.ant.log" />
|
|
65 |
<au:assertTrue message="stage2.ant.log content is invalid: In stage1">
|
|
66 |
<contains string="${stage2.log}" substring="In stage2 (1)" />
|
|
67 |
</au:assertTrue>
|
|
68 |
<au:assertTrue message="stage2.ant.log content is invalid: In stage1">
|
|
69 |
<contains string="${stage2.log}" substring="In stage2 (2)" />
|
|
70 |
</au:assertTrue>
|
|
71 |
</target>
|
|
72 |
|
|
73 |
<target name="test-build-failure">
|
|
74 |
<au:expectfailure>
|
|
75 |
<runScenario scenario="build_failure" target="build" />
|
|
76 |
</au:expectfailure>
|
|
77 |
<au:assertFileExists file="${temp.dir}/main.ant.log" />
|
|
78 |
<au:assertFileExists file="${temp.dir}/stage1.ant.log" />
|
|
79 |
<au:assertFileExists file="${temp.dir}/stage2.ant.log" />
|
|
80 |
<loadfile property="main.log" srcFile="${temp.dir}/main.ant.log" />
|
|
81 |
<au:assertTrue message="main.ant.log content is invalid: Main log start step1">
|
|
82 |
<contains string="${main.log}" substring="Main log start step1" />
|
|
83 |
</au:assertTrue>
|
|
84 |
<au:assertTrue message="main.ant.log content is invalid: Main log start step2">
|
|
85 |
<contains string="${main.log}" substring="Main log start step2" />
|
|
86 |
</au:assertTrue>
|
|
87 |
<au:assertTrue message="main.ant.log content is invalid: Main log start step3">
|
|
88 |
<contains string="${main.log}" substring="Main log start step3" />
|
|
89 |
</au:assertTrue>
|
|
90 |
<au:assertTrue message="main.ant.log content is invalid: Main log start step4">
|
|
91 |
<not>
|
|
92 |
<contains string="${main.log}" substring="Main log start step4" />
|
|
93 |
</not>
|
|
94 |
</au:assertTrue>
|
|
95 |
<au:assertTrue message="main.ant.log content is invalid: Main log start step5">
|
|
96 |
<not>
|
|
97 |
<contains string="${main.log}" substring="Main log start step5" />
|
|
98 |
</not>
|
|
99 |
</au:assertTrue>
|
|
100 |
<au:assertTrue message="main.ant.log content is invalid: BUILD FAILED">
|
|
101 |
<contains string="${main.log}" substring="BUILD FAILED" />
|
|
102 |
</au:assertTrue>
|
|
103 |
|
|
104 |
|
|
105 |
<loadfile property="stage1.log" srcFile="${temp.dir}/stage1.ant.log" />
|
|
106 |
<au:assertTrue message="stage1.ant.log content is invalid: In stage1">
|
|
107 |
<contains string="${stage1.log}" substring="In stage1 (1)" />
|
|
108 |
</au:assertTrue>
|
|
109 |
<au:assertTrue message="stage1.ant.log content is invalid: In stage1">
|
|
110 |
<contains string="${stage1.log}" substring="In stage1 (2)" />
|
|
111 |
</au:assertTrue>
|
|
112 |
<loadfile property="stage2.log" srcFile="${temp.dir}/stage2.ant.log" />
|
|
113 |
<au:assertTrue message="stage2.ant.log content is invalid: In stage1">
|
|
114 |
<contains string="${stage2.log}" substring="In stage2 (1)" />
|
|
115 |
</au:assertTrue>
|
|
116 |
<au:assertTrue message="stage2.ant.log content is invalid: In stage1">
|
|
117 |
<not>
|
|
118 |
<contains string="${stage2.log}" substring="In stage2 (2)" />
|
|
119 |
</not>
|
|
120 |
</au:assertTrue>
|
|
121 |
</target>
|
|
122 |
|
|
123 |
<target name="test-backup-scenario">
|
|
124 |
<runScenario scenario="override_scenario" target="build" />
|
|
125 |
<runScenario scenario="override_scenario" target="build" />
|
|
126 |
|
|
127 |
<au:assertLogContains text="Backing up of"/>
|
|
128 |
<au:assertFileDoesntExist file="${temp.dir}/main.ant.log" />
|
|
129 |
<au:assertFileDoesntExist file="${temp.dir}/stage2.ant.log" />
|
|
130 |
<au:assertFileExists file="${temp.dir}/main_override.ant.log" />
|
|
131 |
<au:assertFileExists file="${temp.dir}/stage1.ant.log" />
|
|
132 |
<au:assertFileExists file="${temp.dir}/stage2_override.ant.log" />
|
|
133 |
</target>
|
|
134 |
|
|
135 |
<target name="test-build-status-fail">
|
|
136 |
<au:expectfailure>
|
|
137 |
<runScenario scenario="build_status" target="failure" />
|
|
138 |
</au:expectfailure>
|
|
139 |
<au:assertFileExists file="${temp.dir}/main.ant.log" />
|
|
140 |
<au:assertFileExists file="${temp.dir}/stage1.ant.log" />
|
|
141 |
<loadfile property="main.log" srcFile="${temp.dir}/main.ant.log" />
|
|
142 |
<au:assertTrue message="main.ant.log content should have "BUILD FAILED" string.">
|
|
143 |
<contains string="${main.log}" substring="BUILD FAILED" />
|
|
144 |
</au:assertTrue>
|
|
145 |
<loadfile property="stage1.log" srcFile="${temp.dir}/stage1.ant.log" />
|
|
146 |
<au:assertTrue message="stage1.ant.log content should not have "BUILD FAILED" string.">
|
|
147 |
<not>
|
|
148 |
<contains string="${stage1.log}" substring="BUILD FAILED" />
|
|
149 |
</not>
|
|
150 |
</au:assertTrue>
|
|
151 |
</target>
|
|
152 |
|
|
153 |
<target name="test-build-status-success">
|
|
154 |
<runScenario scenario="build_status" target="success" />
|
|
155 |
<loadfile property="main.log" srcFile="${temp.dir}/main.ant.log" />
|
|
156 |
<au:assertTrue message="main.ant.log content should have "BUILD SUCCESSFUL" string.">
|
|
157 |
<contains string="${main.log}" substring="BUILD SUCCESSFUL" />
|
|
158 |
</au:assertTrue>
|
|
159 |
<loadfile property="stage2.log" srcFile="${temp.dir}/stage2.ant.log" />
|
|
160 |
<au:assertTrue message="stage2.ant.log content should not have "BUILD SUCCESSFUL" string.">
|
|
161 |
<not>
|
|
162 |
<contains string="${stage2.log}" substring="BUILD SUCCESSFUL" />
|
|
163 |
</not>
|
|
164 |
</au:assertTrue>
|
|
165 |
</target>
|
|
166 |
|
628
|
167 |
<target name="test-missing-default-config">
|
|
168 |
<au:expectfailure>
|
|
169 |
<runScenario scenario="missing_default_config" target="build" />
|
|
170 |
</au:expectfailure>
|
|
171 |
<au:assertLogContains text="BUILD FAILED" />
|
|
172 |
<au:assertLogContains text="There must be one default stagerecord datatype." />
|
|
173 |
</target>
|
|
174 |
|
|
175 |
<target name="test-missing-stage-refid">
|
|
176 |
<au:expectfailure>
|
|
177 |
<runScenario scenario="missing_stage_refid" target="build" />
|
|
178 |
</au:expectfailure>
|
|
179 |
<au:assertLogContains text="BUILD FAILED" />
|
|
180 |
<au:assertLogContains text="Invalid stagerecord configuration, the stageRefId attribute is not defined at" />
|
|
181 |
</target>
|
|
182 |
|
|
183 |
<target name="test-invalid-stagerefid-reference">
|
|
184 |
<au:expectfailure>
|
|
185 |
<runScenario scenario="invalid_stage_refid" target="build" />
|
|
186 |
</au:expectfailure>
|
|
187 |
<au:assertLogContains text="BUILD FAILED" />
|
|
188 |
<au:assertLogContains text="Invalid stagerecord stageRefId attribute value, the 'stage1-invalid' id doesn't exist at" />
|
|
189 |
</target>
|
|
190 |
|
|
191 |
<target name="test-invalid-stagerefid-object">
|
|
192 |
<au:expectfailure>
|
|
193 |
<runScenario scenario="inavlid_stage_refid_object" target="build" />
|
|
194 |
</au:expectfailure>
|
|
195 |
<au:assertLogContains text="BUILD FAILED" />
|
|
196 |
<au:assertLogContains text="Invalid stagerecord stageRefId attribute value, the 'stage1-invalid-object' id doesn't refer to a stage type at" />
|
|
197 |
</target>
|
587
|
198 |
</project>
|