蚂蚁排除文件 [英] ant excluding files

查看:23
本文介绍了蚂蚁排除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须为 Junit 报告编写一个蚂蚁目标.它是一个现有的应用程序.一些测试类文件被命名为 TestSample.java 或 SampleTest.java.但是有一些与junit测试用例无关的java文件被编写为HeaderTest.java,它没有扩展TestCase.

I have to write an ant target for Junit report. It is an existing application. Some of the Test class files are named as TestSample.java or SampleTest.java. But there are some few java files which are not to do anything with junit testcases are written HeaderTest.java which doesnt extending TestCase.

如何过滤这些 calss 文件?

How can i filter these calss files?

<junit printsummary="on" fork="off" haltonfailure="false" showoutput="true">
    <classpath>
        <path refid="CLASSPATH_JUNIT"/>             
    </classpath>            
    <batchtest fork="off"  todir="${BUILD_TEST_DIR}">
        <fileset dir="${TEST_CLASSES_DIR}">
            <include name="**/*Test.class" />
            <include name="**/Test*.class" />
        </fileset> 
    </batchtest>
    <formatter type="xml" />
</junit>

推荐答案

fileset 也有一个 exclude.

<exclude name="**/DoNotIncludeThisOne.class" />

这篇关于蚂蚁排除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