How to migrate or convert a JUnit/JMock test cases into Spock test cases without manual coding.?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to migrate or convert a JUnit/JMock test cases into Spock test cases without manual coding.?

Mahendra Kumar
In our project we have around 13,000 JUnit/JMock test cases. Now we are planning to convert all of them into Spock Test cases. We are looking for the approach or a tool where we can convert the JUnit/JMock test cases to Spock test cases automatically to avoid the manual effort and time lag as the test cases count is 13,000.  Is there any tool or framework available to do this.? Could you please any one suggest me for my requirement. We are expecting  60-80% at least to convert the test cases by using any tool or framework, other part will take care by the manual effort(coding entire test cases in to Spock by analyzing existing JUnit/JMock test cases). 

Thanks in adv. 

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

Re: How to migrate or convert a JUnit/JMock test cases into Spock test cases without manual coding.?

Leonard Brünings
Hi,

I don't know of any framework that could do that. And even if you could convert those junit test to spock syntax they would not really be spock tests, since most likely they will not follow the Spock structure.
You can however use Spock together with JUnit tests, and whenever you write a new one or refactor an existing one you can do it in Spock. This way you can gradually convert to Spock without the need to
invest a huge amount of time at the start.

On Tuesday, March 17, 2015 at 4:09:40 AM UTC+1, Mahendra Kumar wrote:
In our project we have around 13,000 JUnit/JMock test cases. Now we are planning to convert all of them into Spock Test cases. We are looking for the approach or a tool where we can convert the JUnit/JMock test cases to Spock test cases automatically to avoid the manual effort and time lag as the test cases count is 13,000.  Is there any tool or framework available to do this.? Could you please any one suggest me for my requirement. We are expecting  60-80% at least to convert the test cases by using any tool or framework, other part will take care by the manual effort(coding entire test cases in to Spock by analyzing existing JUnit/JMock test cases). 

Thanks in adv. 

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

Re: How to migrate or convert a JUnit/JMock test cases into Spock test cases without manual coding.?

rfletcher
In reply to this post by Mahendra Kumar
Spock tests will run happily alongside existing JUnit test cases. It seems to me a huge effort for very little gain to translate existing tests that are (presumably) working for you right now. There is nothing that can sensibly automate that.

On Monday, March 16, 2015 at 8:09:40 PM UTC-7, Mahendra Kumar wrote:
In our project we have around 13,000 JUnit/JMock test cases. Now we are planning to convert all of them into Spock Test cases. We are looking for the approach or a tool where we can convert the JUnit/JMock test cases to Spock test cases automatically to avoid the manual effort and time lag as the test cases count is 13,000.  Is there any tool or framework available to do this.? Could you please any one suggest me for my requirement. We are expecting  60-80% at least to convert the test cases by using any tool or framework, other part will take care by the manual effort(coding entire test cases in to Spock by analyzing existing JUnit/JMock test cases). 

Thanks in adv. 

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

Re: How to migrate or convert a JUnit/JMock test cases into Spock test cases without manual coding.?

Łukasz Opaluch
I know that this is pretty old thread, but I hope someone finds this useful: I have created small Java tool which migrates Junit/Mockito based tests into Spock specs.
You can find it on Github.


W dniu środa, 25 marca 2015 00:45:45 UTC+1 użytkownik [hidden email] napisał:
Spock tests will run happily alongside existing JUnit test cases. It seems to me a huge effort for very little gain to translate existing tests that are (presumably) working for you right now. There is nothing that can sensibly automate that.

On Monday, March 16, 2015 at 8:09:40 PM UTC-7, Mahendra Kumar wrote:
In our project we have around 13,000 JUnit/JMock test cases. Now we are planning to convert all of them into Spock Test cases. We are looking for the approach or a tool where we can convert the JUnit/JMock test cases to Spock test cases automatically to avoid the manual effort and time lag as the test cases count is 13,000.  Is there any tool or framework available to do this.? Could you please any one suggest me for my requirement. We are expecting  60-80% at least to convert the test cases by using any tool or framework, other part will take care by the manual effort(coding entire test cases in to Spock by analyzing existing JUnit/JMock test cases). 

