문제

I am integrating an external junit.framework.TestSuite into my library which is built using Maven and JUnit4. The typical tests, if not all of them, are kicked off using JUnit4 annotations. How do I incorporate a junit.framework.TestSuite into this existing test codebase?

Here's what I have tried so far:

public class JSR330Tck {
    @Test
    public junit.framework.Test suite(){
        Car car = Factories.get(CarFactory.class).buildCar();
        return Tck.testsFor(car, false, true);
    }
}

Or by defining it with a static suite() method:

public class JSR330Tck {
    public static junit.framework.Test suite(){
        Car car = Factories.get(CarFactory.class).buildCar();
        return Tck.testsFor(car, false, true);
    }
}

Both of these are not triggered via the Maven surefire plugin.

도움이 되었습니까?

해결책

I would assume that your test classes are not named based on the naming convention for test in relationship with maven-surefire-plugin

includes>
 <include>**/*Test*.java</include>
 <include>**/*Test.java</include>
 <include>**/*TestCase.java</include>
</includes>

Apart from that you shouldn't use TestSuites, cause surefire-plugin will handle that already. So usually there is no need to suites to be defined separately.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top