aboutsummaryrefslogtreecommitdiffstats
path: root/nbproject/ide-file-targets.xml
blob: 7f325d2a694589c38cb701c748023d9e5b352aa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by Brian Burch on October 8, 2008
     Netbeans debug targets are now held in this file.
    -->
<project basedir=".." name="SIP Communicator-IDE">

    <import file="../build.xml"/>

    <target name="debug-selected-file-in-test"
            depends="prepare-local-accounts,prepare-all-tests,deploy-os-specific-bundles"
            description="Starts felix and debugs the selected Service Impl Compatibility Kit" >
        <!-- This target runs felix under the debugger, but it can only work with
             unit test classes that extend TestSuite and implements BundleActivator
             e.g. GibberishProtocolProviderServiceLick -->

        <!-- if 'test.name' property is not defined, we will be
             runing all tests defined in testing.properties. -->

        <!-- we allow users to pass command line args using the "args" system
             property. However we need to manually set tha prop to an empty
             string here or otherwise the application would get an argument with
             the value ${args}-->
        <property name="args" value=""/>

        <nbjpdastart name="${short.test.name}"
                     addressproperty="jpda.address"
                     transport="dt_socket" >
            <classpath refid="debug.class.path" />
            <sourcepath refid="project.source.path" />
        </nbjpdastart>

        <!-- fork=true no longer prevents debug break points latching... -->
        <java fork="true"
              classname="org.apache.felix.main.Main"
              resultproperty="test.result.code"
              failonerror="true" >

            <classpath refid="debug.class.path"/>
            <jvmarg value="-Xdebug"/>
            <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>

            <!-- Tell felix to run as a test environment-->
            <sysproperty key="felix.config.properties"
                         value="file:${lib}/felix.unit.test.properties"/>

            <!-- Tell the slick runner where to store test results. -->
            <sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR"
                         value="${test.reports.dir}"/>

            <!-- Tell the slick runner which Test classes to run. -->
            <sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
                         value="${net.java.sip.communicator.slick.runner.TEST_LIST}"/>

            <!-- use a meta contact list file different to normal client. -->
            <sysproperty key="net.java.sip.communicator.CONTACTLIST_FILE_NAME"
                         value="net.java.sip.communicator.CONTACTLIST_FILE_NAME"/>
            <!-- use a configuration file different to normal client. -->
            <sysproperty key="net.java.sip.communicator.CONFIGURATION_FILE_NAME"
                         value="net.java.sip.communicator.CONFIGURATION_FILE_NAME"/>

            <!-- Tell java.util.logging about our logging preferences -->
            <sysproperty key="java.util.logging.config.file"
                value="${lib}/logging.properties"/>

            <!-- Tell all protocol testers their account details. -->
            <syspropertyset id="accounts">
              <propertyref prefix="accounts"/>
              <propertyref prefix="net"/>
            </syspropertyset>

            <sysproperty key="java.net.preferIPv6Addresses"
                value="false"/>
        </java>

        <!-- Generate the html junit report.
             Run it quietly (i.e. redirect the output) because we don't won't to
             see its "Build Successful" output line as users might confuse it
             for a general build success while this might not be the case.-->
        <echo message="Generating single test report ..."/>
        <java fork="true"
              classname="org.apache.tools.ant.launch.Launcher"
              classpath="${java.class.path}:${lib.noinst}/xalan-2.6.0.jar.ant"
              failonerror="true"
              output="${test.html.reports.dir}/output.txt">
            <arg value="htmlreport"/>
        </java>
        <echo message="Done."/>
        <echo/><echo/>
        <echo message="Test results available in ./test-reports/html/index.html "/>
        <echo/>

        <!-- Check whether testing went alright and fail if not.-->
        <condition property="testing.failed">
          <not>
            <equals arg1="0"
            arg2="${test.result.code}"
            casesensitive="false" trim="true"/>
          </not>
        </condition>
        <fail if="testing.failed"/>
    </target>

</project>