587
|
1 |
<?xml version="1.0"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : test_diamonds.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-diamonds" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
|
|
24 |
<description>Helium Antlib diamonds unittests.</description>
|
|
25 |
|
645
|
26 |
<taskdef name="xpathtest" classname="se.jtech.ant.xpath.XPathEvaluatorTask" onerror="ignore"/>
|
|
27 |
|
587
|
28 |
<import file="run-scenario.ant.xml" />
|
588
|
29 |
|
587
|
30 |
<target name="test-build">
|
|
31 |
<runScenario scenario="build" target="unittest-diamonds" />
|
645
|
32 |
<au:assertLogContains text="Diamonds build id:" />
|
587
|
33 |
</target>
|
|
34 |
|
|
35 |
<target name="test-build-with-invalid-address">
|
|
36 |
<runScenario scenario="invalid-address" target="unittest-diamonds" />
|
645
|
37 |
<au:assertLogContains text="Error sending the message: invalid.server.local" />
|
|
38 |
<au:assertLogContains text="Diamonds reporting will be disabled." />
|
587
|
39 |
</target>
|
|
40 |
|
|
41 |
<target name="test-build-with-invalid-templates">
|
|
42 |
<runScenario scenario="invalid-templates" target="unittest-diamonds" />
|
645
|
43 |
<au:assertLogContains text="Error with invalid-ant-properties-input-file.ftl" />
|
|
44 |
<au:assertLogContains text="Diamonds build id:" />
|
587
|
45 |
</target>
|
588
|
46 |
|
|
47 |
<target name="test-build-with-invalid-templates-1">
|
645
|
48 |
<runScenario scenario="invalid-templates-1" target="unittest-diamonds" />
|
|
49 |
<au:assertLogContains text="Diamonds build id:" />
|
|
50 |
</target>
|
|
51 |
|
|
52 |
<target name="test-build-without-config">
|
|
53 |
<runScenario scenario="build-without-config" target="unittest-diamonds" />
|
|
54 |
<au:assertLogContains text="Diamonds reporting is disabled, because the listener is not configured properly: required property: diamonds.host not defined" />
|
|
55 |
</target>
|
|
56 |
|
|
57 |
<target name="test-failing-build">
|
|
58 |
<au:expectfailure>
|
|
59 |
<runScenario scenario="failing-build" target="build" />
|
|
60 |
</au:expectfailure>
|
|
61 |
<au:assertLogContains text="BUILD FAILED" />
|
|
62 |
<au:assertLogContains text="diamonds:" />
|
|
63 |
<au:assertLogContains text="failing-target:" />
|
|
64 |
<property file="${test.temp.dir}/diamonds.ini" />
|
|
65 |
<get src="http://${diamonds.host}:${diamonds.port}${diamonds.build.id}?fmt=xml"
|
|
66 |
dest="${test.temp.dir}/diamonds_data.xml"
|
|
67 |
usetimestamp="true" />
|
|
68 |
<xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
|
|
69 |
<namespace uri="" prefix=""/>
|
|
70 |
<xpath expression="/diamonds-build/build[status='failed']"/>
|
|
71 |
</xpathtest>
|
|
72 |
<xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
|
|
73 |
<namespace uri="" prefix=""/>
|
|
74 |
<xpath expression="/diamonds-build/build/finished"/>
|
|
75 |
</xpathtest>
|
|
76 |
</target>
|
|
77 |
|
|
78 |
<target name="test-signal-build">
|
|
79 |
<au:expectfailure>
|
|
80 |
<runScenario scenario="signal-build" target="build" />
|
|
81 |
</au:expectfailure>
|
|
82 |
<au:assertLogContains text="BUILD FAILED" />
|
|
83 |
<au:assertLogContains text="diamonds:" />
|
|
84 |
<au:assertLogContains text="failing-target:" />
|
|
85 |
<property file="${test.temp.dir}/diamonds.ini" />
|
|
86 |
<get src="http://${diamonds.host}:${diamonds.port}${diamonds.build.id}?fmt=xml"
|
|
87 |
dest="${test.temp.dir}/diamonds_data.xml"
|
|
88 |
usetimestamp="true" />
|
|
89 |
<xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
|
|
90 |
<namespace uri="" prefix=""/>
|
|
91 |
<xpath expression="/diamonds-build/build[status='failed']"/>
|
|
92 |
</xpathtest>
|
|
93 |
<xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
|
|
94 |
<namespace uri="" prefix=""/>
|
|
95 |
<xpath expression="/diamonds-build/build/finished"/>
|
|
96 |
</xpathtest>
|
|
97 |
<xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
|
|
98 |
<namespace uri="" prefix=""/>
|
|
99 |
<xpath expression="/diamonds-build/signals/signal[position()=1 and name='testDeferredSignalInput']"/>
|
|
100 |
</xpathtest>
|
|
101 |
<xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
|
|
102 |
<namespace uri="" prefix=""/>
|
|
103 |
<xpath expression="/diamonds-build/signals/signal[position()=2 and name='testNowSignalInput']"/>
|
|
104 |
</xpathtest>
|
|
105 |
</target>
|
|
106 |
|
|
107 |
<target name="test-target-recording">
|
|
108 |
<runScenario scenario="target-recording" target="build" />
|
|
109 |
<au:assertLogContains text="BUILD SUCCESSFUL" />
|
|
110 |
<au:assertLogContains text="diamonds:" />
|
|
111 |
<property file="${test.temp.dir}/diamonds.ini" />
|
|
112 |
<get src="http://${diamonds.host}:${diamonds.port}${diamonds.build.id}?fmt=xml"
|
|
113 |
dest="${test.temp.dir}/diamonds_data.xml"
|
|
114 |
usetimestamp="true" />
|
|
115 |
<xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
|
|
116 |
<namespace uri="" prefix=""/>
|
|
117 |
<xpath expression="/diamonds-build/targets/target[name='target-recording']"/>
|
|
118 |
<xpath expression="/diamonds-build/targets/target[name='sub-target2']"/>
|
|
119 |
<xpath expression="/diamonds-build/targets/target[name='sub-target3']"/>
|
|
120 |
<xpath expression="/diamonds-build/targets[count(target)=3]"/>
|
|
121 |
</xpathtest>
|
588
|
122 |
</target>
|
587
|
123 |
|
|
124 |
</project> |