buildframework/helium/sf/java/logging/tests/scenarii/logger/build.xml
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 588 c7c26511138f
child 645 b8d81fa19e7d
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
============================================================================ 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
Name        : build.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-recorder" 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 logger unittests.</description>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    25
    <taskdef resource="com/nokia/helium/core/ant/antlib.xml" uri="http://www.nokia.com/helium"/>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    26
    <import file="../../stages_config.ant.xml" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    27
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
    <target name="test-recorder">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
        <echo message="something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
        <hlm:record name="${temp.dir}/record.log" action="start" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
        <echo message="something to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
        <hlm:record name="${temp.dir}/record.log" action="stop" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
        <echo message="something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
        <loadfile property="message" srcFile="${temp.dir}/record.log" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
        <au:assertTrue message="message not recorded">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
            <contains string="${message}" substring="something to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
        </au:assertTrue>
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-recorder-backup">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
        <echo message="something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
        <hlm:record name="${temp.dir}/record.log" action="start" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
        <echo message="something to be recorded 1st" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
        <hlm:record name="${temp.dir}/record.log" action="stop" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
        <echo message="something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
        <hlm:record name="${temp.dir}/record.log" action="start" backup="true" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
        <echo message="something to be recorded 2nd" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
        <hlm:record name="${temp.dir}/record.log" action="stop" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
        <echo message="something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
        <hlm:record name="${temp.dir}/record.log" action="start" backup="true" backupProperty="backup.log"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
        <echo message="something to be recorded 3rd" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
        <hlm:record name="${temp.dir}/record.log" action="stop" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
        <echo message="something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
        <au:assertFileExists file="${backup.log}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
        <au:assertFileExists file="${temp.dir}/record.log" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
        <loadfile property="message" srcFile="${temp.dir}/record.log" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
        <au:assertTrue message="3rd message should be recorded">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
            <contains string="${message}" substring="something to be recorded 3rd" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
        <au:assertFalse message="1st message should not be recorded">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
            <contains string="${message}" substring="something to be recorded 1st" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
        </au:assertFalse>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
        <au:assertFalse message="2nd message should not be recorded">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
            <contains string="${message}" substring="something to be recorded 2nd" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
        </au:assertFalse>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
    <target name="test-recorder-append">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
        <echo message="something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
        <hlm:record name="${temp.dir}/record.log" action="start" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    75
        <echo message="something to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
        <hlm:record name="${temp.dir}/record.log" action="stop" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
        <echo message="something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
        <hlm:record name="${temp.dir}/record.log" action="start" append="true" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
        <echo message="something else to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
        <hlm:record name="${temp.dir}/record.log" action="stop" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    81
        <echo message="something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
        <loadfile property="message" srcFile="${temp.dir}/record.log" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
        <au:assertTrue message="message not recorded">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
            <contains string="${message}" substring="something to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    87
        <au:assertTrue message="second message not recorded">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
            <contains string="${message}" substring="something else to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
    <target name="antcall-record">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    93
        <hlm:record name="${temp.dir}/record.log" action="start" append="true" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
        <echo message="${message}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    95
        <hlm:record name="${temp.dir}/record.log" action="stop" />        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    97
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
    <target name="test-recorder-append-antcall">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    99
        <echo message="Antcall: something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   100
        <antcall target="antcall-record">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   101
            <param name="message" value="something to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   102
        </antcall>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   103
        <echo message="Antcall: something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
        <antcall target="antcall-record">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   105
            <param name="message" value="something else to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
        </antcall>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
        <echo message="Antcall: something to be not be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   108
 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
        <loadfile property="message" srcFile="${temp.dir}/record.log" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   110
        <echo>${message}</echo>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
        <au:assertTrue message="Antcall: message not recorded">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
            <contains string="${message}" substring="something to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   113
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   114
        <au:assertTrue message="Antcall: second message not recorded">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   115
            <contains string="${message}" substring="something else to be recorded" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   117
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   118
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   119
    <target name="test-recorder-filtering">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   120
        <hlm:record name="${temp.dir}/record.log" action="start" >
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   121
            <hlm:recordfilter category="unix" regexp="badtext" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   122
        </hlm:record>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   123
        <echo>Some sensitive test output badtext</echo>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   124
        <hlm:record name="${temp.dir}/record.log" action="stop"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   125
        <loadfile srcfile="${temp.dir}/record.log" property="message"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   126
        <au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   127
            <contains string="${message}" substring="Some sensitive test output ********"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   128
        </au:assertTrue>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   129
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   130
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   131
</project>