I also ran into this issue and found this page with a workaround:

http://www.jroller.com/page/gridhaus?entry=maven2_testing_madness

Basically, just configure Surefire to exclude the problem classes, like
this worked for me:

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>
                <exclude>**/TestDevice.java</exclude>
          </excludes>
        </configuration>
      </plugin>

Chris

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, 27 July, 2006 11:49
> To: Maven Users List
> Subject: Re: [M2] Surefire POJO / Inner class issue
> 
> Hi Hal -
> 
> I'm running into a similar issue.. did you find a work-around?
> 
> thx,
> -Russ
> 
> ([EMAIL PROTECTED])
> 
> At 4:05 PM -0700 7/14/06, Hal Hildebrand wrote:
> >I'm running into a weird issue here.  It seems that the 
> Maven surefire 
> >plugin is trying to create POJO tests for inner classes 
> which clearly 
> >aren't tests.  I'm not even a surefire novice, so I'm not 
> sure why on 
> >earth this is happening - I'm just wondering how to stop it 
> from happening.
> >
> >Anyone have any clues as to how to escape this?
> >
> >[INFO] Surefire report directory:
> >/Users/hhildebrand/Projects/wadi/modules/core/target/surefire-reports
> >org.apache.maven.surefire.booter.SurefireExecutionException: 
> Unable to 
> >instantiate POJO 'class 
> >org.codehaus.wadi.sandbox.jcache.TestJCache$NoEvictionPolicy'
> ; nested 
> >exception is java.lang.InstantiationException:
> >org.codehaus.wadi.sandbox.jcache.TestJCache$NoEvictionPolicy; nested 
> >exception is 
> org.apache.maven.surefire.testset.TestSetFailedException:
> >Unable to instantiate POJO 'class
> >org.codehaus.wadi.sandbox.jcache.TestJCache$NoEvictionPolicy'
> ; nested 
> >exception is java.lang.InstantiationException:
> >org.codehaus.wadi.sandbox.jcache.TestJCache$NoEvictionPolicy
> >org.apache.maven.surefire.testset.TestSetFailedException: Unable to 
> >instantiate POJO 'class 
> >org.codehaus.wadi.sandbox.jcache.TestJCache$NoEvictionPolicy'
> ; nested 
> >exception is java.lang.InstantiationException:
> >org.codehaus.wadi.sandbox.jcache.TestJCache$NoEvictionPolicy
> >java.lang.InstantiationException:
> >org.codehaus.wadi.sandbox.jcache.TestJCache$NoEvictionPolicy
> >    at java.lang.Class.newInstance0(Class.java:335)
> >    at java.lang.Class.newInstance(Class.java:303)
> >    at
> >org.apache.maven.surefire.testset.PojoTestSet.<init>(PojoTest
> Set.java:52)
> >    at
> >org.apache.maven.surefire.junit.JUnitDirectoryTestSuite.creat
> eTestSet(J
> >UnitD
> >irectoryTestSuite.java:61)
> >    at
> >org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.lo
> cateTestSe
> >ts(Ab
> >stractDirectoryTestSuite.java:93)
> >    at
> >org.apache.maven.surefire.Surefire.createSuiteFromDefinition(
> Surefire.j
> >ava:1
> >47)
> >    at org.apache.maven.surefire.Surefire.run(Surefire.java:108)
> >    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >    at
> >sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
> sorImpl.ja
> >va:39
> >)
> >    at
> >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
> hodAccesso
> >rImpl
> >.java:25)
> >    at java.lang.reflect.Method.invoke(Method.java:585)
> >    at
> >org.apache.maven.surefire.booter.SurefireBooter.runSuitesInPr
> ocess(Sure
> >fireB
> >ooter.java:225)
> >    at
> >org.apache.maven.surefire.booter.SurefireBooter.main(Surefire
> Booter.jav
> >a:747)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to