buildframework/helium/tools/common/test/test_deconfigure_task.ant.xml
author wbernard
Wed, 23 Dec 2009 19:29:07 +0200
changeset 179 d8ac696cc51f
parent 1 be27ed110b50
permissions -rw-r--r--
helium_7.0-r14027

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
============================================================================ 
Name        : test_deconfigure_task.ant.xml 
Part of     : Helium 

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_deconfigure_task" xmlns:au="org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
    <description>
        Deconfigure testing targets for script deconfigure.pl
    </description>
    <property environment="env"/>
    
    <property name="helium.dir" location="../../.." />
    <import file="../../../helium.ant.xml"/>


    <target name="test-deconfigure-no-arguments-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - database password ccmProject">
            <hlm:deconfigure/>
        </au:expectfailure>
    </target>

    <target name="test-deconfigure-task-database-set-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - password ccmProject">
            <hlm:deconfigure database="to1tobet"/>
        </au:expectfailure>
        <au:assertLogContains text="Set database to to1tobet" />
    </target>

    <target name="test-deconfigure-task-ccmproject-set-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - database password">
            <hlm:deconfigure ccmProject="helium-to1tobet#helium_4.49:project:vc1s60p1#1"/>
        </au:expectfailure>
        <au:assertLogContains text="Set ccmProject to helium-to1tobet#helium_4.49:project:vc1s60p1#1" />
    </target>

    <target name="test-deconfigure-task-password-set-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - database ccmProject">
            <hlm:deconfigure password="test"/>
        </au:expectfailure>
        <au:assertLogContains text="Set password to ******"/>
    </target>

    <target name="test-deconfigure-task-consider-branch-releases-set-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - database password ccmProject">
            <hlm:deconfigure considerBranchReleases="yes"/>
        </au:expectfailure>
        <au:assertLogContains text="Set considerBranchReleases to true"/>
    </target>

    <target name="test-deconfigure-task-verbosity-set-to-quiet-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - database password ccmProject">
            <hlm:deconfigure verbosity="0"/>
        </au:expectfailure>
        <au:assertLogContains text="Set verbosity to 0"/>
    </target>

    <target name="test-deconfigure-task-verbosity-set-to-verbose-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - database password ccmProject">
            <hlm:deconfigure verbosity="1"/>
        </au:expectfailure>
        <au:assertLogContains text="Set verbosity to 1"/>
    </target>

    <target name="test-deconfigure-task-verbosity-set-to-very-verbose-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - database password ccmProject">
            <hlm:deconfigure verbosity="2"/>
        </au:expectfailure>
        <au:assertLogContains text="Set verbosity to 2"/>
    </target>

    <target name="test-deconfigure-task-database-and-ccmproject-set-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - password">
            <hlm:deconfigure database="to1tobet" ccmProject="helium-to1tobet#helium_4.49:project:vc1s60p1#1"/>
        </au:expectfailure>
    </target>

    <target name="test-deconfigure-task-database-and-password-set-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - ccmProject">
            <hlm:deconfigure database="to1tobet" password="test"/>
        </au:expectfailure>
    </target>

    <target name="test-deconfigure-task-ccmproject-and-password-set-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: mandatory attributes are not defined - database">
            <hlm:deconfigure ccmProject="helium-to1tobet#helium_4.49:project:vc1s60p1#1" password="test"/>
        </au:expectfailure>
    </target>

    <target name="test-deconfigure-task-all-mandatory-arguments-given-but-password-wrong-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: Script execution failure.">
            <hlm:deconfigure database="to1tobet" ccmProject="helium-to1tobet#helium_4.49:project:vc1s60p1#1" password="test"/>
        </au:expectfailure>
        <au:assertLogContains text="Set database to to1tobet" />
        <au:assertLogContains text="Set ccmProject to helium-to1tobet#helium_4.49:project:vc1s60p1#1" />
        <au:assertLogContains text="Set password to ******" />
    </target>

    <target name="test-deconfigure-task-all-mandatory-arguments-and-optional-arguments-given-but-password-wrong-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: Script execution failure.">
            <hlm:deconfigure database="to1tobet" ccmProject="symbiantools-to1tobet#symbiantools_08_w34:project:ccm51#1" password="test" considerBranchReleases="yes" verbosity="1"/>
        </au:expectfailure>
        <au:assertLogContains text="Set database to to1tobet" />
        <au:assertLogContains text="Set ccmProject to symbiantools-to1tobet#symbiantools_08_w34:project:ccm51#1" />
        <au:assertLogContains text="Set password to ******" />
        <au:assertLogContains text="Set considerBranchReleases to true" />
        <au:assertLogContains text="Set verbosity to 1" />
    </target>

    <target name="test-deconfigure-task-all-mandatory-arguments-and-optional-arguments-given-but-password-wrong-and-verbosity-wrong-case">
        <au:expectfailure expectedMessage="[hlm:deconfigure] Error: Verbosity level is not recognised. Legal values are: 0 - quiet, 1 - verbose or 2 - very verbose">
            <hlm:deconfigure database="to1tobet" ccmProject="symbiantools-to1tobet#symbiantools_08_w34:project:ccm51#1" password="test" considerBranchReleases="no" verbosity="9"/>
        </au:expectfailure>
        <au:assertLogContains text="Set database to to1tobet" />
        <au:assertLogContains text="Set ccmProject to symbiantools-to1tobet#symbiantools_08_w34:project:ccm51#1"/>
        <au:assertLogContains text="Set password to ******" />
        <au:assertLogContains text="Set considerBranchReleases to false" />
        <au:assertLogContains text="Set verbosity to 9" />
    </target>

</project>