ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Artima SuiteRunner Task
Date Wed, 26 Mar 2003 17:17:35 GMT
I don't buy that. If your exception doesn't contain enough info, then modify
the exception. I never trap exception in Unit tests, unless I'm expecting it
to be thrown and fail() if it doesn't.

As far as running one of more tests, I use a
-Dtestcase=com/acme/SomeTest.class, and testcases defaultsto
**/test/*Test.class if not explicitly specified.

Like I said, I'm still trying to understand what SuiteRunner brings to the
table... I even prefer the distinction between Failures and Errors... With
JUnit 3.8.1, I even write test cases with just test methods and nothing else
(if one doesn't use setUp/tearDown).

I looked at SuiteRunner because of the talk about Conformance/API testing,
and it doesn't bring anything above JUnit at all. Like I said, I'm still
waiting to be enlightened about SuiteRunner's cons ;-) --DD


-----Original Message-----
From: Nathaniel Spurling [mailto:nathaniel.spurling@db.com] 
Sent: Wednesday, March 26, 2003 11:08 AM
To: Ant Developers List
Subject: Re: Artima SuiteRunner Task


On Wednesday, March 26, 2003, at 11:46  AM, Nathaniel Spurling wrote:
   >
   > Regarding suiterunner vs JUnit, I prefer the suiterunner API:
   >
   >       test methods can throw Exceptions, also assertion failures
   > generate Exceptions so you can put one catch(Exception) at the bottom
   > of your method and print out any useful info before throwing the
   > exception on, rather than separate ones for AssertionFailedError and
   > Exception which looks very messy. Alternatively you can leave out the
   > try/catch altogether  - saves typing if you just want the stacktrace
   > -- I Don't find the failures/exceptions distinction useful in JUnit.

   I often simply have my JUnit testXXX throw Exception since that is
   unexpected and a test failure/error.  I don't quite get how SuiteRunner
   is different here.


say you've got a method which goes:

      testXXX() throws Exception{

            //generate random data

            try{
                  //do testing

            } catch(Exception e){
                  //print data used
                  throw e;
            }
      }

 in JUnit you need an extra catch(AssertionFailedError) clause in the event
of an assertion being untrue - not a big difference, but if all your tests
are the same format it's preferable.



--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org

Mime
View raw message