2 Replies Latest reply on Jan 8, 2009 8:27 AM by david.pegram

    No tests found during Maven build

    david.pegram

      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!


        • 1. Re: No tests found during Maven build
          ssilvert

          Right now I don't have a good solution for testing an EAR from Maven but it's something I need to work on soon. You can look at the JSFUnit examples and see how I've built the Seam EAR files for JSFUnit.

          Also, you might want to look at what Wolfgang has done with JSR-88 deployments and Eclipse. See http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148144

          I think you are doing everything "right" except that your test classes need to end up in the WAR because they will be run inside the container. I think if you search around on the web you will find others who have the same problem running Cactus tests (which is what JSFUnit is) on an EAR. There are various solutions people have come up with. Please let me know if you find a good one.

          Today, for EARs, I deploy and then run JSFUnit tests through the browser.

          Stan

          • 2. Re: No tests found during Maven build
            david.pegram

            OK, thanks Stan!

            I'll take a look at some of the references you've provided and let you know when I get it working.