628
|
1 |
<!--
|
|
2 |
============================================================================
|
|
3 |
Name : test_sysdef_input.ant.xml
|
|
4 |
Part of : Helium
|
|
5 |
|
|
6 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
7 |
All rights reserved.
|
|
8 |
This component and the accompanying materials are made available
|
|
9 |
under the terms of the License "Eclipse Public License v1.0"
|
|
10 |
which accompanies this distribution, and is available
|
|
11 |
at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
12 |
|
|
13 |
Initial Contributors:
|
|
14 |
Nokia Corporation - initial contribution.
|
|
15 |
|
|
16 |
Contributors:
|
|
17 |
|
|
18 |
Description:
|
|
19 |
|
|
20 |
============================================================================
|
|
21 |
-->
|
|
22 |
<project name="test-sysdef-input" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
|
|
23 |
<description>Helium metadata text input unittests.</description>
|
|
24 |
|
|
25 |
<taskdef resource="com/nokia/helium/metadata/ant/antlib.xml" uri="http://www.nokia.com/helium" />
|
|
26 |
<taskdef name="fmpp" classname="fmpp.tools.AntTask" onerror="report"/>
|
|
27 |
|
|
28 |
<target name="setUp">
|
|
29 |
<echo>---=====================================---</echo>
|
|
30 |
<mkdir dir="${test.temp.dir}" />
|
|
31 |
<delete dir="${test.temp.dir}" />
|
|
32 |
<mkdir dir="${test.temp.dir}" />
|
|
33 |
</target>
|
|
34 |
|
|
35 |
<target name="tearDown">
|
|
36 |
<delete dir="${test.temp.dir}" />
|
|
37 |
<echo>---=====================================---</echo>
|
|
38 |
</target>
|
|
39 |
|
|
40 |
<target name="test-sysdef-metadata-input-missing-file">
|
|
41 |
<echo message="test-sysdef-metadata-input" />
|
|
42 |
<au:expectfailure expectedMessage="file attribute is not defined.">
|
|
43 |
<hlm:metadatarecord database="${test.temp.dir}/metadata_db">
|
|
44 |
<hlm:sysdefmetadatainput />
|
|
45 |
</hlm:metadatarecord>
|
|
46 |
</au:expectfailure>
|
|
47 |
</target>
|
|
48 |
|
|
49 |
<target name="test-sysdef-metadata-input-inexisting-file">
|
|
50 |
<echo message="test-sysdef-metadata-input" />
|
|
51 |
<au:expectfailure>
|
|
52 |
<hlm:metadatarecord database="${test.temp.dir}/metadata_db">
|
|
53 |
<hlm:sysdefmetadatainput file="inexisting/inexisting_sysdef3.xml" />
|
|
54 |
</hlm:metadatarecord>
|
|
55 |
</au:expectfailure>
|
|
56 |
</target>
|
|
57 |
|
|
58 |
<target name="test-sysdef-metadata-input">
|
|
59 |
<echo message="test-sysdef-metadata-input" />
|
|
60 |
<hlm:metadatarecord database="${test.temp.dir}/metadata_db">
|
|
61 |
<hlm:sysdefmetadatainput file="../data/sysdef/sysdef3.xml" epocroot="../" />
|
|
62 |
</hlm:metadatarecord>
|
|
63 |
<fmpp sourceFile="../data/sysdef/sysdef_data.ini.ftl"
|
|
64 |
outputfile="${test.temp.dir}/sysdef_data.ini">
|
|
65 |
<data expandProperties="yes">
|
|
66 |
dbPath: ${test.temp.dir}/metadata_db
|
|
67 |
ant: antProperties()
|
|
68 |
</data>
|
|
69 |
</fmpp>
|
|
70 |
<property file="${test.temp.dir}/sysdef_data.ini" />
|
|
71 |
<echo>package.count: ${package.count}</echo>
|
|
72 |
<echo>collection.count: ${collection.count}</echo>
|
|
73 |
<echo>component.count: ${component.count}</echo>
|
|
74 |
<echo>unit.count: ${unit.count}</echo>
|
|
75 |
<au:assertTrue message="Invalid number of packages">
|
|
76 |
<equals arg1="${package.count}" arg2="2" />
|
|
77 |
</au:assertTrue>
|
|
78 |
<au:assertTrue message="Invalid number of collection">
|
|
79 |
<equals arg1="${collection.count}" arg2="2" />
|
|
80 |
</au:assertTrue>
|
|
81 |
<au:assertTrue message="Invalid number of components">
|
|
82 |
<equals arg1="${component.count}" arg2="2" />
|
|
83 |
</au:assertTrue>
|
|
84 |
<au:assertTrue message="Invalid number of units">
|
|
85 |
<equals arg1="${unit.count}" arg2="2" />
|
|
86 |
</au:assertTrue>
|
|
87 |
</target>
|
|
88 |
|
|
89 |
<target name="test-sysdef-metadata-input-with-invalid-model">
|
|
90 |
<echo message="test-sysdef-metadata-input" />
|
|
91 |
<au:expectfailure>
|
|
92 |
<hlm:metadatarecord database="${test.temp.dir}/metadata_db">
|
|
93 |
<hlm:sysdefmetadatainput file="../data/sysdef/invalid_sysdef3.xml" epocroot="../" />
|
|
94 |
</hlm:metadatarecord>
|
|
95 |
</au:expectfailure>
|
|
96 |
</target>
|
|
97 |
</project>
|