Changeset 6850


Ignore:
Timestamp:
08/26/10 15:38:17 (9 years ago)
Author:
melissa
Message:

Initial version of data-driven JUnit tests, see #498.

'ant -Djunit.directory=/path/to/data/ test-all' should more or less work, but the tests, logging, and Ant targets still need quite a bit of polishing.

Location:
branches/junit-test-suite/components/test-suite
Files:
4 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • branches/junit-test-suite/components/test-suite/build.properties

    r6517 r6850  
    1414                           ${artifact.dir}/ome-io.jar:\ 
    1515                           ${lib.dir}/log4j-1.2.15.jar:\ 
    16                            ${lib.dir}/slf4j-api-1.5.10.jar:\ 
    17                            ${lib.dir}/testng-5.11-jdk15.jar 
     16                           ${lib.dir}/slf4j-api-1.5.10.jar 
    1817component.java-version   = 1.5 
    1918component.deprecation    = true 
     
    2524component.runtime-cp     = ${component.classpath} 
    2625 
    27 testng.memory            = 512m 
    28 reader-test.class        = loci/tests/testng/FormatReaderTestFactory.class 
    29 writer-test.class        = loci/tests/testng/FormatWriterTestFactory.class 
     26junit.memory            = 512m 
     27reader-test.class        = loci/tests/junit/FormatReaderTestFactory.class 
     28writer-test.class        = loci/tests/junit/FormatWriterTestFactory.class 
  • branches/junit-test-suite/components/test-suite/build.xml

    r6745 r6850  
    1313  <property file="build.properties"/> 
    1414 
    15   <target name="test-convert" depends="compile" 
    16     description="run automated tests on writers"> 
    17     <testng sourcedir="${dest.dir}" 
    18       annotations="Javadoc" groups="all" testname="Writer tests" 
    19       listener="loci.tests.testng.DotTestListener" 
    20       suitename="LOCI software test suite" 
    21       failureProperty="failedTest"> 
     15  <target name="test-all" depends="compile" 
     16    description="run all automated tests"> 
     17    <junit haltonfailure="true" printsummary="on" includeantruntime="false"> 
    2218      <classpath> 
     19        <pathelement location="${artifact.dir}/junit-4.8.2.jar"/> 
    2320        <pathelement location="${classes.dir}"/> 
    2421        <pathelement path="${component.classpath}"/> 
    2522      </classpath> 
    26       <classfileset file="${classes.dir}/${writer-test.class}"/> 
    27       <sysproperty key="testng.filename" value="${testng.filename}"/> 
    28       <sysproperty key="testng.directory" value="${testng.directory}"/> 
     23      <jvmarg value="-mx${junit.memory}"/> 
     24      <sysproperty key="junit.directory" value="${junit.directory}"/> 
    2925      <sysproperty key="lurawave.license" value="${lurawave.license}"/> 
    30       <jvmarg value="-mx${testng.memory}"/> 
    31     </testng> 
    32     <fail if="failedTest"/> 
    33   </target> 
    34  
    35   <target name="test-all" depends="compile" 
    36     description="run all automated tests"> 
    37     <testng sourcedir="${dest.dir}" 
    38       annotations="Javadoc" groups="all" testname="All tests" 
    39       listener="loci.tests.testng.DotTestListener" 
    40       suitename="LOCI software test suite" 
    41       failureProperty="failedTest"> 
    42       <classpath> 
    43         <pathelement location="${classes.dir}"/> 
    44         <pathelement path="${component.classpath}"/> 
    45       </classpath> 
    46       <classfileset file="${classes.dir}/${reader-test.class}"/> 
    47       <sysproperty key="testng.filename" value="${testng.filename}"/> 
    48       <sysproperty key="testng.directory" value="${testng.directory}"/> 
    49       <sysproperty key="testng.multiplier" value="${testng.multiplier}"/> 
    50       <sysproperty key="lurawave.license" value="${lurawave.license}"/> 
    51       <jvmarg value="-mx${testng.memory}"/> 
    52     </testng> 
    53     <fail if="failedTest"/> 
    54   </target> 
    55  
    56   <target name="test-config" depends="compile" 
    57     description="generate config files for automated test suite"> 
    58     <testng sourcedir="${dest.dir}" 
    59       annotations="Javadoc" groups="config" testname="Config generation" 
    60       listener="loci.tests.testng.DotTestListener" 
    61       suitename="LOCI software test suite" 
    62       failureProperty="failedTest"> 
    63       <classpath> 
    64         <pathelement location="${classes.dir}"/> 
    65         <pathelement path="${component.classpath}"/> 
    66       </classpath> 
    67       <classfileset file="${classes.dir}/${reader-test.class}"/> 
    68       <sysproperty key="testng.filename" value="${testng.filename}"/> 
    69       <sysproperty key="testng.directory" value="${testng.directory}"/> 
    70       <sysproperty key="testng.multiplier" value="${testng.multiplier}"/> 
    71       <sysproperty key="lurawave.license" value="${lurawave.license}"/> 
    72       <jvmarg value="-mx${testng.memory}"/> 
    73     </testng> 
    74     <fail if="failedTest"/> 
    75   </target> 
    76  
    77   <target name="test-fast" depends="compile" 
    78     description="run automated tests in group 'fast'"> 
    79     <testng sourcedir="${dest.dir}" 
    80       annotations="Javadoc" groups="fast" testname="Fast tests" 
    81       listener="loci.tests.testng.DotTestListener" 
    82       suitename="LOCI software test suite" 
    83       failureProperty="failedTest"> 
    84       <classpath> 
    85         <pathelement location="${classes.dir}"/> 
    86         <pathelement path="${component.classpath}"/> 
    87       </classpath> 
    88       <classfileset file="${classes.dir}/${reader-test.class}"/> 
    89       <sysproperty key="testng.filename" value="${testng.filename}"/> 
    90       <sysproperty key="testng.directory" value="${testng.directory}"/> 
    91       <sysproperty key="testng.multiplier" value="${testng.multiplier}"/> 
    92       <sysproperty key="lurawave.license" value="${lurawave.license}"/> 
    93       <jvmarg value="-mx${testng.memory}"/> 
    94     </testng> 
    95     <fail if="failedTest"/> 
    96   </target> 
    97  
    98   <target name="test-pixels" depends="compile" 
    99     description="run automated tests in group 'pixels'"> 
    100     <testng sourcedir="${dest.dir}" 
    101       annotations="Javadoc" groups="pixels" testname="Pixels tests" 
    102       listener="loci.tests.testng.DotTestListener" 
    103       suitename="LOCI software test suite" 
    104       failureProperty="failedTest"> 
    105       <classpath> 
    106         <pathelement location="${classes.dir}"/> 
    107         <pathelement path="${component.classpath}"/> 
    108       </classpath> 
    109       <classfileset file="${classes.dir}/${reader-test.class}"/> 
    110       <sysproperty key="testng.filename" value="${testng.filename}"/> 
    111       <sysproperty key="testng.directory" value="${testng.directory}"/> 
    112       <sysproperty key="testng.multiplier" value="${testng.multiplier}"/> 
    113       <sysproperty key="lurawave.license" value="${lurawave.license}"/> 
    114       <jvmarg value="-mx${testng.memory}"/> 
    115     </testng> 
    116     <fail if="failedTest"/> 
    117   </target> 
    118  
    119   <target name="test-xml" depends="compile" 
    120     description="run automated tests in group 'xml'"> 
    121     <testng sourcedir="${dest.dir}" 
    122       annotations="Javadoc" groups="xml" testname="XML tests" 
    123       listener="loci.tests.testng.DotTestListener" 
    124       suitename="LOCI software test suite" 
    125       failureProperty="failedTest"> 
    126       <classpath> 
    127         <pathelement location="${classes.dir}"/> 
    128         <pathelement path="${component.classpath}"/> 
    129       </classpath> 
    130       <classfileset file="${classes.dir}/${reader-test.class}"/> 
    131       <sysproperty key="testng.filename" value="${testng.filename}"/> 
    132       <sysproperty key="testng.directory" value="${testng.directory}"/> 
    133       <sysproperty key="testng.multiplier" value="${testng.multiplier}"/> 
    134       <sysproperty key="lurawave.license" value="${lurawave.license}"/> 
    135       <jvmarg value="-mx${testng.memory}"/> 
    136     </testng> 
    137     <fail if="failedTest"/> 
    138   </target> 
    139  
    140   <target name="test-type" depends="compile" 
    141     description="run automated tests in group 'type'"> 
    142     <testng sourcedir="${dest.dir}" 
    143       annotations="Javadoc" groups="type" testname="Type tests" 
    144       listener="loci.tests.testng.DotTestListener" 
    145       suitename="LOCI software test suite" 
    146       failureProperty="failedTest"> 
    147       <classpath> 
    148         <pathelement location="${classes.dir}"/> 
    149         <pathelement path="${component.classpath}"/> 
    150       </classpath> 
    151       <classfileset file="${classes.dir}/${reader-test.class}"/> 
    152       <sysproperty key="testng.filename" value="${testng.filename}"/> 
    153       <sysproperty key="testng.directory" value="${testng.directory}"/> 
    154       <sysproperty key="testng.multiplier" value="${testng.multiplier}"/> 
    155       <sysproperty key="lurawave.license" value="${lurawave.license}"/> 
    156       <jvmarg value="-mx${testng.memory}"/> 
    157     </testng> 
    158     <fail if="failedTest"/> 
     26      <sysproperty key="junit.multiplier" value="${junit.multiplier}"/> 
     27      <formatter type="plain" usefile="true"/> 
     28      <batchtest> 
     29        <fileset dir="${classes.dir}"> 
     30          <include name="**/junit/*Test.class"/> 
     31        </fileset> 
     32      </batchtest> 
     33    </junit> 
    15934  </target> 
    16035 
Note: See TracChangeset for help on using the changeset viewer.