Running a specification as an Eclipse JUnit Plug-in Test ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running a specification as an Eclipse JUnit Plug-in Test ?

Thomas Elskens
Hello,

I'm trying out spock for the first time. In Eclipse, the tests I write work fine when I try to run them as normal JUnit test. 

However, when I try to run it as an Eclipse JUnit Plug-in test (and then Eclipse launches the test in a minimal OSGi application), the test fails with the error message "no runnable methods" (see attachment for the complete stack trace). 

Even the most simple specifications will fail in this case, for instance :

package internal

import spock.lang.Specification

class DomainManagerImplSpec extends Specification
{
def "null test"()
{
given:
List<Integer> aList 
when:
aList = null
then:
!aList
}
}


Any idea how to configure the Eclipse launch configuration to make plug-in tests work ... ?

Thanks in advance,

Thomas Elskens

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

spock_failure.PNG (24K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running a specification as an Eclipse JUnit Plug-in Test ?

Peter Niederwieser
Administrator
Sounds like `RemotePluginTestRunner` mistakenly runs the spec with JUnit’s default runner, ignoring the `@RunWith(Sputnik.class)` directive on the `Specification` base class. One thing you can try is to add the same annotation to your concrete test class. If that doesn’t help, perhaps ask on an Eclipse list or file a bug. (Even if custom runners weren't supported, at least an exception should be thrown.)

On 03 Apr 2015, at 15:42, Thomas Elskens <[hidden email]> wrote:

Hello,

I'm trying out spock for the first time. In Eclipse, the tests I write work fine when I try to run them as normal JUnit test. 

However, when I try to run it as an Eclipse JUnit Plug-in test (and then Eclipse launches the test in a minimal OSGi application), the test fails with the error message "no runnable methods" (see attachment for the complete stack trace). 

Even the most simple specifications will fail in this case, for instance :

package internal

import spock.lang.Specification

class DomainManagerImplSpec extends Specification
{
def "null test"()
{
given:
List<Integer> aList 
when:
aList = null
then:
!aList
}
}


Any idea how to configure the Eclipse launch configuration to make plug-in tests work ... ?

Thanks in advance,

Thomas Elskens

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
<spock_failure.PNG>

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Loading...