How to run single Spock Test method with maven?

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

How to run single Spock Test method with maven?

Bill Chen

It is described in maven document that it can run a specific method in a single test class with the form:

mvn -Dtest=TestCircle#mytest test

As you know, the methods in spock are define in String way like "my test ", So it doesn't work when I run like this:

mvn -Dtest=TestCircle#"my test" test

Reference: http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

Any suggestions on this?
Thanks!
//Bill

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/pyL_ztn0p04J.
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
|  
Report Content as Inappropriate

Re: How to run single Spock Test method with maven?

Peter Niederwieser
Administrator
I didn't know that Maven allows to execute single test methods. Have you tried:

mvn -Dtest="TestCircle#my test" test

Cheers,
Peter

On Jan 10, 2013, at 9:49 AM, Bill Chen <[hidden email]> wrote:

It is described in maven document that it can run a specific method in a single test class with the form:

mvn -Dtest=TestCircle#mytest test

As you know, the methods in spock are define in String way like "my test ", So it doesn't work when I run like this:

mvn -Dtest=TestCircle#"my test" test

Reference: http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

Any suggestions on this?
Thanks!
//Bill


--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/pyL_ztn0p04J.
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 - User" 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
|  
Report Content as Inappropriate

Re: How to run single Spock Test method with maven?

Luke Daley-2
Windows: mvn -Dtest="TestCircle#my test" test
*Nix: mvn "-Dtest=TestCircle#my test" test

On 10/01/2013, at 11:45 AM, Peter Niederwieser wrote:

> I didn't know that Maven allows to execute single test methods. Have you tried:
>
> mvn -Dtest="TestCircle#my test" test
>
> Cheers,
> Peter
>
> On Jan 10, 2013, at 9:49 AM, Bill Chen <[hidden email]> wrote:
>
>> It is described in maven document that it can run a specific method in a single test class with the form:
>>
>> mvn -Dtest=TestCircle#mytest test
>> As you know, the methods in spock are define in String way like "my test ", So it doesn't work when I run like this:
>>
>> mvn -Dtest=TestCircle#"my test" test
>> Reference: http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
>>
>> Any suggestions on this?
>> Thanks!
>> //Bill
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
>> To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/pyL_ztn0p04J.
>> 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 - User" 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 - User" 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
|  
Report Content as Inappropriate

Re: How to run single Spock Test method with maven?

Roan O'Sullivan
Neither Windows nor *Nix options listed seem to work from OS X (Java 8, Maven 3.3.1, Groovy 2.3.4). Has anybody had success with this?

Interestingly, I am able to run a single Spock test from Intellij IDEA 14.1. But seems like they don't use maven under the hood. 

Roan

On Thursday, January 10, 2013 at 8:19:25 AM UTC-5, Luke Daley wrote:
Windows: mvn -Dtest="TestCircle#my test" test
*Nix: mvn "-Dtest=TestCircle#my test" test

On 10/01/2013, at 11:45 AM, Peter Niederwieser wrote:

> I didn't know that Maven allows to execute single test methods. Have you tried:
>
> mvn -Dtest="TestCircle#my test" test
>
> Cheers,
> Peter
>
> On Jan 10, 2013, at 9:49 AM, Bill Chen <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Lkzlk6VbrsAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">phon...@...> wrote:
>
>> It is described in maven document that it can run a specific method in a single test class with the form:
>>
>> mvn -Dtest=TestCircle#mytest test
>> As you know, the methods in spock are define in String way like "my test ", So it doesn't work when I run like this:
>>
>> mvn -Dtest=TestCircle#"my test" test
>> Reference: <a href="http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmaven.apache.org%2Fsurefire%2Fmaven-surefire-plugin%2Fexamples%2Fsingle-test.html\46sa\75D\46sntz\0751\46usg\75AFQjCNGm9HyxSNC2AlHHTad8vAoTE9IfLg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmaven.apache.org%2Fsurefire%2Fmaven-surefire-plugin%2Fexamples%2Fsingle-test.html\46sa\75D\46sntz\0751\46usg\75AFQjCNGm9HyxSNC2AlHHTad8vAoTE9IfLg';return true;">http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
>>
>> Any suggestions on this?
>> Thanks!
>> //Bill
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
>> To view this discussion on the web visit <a href="https://groups.google.com/d/msg/spockframework/-/pyL_ztn0p04J" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/msg/spockframework/-/pyL_ztn0p04J';return true;" onclick="this.href='https://groups.google.com/d/msg/spockframework/-/pyL_ztn0p04J';return true;">https://groups.google.com/d/msg/spockframework/-/pyL_ztn0p04J.
>> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Lkzlk6VbrsAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockfr...@googlegroups.com.
>> To unsubscribe from this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Lkzlk6VbrsAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockframewor...@googlegroups.com.
>> For more options, visit this group at <a href="http://groups.google.com/group/spockframework?hl=en" target="_blank" rel="nofollow" onmousedown="this.href='http://groups.google.com/group/spockframework?hl\75en';return true;" onclick="this.href='http://groups.google.com/group/spockframework?hl\75en';return true;">http://groups.google.com/group/spockframework?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Lkzlk6VbrsAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockfr...@googlegroups.com.
> To unsubscribe from this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Lkzlk6VbrsAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockframewor...@googlegroups.com.
> For more options, visit this group at <a href="http://groups.google.com/group/spockframework?hl=en" target="_blank" rel="nofollow" onmousedown="this.href='http://groups.google.com/group/spockframework?hl\75en';return true;" onclick="this.href='http://groups.google.com/group/spockframework?hl\75en';return true;">http://groups.google.com/group/spockframework?hl=en.

--
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...