开发者

ant junit batchtest from a jar

开发者 https://www.devze.com 2023-03-18 16:57 出处:网络
I\'d like to use ant (post 1.7) to run all tests in classes named *Test.class in a certain jar. Something like the following (although it doesn\'t actually run any tests):

I'd like to use ant (post 1.7) to run all tests in classes named *Test.class in a certain jar.

Something like the following (although it doesn't actually run any tests):

    <junit fork="yes" printsummary="on" haltonfailure="on">
        <formatter type="xml"/>
        <batchtest fork="yes" todir="${junit.output.dir}">
            <resources>
               <zipentry zipfile="tests-only.jar" name="**/*Test.class"/>
            </resources> 
        </batchtest>            
        <classpath refid="testsplus.classpath"/>
    </junit>

What is the correct syntax for the resources/zipentry part?

The ant docs say:

batchtest collects the included resources from any number of nested Resource Collections. It then generates a test class name for each resource that ends in .java or .class.

Any type of Resource Collection is s开发者_如何学Cupported as a nested element, prior to Ant 1.7 only <fileset> has been supported.


Instead of zipentry you can probably use the zipfileset datatype:

<zipfileset src="tests-only.jar" includes="**/*Test.class"/>
0

精彩评论

暂无评论...
验证码 换一张
取 消