[arquillian-issues] [JBoss JIRA] (ARQ-1481) Remove redundancy of both ArquillianSputnik and ArquillianSpecification

Karel Piwko (JIRA) jira-events at lists.jboss.org
Mon Sep 23 03:50:03 EDT 2013


    [ https://issues.jboss.org/browse/ARQ-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806332#comment-12806332 ] 

Karel Piwko commented on ARQ-1481:
----------------------------------

kpiwko: aslak: I'm still working on ArquillianInterceptor for Spock
kpiwko: I think I'm moving in loops. If I put hooks into interceptBeforeSpec() and interceptAfterSpec(), it does not help at all...the problem is that it's +1 and -1 operation, is outcome is always 0, when I'm checking whether I'm in first/last spec
aslak: ha.. of course
aslak: :)
aslak: but the extension has some other spec level doesn't it?
kpiwko: can you elaborate on that?
aslak: kpiwko where you register the Interceptor
kpiwko: in ArquillianSpockExtension
kpiwko: that's the top most object I can get to if I got @ArquillianSpecification way
kpiwko: s/got/go/
kpiwko: and it's created per spec
aslak: when you have a Global extension, you can check if any of the specs contain ArquillianSpecification right?
kpiwko: nope
aslak: ?
kpiwko: global extension has the same scope as annotationdriver extension
aslak: kpiwko what's wrong with this? https://github.com/arquillian/arquillian-testrunner-spock/blob/9749a337f0c04469dd601f16410802299d55e7d3/src/main/java/org/jboss/arquillian/framework/spock/ArquillianExtension.java
aslak: except it executes Arquillian 'always'
kpiwko: beforeSuite/afterSuite is the same as beforeClass/afterClass
aslak: sory, that's basically the same the current ArquillianExtension
aslak: https://github.com/arquillian/arquillian-testrunner-spock/blob/9749a337f0c04469dd601f16410802299d55e7d3/src/main/java/org/jboss/arquillian/framework/spock/ArquillianExtension.java
aslak: kpiwko right.. but if the Counter is +1'ed based on # of specs or something, pre calculated
kpiwko: aslak: right
kpiwko: aslak: but that's exactly the problematic part
kpiwko: you don't know how many specs will be executed
kpiwko: as extension is always fired to process the spec
aslak: mm.. so it's VisitSpec -> RunSpec -> VisitSpec -> RunSpec ?
kpiwko: yes
aslak: aa ic
kpiwko: aslak: http://spock-framework.3207229.n2.nabble.com/How-to-emulate-BeforeSuite-AfterSuite-with-Spock-td7573292.html#a7573295
aslak: then.. BeforeSuite on first spec with @ArquillianSpecification? or i guess it won't be called for non @ArquillianSpecification annotated classes.. then register a ShutdownHook for AfterSuite
kpiwko: aslak: that might work
kpiwko: yes
kpiwko: but I wanted to avoid shutdown hook
kpiwko: because I have no idea what happens if you start forking
aslak: forking what? vm pr test ?
kpiwko: for instance, if you don't fork with surefire, shutdown hook would be called after maven process is down, not after surefire is down, right?
aslak: aa, yea.. good point
kpiwko: so, the only solution I was able to work out was to c&p what's there for arquillian junit 
kpiwko: hook into testrunner creation
kpiwko: given that Sputnik is not really extensible easily, I had to recopy most of its code https://github.com/arquillian/arquillian-testrunner-spock/blob/master/core/src/main/java/org/jboss/arquillian/spock/ArquillianSputnik.java#L169
aslak: last i checked 'not forking' surefire was not an options as it cause dsome classloader issues.. but that's a different story
kpiwko: current master finally does what you'd expect
aslak: hmm
aslak: kpiwko no, then i don't know. i thought the visitSpec ones were all called before run
aslak: like in junit
aslak: my bad :)
kpiwko: unfortunately, they are not
                
> Remove redundancy of both ArquillianSputnik and ArquillianSpecification
> -----------------------------------------------------------------------
>
>                 Key: ARQ-1481
>                 URL: https://issues.jboss.org/browse/ARQ-1481
>             Project: Arquillian
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Spock TestRunner
>    Affects Versions: spock_1.0.0.Beta1
>            Reporter: Karel Piwko
>            Assignee: Karel Piwko
>
> It should be possible to remove @ArquillianSpecification, as it is redundant to @RunWith call.
> {code}
> @ArquillianSpecification
> @RunWith(ArquillianSputik)
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the arquillian-issues mailing list