Tom Jordahl wrote: > I know this test is painful to some people (Sorry Glyn!), but I believe it is >important to have a .NET web service (and WSDL) in the test suite. In this case, >however, I though that 1) perfectxml was a stable site/company and 2) that it would >come back up in a day (or 2 at the most). I guess I was wrong, so I support >excluding the test for now. > > If I was more ant-savvy, I would like this test to fail gracefully - i.e. WSDL2Java >would ignore the connection failures and the Java test files for the WSDL in question >would be excluded from the build if WSDL2Java failed. Anyone want to volunteer to >attempt this? Is it possible given our current framework? > > Glen had the good idea of separating out all interop tests that go out of machine in >to another target. > > Has anyone heard from Berin, who originally provided us with the WSDL test harness?
I'm still around. Our small company had a scare, and I lost my backing, so I had to scale back what I was involved with. Since we currently use Avalon framework and Cocoon in our products, that is what I am actively supporting (more Avalon right now). As to making some tests optional, what we do in Avalon land is use some magic properties (i.e. "test.profile" or something like that). That way, we exclude costly tests that are designed to give an idea of scalability or efficiency rather than correctness. In the <junit> section, we add the unless="test.profile" to the class entry, and all operates nicely. For correctness testing we type: ant all check For robustness testing we type: ant -Dtest.profile=true all check And for running a simple subset we have a different target so we can type something like this: ant -Djunit.test=**/package/test/*TestCase.class test-subset (Runs all the test cases in the "package" hierarchy) This arrangements work quite well. Here is a snippet from the Avalon Excalibur build.xml file: ------------------------------------------------------------------ <target name="check" depends="compile-tests" description="perform unit tests"> <mkdir dir="${build.testdocs}"/> <mkdir dir="${build.reports}"/> <echo message="Performing Unit Tests" /> <junit fork="true" printsummary="yes" dir="${build.reports}"> <formatter type="xml"/> <!-- xml reports for junitreport --> <formatter type="plain"/> <!-- text reports for humans --> <sysproperty key="test.jdbc.driver" value="${test.jdbc.driver}"/> <sysproperty key="test.jdbc.url" value="${test.jdbc.url}"/> <sysproperty key="test.jdbc.user" value="${test.jdbc.user}"/> <sysproperty key="test.jdbc.password" value="${test.jdbc.password}"/> <classpath> <path refid="test.class.path"/> <pathelement location="${build.testclasses}"/> </classpath> <batchtest todir="${build.reports}"> <fileset dir="${build.testclasses}"> <include name="**/test/*TestCase.class"/> <exclude name="**/test/Abstract*TestCase.class"/> <exclude name="**/test/*PerformanceTestCase.class" unless="test.profile"/> <exclude name="**/test/*Profile.class" unless="test.profile"/> <!-- **** Excalibur tests **** --> <!-- Jdbc based tests --> <exclude name="**/*JdbcTestCase.class" unless="test.jdbc"/> <!-- Slow tests only run when test.all property set --> <exclude name="org/apache/avalon/excalibur/naming/rmi/test/RMIContextTestCase.class" unless="test.all"/> <exclude name="org/apache/avalon/excalibur/logger/test/LogKitManagementTestCase.class" unless="test.all"/> <exclude name="org/apache/avalon/excalibur/concurrent/test/ReadWriteLockTestCase.class" unless="test.all"/> <exclude name="org/apache/avalon/excalibur/monitor/test/MonitorTestCase.class" unless="test.all"/> <!-- **** Scratchpad tests **** --> <!-- Slow tests only run when test.all property set --> <exclude name="org/apache/avalon/excalibur/pool/test/*Multithread*TestCase.class" unless="test.all"/> </fileset> </batchtest> </junit> <junitreport todir="${build.reports}"> <fileset dir="${build.reports}"> <include name="TEST-*.xml"/> </fileset> <report format="frames" todir="${build.testdocs}"/> </junitreport> <!-- Clean up the xml reports used by the junitreport task --> <delete> <fileset dir="${build.reports}" includes="TEST-*.xml"/> <fileset dir="${build.reports}" includes="TESTS-*.xml"/> </delete> </target> <target name="test-all-prep"> <property name="test.all" value="true"/> </target> <target name="test-all" depends="test-all-prep, check"/> <!-- Run a subset of the tests --> <target name="test-subset-check" unless="junit.test"> <fail message="junit.test not specified. Example usage: build -Djunit.test=**/ResourceLimiting*TestCase.class test-subset" /> </target> <target name="test-subset" depends="test-subset-check, compile-tests" description="perferm a subset of unit tests"> <mkdir dir="${build.reports}"/> <junit fork="true" printsummary="yes" dir="${build.reports}"> <formatter type="plain"/> <!-- text reports for humans --> <sysproperty key="test.jdbc.driver" value="${test.jdbc.driver}"/> <sysproperty key="test.jdbc.url" value="${test.jdbc.url}"/> <sysproperty key="test.jdbc.user" value="${test.jdbc.user}"/> <sysproperty key="test.jdbc.password" value="${test.jdbc.password}"/> <classpath> <path refid="test.class.path"/> <pathelement location="${build.testclasses}"/> </classpath> <batchtest todir="${build.reports}"> <fileset dir="${build.testclasses}"> <include name="${junit.test}"/> </fileset> </batchtest> </junit> </target> -- "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin