initial release of netbeans support for run and debug of a single test class

cusax-fix
Brian Burch 20 years ago
parent ea597f23fc
commit 2f27215559

@ -5,3 +5,4 @@ bin
sc-bundles
sip-communicator.utest.bin
test-reports
nbproject

@ -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>

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.ant.freeform</type>
<configuration>
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
<!--Do not use Project Properties customizer when editing this file manually.-->
<name>sip-communicator-1.0</name>
<properties/>
<folders>
<source-folder>
<label>src</label>
<type>java</type>
<location>src</location>
</source-folder>
<source-folder>
<label>test</label>
<type>java</type>
<location>test</location>
</source-folder>
</folders>
<ide-actions>
<action name="build">
<target>cc-buildloop</target>
</action>
<action name="clean">
<target>clean</target>
</action>
<action name="javadoc">
<target>javadoc</target>
</action>
<action name="run">
<target>bundle-slick-runner</target>
</action>
<action name="test">
<target>test</target>
</action>
<action name="rebuild">
<target>clean</target>
<target>cc-buildloop</target>
</action>
<action name="run.single">
<target>test</target>
<context>
<property>test.name</property>
<folder>test</folder>
<pattern>\.java$</pattern>
<format>relative-path</format>
<arity>
<one-file-only/>
</arity>
</context>
</action>
<action name="debug.single">
<target>debug-selected-file</target>
<context>
<property>test.name</property>
<folder>test</folder>
<pattern>\.java$</pattern>
<format>relative-path</format>
<arity>
<one-file-only/>
</arity>
</context>
</action>
</ide-actions>
<view>
<items>
<source-folder style="packages">
<label>src</label>
<location>src</location>
</source-folder>
<source-folder style="packages">
<label>test</label>
<location>test</location>
</source-folder>
<source-file>
<location>build.xml</location>
</source-file>
</items>
<context-menu>
<ide-action name="build"/>
<ide-action name="clean"/>
<ide-action name="javadoc"/>
<ide-action name="run"/>
<ide-action name="test"/>
<ide-action name="rebuild"/>
</context-menu>
</view>
<subprojects/>
</general-data>
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
<compilation-unit>
<package-root>src</package-root>
<source-level>1.4</source-level>
</compilation-unit>
<compilation-unit>
<package-root>test</package-root>
<unit-tests/>
<source-level>1.4</source-level>
</compilation-unit>
</java-data>
</configuration>
</project>
Loading…
Cancel
Save