You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by Juan Pablo Santos Rodríguez <ju...@gmail.com> on 2017/12/30 12:03:44 UTC

heads up - really large commit incoming [migrating tests from JUnit 3 to JUnit 4]

Hi,

a quick heads up, I plan to push a really large commit between today /
tomorrow, to migrate all JUnit 3 tests to JUnit 4. As most of the job is
done with scripting + some regexs, the migration is going to be done in one
step; details on migration will go after pushing the commit. The reason
behind the change is that, on last commit, I noticed all *URLConstructor
tests are exactly the same, so it would be fine to have them grouped
through @Parameterized, to enforce same behaviour through all the
implementations (this could also be applied to other places where we have
several implementations for a given feature or, the other way round, to
have some contract/API tests, alongside the tests of the individual
implementations).


br,
juan pablo

Re: heads up - really large commit incoming [migrating tests from JUnit 3 to JUnit 4]

Posted by Juan Pablo Santos Rodríguez <ju...@gmail.com>.
Hi again,

just´ve uptaded the tests, the migration was done following these steps

* modified a little bit & run the script at
https://github.com/FranciscoBorges/junit3ToJunit4/blob/master/junit3ToJUnit4.zsh,
which did most of the initial work
* applied a bunch of regexes like find . -name "*Test.java" -exec sed -i
"s: assertTrue: Assert.assertTrue:g" {} \;
* typed some untyped collections / reformatted on some tests
* removed empty before/after methods
* manually upgraded Test Suites
 - on *Test, remove constructors expecting an String
 - on *Test, remove suite() methods
 - on *Tests, update Suites to JUnit 4 format
* removed other specific JUnit3 methods
* reorg'd imports

And now that all test are on JUnit 4, it would be also nice to have an
specific JUnit rule to handle the TestEngine setup and teardown.. patches
welcome O:-D

br,
juan pablo


On Sat, Dec 30, 2017 at 1:03 PM, Juan Pablo Santos Rodríguez <
juanpablo.santos@gmail.com> wrote:

> Hi,
>
> a quick heads up, I plan to push a really large commit between today /
> tomorrow, to migrate all JUnit 3 tests to JUnit 4. As most of the job is
> done with scripting + some regexs, the migration is going to be done in one
> step; details on migration will go after pushing the commit. The reason
> behind the change is that, on last commit, I noticed all *URLConstructor
> tests are exactly the same, so it would be fine to have them grouped
> through @Parameterized, to enforce same behaviour through all the
> implementations (this could also be applied to other places where we have
> several implementations for a given feature or, the other way round, to
> have some contract/API tests, alongside the tests of the individual
> implementations).
>
>
> br,
> juan pablo
>