buildframework/helium/sf/java/diamonds/tests/antunit/test_diamonds.ant.xml
author wbernard
Sun, 10 Oct 2010 15:22:15 +0300
changeset 645 b8d81fa19e7d
parent 628 7c4a911dc066
permissions -rw-r--r--
helium_12.0.0-63b64366f9cf
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"?>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
<!-- 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
============================================================================ 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
Name        : test_diamonds.ant.xml 
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-diamonds" 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 diamonds unittests.</description>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    26
    <taskdef name="xpathtest" classname="se.jtech.ant.xpath.XPathEvaluatorTask" onerror="ignore"/>    
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    27
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
    <import file="run-scenario.ant.xml" />
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    29
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
    <target name="test-build">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
        <runScenario scenario="build" target="unittest-diamonds" />
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    32
        <au:assertLogContains text="Diamonds build id:" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
    <target name="test-build-with-invalid-address">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
        <runScenario scenario="invalid-address" target="unittest-diamonds" />
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    37
        <au:assertLogContains text="Error sending the message: invalid.server.local" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    38
        <au:assertLogContains text="Diamonds reporting will be disabled." />
587
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-build-with-invalid-templates">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
        <runScenario scenario="invalid-templates" target="unittest-diamonds" />
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    43
        <au:assertLogContains text="Error with invalid-ant-properties-input-file.ftl" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    44
        <au:assertLogContains text="Diamonds build id:" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
    </target>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    46
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    47
    <target name="test-build-with-invalid-templates-1">
645
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    48
        <runScenario scenario="invalid-templates-1" target="unittest-diamonds" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    49
        <au:assertLogContains text="Diamonds build id:" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    50
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    51
    
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    52
    <target name="test-build-without-config">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    53
        <runScenario scenario="build-without-config" target="unittest-diamonds" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    54
        <au:assertLogContains text="Diamonds reporting is disabled, because the listener is not configured properly: required property: diamonds.host not defined" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    55
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    56
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    57
    <target name="test-failing-build">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    58
        <au:expectfailure>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    59
            <runScenario scenario="failing-build" target="build" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    60
        </au:expectfailure>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    61
        <au:assertLogContains text="BUILD FAILED" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    62
        <au:assertLogContains text="diamonds:" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    63
        <au:assertLogContains text="failing-target:" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    64
        <property file="${test.temp.dir}/diamonds.ini" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    65
        <get src="http://${diamonds.host}:${diamonds.port}${diamonds.build.id}?fmt=xml"
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    66
             dest="${test.temp.dir}/diamonds_data.xml" 
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    67
             usetimestamp="true" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    68
        <xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    69
            <namespace uri="" prefix=""/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    70
            <xpath expression="/diamonds-build/build[status='failed']"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    71
         </xpathtest>        
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    72
        <xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    73
            <namespace uri="" prefix=""/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    74
            <xpath expression="/diamonds-build/build/finished"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    75
         </xpathtest>        
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    76
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    77
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    78
    <target name="test-signal-build">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    79
        <au:expectfailure>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    80
            <runScenario scenario="signal-build" target="build" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    81
        </au:expectfailure>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    82
        <au:assertLogContains text="BUILD FAILED" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    83
        <au:assertLogContains text="diamonds:" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    84
        <au:assertLogContains text="failing-target:" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    85
        <property file="${test.temp.dir}/diamonds.ini" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    86
        <get src="http://${diamonds.host}:${diamonds.port}${diamonds.build.id}?fmt=xml"
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    87
             dest="${test.temp.dir}/diamonds_data.xml" 
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    88
             usetimestamp="true" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    89
        <xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    90
            <namespace uri="" prefix=""/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    91
            <xpath expression="/diamonds-build/build[status='failed']"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    92
         </xpathtest>        
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    93
        <xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    94
            <namespace uri="" prefix=""/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    95
            <xpath expression="/diamonds-build/build/finished"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    96
         </xpathtest>        
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    97
        <xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    98
            <namespace uri="" prefix=""/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
    99
            <xpath expression="/diamonds-build/signals/signal[position()=1 and name='testDeferredSignalInput']"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   100
         </xpathtest>        
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   101
        <xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   102
            <namespace uri="" prefix=""/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   103
            <xpath expression="/diamonds-build/signals/signal[position()=2 and name='testNowSignalInput']"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   104
         </xpathtest>        
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   105
    </target>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   106
    
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   107
    <target name="test-target-recording">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   108
        <runScenario scenario="target-recording" target="build" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   109
        <au:assertLogContains text="BUILD SUCCESSFUL" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   110
        <au:assertLogContains text="diamonds:" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   111
        <property file="${test.temp.dir}/diamonds.ini" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   112
        <get src="http://${diamonds.host}:${diamonds.port}${diamonds.build.id}?fmt=xml"
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   113
             dest="${test.temp.dir}/diamonds_data.xml" 
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   114
             usetimestamp="true" />
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   115
        <xpathtest xmlfile="${test.temp.dir}/diamonds_data.xml">
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   116
            <namespace uri="" prefix=""/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   117
            <xpath expression="/diamonds-build/targets/target[name='target-recording']"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   118
            <xpath expression="/diamonds-build/targets/target[name='sub-target2']"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   119
            <xpath expression="/diamonds-build/targets/target[name='sub-target3']"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   120
            <xpath expression="/diamonds-build/targets[count(target)=3]"/>
b8d81fa19e7d helium_12.0.0-63b64366f9cf
wbernard
parents: 628
diff changeset
   121
         </xpathtest>        
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   122
    </target>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   123
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   124
</project>