buildframework/helium/sf/java/legacy/tests/antunit/test_rebaseline_task.ant.xml
author wbernard
Tue, 27 Apr 2010 08:33:08 +0300
changeset 587 85df38eb4012
permissions -rw-r--r--
helium_9.0-a7879c935424

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
============================================================================ 
Name        : test_rebaseline_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_rebaseline_task" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
    <description>
        Rebaseline testing targets for script rebaseline.pl
    </description>
    <property environment="env"/>
    <taskdef resource="com/nokia/ant/antlib.xml" uri="http://www.nokia.com/helium" />


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

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

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

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

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

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

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

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

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

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

    <target name="test-rebaseline-task-newbaselineName-set-to-quiet-case">
        <au:expectfailure expectedMessage="[hlm:rebaseline] Error: mandatory attributes are not defined - database password ccmProject">
            <hlm:rebaseline newBaselineName="shoephone-RnD_2007wk49_01project:co1train#1"/>
        </au:expectfailure>
        <au:assertLogContains text="Set newBaselineName to shoephone-RnD_2007wk49_01project:co1train#1" />
    </target>

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

    <target name="test-rebaseline-task-create-baseline-for-rollingreleasetag-set-case">
        <au:expectfailure expectedMessage="[hlm:rebaseline] Error: mandatory attributes are not defined - database password ccmProject">
            <hlm:rebaseline createBaselineForRollingReleaseTag="yes"/>
        </au:expectfailure>
        <au:assertLogContains text="Set createBaselineForRollingReleaseTag to true" />
    </target>

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

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

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

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

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

    <target name="test-rebaseline-task-all-mandatory-arguments-given-but-password-wrong-case">
        <au:expectfailure expectedMessage="[hlm:rebaseline] Error: Script execution failure.">
            <hlm:rebaseline 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-rebaseline-task-all-mandatory-arguments-and-optional-arguments-given-but-password-wrong-case">
        <au:expectfailure expectedMessage="[hlm:rebaseline] Error: Script execution failure.">
            <hlm:rebaseline database="to1tobet" ccmProject="symbiantools-to1tobet#symbiantools_08_w34:project:ccm51#1" password="test" 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 verbosity to 1" />
    </target>

    <target name="test-rebaseline-task-all-mandatory-arguments-and-optional-arguments-given-but-password-wrong-and-verbosity-wrong-case">
        <au:expectfailure expectedMessage="[hlm:rebaseline] Error: Verbosity level is not recognised. Legal values are: 0 - quiet, 1 - verbose.">
            <hlm:rebaseline database="to1tobet" ccmProject="symbiantools-to1tobet#symbiantools_08_w34:project:ccm51#1" password="test" 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 verbosity to 9" />
    </target>

</project>