Differences between revisions 1 and 2
Revision 1 as of 2004-04-02 10:10:52
Size: 1440
Editor: cy114
Revision 2 as of 2009-09-20 23:16:46
Size: 1440
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Project and test cases classes should be placed in separate directories in your project main directory, for example build/classes and build/tests.In next step you should prepare block.xml file which has classloader with classpath entry pointing at build/classes directory.

<container name="my-container>

      <fileset dir="build/classes"/>


All required libraries should be placed on JUnit classpath, below you can find sample ant target.

<junit showoutput="true" fork="true" printsummary="yes" newenvironment="true">
  <sysproperty key="basedir" value="${basedir}"/>
    <pathelement path="${build.tests.dir}"/>
    <pathelement path="${build.classes.dir}"/>
    <path path="${libs.dir}/merlin-kernel-unit-3.2.5.jar"/>
    <path path="${libs.dir}/avalon-repository-main-1.2.jar"/>
    <path path="${libs.dir}/avalon-framework-api-4.1.5.jar"/>
    <path path="${libs.dir}/mrt-service-impl-0.1.jar"/>
    <path path="${libs.dir}/hibernate-2.1.2.jar"/>
  <batchtest fork="true" todir="${build.tests.dir}">
    <formatter type="xml"/>
    <fileset dir="${build.tests.dir}">
      <include name="com/mrt/vend/impl/tests/**"/> 

It's very important to run tests in separate VM (fork="true"), because only then we avoid use of ant's classloader.

AbstractMerlinTestCase (last edited 2009-09-20 23:16:46 by localhost)