|
1 <!-- |
|
2 ============================================================================ |
|
3 Name : test_abld_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-abld-input" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium"> |
|
23 <description>Helium metadata Abld input unittests.</description> |
|
24 |
|
25 <dirname property="project.dir" file="${ant.file.test-abld-input}" /> |
|
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="abld.regex"> |
|
42 <metadatafilter severity="WARNING" regex=".*warning U4010" description="mingw error" /> |
|
43 <metadatafilterset filterfile="${project.dir}/../data/common.csv" /> |
|
44 </hlm:metadatafilterset> |
|
45 |
|
46 |
|
47 <target name="test-abld-log-parsing"> |
|
48 <echo message="test-abld-log-parsing" /> |
|
49 |
|
50 <hlm:metadatarecord database="${test.temp.dir}/metadata_db"> |
|
51 <hlm:abldmetadatainput> |
|
52 <fileset dir="${project.dir}/../data/abld"> |
|
53 <include name="sample_abld.log"/> |
|
54 </fileset> |
|
55 <metadatafilterset refid="abld.regex" /> |
|
56 </hlm:abldmetadatainput> |
|
57 </hlm:metadatarecord> |
|
58 <au:assertTrue> |
|
59 <available type="dir" file="${test.temp.dir}/metadata_db" /> |
|
60 </au:assertTrue> |
|
61 |
|
62 <fmpp sourceFile="${project.dir}/../data/abld/parsing_result.ini.ftl" |
|
63 outputfile="${test.temp.dir}/result.ini"> |
|
64 <data expandProperties="yes"> |
|
65 dbPath: ${test.temp.dir}/metadata_db |
|
66 ant: antProperties() |
|
67 </data> |
|
68 </fmpp> |
|
69 <property file="${test.temp.dir}/result.ini" /> |
|
70 <echo>number.of.logs: ${number.of.logs}</echo> |
|
71 <echo>number.of.execution.times: ${number.of.execution.times}</echo> |
|
72 <echo>number.of.components: ${number.of.components}</echo> |
|
73 <au:assertTrue message="Invalid number of logs"> |
|
74 <equals arg1="${number.of.logs}" arg2="1" /> |
|
75 </au:assertTrue> |
|
76 <au:assertTrue message="Invalid number of execution time"> |
|
77 <equals arg1="${number.of.execution.times}" arg2="0" /> |
|
78 </au:assertTrue> |
|
79 <au:assertTrue message="Invalid number of components"> |
|
80 <equals arg1="${number.of.components}" arg2="3" /> |
|
81 </au:assertTrue> |
|
82 </target> |
|
83 |
|
84 |
|
85 </project> |