buildframework/helium/sf/java/sysdef/tests/antunit/test_create_root_sysdef.ant.xml
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 588 c7c26511138f
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
<!-- 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
============================================================================ 
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
     4
Name        : test_create_root_sysdef.ant.xml 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
Part of     : Helium AntLib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
All rights reserved.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
This component and the accompanying materials are made available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
which accompanies this distribution, and is available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
Initial Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
Description:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
============================================================================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
-->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
<project name="test-create-root-sysdef" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
    <description>Helium antlib merge sysdef tests.</description>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
    <taskdef resource="com/nokia/helium/sysdef/ant/antlib.xml" uri="http://www.nokia.com/helium" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
    <property name="epocroot" location="../data/rootsysdef" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
    <property name="epocroot.temp" location="${epocroot}/temp" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
    <!-- is called prior to the test -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
    <target name="setUp">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
        <delete dir="${epocroot.temp}/" failonerror="false" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
        <mkdir dir="${epocroot.temp}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
    <!-- is called after the test, even if that caused an error -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
    <target name="tearDown">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
        <delete dir="${epocroot.temp}" failonerror="false" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
    <target name="test-missing-epocroot">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
        <au:expectfailure message="Must fail if epocroot is missing">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
            <hlm:createRootSysdef />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
        </au:expectfailure>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
    <target name="test-missing-destFile">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
        <au:expectfailure message="Must fail if epocroot is missing">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
            <hlm:createRootSysdef epocroot="${epocroot}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
        </au:expectfailure>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
    <target name="test-destFile-out-of-epocroot">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
        <au:expectfailure message="Must fail if destfile is not under epocroot">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
            <hlm:createRootSysdef epocroot="${epocroot}" destFile="${java.io.tmpdir}/root.sysdef.xml"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
        </au:expectfailure>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
            <!--
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
      This test checks how the task is behaving while a dir is given in place of a 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
      output file. Failure is of course expected, and clear error message shown.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
     -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
    <target name="test-create-root-invalid-dest-file">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
        <au:expectfailure message="Must fail in case of invalid destFile">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
            <hlm:createRootSysdef destFile="${epocroot.temp}/" epocroot="${epocroot}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
                <fileset dir="${epocroot}">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    67
                    <include name="valid_package/package_definition.xml" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
                </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
            </hlm:createRootSysdef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
        </au:expectfailure>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
        <au:assertFileDoesntExist file="${epocroot.temp}/sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
        <au:assertLogContains text="Error while creating output file:" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    75
    <target name="test-create-root-invalid-dest-file-failonerror">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
        <hlm:createRootSysdef destFile="${epocroot.temp}/" epocroot="${epocroot}" failonerror="false">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
            <fileset dir="${epocroot}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
                <include name="**/valid_package/package_definition.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
            </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
        </hlm:createRootSysdef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    81
        <au:assertFileDoesntExist file="${epocroot.temp}/sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
    <target name="test-create-root-sysdef-single-root">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
        <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.xml" epocroot="${epocroot}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
            <fileset dir="${epocroot}">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    87
                <include name="valid_package/package_definition.xml" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
            </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
        </hlm:createRootSysdef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
        <au:assertFileExists file="${epocroot.temp}/sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
        <loadfile property="pkg.root" srcfile="${epocroot.temp}/sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
        <au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    93
            <contains string="${pkg.root}" substring="valid_package" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
        </au:assertTrue>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    95
        <au:assertFalse>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    96
            <contains string="${pkg.root}" substring="id-namespace=&quot;&quot;" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    97
        </au:assertFalse>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    98
        <au:assertTrue message="Check if xmlns:qt=&quot;http://qt.nokia.com&quot; is defined.">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    99
            <contains string="${pkg.root}" substring="xmlns:qt=&quot;http://qt.nokia.com&quot;" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   100
        </au:assertTrue>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   101
        <au:assertTrue message="Check if id=&quot;valid_package&quot; is defined.">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   102
            <contains string="${pkg.root}" substring="id=&quot;valid_package&quot;" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   103
        </au:assertTrue>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   105
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
    <!--
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
      Check the generation of a root sysdef file.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   108
        * contains the correct package under the correct layer
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
        * url starts correctly
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   110
     -->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
    <target name="test-create-root-sysdef-dual-root">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
        <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.xml" epocroot="${epocroot}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   113
            <fileset dir="${epocroot}">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   114
                <include name="valid_package/package_definition.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   115
                <include name="valid_package_root2/package_definition.xml" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
            </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   117
        </hlm:createRootSysdef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   118
        <au:assertLogContains text="Creating ${epocroot.temp}${file.separator}sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   119
        <au:assertFileExists file="${epocroot.temp}/sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   120
        <loadfile property="pkg.root" srcfile="${epocroot.temp}/sysdef_model.xml"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   121
        <echo>${pkg.root}</echo>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   122
        <au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   123
            <contains string="${pkg.root}" substring="&quot;../root/layer/valid_package" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   124
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   125
        <au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   126
            <contains string="${pkg.root}" substring="&quot;../root2/layer/valid_package_root2" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   127
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   128
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   129
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   130
    <target name="test-create-root-sysdef-dual-root-invalid-pkg-data-file-failure">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   131
        <au:expectfailure message="Must fail if an pkgdata file is invalid.">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   132
            <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.xml" epocroot="${epocroot}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   133
                <fileset dir="${epocroot}">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   134
                    <include name="valid_package/package_definition.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   135
                    <include name="invalid_pkg_data/package_definition.xml" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   136
                </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   137
            </hlm:createRootSysdef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   138
        </au:expectfailure>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   139
        <au:assertFileDoesntExist file="${epocroot.temp}/sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   140
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   141
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   142
    <target name="test-create-root-sysdef-dual-root-missing-pkg-data">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   143
        <au:expectfailure message="Must fail if an pkgdata file is missing.">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   144
            <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.xml" epocroot="${epocroot}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   145
                <fileset dir="${epocroot}">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   146
                    <include name="/valid_package/package_definition.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   147
                    <include name="missing_data_file_pkg/package_definition.xml" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   148
                </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   149
            </hlm:createRootSysdef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   150
        </au:expectfailure>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   151
        <au:assertFileDoesntExist file="${epocroot.temp}/sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   152
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   153
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   154
    <target name="test-create-root-sysdef-dual-root-missing-pkg-data-failonerror">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   155
        <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.xml" epocroot="${epocroot}" failonerror="false">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   156
            <fileset dir="${epocroot}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   157
                <include name="**/valid_package/package_definition.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   158
                <include name="**/missing_data_file_pkg/package_definition.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   159
            </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   160
        </hlm:createRootSysdef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   161
        <au:assertFileExists file="${epocroot.temp}/sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   162
        <loadfile property="pkg.root" srcfile="${epocroot.temp}/sysdef_model.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   163
        <au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   164
            <contains string="${pkg.root}" substring="valid_package" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   165
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   166
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   167
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   168
    <target name="test-create-root-sysdef-dual-root-missing-pkg-data-custom-template">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   169
        <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.txt" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   170
            epocroot="${epocroot}"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   171
            template="${epocroot}/template.txt.ftl">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   172
            <fileset dir="${epocroot}">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   173
                <include name="valid_package/package_definition.xml" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   174
            </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   175
        </hlm:createRootSysdef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   176
        <au:assertFileExists file="${epocroot.temp}/sysdef_model.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   177
        <loadfile property="pkg.root" srcfile="${epocroot.temp}/sysdef_model.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   178
        <au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   179
            <contains string="${pkg.root}" substring="root/layer/valid_package" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   180
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   181
        <au:assertLogContains text="Creating ${epocroot.temp}${file.separator}sysdef_model.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   182
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   183
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   184
    <target name="test-create-root-sysdef-dual-root-missing-pkg-data-failonerror-custom-template">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   185
        <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.txt" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   186
            epocroot="${epocroot}" failonerror="false"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   187
            template="${epocroot}/faulty_template.txt.ftl">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   188
            <fileset dir="${epocroot}">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   189
                <include name="valid_package/package_definition.xml" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   190
            </fileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   191
        </hlm:createRootSysdef>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   192
        <au:assertFileDoesntExist file="${epocroot.temp}/sysdef_model.txt" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   193
        <au:assertLogContains text="Error while creating output file: Unexpected end of file reached." />
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   194
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   195
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   196
    <target name="test-create-root-sysdef-single-root-test-target-package">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   197
        <copy todir="${epocroot.temp}">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   198
            <fileset dir="${epocroot}/epocroot_valid" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   199
        </copy>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   200
        <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.xml" epocroot="${epocroot.temp}"
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   201
            checkPackageExists="true">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   202
            <fileset dir="${epocroot}">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   203
                <include name="valid_package/package_definition.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   204
                <include name="vendor_package/**/package_definition.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   205
            </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   206
        </hlm:createRootSysdef>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   207
        <au:assertFileExists file="${epocroot.temp}/sysdef_model.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   208
        <loadfile property="pkg.root" srcfile="${epocroot.temp}/sysdef_model.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   209
        <au:assertTrue>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   210
            <and>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   211
                <contains string="${pkg.root}" substring="valid_package" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   212
                <contains string="${pkg.root}" substring="vendor_package" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   213
                <contains string="${pkg.root}" substring="nokia_vendor_package" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   214
            </and>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   215
        </au:assertTrue>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   216
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   217
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   218
    <target name="test-create-root-sysdef-single-root-test-target-package-missing">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   219
        <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.xml" epocroot="${epocroot.temp}"
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   220
            checkPackageExists="true">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   221
            <fileset dir="${epocroot}">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   222
                <include name="valid_package/package_definition.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   223
                <include name="vendor_package/**/package_definition.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   224
            </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   225
        </hlm:createRootSysdef>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   226
        <au:assertFileExists file="${epocroot.temp}/sysdef_model.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   227
        <loadfile property="pkg.root" srcfile="${epocroot.temp}/sysdef_model.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   228
        <au:assertTrue>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   229
            <not>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   230
                <and>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   231
                    <contains string="${pkg.root}" substring="valid_package/package_definition.xml" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   232
                    <contains string="${pkg.root}" substring="vendor_package/package_definition.xml" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   233
                    <contains string="${pkg.root}" substring="vendor_package/vendor_package_info/nokia_vendor_package_metadata/package_definition.xml" />
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   234
                </and>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   235
            </not>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   236
        </au:assertTrue>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   237
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   238
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   239
    <target name="test-create-root-sysdef-single-root-test-vendor-package">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   240
        <hlm:createRootSysdef destFile="${epocroot.temp}/sysdef_model.xml" epocroot="${epocroot.temp}">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   241
            <fileset dir="${epocroot}">
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   242
                <include name="vendor_package/*/*/package_definition.xml" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   243
                <include name="vendor_package2/**/package_definition.xml" />
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   244
            </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   245
        </hlm:createRootSysdef>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   246
        <au:assertFileExists file="${epocroot.temp}/sysdef_model.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   247
        <loadfile property="pkg.root" srcfile="${epocroot.temp}/sysdef_model.xml" />
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   248
        <echo>${pkg.root}</echo>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   249
        <au:assertTrue>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   250
            <contains string="${pkg.root}" substring="vendor_package/vendor_package_info/nokia_vendor_package_metadata/package_definition.xml" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   251
        </au:assertTrue>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   252
        <au:assertTrue message="Vendor package overriding SF should not be prefixed by sf because it is the default namespace.">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   253
            <contains string="${pkg.root}" substring="id=&quot;vendor_package&quot;" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   254
        </au:assertTrue>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   255
        <au:assertTrue message="Check that xmlns:qt=&quot;http://www.nokia.com/qt&quot; is added.">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   256
            <contains string="${pkg.root}" substring="xmlns:qt=&quot;http://www.nokia.com/qt&quot;" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   257
        </au:assertTrue>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   258
        <au:assertTrue message="Check that xmlns:vendor=&quot;http://www.vendor.com/schema/drd/system-definition&quot; is added.">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   259
            <contains string="${pkg.root}" substring="xmlns:vendor=&quot;http://www.vendor.com/schema/drd/system-definition&quot;" />
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   260
        </au:assertTrue>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   261
        <au:assertTrue message="Verify that a space is added between namespaces">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   262
            <not>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   263
                <contains string="${pkg.root}" substring="&quot;xmlns" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   264
            </not>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   265
        </au:assertTrue>        
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   266
        <au:assertTrue message="Vendor package 2 is pure vendor, so it must be prefixed with vendor.">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   267
            <contains string="${pkg.root}" substring="id=&quot;vendor:vendor_package2&quot;" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   268
        </au:assertTrue>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   269
    	<!-- Let's check if the file is syntaxically correct. -->
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   270
    	<xmlvalidate file="${epocroot.temp}/sysdef_model.xml" lenient="yes"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   271
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   272
      
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   273
</project>