1

我已经配置了 maven-failsafe-plugin 以排除/包括一些测试类别:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.18.1</version>
        <configuration>
            <groups>my.company.SomeImportantCategory</groups>
        </configuration>
    </plugin>
</plugins>

现在我有一个没有注释的参数化测试SomeImportantCategory

@RunWith(Parameterized.class)
@Category(AnotherCategory.class)
public class SomeTestIT {

    @Parameters(name = "{0}")
    public static Collection<TestData[]> setUp() throws Exception {
        // Loading Some Excel-Sheets. I'm using github.com/fhm84/jexunit
        return doSomethingVeryTimeConsuming("with/this/excel-file.xls");
    }
}

现在我使用这个配置文件运行集成测试。Maven 确实执行了 setUp-Method 来收集测试用例。

你知道如何跳过这个吗?我可以访问 setUp-Method 并执行一些 Java 魔术,例如读出包含/排除的组(如何?!?)并doSomethingVeryTimeConsuming使用反射跳过。

4

0 回答 0