English 中文(简体)
在使用ant子时仅援引检测器中的必要测试
原标题:invoking only the required test in testng file while using ant

我正试图对ant子的试射。

我的考验是:

<suite name="testsuite">
   bunch of parameters here
   <test name="test1">
   </test>

   <test name="test2">
   </test>
</suite>

现在,我只想进行“试验1”测试,而不是“试验2”测试。 是否有办法(参数?)来说明ant的造物。

<testng classpathref="testng.class.path" delegateCommandSystemProperties="true" 
            outputDir="${test-output}" haltOnfailure="false" useDefaultListeners="true" 
            parallel="methods"
            failureproperty="test.failure">
            <xmlfileset file="testng.xml"/>
            <!--forked JVM OOM issue-->
            <jvmarg value="-Xmx512M"/>
            <jvmarg value="-Xms512M"/>
            <jvmarg value="-Xmn192M"/>
            <jvmarg value="-XX:PermSize=128M"/>
            <jvmarg value="-XX:MaxPermSize=128M"/>

        </testng>
问题回答

查阅-testnames in the documentation (note: plural)。

Xml文档是:没有从含有测试的一类档案中进行所有测试。 正如我所看到的那样,打算走的道路是改变现有的xml文档,或建立新的档案。

然而,如果将你的测试列入不同的类别档案(我无法从你的榜样守则中看到这一点),那么你可以具体说明一个类别档案,而不是一个Xmlfileset,例如:

<testng  workingDir="../../" outputdir="${output_dir}" 
                verbose="2" listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter"
                classpathref="testsClasspath">
                <classfileset dir="./${test_classes}/com/my/organization" includes="MyTest.class" />
            </testng>




相关问题
i want to continously run my java threads

I am running my java application where i have used threads... i am running this application using ant command on the terminal.. But when i close my terminal or press ctrl+c,then java program which was ...

Subant targets instead of ant

I m having a problem with subant and have no ideas any more. Can anyone help? Using Ant to replace some strings for other (i.e Productname and Version for "Foo" and "1.2") I used ...

java ant buildfile for project with dependencies

I am new to ant, but am trying to create an ant script that builds my current proeject with another project as a dependency. I have the ant script building my current project, but am unsure how to add ...

Building Apache Hive - impossible to resolve dependencies

I am trying out the Apache Hive as per http://wiki.apache.org/hadoop/Hive/GettingStarted and am getting this error from Ivy: Downloaded file size doesn t match expected Content Length for http://...

Ivy, ant and start scripts

I have a project that uses ant to build and ivy for dependencies. I would like to generate the start scripts for my project, with the classpath, based on the dependencies configured in Ivy, ...

热门标签