179
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : test_join_sysdef.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-join-sysdef" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
|
|
24 |
<description>Helium antlib join sysdef tests.</description>
|
|
25 |
|
|
26 |
<taskdef resource="com/nokia/helium/sysdef/ant/antlib.xml" uri="http://www.nokia.com/helium" />
|
|
27 |
<property name="epocroot" location="../../demo/data" />
|
|
28 |
<property name="epocroot.temp" location="${epocroot}/temp" />
|
|
29 |
|
|
30 |
|
|
31 |
<!-- is called prior to the test -->
|
|
32 |
<target name="setUp">
|
|
33 |
<delete dir="${epocroot.temp}" failonerror="false" />
|
|
34 |
<mkdir dir="${epocroot.temp}" />
|
|
35 |
</target>
|
|
36 |
|
|
37 |
<!-- is called after the test, even if that caused an error -->
|
|
38 |
<target name="tearDown">
|
|
39 |
<delete dir="${epocroot.temp}" failonerror="false" />
|
|
40 |
</target>
|
|
41 |
|
|
42 |
|
|
43 |
<target name="test-noargs">
|
|
44 |
<au:expectfailure expectedMessage="'srcfile' attribute is not defined">
|
|
45 |
<hlm:joinSysdef />
|
|
46 |
</au:expectfailure>
|
|
47 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
|
|
48 |
</target>
|
|
49 |
|
|
50 |
<target name="test-srcfile">
|
|
51 |
<au:expectfailure expectedMessage="'destfile' attribute is not defined">
|
|
52 |
<hlm:joinSysdef epocroot="${epocroot}" srcfile="${epocroot}/root/system_definition_layer1.xml" />
|
|
53 |
</au:expectfailure>
|
|
54 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
|
|
55 |
</target>
|
|
56 |
|
|
57 |
<target name="test-srcfile-destfile">
|
|
58 |
<hlm:joinSysdef epocroot="${epocroot}" srcfile="${epocroot}/root/system_definition_layer1.xml" destfile="${epocroot.temp}/output.sysdef.xml" />
|
|
59 |
<au:assertFileExists file="${epocroot.temp}/output.sysdef.xml" />
|
|
60 |
</target>
|
|
61 |
|
|
62 |
<target name="test-srcfile-destfile-wrong-epocroot">
|
|
63 |
<echo>test-srcfile-destfile-wrong-epocroot</echo>
|
|
64 |
<au:expectfailure expectedMessage="Could not find">
|
|
65 |
<hlm:joinSysdef epocroot="${epocroot}/foobar" srcfile="${epocroot}/root/system_definition_layer1.xml" destfile="${epocroot.temp}/output.sysdef.xml" />
|
|
66 |
</au:expectfailure>
|
|
67 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
|
|
68 |
</target>
|
|
69 |
|
|
70 |
<target name="test-wrong-content">
|
|
71 |
<echo>test-wrong-content</echo>
|
|
72 |
<au:expectfailure expectedMessage="javax.xml.transform.TransformerException:">
|
|
73 |
<hlm:joinSysdef epocroot="${epocroot}" srcfile="${epocroot}/root/system_definition_layer3.xml" destfile="${epocroot.temp}/output.sysdef.xml" />
|
|
74 |
</au:expectfailure>
|
|
75 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
|
|
76 |
</target>
|
|
77 |
|
|
78 |
<target name="test-invalid-src-file">
|
|
79 |
<echo>test-wrong-content</echo>
|
|
80 |
<au:expectfailure expectedMessage="Could not find source file ">
|
|
81 |
<hlm:joinSysdef epocroot="${epocroot}" srcfile="${epocroot}/root/system_definition_layer_invalid.xml" destfile="${epocroot.temp}/output.sysdef.xml" />
|
|
82 |
</au:expectfailure>
|
|
83 |
<au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
|
|
84 |
</target>
|
|
85 |
|
|
86 |
</project> |