You are viewing a plain text version of this content. The canonical link for it is here.
Posted to surefire-users@maven.apache.org by Igor Petruk <Ig...@epam.com> on 2011/04/06 19:09:29 UTC

surefire-junit47 provider does not see my tests (while older one does but fails)

Hi.

I forced surefire provider in the following way

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.8</version>
                    <configuration>
                        <excludes>
                            <exclude>**/manual/**</exclude>
                        </excludes>
                    </configuration>
                      <dependencies>
                            <dependency>
                              <groupId>org.apache.maven.surefire</groupId>
                              <artifactId>surefire-junit47</artifactId>
                              <version>2.8</version>
                            </dependency>
                         </dependencies>
                </plugin>

When I run the tests it says "There are no tests to run". If I don't force the provider tests fail in a regular way with
 something like

java.lang.AbstractMethodError
    at org.springframework.test.context.TestContextManager.afterTestClass(TestContextManager.java:448)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:77)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)

reported to surefire-reports (not to console)

What could be the reason of a new provider not finding the test. I use Spring 3, JUnit 4.7

Thanks

RE: surefire-junit47 provider does not see my tests (while older one does but fails)

Posted by Igor Petruk <Ig...@epam.com>.
Now my config looks like this

                               <plugin>
                                       <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-surefire-plugin</artifactId>
                                        <version>2.8.1</version>
                                            <dependencies>
                                                  <dependency>
                                                        <groupId>org.apache.maven.surefire</groupId>
                                                        <artifactId>surefire-junit47</artifactId>
                                                        <version>2.8.1</version>
                                                  </dependency>
                                                </dependencies>

                                        <configuration>
                                                <includes>
                                                        <include>**/Test*.java</include>
                                                        <include>**/*Test.java</include>
                                                        <include>**/*TestCase.java</include>
                                                </includes>
                                <!--            <excludes>
                                                        <exclude>**/manual/**</exclude>
                                                </excludes>
-->
                                                <argLine>-Xmx1024m -XX:MaxPermSize=128m</argLine>
                                        </configuration>
                                </plugin>

You can see an obvious copy-paste of includes from what should be enabled by default in documentation. Still no good.

What I noticed from experimenting. I can make test run, but through "test" option and Spring's "@RunWith(SpringJUnit4ClassRunner.class)" should be removed. These are the only options to make tests run.