21 ============================================================================ |
21 ============================================================================ |
22 --> |
22 --> |
23 <project name="test-diamonds-invalid-template" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium"> |
23 <project name="test-diamonds-invalid-template" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium"> |
24 <description>Helium Antlib diamonds unittests.</description> |
24 <description>Helium Antlib diamonds unittests.</description> |
25 <property environment="env" /> |
25 <property environment="env" /> |
26 |
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" /> |
27 <property name="diamonds.unitest.dir" location="${ant.file.test-diamonds-invalid-template}/../../../" /> |
29 <property name="diamonds.unitest.dir" location="${ant.file.test-diamonds-invalid-template}/../../../" /> |
28 <import file="../../../../../../nokia/companyproperties.ant.xml" optional="true"/> |
30 <import file="../../../../../../nokia/companyproperties.ant.xml" optional="true"/> |
29 <import file="../../../../../../../extensions/nokia/external/helium-nokia-antlib/companyproperties.ant.xml" optional="true"/> |
|
30 <property name="diamonds.output.dir" location="${temp.dir}/output" /> |
31 <property name="diamonds.output.dir" location="${temp.dir}/output" /> |
31 <property name="diamonds.template.dir" location="${diamonds.unitest.dir}/data/invalid_templates" /> |
32 <property name="diamonds.template.dir" location="${diamonds.unitest.dir}/data/invalid_templates" /> |
32 <property name="build.family" value="test_new_hlm"/> |
33 <property name="build.family" value="test_new_hlm"/> |
33 <property name="id" value="123"/> |
34 <property name="id" value="123"/> |
34 <property name="name" value="${build.family}_${id}"/> |
35 <property name="name" value="${build.family}_${id}"/> |
35 <property name="build.system" value="ec-helium"/> |
36 <property name="build.system" value="ec-helium"/> |
36 <property name="diamonds.listener.configuration.file" location="${diamonds.unitest.dir}/config/diamonds_config.xml.ftl" /> |
|
37 <property name="compile.log.input" location="${diamonds.unitest.dir}/data/compile.log.xml" /> |
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" /> |
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" /> |
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" /> |
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" /> |
41 <property name="symsee.version" value="9.1.0" /> |
|
42 <import file="../../config/diamonds_config_default.ant.xml" /> |
42 |
43 |
43 <target name="unittest" depends="unittest-diamonds" /> |
44 <target name="unittest" depends="unittest-diamonds" /> |
44 |
45 |
45 <target name="unittest-diamonds" > |
46 <target name="unittest-diamonds" > |
46 <delete dir="${diamonds.output.dir}" failonerror="false"/> |
47 <delete dir="${diamonds.output.dir}" failonerror="false"/> |
65 |
66 |
66 <target name="create-bom-log"> |
67 <target name="create-bom-log"> |
67 <echo message="target without input file and just to send the data" /> |
68 <echo message="target without input file and just to send the data" /> |
68 </target> |
69 </target> |
69 |
70 |
70 <target name="invalid-target-input-file"> |
|
71 <echo message="target with invalid input source xml file" /> |
|
72 </target> |
|
73 |
|
74 <target name="invalid-stage-input-file"> |
|
75 <echo message="stage with invalid input source xml file" /> |
|
76 </target> |
|
77 |
71 |
78 <target name="invalid-template-file"> |
72 <target name="invalid-template-file"> |
79 <echo message="target with invalid template-file" /> |
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> |
80 </target> |
83 </target> |
81 |
84 |
82 <target name="invalid-ant-properties-input"> |
85 <target name="invalid-ant-properties-input"> |
83 <echo message="target with invalid ant properties input" /> |
86 <echo message="target with invalid ant properties input" /> |
84 </target> |
87 </target> |
85 |
88 |
86 <target name="non-existing-ant-properties"> |
|
87 <echo message="target with non-existing-ant-properties" /> |
|
88 </target> |
|
89 |
|
90 <target name="invalid-diamonds-server-properties"> |
|
91 <echo message="target with invalid-diamonds-server-properties" /> |
|
92 </target> |
|
93 |
|
94 <target name="defer-type"> |
|
95 <echo message="version target for diamonds to verify sending data to diamonds" /> |
|
96 </target> |
|
97 |
|
98 <target name="test-defer-type"> |
|
99 <antcall target="defer-type" /> |
|
100 </target> |
|
101 |
|
102 <target name="test-create-bom-log"> |
|
103 <antcall target="create-bom-log" /> |
|
104 </target> |
|
105 |
|
106 <target name="test-codescanner"> |
|
107 <antcall target="codescanner" /> |
|
108 </target> |
|
109 |
|
110 <target name="test-invalid-target-input-file"> |
|
111 <antcall target="invalid-target-input-file" /> |
|
112 </target> |
|
113 |
|
114 <target name="test-invalid-stage-input-file"> |
|
115 <antcall target="invalid-target-input-file" /> |
|
116 <echo message="stage with invalid input source xml file" /> |
|
117 </target> |
|
118 |
|
119 <target name="test-invalid-template-file"> |
|
120 <antcall target="invalid-template-file" /> |
|
121 </target> |
|
122 |
|
123 <target name="test-invalid-ant-properties-input"> |
89 <target name="test-invalid-ant-properties-input"> |
124 <antcall target="invalid-ant-properties-input" /> |
90 <antcall target="invalid-ant-properties-input" /> |
125 </target> |
|
126 |
|
127 <target name="test-non-existing-ant-properties"> |
|
128 <antcall target="non-existing-ant-properties" /> |
|
129 </target> |
|
130 |
|
131 <target name="test-invalid-diamonds-server-properties"> |
|
132 <antcall target="invalid-diamonds-server-properties" /> |
|
133 <echo message="target with invalid-diamonds-server-properties" /> |
|
134 </target> |
|
135 |
|
136 <target name="test-compile-target"> |
|
137 <antcall target="compile-target" /> |
|
138 </target> |
91 </target> |
139 |
92 |
140 <target name="test-version"> |
93 <target name="test-version"> |
141 <antcall target="version" /> |
94 <antcall target="version" /> |
142 </target> |
95 </target> |
152 <au:assertFalse> |
105 <au:assertFalse> |
153 <isset property="diamonds.build.id"/> |
106 <isset property="diamonds.build.id"/> |
154 </au:assertFalse> |
107 </au:assertFalse> |
155 </target> |
108 </target> |
156 |
109 |
157 <target name="test-all" depends="test-buildid-notset, diamonds, test-buildid-set, test-defer-type, test-version, |
110 <target name="test-invalid-template-file"> |
158 test-create-bom-log,test-codescanner,test-compile-target,test-invalid-diamonds-server-properties, |
111 <antcall target="invalid-template-file" /> |
159 test-non-existing-ant-properties,test-invalid-ant-properties-input,test-invalid-template-file, |
112 </target> |
160 test-invalid-target-input-file,test-invalid-stage-input-file " /> |
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" /> |
161 </project> |
133 </project> |