[testng-dev] Making migration from JUnit to TestNG bit easier

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

[testng-dev] Making migration from JUnit to TestNG bit easier

Lukas Jungmann-3
Hi Cedric,

   I was thinking about making it easier for developers to switch from
JUnit to TestNG. At this point there's an eclipse plugin you're
maintaining but in my eyes it has some limitations - the bigest one is
that it is not that useful for big projects not developed in Eclipse.
   I tried to look at the migration itself from a different
perspective - TestNG allows one to run JUnit 3 tests, so why not to
try to extend it a bit to so it can recognize JUnit tests
automatically and run them if needed? I believe this could also help
TestNG adoption a lot.

  All one will have to do will be - for Ant based projects - replace
junit ant task with testng one and run it in new "mixed" mode - this
will tell it that it should try to find junit library on the
classpath, check passed in files whether there are any JUnit tests and
if so, then run them in junit mode (which has been extended to handle
also JUnit 4 tests).

  Also note that I don't plan to work on bringing particular TestNG
features to JUnit. Only on making it possible to run existing JUnit
tests through TestNG (if needed).

   I made all changes required for this to work in my forked
repository[1], created full diff between official TestNG repository
and my fork to make review easier[2] and created a wiki page
describing the motivation, particular commits etc[3]. I tested these
changes also on some existing modules from NetBeans codebase and with
my changes I'm able to successfully run them using TestNG (eventhough
they're mostly written in JUnit 3 format) without almost any migration
issues.

   I will be happy if you'd consider this contribution for inclusion
in the official TestNG distribution and definitely will appreciate any
feedback you may have on this (there's already pull request for
this[4]).

Thanks,

WBR,
--lukas

[1]: https://github.com/lukasj/testng/
[2]: http://wiki.netbeans.org/wiki/images/d/dc/Testng-6.4beta.diff.zip
[3]: http://wiki.netbeans.org/TestNG_MixedMode
[4]: https://github.com/cbeust/testng/pull/139

--
You received this message because you are subscribed to the Google Groups "testng-dev" 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/testng-dev?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [testng-dev] Making migration from JUnit to TestNG bit easier

Cédric Beust ♔-2
Hi Lukas,

Just wanted to send you a quick acknowledgment of your email: this looks some major work so I'd like to take some time to read your email and patch  fully before commenting further.

Thanks again for doing all this work!

-- 
Cédric




On Mon, Feb 6, 2012 at 11:33 AM, Lukas Jungmann <[hidden email]> wrote:
Hi Cedric,

  I was thinking about making it easier for developers to switch from
JUnit to TestNG. At this point there's an eclipse plugin you're
maintaining but in my eyes it has some limitations - the bigest one is
that it is not that useful for big projects not developed in Eclipse.
  I tried to look at the migration itself from a different
perspective - TestNG allows one to run JUnit 3 tests, so why not to
try to extend it a bit to so it can recognize JUnit tests
automatically and run them if needed? I believe this could also help
TestNG adoption a lot.

 All one will have to do will be - for Ant based projects - replace
junit ant task with testng one and run it in new "mixed" mode - this
will tell it that it should try to find junit library on the
classpath, check passed in files whether there are any JUnit tests and
if so, then run them in junit mode (which has been extended to handle
also JUnit 4 tests).

 Also note that I don't plan to work on bringing particular TestNG
features to JUnit. Only on making it possible to run existing JUnit
tests through TestNG (if needed).

  I made all changes required for this to work in my forked
repository[1], created full diff between official TestNG repository
and my fork to make review easier[2] and created a wiki page
describing the motivation, particular commits etc[3]. I tested these
changes also on some existing modules from NetBeans codebase and with
my changes I'm able to successfully run them using TestNG (eventhough
they're mostly written in JUnit 3 format) without almost any migration
issues.

  I will be happy if you'd consider this contribution for inclusion
in the official TestNG distribution and definitely will appreciate any
feedback you may have on this (there's already pull request for
this[4]).

