Use of @Ignore causes NoSuchMethodError at compile

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Use of @Ignore causes NoSuchMethodError at compile

Barry Kaplan (2)
I have a base class for a specific kind of test. I would like make
that class abstract, but cannot due to a groovy bug (see comment). So
instead I tried to @Ignore (both junit's and spock's). But this causes
a compiler error.

So I'm left with a failing test, as this fixture has some expectations
on the concrete test class which fail.

-----
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
Error:java.lang.NoSuchMethodError:
org.codehaus.groovy.ast.ModuleNode.getImport(Ljava/lang/String;)Lorg/
codehaus/groovy/ast/ClassNode;
at org.spockframework.compiler.EarlyTransform.nameResolvesToType
(EarlyTransform.java:81)
at org.spockframework.compiler.EarlyTransform.hasSpecAnnotation
(EarlyTransform.java:64)
at
org.spockframework.compiler.EarlyTransform.moduleContainsClassWithSpecAnnotation
(EarlyTransform.java:52)
at org.spockframework.compiler.EarlyTransform.visit
(EarlyTransform.java:42)
at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call
(ASTTransformationVisitor.java:268)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits
(CompilationUnit.java:810)
at org.codehaus.groovy.control.CompilationUnit.compile
(CompilationUnit.java:470)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile
(GroovyCompilerWrapper.java:41)
at org.jetbrains.groovy.compiler.rt.GroovycRunner.main
(GroovycRunner.java:128)

-----
//BUG Can't define this as abstract because of a groovy bug:
http://jira.codehaus.org/browse/GROOVY-3318
// Can't ignore because then Spocks AST process fails.
@Ignore
/*abstract*/ class DroolsGroovyTestFixture extends Specification
{ .. }

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Use of @Ignore causes NoSuchMethodError at compile

Peter Niederwieser
Administrator
Barry,

which versions of Spock and Groovy are you using?

Cheers,
Peter

On Dec 17, 8:08 pm, Barry Kaplan <[hidden email]> wrote:

> I have a base class for a specific kind of test. I would like make
> that class abstract, but cannot due to a groovy bug (see comment). So
> instead I tried to @Ignore (both junit's and spock's). But this causes
> a compiler error.
>
> So I'm left with a failing test, as this fixture has some expectations
> on the concrete test class which fail.
>
> -----
> Information:Compilation completed with 1 error and 0 warnings
> Information:1 error
> Information:0 warnings
> Error:java.lang.NoSuchMethodError:
> org.codehaus.groovy.ast.ModuleNode.getImport(Ljava/lang/String;)Lorg/
> codehaus/groovy/ast/ClassNode;
> at org.spockframework.compiler.EarlyTransform.nameResolvesToType
> (EarlyTransform.java:81)
> at org.spockframework.compiler.EarlyTransform.hasSpecAnnotation
> (EarlyTransform.java:64)
> at
> org.spockframework.compiler.EarlyTransform.moduleContainsClassWithSpecAnnot ation
> (EarlyTransform.java:52)
> at org.spockframework.compiler.EarlyTransform.visit
> (EarlyTransform.java:42)
> at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call
> (ASTTransformationVisitor.java:268)
> at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits
> (CompilationUnit.java:810)
> at org.codehaus.groovy.control.CompilationUnit.compile
> (CompilationUnit.java:470)
> at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile
> (GroovyCompilerWrapper.java:41)
> at org.jetbrains.groovy.compiler.rt.GroovycRunner.main
> (GroovycRunner.java:128)
>
> -----
> //BUG Can't define this as abstract because of a groovy bug:http://jira.codehaus.org/browse/GROOVY-3318
> // Can't ignore because then Spocks AST process fails.
> @Ignore
> /*abstract*/ class DroolsGroovyTestFixture extends Specification
> { .. }

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Use of @Ignore causes NoSuchMethodError at compile

Barry Kaplan (2)
Sorry,

groovy-1.7-beta2
spock 0.3

It seems that I get this error for any annotation (eg, @Mixin)

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Use of @Ignore causes NoSuchMethodError at compile

Barry Kaplan (2)
And I also just tried groovy-all-1.7-rc-2 -- same error

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Use of @Ignore causes NoSuchMethodError at compile

Peter Niederwieser
Administrator
In reply to this post by Barry Kaplan (2)
Barry,

Spock 0.3 only works with Groovy 1.6. For 1.7 (preferably rc-2) you have to use spock-core-0.4-groovy-1.7-SNAPSHOT, which is available from http://m2repo.spockframework.org/snapshots. Spock 0.4 release will come in two flavors for Groovy 1.6 and 1.7, respectively.
Please let me know if this solves your problem.

Cheers,
Peter

On 18.12.2009, at 02:38, Barry Kaplan wrote:

> Sorry,
>
> groovy-1.7-beta2
> spock 0.3
>
> It seems that I get this error for any annotation (eg, @Mixin)
>
> --
>
> You received this message because you are subscribed to the Google Groups "Spock Framework" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.
>
>

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Use of @Ignore causes NoSuchMethodError at compile

Barry Kaplan (2)
In reply to this post by Barry Kaplan (2)
Ok, just upped to 0.4-snapshot and this issue seems to be resolved.
Don't know how I got so behind in versions. Sorry for the noise.

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Use of @Ignore causes NoSuchMethodError at compile

Peter Niederwieser
Administrator
Yeah, 0.4-SNAPSHOT is less likely to fail, but you should nevertheless use the version for Groovy 1.7.

On 18.12.2009, at 02:47, Barry Kaplan wrote:

> Ok, just upped to 0.4-snapshot and this issue seems to be resolved.
> Don't know how I got so behind in versions. Sorry for the noise.
>
> --
>
> You received this message because you are subscribed to the Google Groups "Spock Framework" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.
>
>

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Use of @Ignore causes NoSuchMethodError at compile

Barry Kaplan (2)
Not 0.4-S? There is a specific version for groovy 1.7?google.com/group/
spockframework?hl=en.

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Use of @Ignore causes NoSuchMethodError at compile

Barry Kaplan (2)
Ok, I see in the m2 repo. Thanks!

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Use of @Ignore causes NoSuchMethodError at compile

Barry Kaplan (2)
In reply to this post by Barry Kaplan (2)
Ok, I see the 1.7 version in the m2 repo. Thanks!

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.