fix ant build bug: single test case run was executing ALL defined test cases, not just the nominated slick

cusax-fix
Brian Burch 17 years ago
parent fe51cbaf69
commit bb205673aa

@ -47,9 +47,6 @@
<isset property="label"/> <isset property="label"/>
</condition> </condition>
<!-- load properties needed for running the automated tests (e.g. test.list)-->
<property file="${lib}/testing.properties"/>
<!-- The following file contains a list of protocol account initialization <!-- The following file contains a list of protocol account initialization
properties, such as SIP server addresses and usernames, ICQ uin-s and properties, such as SIP server addresses and usernames, ICQ uin-s and
passwords, AIM screennames and etc. The file should not be committed passwords, AIM screennames and etc. The file should not be committed
@ -428,7 +425,7 @@
<!--PREPARE-TESTS--> <!--PREPARE-TESTS-->
<target name="identify-test"> <target name="identify-test">
<!--internal-target- identify Service Impl Compatibility Kits to run --> <!--internal-target- is a single slick defined to be run alone? -->
<condition property="test.name.known"> <condition property="test.name.known">
<!-- has a single test class has been defined? --> <!-- has a single test class has been defined? -->
<!-- e.g. ant test -Dtest.name=SlickName --> <!-- e.g. ant test -Dtest.name=SlickName -->
@ -436,28 +433,38 @@
</condition> </condition>
</target> </target>
<target name="prepare-single-test" depends="identify-test" <target name="prepare-single-test"
depends="identify-test"
if="test.name.known"> if="test.name.known">
<!--internal-target- prepare to run a single Service Impl Compatibility Kit --> <!--internal-target- prepare to run a single Service Impl Compatibility Kit -->
<!-- extract the simple Test class name. --> <!-- extract the simple Test class name...
<basename property="simple.test.names" file="${test.name}"/> Command prompt ant calls should define the property as the
<echo message="single test prepared: ${simple.test.names}" /> simple name (without the package hierarchy),
</target> e.g. -Dtest.name=GibberishProtocolProviderServiceLick
netbeans must format the property using the relative-path-noext
<!--internal-target- prepare to run all known Service Impl Compatibility Kit --> rule so that we can extract the simple name. The Felix
<!-- assign all known Test classes. --> slick runner ONLY works with unqualified class names. -->
<target name="prepare-all-tests" depends="identify-test" <basename property="short.test.name" file="${test.name}"/>
unless="test.name.known" <!-- Tell the slick runner which Test class to run. (This will prevent
description="prepares to run all known Service Impl Compatibility Kits"> the default external list from being defined.) -->
<!-- load Test classes from a test conf file. --> <property name="net.java.sip.communicator.slick.runner.TEST_LIST"
<!-- this would set the "simple.test.names" property --> value="${short.test.name}"/>
<property name="simple.test.names" value="${test.list}"/> </target>
<target name="prepare-all-tests"
depends="clean-test-reports,prepare-single-test">
<!--internal-target- prepare to run all selected Service Impl Compatibility Kits -->
<!-- load properties needed for running any/all automated tests.
n.b. the local file will select what is meant on this system by
"all tests" UNLESS a single test has already been selected. (This
is because ant will not replace a property value once set.) -->
<property file="${lib}/testing.properties"/>
<echo message="tests prepared: ${net.java.sip.communicator.slick.runner.TEST_LIST}" />
</target> </target>
<!--RUN-TESTS--> <!--RUN-TESTS-->
<target name="test" <target name="test"
depends="prepare-single-test,prepare-all-tests,clean-test-reports, depends="prepare-all-tests,-deploy-os-specific-bundles"
-deploy-os-specific-bundles"
description="Starts felix and runs selected Service Impl Compatibility Kits."> description="Starts felix and runs selected Service Impl Compatibility Kits.">
<!-- Do the testing itself. Note that we don't fail on error as we need <!-- Do the testing itself. Note that we don't fail on error as we need
@ -468,18 +475,24 @@
resultproperty="test.result.code" resultproperty="test.result.code"
classpathref="project.class.path"> classpathref="project.class.path">
<!-- The following two configure felix telling it that it's running <!-- Tell felix to run as a test environment-->
as a test environment-->
<sysproperty key="felix.config.properties" <sysproperty key="felix.config.properties"
value="file:${lib}/felix.unit.test.properties"/> value="file:${lib}/felix.unit.test.properties"/>
<!-- Tell the slick runner where to store test results. --> <!-- Tell the slick runner where to store test results. -->
<sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR" <sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR"
value="${test.reports.dir}"/> value="${test.reports.dir}"/>
<!-- Tell the slick runner about TestSutes we've preregistered. --> <!-- Tell the slick runner which Test classes to run. -->
<sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST" <sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
value="${simple.test.names}"/> 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 --> <!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file" <sysproperty key="java.util.logging.config.file"

Loading…
Cancel
Save