|
1 <?xml version="1.0" encoding="UTF-8"?> |
|
2 <!-- |
|
3 ============================================================================ |
|
4 Name : test_is_vendor_package.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-is-vendor-package" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium"> |
|
24 <description>Helium antlib merge 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="../data/rootsysdef" /> |
|
28 <property name="epocroot.temp" location="${epocroot}/temp" /> |
|
29 |
|
30 <!-- is called prior to the test --> |
|
31 <target name="setUp"> |
|
32 <delete dir="${epocroot.temp}/" failonerror="false" /> |
|
33 <mkdir dir="${epocroot.temp}" /> |
|
34 </target> |
|
35 |
|
36 <!-- is called after the test, even if that caused an error --> |
|
37 <target name="tearDown"> |
|
38 <delete dir="${epocroot.temp}" failonerror="false" /> |
|
39 </target> |
|
40 |
|
41 <target name="test-missing-file"> |
|
42 <au:expectfailure expectedMessage="'file' attribute is not defined."> |
|
43 <condition property="is.vendor" value="true"> |
|
44 <hlm:isVendorPackage /> |
|
45 </condition> |
|
46 </au:expectfailure> |
|
47 </target> |
|
48 |
|
49 <target name="test-regular-package"> |
|
50 <condition property="is.vendor" value="true" else="false"> |
|
51 <hlm:isVendorPackage file="../data/isvendor/package/package_definition.xml" /> |
|
52 </condition> |
|
53 <au:assertTrue message="Must not be a vendor package"> |
|
54 <isfalse value="${is.vendor}" /> |
|
55 </au:assertTrue> |
|
56 </target> |
|
57 |
|
58 <target name="test-vendor-package"> |
|
59 <condition property="is.vendor" value="true" else="false"> |
|
60 <hlm:isVendorPackage file="../data/isvendor/package/vendor_package_info/vendor_package_metadata/package_definition.xml" /> |
|
61 </condition> |
|
62 <au:assertTrue message="Must be a vendor package"> |
|
63 <istrue value="${is.vendor}" /> |
|
64 </au:assertTrue> |
|
65 </target> |
|
66 |
|
67 <target name="test-regular-package-selector"> |
|
68 <au:assertTrue message="Must not count a package"> |
|
69 <resourcecount when="eq" count="0"> |
|
70 <restrict> |
|
71 <fileset dir="../data/isvendor" includes="*/package_definition.xml"> |
|
72 <custom classname="com.nokia.helium.sysdef.ant.conditions.IsVendorPackage" /> |
|
73 </fileset> |
|
74 </restrict> |
|
75 </resourcecount> |
|
76 </au:assertTrue> |
|
77 </target> |
|
78 |
|
79 <target name="test-vendor-package-selector"> |
|
80 <au:assertTrue message="Must not be a vendor package"> |
|
81 <resourcecount when="eq" count="1"> |
|
82 <fileset dir="../data/isvendor" includes="*/*/*/package_definition.xml"> |
|
83 <custom classname="com.nokia.helium.sysdef.ant.conditions.IsVendorPackage" /> |
|
84 </fileset> |
|
85 </resourcecount> |
|
86 </au:assertTrue> |
|
87 </target> |
|
88 |
|
89 <target name="test-vendor-package-selector-resource"> |
|
90 <au:assertTrue message="Must count a vendor package"> |
|
91 <resourcecount when="eq" count="1"> |
|
92 <restrict> |
|
93 <fileset dir="../data/isvendor" includes="*/*/*/package_definition.xml" /> |
|
94 <hlm:isVendorPackage /> |
|
95 </restrict> |
|
96 </resourcecount> |
|
97 </au:assertTrue> |
|
98 </target> |
|
99 |
|
100 <target name="test-regular-package-selector-resource"> |
|
101 <au:assertTrue message="Must not count any package package"> |
|
102 <resourcecount when="eq" count="0"> |
|
103 <restrict> |
|
104 <fileset dir="../data/isvendor" includes="*/package_definition.xml" /> |
|
105 <hlm:isVendorPackage /> |
|
106 </restrict> |
|
107 </resourcecount> |
|
108 </au:assertTrue> |
|
109 </target> |
|
110 |
|
111 </project> |