Use of @Ignore causes NoSuchMethodError at compile

26 views
Skip to first unread message

Barry Kaplan

unread,
Dec 17, 2009, 2:08:39 PM12/17/09
to Spock Framework
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
{ .. }

Peter Niederwieser

unread,
Dec 17, 2009, 6:26:04 PM12/17/09
to Spock Framework
Barry,

which versions of Spock and Groovy are you using?

Cheers,
Peter

Barry Kaplan

unread,
Dec 17, 2009, 8:38:53 PM12/17/09
to Spock Framework
Sorry,

groovy-1.7-beta2
spock 0.3

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

Barry Kaplan

unread,
Dec 17, 2009, 8:43:26 PM12/17/09
to Spock Framework
And I also just tried groovy-all-1.7-rc-2 -- same error

Barry Kaplan

unread,
Dec 17, 2009, 8:47:06 PM12/17/09
to Spock Framework
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.

Peter Niederwieser

unread,
Dec 17, 2009, 8:47:01 PM12/17/09
to spockfr...@googlegroups.com
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

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

Peter Niederwieser

unread,
Dec 17, 2009, 8:50:57 PM12/17/09
to spockfr...@googlegroups.com
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.
>

Barry Kaplan

unread,
Dec 17, 2009, 9:03:36 PM12/17/09
to Spock Framework
Not 0.4-S? There is a specific version for groovy 1.7?google.com/group/
spockframework?hl=en.

Barry Kaplan

unread,
Dec 17, 2009, 9:04:45 PM12/17/09
to Spock Framework
Ok, I see in the m2 repo. Thanks!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages