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 |
-->
|
588
|
23 |
<project name="test-diamonds-invalid-template" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
|
587
|
24 |
<description>Helium Antlib diamonds unittests.</description>
|
|
25 |
<property environment="env" />
|
628
|
26 |
<taskdef resource="com/nokia/helium/core/ant/antlib.xml" uri="http://www.nokia.com/helium"/>
|
|
27 |
<taskdef name="xpathtest" classname="se.jtech.ant.xpath.XPathEvaluatorTask" onerror="ignore"/>
|
|
28 |
<property name="diamonds.enabled" value="true" />
|
588
|
29 |
<property name="diamonds.unitest.dir" location="${ant.file.test-diamonds-invalid-template}/../../../" />
|
587
|
30 |
<import file="../../../../../../nokia/companyproperties.ant.xml" optional="true"/>
|
|
31 |
<property name="diamonds.output.dir" location="${temp.dir}/output" />
|
|
32 |
<property name="diamonds.template.dir" location="${diamonds.unitest.dir}/data/invalid_templates" />
|
|
33 |
<property name="build.family" value="test_new_hlm"/>
|
|
34 |
<property name="id" value="123"/>
|
|
35 |
<property name="name" value="${build.family}_${id}"/>
|
|
36 |
<property name="build.system" value="ec-helium"/>
|
|
37 |
<property name="compile.log.input" location="${diamonds.unitest.dir}/data/compile.log.xml" />
|
|
38 |
<property name="codescanner.log.input" location="${diamonds.unitest.dir}/data/problemIndex.xml" />
|
|
39 |
<property name="policy.log.input" location="${diamonds.unitest.dir}/data/policy.log.xml" />
|
|
40 |
<property name="invalid.target.input.file" location="${diamonds.unitest.dir}/data/invalid.target.input.log.xml" />
|
|
41 |
<property name="symsee.version" value="9.1.0" />
|
628
|
42 |
<import file="../../config/diamonds_config_default.ant.xml" />
|
587
|
43 |
|
|
44 |
<target name="unittest" depends="unittest-diamonds" />
|
|
45 |
|
|
46 |
<target name="unittest-diamonds" >
|
|
47 |
<delete dir="${diamonds.output.dir}" failonerror="false"/>
|
|
48 |
<mkdir dir="${diamonds.output.dir}"/>
|
|
49 |
<antcall target="test-all" />
|
|
50 |
</target>
|
|
51 |
|
|
52 |
<dirname property="project.dir" file="${ant.file.test-diamonds}" />
|
|
53 |
<target name="version">
|
|
54 |
<echo message="version target for diamonds to verify sending data to diamonds" />
|
|
55 |
</target>
|
|
56 |
|
|
57 |
<target name="diamonds" />
|
|
58 |
|
|
59 |
<target name="compile-target">
|
|
60 |
<echo message="verify the build stage with input source xml file" />
|
|
61 |
</target>
|
|
62 |
|
|
63 |
<target name="codescanner">
|
|
64 |
<echo message="target verification with input source xml file" />
|
|
65 |
</target>
|
|
66 |
|
|
67 |
<target name="create-bom-log">
|
|
68 |
<echo message="target without input file and just to send the data" />
|
|
69 |
</target>
|
|
70 |
|
|
71 |
|
|
72 |
<target name="invalid-template-file">
|
628
|
73 |
<echo message="expected message: ${diamonds.template-dir}${file.separator}invalid-target-input-file.ftl doesn't exists" />
|
|
74 |
<au:expectfailure expectedMessage="input file : ${diamonds.template-dir}${file.separator}invalid-target-input-file.ftl doesn't exists" >
|
|
75 |
<hlm:targetMessageTrigger id="invalid-target-input-file.id" target="invalid-target-input-file">
|
|
76 |
<hlm:fmppMessage sourceFile="${diamonds.template-dir}${file.separator}invalid-target-input-file.ftl">
|
|
77 |
<data expandProperties="yes">
|
|
78 |
ant: antProperties()
|
|
79 |
</data>
|
|
80 |
</hlm:fmppMessage>
|
|
81 |
</hlm:targetMessageTrigger>
|
|
82 |
</au:expectfailure>
|
587
|
83 |
</target>
|
|
84 |
|
|
85 |
<target name="invalid-ant-properties-input">
|
|
86 |
<echo message="target with invalid ant properties input" />
|
|
87 |
</target>
|
|
88 |
|
|
89 |
<target name="test-invalid-ant-properties-input">
|
|
90 |
<antcall target="invalid-ant-properties-input" />
|
|
91 |
</target>
|
|
92 |
|
|
93 |
<target name="test-version">
|
|
94 |
<antcall target="version" />
|
|
95 |
</target>
|
|
96 |
|
|
97 |
<target name="test-buildid-set">
|
|
98 |
<echo>${diamonds.build.id}</echo>
|
|
99 |
<au:assertTrue>
|
|
100 |
<isset property="diamonds.build.id"/>
|
|
101 |
</au:assertTrue>
|
|
102 |
</target>
|
|
103 |
|
|
104 |
<target name="test-buildid-notset">
|
|
105 |
<au:assertFalse>
|
|
106 |
<isset property="diamonds.build.id"/>
|
|
107 |
</au:assertFalse>
|
|
108 |
</target>
|
|
109 |
|
628
|
110 |
<target name="test-invalid-template-file">
|
|
111 |
<antcall target="invalid-template-file" />
|
|
112 |
</target>
|
|
113 |
|
|
114 |
<target name="test-verify-targets">
|
|
115 |
<au:assertTrue>
|
|
116 |
<isset property="diamonds.build.id"/>
|
|
117 |
</au:assertTrue>
|
|
118 |
</target>
|
|
119 |
|
|
120 |
<target name="test-verify-stages">
|
|
121 |
<get src="http://${diamonds.host}:${diamonds.port}${diamonds.build.id}?fmt=xml"
|
|
122 |
dest="${temp.dir}/test-verify-stages.xml"
|
|
123 |
usetimestamp="true" />
|
|
124 |
<xpathtest xmlfile="${temp.dir}/test-verify-stages.xml">
|
|
125 |
<namespace uri="" prefix=""/>
|
|
126 |
<xpath expression="/diamonds-build/stages/stage[name='invalid-template-sequence']"/>
|
|
127 |
</xpathtest>
|
|
128 |
</target>
|
|
129 |
|
|
130 |
|
|
131 |
<target name="test-all" depends="test-buildid-notset, diamonds, test-buildid-set, test-invalid-ant-properties-input,
|
|
132 |
test-invalid-template-file, test-verify-targets, test-verify-stages" />
|
587
|
133 |
</project> |