|
1 <!-- |
|
2 ============================================================================ |
|
3 Name : test_ant_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-ant-input" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium"> |
|
23 <description>Helium metadata Ant input unittests.</description> |
|
24 |
|
25 <dirname property="project.dir" file="${ant.file.test-metadata-regex}" /> |
|
26 <taskdef resource="com/nokia/helium/metadata/ant/antlib.xml" uri="http://www.nokia.com/helium" /> |
|
27 <taskdef name="fmpp" classname="fmpp.tools.AntTask" onerror="report"/> |
|
28 |
|
29 <target name="setUp"> |
|
30 <echo>---=====================================---</echo> |
|
31 <mkdir dir="${test.temp.dir}" /> |
|
32 <delete dir="${test.temp.dir}" /> |
|
33 <mkdir dir="${test.temp.dir}" /> |
|
34 </target> |
|
35 |
|
36 <target name="tearDown"> |
|
37 <delete dir="${test.temp.dir}" /> |
|
38 <echo>---=====================================---</echo> |
|
39 </target> |
|
40 |
|
41 <hlm:metadatafilterset id="error.filterset"> |
|
42 <hlm:metadatafilter severity="error" regex="^ERROR: .*" description="Simple error pattern"/> |
|
43 <hlm:metadatafilter severity="warning" regex="^WARNING: .*" description="Simple warning pattern"/> |
|
44 </hlm:metadatafilterset> |
|
45 |
|
46 |
|
47 <target name="test-ant-log-metadata-input"> |
|
48 <echo message="Ant log metadata input validation" /> |
|
49 <mkdir dir="${test.temp.dir}"/> |
|
50 |
|
51 <hlm:metadatarecord database="${test.temp.dir}/metadata_db"> |
|
52 <hlm:antmetadatainput> |
|
53 <fileset file="${project.dir}/../data/ant/package_ant_build.log" /> |
|
54 <metadatafilterset refid="error.filterset" /> |
|
55 </hlm:antmetadatainput> |
|
56 </hlm:metadatarecord> |
|
57 |
|
58 <fmpp sourceFile="${project.dir}/../data/ant/result.ini.ftl" |
|
59 outputfile="${test.temp.dir}/result.ini"> |
|
60 <data expandProperties="yes"> |
|
61 dbPath: ${test.temp.dir}/metadata_db |
|
62 ant: antProperties() |
|
63 </data> |
|
64 </fmpp> |
|
65 <property file="${test.temp.dir}/result.ini" /> |
|
66 <echo>number.of.logs: ${number.of.logs}</echo> |
|
67 <echo>number.of.components: ${number.of.components}</echo> |
|
68 <echo>number.of.errors: ${number.of.errors}</echo> |
|
69 <au:assertTrue message="Invalid number of logs"> |
|
70 <equals arg1="${number.of.logs}" arg2="1" /> |
|
71 </au:assertTrue> |
|
72 <au:assertTrue message="Invalid number of components"> |
|
73 <equals arg1="${number.of.components}" arg2="16" /> |
|
74 </au:assertTrue> |
|
75 <au:assertTrue message="Invalid number of errors"> |
|
76 <equals arg1="${number.of.errors}" arg2="1" /> |
|
77 </au:assertTrue> |
|
78 |
|
79 </target> |
|
80 |
|
81 </project> |