aboutsummaryrefslogtreecommitdiffstats
path: root/build.xml
diff options
context:
space:
mode:
authorBrian Burch <burchb@java.net>2005-11-29 18:32:43 +0000
committerBrian Burch <burchb@java.net>2005-11-29 18:32:43 +0000
commit2f272155597da41e70968a7de8fa888fef439f5b (patch)
treec253b45facbf768667f60c8e7566a16f4dc58e0e /build.xml
parentea597f23fcd1194d01e46a9d6280ec75777ed881 (diff)
downloadjitsi-2f272155597da41e70968a7de8fa888fef439f5b.zip
jitsi-2f272155597da41e70968a7de8fa888fef439f5b.tar.gz
jitsi-2f272155597da41e70968a7de8fa888fef439f5b.tar.bz2
initial release of netbeans support for run and debug of a single test class
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml105
1 files changed, 94 insertions, 11 deletions
diff --git a/build.xml b/build.xml
index 237e31e..30b4d02 100644
--- a/build.xml
+++ b/build.xml
@@ -57,6 +57,12 @@
</condition>
<!-- end jmf.home-->
+ <path id="project.source.path">
+ <!-- refer to both main and test source files. -->
+ <pathelement location="${src}"/>
+ <pathelement location="${src2}"/>
+ </path>
+
<path id="project.class.path">
<pathelement location="${dest}"/>
@@ -65,7 +71,7 @@
<include name="**/*.jar"/>
</fileset>
</path>
-
+
<!-- java compile -->
<target name="compile" depends="init"
description="Runs javac on the project source tree.">
@@ -181,9 +187,41 @@
</unjar>
</target>
+ <!--PREPARE-TESTS-->
+ <target name="identify-test"
+ description="identifies Service Impl Compatibility Kits to run">
+ <!-- has a single test class has been defined? -->
+ <condition property="test.name.known">
+ <isset property="test.name"/>
+ </condition>
+ </target>
+
+ <target name="prepare-single-test" depends="identify-test"
+ if="test.name.known"
+ description="prepares to run a single Service Impl Compatibility Kit">
+ <!-- extract the simple Test class name. -->
+ <basename property="simple.test.names"
+ file="${test.name}" suffix=".java"/>
+ </target>
+
+ <target name="prepare-all-tests" depends="identify-test"
+ unless="test.name.known"
+ description="prepares to run all known Service Impl Compatibility Kits">
+ <!-- assign all known Test classes. -->
+ <property name="simple.test.names"
+ value="
+ ConfigurationServiceLick
+ MediaServiceLick
+ NetworkAddressManagerServiceLick
+ ResourcesServicesLick
+ HistoryServiceLick
+ SlicklessTests
+ "/>
+ </target>
+
<!--RUN-TESTS-->
- <target name="test" depends="init"
- description="starts oscar and runs all Service Impl Compatibility Kits">
+ <target name="test" depends="init,prepare-single-test,prepare-all-tests"
+ description="starts oscar and runs selected Service Impl Compatibility Kits">
<java classname="org.ungoverned.oscar.Main"
fork="true"
@@ -201,14 +239,7 @@
<!-- Tell the slick runner about TestSutes we've preregistered. -->
<sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
- value="
- ConfigurationServiceLick
- MediaServiceLick
- NetworkAddressManagerServiceLick
- ResourcesServicesLick
- HistoryServiceLick
- SlicklessTests
- "/>
+ value="${simple.test.names}"/>
<!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file"
@@ -416,5 +447,57 @@ javax.swing.event, javax.swing.border"/>
prefix="net/java/sip/communicator/service/protocol/sip"/>
</jar>
</target>
+
+<!--NetBeans Targets for specific files selected via ide-actions -->
+
+ <!--netbeans only - debug a single test file under oscar and jUnit-->
+ <target name="debug-selected-file"
+ depends="init,init,prepare-single-test,prepare-all-tests"
+ description="starts oscar and runs selected Service Impl Compatibility Kit">
+
+ <fail unless="test.name"
+ message="debug impossible when 'test.name' property not defined!" />
+
+ <nbjpdastart name="${test.name}"
+ addressproperty="jpda.address"
+ transport="dt_socket" >
+ <classpath refid="project.class.path" />
+ <sourcepath refid="project.source.path" />
+ </nbjpdastart>
+
+ <java fork="true"
+ classname="org.ungoverned.oscar.Main"
+ classpathref="project.class.path"
+ failonerror="true" >
+ <jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xnoagent"/>
+ <jvmarg value="-Djava.compiler=none"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
+ <arg value="${test.name}"/>
+
+ <!-- The following two configure oscar telling it that it's running
+ as a test environment-->
+ <sysproperty key="oscar.config.properties"
+ value="file:./lib/oscar.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 class to run. -->
+ <sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
+ value="${simple.test.names}"/>
+
+ <!-- Tell the slick runner which Test class to run.
+ <sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
+ value="SlicklessTests"/> -->
+
+ <!-- Tell java.util.logging about our logging preferences -->
+ <sysproperty key="java.util.logging.config.file"
+ value="lib/logging.properties"/>
+
+ </java>
+ </target>
+
</project>