Invoking test from Runner Class

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

Invoking test from Runner Class

Rahul Sharma
Is it possible to invoke Spoke test from Runner class rather than executing from any build tool like Gradle or Maven?
I have a requirement of getting this test executed from main() method instead of running some thing like "gradle test".
Please share some examples too.

Regards,
Rahul

--
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Invoking test from Runner Class

Kostis Kapelonis
Hello

Maybe you are lucky and if you invoke manually the JUnit runner it
will work as well.
http://junit.sourceforge.net/doc/faq/faq.htm#running_4
Have you tried something similar and it didn't work?

Of course a better way would be to read the source code of Maven
Surefire (or Gradle) and find out what they do (porting
the respective code to your main method)

One would have to ask why would you want to do this?
The canonical way of running tests is via your build system.

Unless you are writing a build system yourself. In that case looking
at existing code (Gradle/Maven) is your best bet.

Kostis

On Sat, Oct 24, 2015 at 6:36 AM, Rahul Sharma <[hidden email]> wrote:

> Is it possible to invoke Spoke test from Runner class rather than executing
> from any build tool like Gradle or Maven?
> I have a requirement of getting this test executed from main() method
> instead of running some thing like "gradle test".
> Please share some examples too.
>
> Regards,
> Rahul
>
> --
> 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.

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