buildframework/helium/external/helium-antlib/sysdef/tests/antunit/test_join_sysdef.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/external/helium-antlib/sysdef/tests/antunit/test_join_sysdef.ant.xml Wed Dec 23 19:29:07 2009 +0200
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+============================================================================
+Name : test_join_sysdef.ant.xml
+Part of : Helium AntLib
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+<project name="test-join-sysdef" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
+ <description>Helium antlib join sysdef tests.</description>
+
+ <taskdef resource="com/nokia/helium/sysdef/ant/antlib.xml" uri="http://www.nokia.com/helium" />
+ <property name="epocroot" location="../../demo/data" />
+ <property name="epocroot.temp" location="${epocroot}/temp" />
+
+
+ <!-- is called prior to the test -->
+ <target name="setUp">
+ <delete dir="${epocroot.temp}" failonerror="false" />
+ <mkdir dir="${epocroot.temp}" />
+ </target>
+
+ <!-- is called after the test, even if that caused an error -->
+ <target name="tearDown">
+ <delete dir="${epocroot.temp}" failonerror="false" />
+ </target>
+
+
+ <target name="test-noargs">
+ <au:expectfailure expectedMessage="'srcfile' attribute is not defined">
+ <hlm:joinSysdef />
+ </au:expectfailure>
+ <au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
+ </target>
+
+ <target name="test-srcfile">
+ <au:expectfailure expectedMessage="'destfile' attribute is not defined">
+ <hlm:joinSysdef epocroot="${epocroot}" srcfile="${epocroot}/root/system_definition_layer1.xml" />
+ </au:expectfailure>
+ <au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
+ </target>
+
+ <target name="test-srcfile-destfile">
+ <hlm:joinSysdef epocroot="${epocroot}" srcfile="${epocroot}/root/system_definition_layer1.xml" destfile="${epocroot.temp}/output.sysdef.xml" />
+ <au:assertFileExists file="${epocroot.temp}/output.sysdef.xml" />
+ </target>
+
+ <target name="test-srcfile-destfile-wrong-epocroot">
+ <echo>test-srcfile-destfile-wrong-epocroot</echo>
+ <au:expectfailure expectedMessage="Could not find">
+ <hlm:joinSysdef epocroot="${epocroot}/foobar" srcfile="${epocroot}/root/system_definition_layer1.xml" destfile="${epocroot.temp}/output.sysdef.xml" />
+ </au:expectfailure>
+ <au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
+ </target>
+
+ <target name="test-wrong-content">
+ <echo>test-wrong-content</echo>
+ <au:expectfailure expectedMessage="javax.xml.transform.TransformerException:">
+ <hlm:joinSysdef epocroot="${epocroot}" srcfile="${epocroot}/root/system_definition_layer3.xml" destfile="${epocroot.temp}/output.sysdef.xml" />
+ </au:expectfailure>
+ <au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
+ </target>
+
+ <target name="test-invalid-src-file">
+ <echo>test-wrong-content</echo>
+ <au:expectfailure expectedMessage="Could not find source file ">
+ <hlm:joinSysdef epocroot="${epocroot}" srcfile="${epocroot}/root/system_definition_layer_invalid.xml" destfile="${epocroot.temp}/output.sysdef.xml" />
+ </au:expectfailure>
+ <au:assertFileDoesntExist file="${epocroot.temp}/output.sysdef.xml" />
+ </target>
+
+</project>
\ No newline at end of file