[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-scm
Subject:    [groovy-scm] [jira] Commented: (GROOVY-3861) @Grab of spock library does not
From:       "Roshan Dawrani (JIRA)" <jira () codehaus ! org>
Date:       2009-10-31 11:53:55
Message-ID: 22613421.37.1256990035475.JavaMail.haus-jira () codehaus01 ! managed ! contegix ! com
[Download RAW message or body]


    [ http://jira.codehaus.org/browse/GROOVY-3861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=196752#action_196752 \
] 

Roshan Dawrani commented on GROOVY-3861:
----------------------------------------

I was trying a way to fix this issue but I have hit a little stumbling block. The \
issue is related to adding new phase operations in the list that is being iterated.

So Grab annotation gets processed in phase CONVERSION and spock has this transform \
called EarlyTransform, which is also to be added in the phase CONVERSION. 

Now the list that contains phase operations of CONVERSION is getting iterated when it \
calls GrabAnnotationTransformation, which then results in addition of new spock \
transform EarlyTransform to the same list causing ConcurrentModificationException.

Any suggestions there?

> @Grab of spock library does not work
> ------------------------------------
> 
> Key: GROOVY-3861
> URL: http://jira.codehaus.org/browse/GROOVY-3861
> Project: groovy
> Issue Type: Bug
> Affects Versions: 1.6.3
> Reporter: Roshan Dawrani
> 
> Try the following script in groovy console
> {code}
> import spock.lang.*
> @Grab(group='org.spockframework', module='spock-core', version='0.2')
> class HelloSpock extends Specification {
> def "can you figure out what I'm up to?"() {
> expect:
> name.size() == length
> where:
> ignored = println ("where: \n p0=$p0\n p1=$p1")
> name << ["Kirk", "Spock", "Scotty"]
> length << [4, 5, 6]
> }
> }
> {code}
> Output:
> {noformat}
> JUnit 4 Runner, Tests: 1, Failures: 1, Time: 0
> Test Failure: initializationError(HelloSpock)
> org.spockframework.runtime.InvalidSpeckError: Class 'HelloSpock' is not a Speck, or \
> has not been compiled properly  at \
> org.spockframework.runtime.SpeckInfoBuilder.getSpeckMetadata(SpeckInfoBuilder.java:66)
>   at org.spockframework.runtime.SpeckInfoBuilder.build(SpeckInfoBuilder.java:46)
> 	at spock.lang.Sputnik.<init>(Sputnik.java:38)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> ....
> {noformat}
> This is happening because spock works by ASTTransformation and before @Grab(spock) \
> has brought spock jar on groovy classpath, groovy does not see its AST transforms \
> and hence the class does not undergo spock related AST transformation and does not \
> run as a spock test. However, from the 2nd run onwards, it runs from the same \
> console because in the 2nd run, when groovy scans for AST transforms, it finds \
> spock jar also on the classpath and its AST transformation happens and the class \
> runs as a spock test.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: \
                http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
    <a href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic