Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipse-dev] change in junit plugin

What I've been doing at work when grandfathering in junit tests is something
like the following (I don't have the code with me, but here's the idea):

public class MyTestCase extends TestCase
{
  ...
  public void testSomething()
  {
     assertTrue("this test needs to be implemented",
                !Boolean.getBoolean("FAIL_ON_JUNIT_TBD"),
  }
}

This allows you to put the skeletons in place for all existing methods, and
still have a successful test run, while at the same time, giving you a way
to turn on a check to see which tests haven't really been implemented.

At work, I'm working on an Eclipse plugin to generate test case methods as
well, based on some patterns on method names, arguments, interface testing,
and so on. Don't know when we'll be done though...

REQEUST: It would be great if the Junit runner plugin had a checkbox
somewhere to set a system property like this before running tests...

-- Scott

==============================================================
Scott Stanchfield    scott@xxxxxxxxxxxx    http://javadude.com

Lead author of "Effective VisualAge for Java, Version 3"
                                      http://javadude.com/evaj

VisualAge for Java Tips and Tricks     http://javadude.com/vaj
Visit for Java Enlightenment!             http://www.jguru.com
==============================================================

> -----Original Message-----
> From: eclipse-dev-admin@xxxxxxxxxxx
> [mailto:eclipse-dev-admin@xxxxxxxxxxx]On Behalf Of Matt Munz
> Sent: Thursday, October 17, 2002 9:13 AM
> To: eclipse-dev@xxxxxxxxxxx
> Subject: RE: [eclipse-dev] change in junit plugin
>
>
> Emerson,
>
>   There us an easy way to do this.  When writing a test, do the following.
>
> ...
> public class MyTestCase extends TestCase
> {
>   ...
>   public void testSomething()
>   {
>      fail("this test needs to be implemented");
>   }
> }
>
>   - Matt
>
> -----Original Message-----
> From: eclipse-dev-admin@xxxxxxxxxxx
> [mailto:eclipse-dev-admin@xxxxxxxxxxx]On Behalf Of Emerson Cargnin -
> SICREDI Serviços
> Sent: Wednesday, October 16, 2002 5:32 PM
> To: eclipse-dev@xxxxxxxxxxx
> Subject: [eclipse-dev] change in junit plugin
>
>
> What about change the way junit test cases are created?
> the problem is that it creates one test for each method of the chosen
> class and the methods are empty. When the tests are executed, even for
> not implemented yet methods it gives success. It could be insert a :
>
> <code>throw new Exception ("Test not implemented yet ");</code>
>
> This way the tests not implemented will be visible to the tests results.
>
>
>
> --
> xxxxxxxxxxxxxxxxxxxxxxxxxxxx
> | Emerson Cargnin          |
> | Analista de Sistemas Sr. |
> | Tel : (051) 3358-4959    |
> | SICREDI Serviços         |
> | Porto Alegre - Brasil    |
> |xxxxxxxxxxxxxxxxxxxxxxxxxx|
>
>
> _______________________________________________
> eclipse-dev mailing list
> eclipse-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/eclipse-dev
>
> _______________________________________________
> eclipse-dev mailing list
> eclipse-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/eclipse-dev
>




Back to the top