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

<let's take this discussion over to jdt-ui-dev>

It is important that you can still see green even when a test isn't
implemented yet.
Scott's approach shows a good way to do so.

In fact there are many other ways to tag a test case that needs to be done.
This is one
reason why we don't want to prescribe a particular one. We are looking into
a more general
scheme to customize the stubs that are generated by JDT.

For example, in the 2.1 stream you can tag it with a //TODO comment
and you automatically get a task marker.

>REQEUST: It would be great if the Junit runner plugin had a checkbox
>somewhere to set a system property like this before running tests...
there is no check box currently, but you can set properties in the VM
arguments of the
JUnit launch config, e.g., -Dfail_on_tbd=true. So you can define two launch
configs one with
the property set and another without it.

--erich



                                                                                                                         
                      Scott Stanchfield                                                                                  
                      <scott@xxxxxxxxxxx         To:      eclipse-dev@xxxxxxxxxxx                                        
                      m>                         cc:                                                                     
                      Sent by:                   Subject: RE: [eclipse-dev] change in junit plugin                       
                      eclipse-dev-admin@                                                                                 
                      eclipse.org                                                                                        
                                                                                                                         
                                                                                                                         
                      10/17/2002 05:29                                                                                   
                      PM                                                                                                 
                      Please respond to                                                                                  
                      eclipse-dev                                                                                        
                                                                                                                         



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
>


_______________________________________________
eclipse-dev mailing list
eclipse-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/eclipse-dev





Back to the top