简体   繁体   English

如何在 Hybris 中通过 ant 只运行一种测试方法

[英]How to run only one test method via ant in Hybris

I have test class MyTest :我有测试类MyTest

package com.my.package;
...
@IntegrationTest
public class MyTest extends ServicelayerTest {
    @Test
    public myTest1() {...}

    @Test
    public myTest2() {...}
}

I only need to run the myTest1() test via ant.我只需要通过 ant 运行myTest1()测试。

To run all integration tests from the class, I can use要运行类中的所有集成测试,我可以使用

ant integrationtests -Dtestclasses.packages='com.my.package.MyTest'

How to run only one myTest1() ?如何只运行一个myTest1() Maybe I can use something like也许我可以用类似的东西

ant integrationtests -Dtestclasses.packages='com.my.package.MyTest#myTest1()' ? ant integrationtests -Dtestclasses.packages='com.my.package.MyTest#myTest1()'

There is no filter that lets you run JUnit by method name.没有允许您通过方法名称运行 JUnit 的过滤器。

Check the Filters documentation on what is supported: https://help.sap.com/docs/SAP_COMMERCE/d0224eca81e249cb821f2cdf45a82ace/f7f454a4f5254944a366db9bdf129be6.html检查有关支持内容的过滤器文档: https ://help.sap.com/docs/SAP_COMMERCE/d0224eca81e249cb821f2cdf45a82ace/f7f454a4f5254944a366db9bdf129be6.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM