You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris Hilton <ch...@alterpoint.com> on 2006/08/01 21:29:15 UTC

RE: [M2] Surefire POJO / Inner class issue

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: Russ.Tremain@Sun.COM [mailto:Russ.Tremain@Sun.COM] 
> 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
> 
> (russ.tremain@sun.com)
> 
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: [M2] Surefire POJO / Inner class issue

Posted by Denis Cabasson <de...@insee.fr>.
Guess this issue is related to:
http://jira.codehaus.org/browse/SUREFIRE-44

You can just vote for it, or better, find a way to fix it, if you feel like
it :)

Denis.


Chris Hilton-2 wrote:
> 
> 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: Russ.Tremain@Sun.COM [mailto:Russ.Tremain@Sun.COM] 
>> 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
>> 
>> (russ.tremain@sun.com)
>> 
>> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-M2---Surefire-POJO---Inner-class-issue-tf1945806.html#a5609134
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org