2 Replies Latest reply on Jan 8, 2009 8:27 AM by David Pegram

    No tests found during Maven build

    David Pegram Newbie

      Greetings,

      I suspect this is probably a project/Maven module configuration issue. Here's the error I get when I run the maven build.

      -------------------------------------------------------------------------------
      Test set: org.someorg.someapp.LoginTest
      -------------------------------------------------------------------------------
      Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
      warning(junit.framework.TestSuite$1) Time elapsed: 0.016 sec <<< FAILURE!
      junit.framework.AssertionFailedError: No tests found in org.someorg.someapp.LoginTest
       at junit.framework.Assert.fail(Assert.java:47)
       at junit.framework.TestSuite$1.runTest(TestSuite.java:97)
       at junit.framework.TestCase.runBare(TestCase.java:134)
       at junit.framework.TestResult$1.protect(TestResult.java:110)
       at junit.framework.TestResult.runProtected(TestResult.java:128)
       at junit.framework.TestResult.run(TestResult.java:113)
       at junit.framework.TestCase.run(TestCase.java:124)
       at junit.framework.TestSuite.runTest(TestSuite.java:232)
       at junit.framework.TestSuite.run(TestSuite.java:227)
       at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
       at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
       at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
       at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
       at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
       at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
      


      Here's an overview of the Maven modules.

      SomeAppParent

      SomeAppEjb

      SomeAppWeb - the WAR

      SomeAppEar - plain vanilla EAR based on WAR in Web module

      SomeAppWebTest - WAR with regular Web overlay; basically just contains the web.xml changes and cactus-report.xsl

      SomeAppTestEar - EAR built using the WebTest WAR

      SomeAppWebTestRunner - deploys TestEar to container and runs LoginTest during the integration phase; LoginTest is part of this module/project.




      I admit the various modules are a bit much. This was done to prevent packaging the web.xml changes with the "regular" EAR. Maybe ther's a better way?

      Can someone tell me if my test class is in the right place (under the WebTestRunner)?

      Thanks!