Thanks,

WBR,
--lukas

[1]: https://github.com/lukasj/testng/
[2]: http://wiki.netbeans.org/wiki/images/d/dc/Testng-6.4beta.diff.zip
[3]: http://wiki.netbeans.org/TestNG_MixedMode
[4]: https://github.com/cbeust/testng/pull/139

--
You received this message because you are subscribed to the Google Groups "testng-dev" 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/testng-dev?hl=en.


--
You received this message because you are subscribed to the Google Groups "testng-dev" 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/testng-dev?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: [testng-dev] Making migration from JUnit to TestNG bit easier

Lukas Jungmann-3
Hi Cedric,

2012/2/6 Cédric Beust ♔ <[hidden email]>:
> Hi Lukas,
>
> Just wanted to send you a quick acknowledgment of your email: this looks
> some major work so I'd like to take some time to read your email and patch
>  fully before commenting further.

Thanks for letting me know. I've found one bug in my patch and that's
that public abstract class with suite method is not treated as JUnit
test - I already put this under known issues[1]. This shouldn't be
hard to fix :-)

I've also added a section about how -testclass and -methods options
translates to testng.xml[2] with my patch as this part may be
interesting to others as well.

Regards,
--lj

[1]: http://wiki.netbeans.org/wiki/index.php?title=TestNG_MixedMode&diff=51464&oldid=51463
[2]: http://wiki.netbeans.org/wiki/index.php?title=TestNG_MixedMode&diff=51463&oldid=51462

>
> Thanks again for doing all this work!
>
> --
> Cédric
>
>
>
>
> On Mon, Feb 6, 2012 at 11:33 AM, Lukas Jungmann <[hidden email]>
> wrote:
>>
>> Hi Cedric,
>>
>>   I was thinking about making it easier for developers to switch from
>> JUnit to TestNG. At this point there's an eclipse plugin you're
>> maintaining but in my eyes it has some limitations - the bigest one is
>> that it is not that useful for big projects not developed in Eclipse.
>>   I tried to look at the migration itself from a different
>> perspective - TestNG allows one to run JUnit 3 tests, so why not to
>> try to extend it a bit to so it can recognize JUnit tests
>> automatically and run them if needed? I believe this could also help
>> TestNG adoption a lot.
>>
>>  All one will have to do will be - for Ant based projects - replace
>> junit ant task with testng one and run it in new "mixed" mode - this
>> will tell it that it should try to find junit library on the
>> classpath, check passed in files whether there are any JUnit tests and
>> if so, then run them in junit mode (which has been extended to handle
>> also JUnit 4 tests).
>>
>>  Also note that I don't plan to work on bringing particular TestNG
>> features to JUnit. Only on making it possible to run existing JUnit
>> tests through TestNG (if needed).
>>
>>   I made all changes required for this to work in my forked
>> repository[1], created full diff between official TestNG repository
>> and my fork to make review easier[2] and created a wiki page
>> describing the motivation, particular commits etc[3]. I tested these
>> changes also on some existing modules from NetBeans codebase and with
>> my changes I'm able to successfully run them using TestNG (eventhough
>> they're mostly written in JUnit 3 format) without almost any migration
>> issues.
>>
>>   I will be happy if you'd consider this contribution for inclusion
>> in the official TestNG distribution and definitely will appreciate any
>> feedback you may have on this (there's already pull request for
>> this[4]).
>>
>> Thanks,
>>
>> WBR,
>> --lukas
>>
>> [1]: https://github.com/lukasj/testng/
>> [2]: http://wiki.netbeans.org/wiki/images/d/dc/Testng-6.4beta.diff.zip
>> [3]: http://wiki.netbeans.org/TestNG_MixedMode
>> [4]: https://github.com/cbeust/testng/pull/139
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "testng-dev" 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/testng-dev?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "testng-dev" 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/testng-dev?hl=en.

--
You received this message because you are subscribed to the Google Groups "testng-dev" 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/testng-dev?hl=en.