You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@river.apache.org by Zsolt Kúti <la...@gmail.com> on 2010/11/13 14:29:08 UTC

Re: test framework migration

On Fri, 12 Nov 2010 13:16:58 -0500
"Christopher Dolan" <ch...@avid.com> wrote:

> One more thing: the annotations are named similarly, but they are NOT
> shared.  It's @org.testng.Test vs. @org.junit.Test, for example. The
> similarity makes it easier to change the source code via
> s/junit/testng/g but it's not zero-effort.
> Chris

A further thing I found useful: test methods can be
ordered/made dependent.

@Test
public void m1() {...}

@Test(dependsOnMethods="m1")
public void m2() {...}


Zsolt


Re: test framework migration

Posted by Zsolt Kúti <la...@gmail.com>.
On Mon, 15 Nov 2010 12:38:06 -0500
"Christopher Dolan" <ch...@avid.com> wrote:

> While useful, I recommend against that feature in general.
> Philosophically, it's bad practice to connect the unit tests -- they
> should be as simple as possible and stand alone.  Technologically,
> when the first test fails, then the second one fails with a really
> obscure error.  I can't remember the specifics, but it was bad enough
> to convince me to rewrite all of my "dependsOnMethod" tests.

I agree in general :-)
In some cases test setup can take long or a resource cannot be reused
quickly enough and (test) class level setup is in order. For the former
doing an exhaustive testing of database functionality can be an
example. I also had a case involving extended XML trees for which
initializations would have been cumbersome and would have made more
hardly followable code. (Admittedly it is still a trade-off considering
the brittleness you mention.) For the latter I have only a gut feeling
that some use of the resources by River might fall into that category.

Zsolt

Ps.: It should be noted that TestNG runs test cases parallely by
default.

RE: test framework migration

Posted by Christopher Dolan <ch...@avid.com>.
While useful, I recommend against that feature in general.  Philosophically, it's bad practice to connect the unit tests -- they should be as simple as possible and stand alone.  Technologically, when the first test fails, then the second one fails with a really obscure error.  I can't remember the specifics, but it was bad enough to convince me to rewrite all of my "dependsOnMethod" tests.

Chris

-----Original Message-----
From: Zsolt Kúti [mailto:la.tinca@gmail.com] 
Sent: Saturday, November 13, 2010 7:29 AM
To: river-dev@incubator.apache.org
Subject: Re: test framework migration

On Fri, 12 Nov 2010 13:16:58 -0500
"Christopher Dolan" <ch...@avid.com> wrote:

> One more thing: the annotations are named similarly, but they are NOT
> shared.  It's @org.testng.Test vs. @org.junit.Test, for example. The
> similarity makes it easier to change the source code via
> s/junit/testng/g but it's not zero-effort.
> Chris

A further thing I found useful: test methods can be
ordered/made dependent.

@Test
public void m1() {...}

@Test(dependsOnMethods="m1")
public void m2() {...}


Zsolt