Thanks in adv. 

--
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 https://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate or convert a JUnit/JMock test cases into Spock test cases without manual coding.?

Kostis Kapelonis
Very cool!

Thanks for sharing.

Have you used it in a production project? Or this is just a prototype?

Kostis

On Sun, May 14, 2017 at 12:52 PM, Łukasz Opaluch
<[hidden email]> wrote:

> I know that this is pretty old thread, but I hope someone finds this useful:
> I have created small Java tool which migrates Junit/Mockito based tests into
> Spock specs.
> You can find it on Github.
>
>
> W dniu środa, 25 marca 2015 00:45:45 UTC+1 użytkownik [hidden email]
> napisał:
>>
>> Spock tests will run happily alongside existing JUnit test cases. It seems
>> to me a huge effort for very little gain to translate existing tests that
>> are (presumably) working for you right now. There is nothing that can
>> sensibly automate that.
>>
>> On Monday, March 16, 2015 at 8:09:40 PM UTC-7, Mahendra Kumar wrote:
>>>
>>> In our project we have around 13,000 JUnit/JMock test cases. Now we are
>>> planning to convert all of them into Spock Test cases. We are looking for
>>> the approach or a tool where we can convert the JUnit/JMock test cases to
>>> Spock test cases automatically to avoid the manual effort and time lag as
>>> the test cases count is 13,000.  Is there any tool or framework available to
>>> do this.? Could you please any one suggest me for my requirement. We are
>>> expecting  60-80% at least to convert the test cases by using any tool or
>>> framework, other part will take care by the manual effort(coding entire test
>>> cases in to Spock by analyzing existing JUnit/JMock test cases).
>>>
>>> Thanks in adv.
>
> --
> 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 https://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 https://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate or convert a JUnit/JMock test cases into Spock test cases without manual coding.?

Łukasz Opaluch
I am quite sure that I've anserved this but somehow it has not been published. Anyway, I've used this tool on some random projects from github and on one medium size production project and it performed rather well. Still, I can think about many useful features that could be implemented to make migration even easier. I've published it to get some feedback how it could be improved further to hadle more use cases.

W dniu wtorek, 16 maja 2017 06:25:24 UTC+2 użytkownik Kostis Kapelonis napisał:
Very cool!

Thanks for sharing.

Have you used it in a production project? Or this is just a prototype?

Kostis

On Sun, May 14, 2017 at 12:52 PM, Łukasz Opaluch
<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JDDB68xNAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">opaluch...@...> wrote:

> I know that this is pretty old thread, but I hope someone finds this useful:
> I have created small Java tool which migrates Junit/Mockito based tests into
> Spock specs.
> You can find it on Github.
>
>
> W dniu środa, 25 marca 2015 00:45:45 UTC+1 użytkownik [hidden email]
> napisał:
>>
>> Spock tests will run happily alongside existing JUnit test cases. It seems
>> to me a huge effort for very little gain to translate existing tests that
>> are (presumably) working for you right now. There is nothing that can
>> sensibly automate that.
>>
>> On Monday, March 16, 2015 at 8:09:40 PM UTC-7, Mahendra Kumar wrote:
>>>
>>> In our project we have around 13,000 JUnit/JMock test cases. Now we are
>>> planning to convert all of them into Spock Test cases. We are looking for
>>> the approach or a tool where we can convert the JUnit/JMock test cases to
>>> Spock test cases automatically to avoid the manual effort and time lag as
>>> the test cases count is 13,000.  Is there any tool or framework available to
>>> do this.? Could you please any one suggest me for my requirement. We are
>>> expecting  60-80% at least to convert the test cases by using any tool or
>>> framework, other part will take care by the manual effort(coding entire test
>>> cases in to Spock by analyzing existing JUnit/JMock test cases).
>>>
>>> Thanks in adv.
>
> --
> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="JDDB68xNAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">spockframewor...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="JDDB68xNAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">spockfr...@googlegroups.com.
> Visit this group at <a href="https://groups.google.com/group/spockframework" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/spockframework&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/spockframework&#39;;return true;">https://groups.google.com/group/spockframework.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 https://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.