• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: JUnit testing outside Eclipse
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JUnit testing outside Eclipse


  • Subject: Re: JUnit testing outside Eclipse
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 6 Aug 2010 08:48:58 -0700

On Aug 6, 2010, at 4:08 AM, Paul Hoadley wrote:

> Hello,
>
> Having recently set up a Hudson build server, I am now trying to get some JUnit tests running as part of the build, and hence outside of Eclipse.  I have a test suite for a framework which I've previously run manually in Eclipse just fine, but it's evident that Eclipse is providing quite a bit of help with the classpath.  I'm about half way through manually tracking down all the locations of classes on which the test suite depends (javafoundation.jar, javaeoacess.jar, javaeocontrol.jar, log4j-1.2.14.jar...), and have almost got the tests running outside Eclipse.  Is this the only way to do it?  Or am I missing an easier way?

Yes?  Are you using the WO-fu of wopath?

        <!-- Non-source Classpath for project-->
        <wopath id="project.classpath">
       		<frameworks root="User"  eclipse="true" />
       		<frameworks root="Local"  eclipse="true" />
       		<frameworks root="System"  eclipse="true" />
                <path refid="project.jars" />  <!-- See below for example -->
	</wopath>


        <property name="ProjectJars" value="${the.basedir}${file.separator}ERJars${file.separator}Libraries" />
    	<path id="project.jars">
	    	<fileset dir="${ProjectJars}" includes="*.jar" />
    	</path>

And then (this is TestNG, but JUnit is very similar)

    <target name="unit.test" depends="init.all, set_framework_build_properties" if="has.unit.tests">

        <testng workingdir="${project.working.directory}"
                outputDir="${test.report.dir}/${database.type}"
                sourcedirref="${project.source.path}"
                haltOnfailure="false"
        	dumpCommand="true" parallel="false">

            <!-- Pass values to net.hhshoppers.hh.testng.EOTestSuite.java -->
            <jvmarg value="-DDBType=${database.type}" />
            <jvmarg value="-DJDBCUrl=${database.url}" />
            <jvmarg value="-DJDBCDriver=${database.driver}" />
            <jvmarg value="-DDBUserName=${database.userid}" />
            <jvmarg value="-DDBPassword=${database.password}" />

        	<!-- Enable coverage reporting if the classes are instrumented -->
        	<jvmarg value="-Demma.coverage.out.file=${emma.coverage.out.file}" />
        	<jvmarg value="-Demma.coverage.out.merge=${emma.coverage.out.merge}" />

            <!-- Make sure the tests run with enough memory -->
            <jvmarg value="-Xmx768m" />

            <classpath refid="project.classpath"/>
            <classpath>
                <fileset dir="${project.java.dir}" includes="**/*.jar" />
            </classpath>
            <xmlfileset dir="Testing/" includes="${unit.test.suite}"/>
        </testng>
    </target>


--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: JUnit testing outside Eclipse
      • From: Paul Hoadley <email@hidden>
References: 
 >JUnit testing outside Eclipse (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: two different databases at same time?
  • Next by Date: Re: [ANN] Safari Extension 0.88
  • Previous by thread: JUnit testing outside Eclipse
  • Next by thread: Re: JUnit testing outside Eclipse
  • Index(es):
    • Date
    • Thread