JUnit Tests w/ no Class to Test [message #146997] |
Tue, 02 March 2004 11:49  |
Eclipse User |
|
|
|
Originally posted by: geoffrobinson.yahoo.com
I was following a tutorial at http://www.onjava.com/lpt/a/4524, regarding
using JUnit with Eclipse. The article wants the creation of the test
before the class exists, according to XP practices. My version of Eclipse
won't allow that. That's fine, I can get around that easily.
Is this a new feature? Is this a desired feature?
regards,
Geoff
|
|
|
Re: JUnit Tests w/ no Class to Test [message #147314 is a reply to message #146997] |
Thu, 04 March 2004 11:56   |
Eclipse User |
|
|
|
Originally posted by: robwms63.yahoo.com
It will allow it. Just create a class and make it extend
junit.framework.TestCase. It won't create a stub for you because there
is nothing to base the stub on, that's all. Personally, I don't find the
stub generation to be that helpful anyway. One other way of working you
might consider is, if you are using interfaces, gen the interface,
create an implementer (it will put in the methods you have to provide),
then make the unit test from that stub. (That said, I personally don't
like the practice of having an interface for every single class.)
Geoff Robinson wrote:
> I was following a tutorial at http://www.onjava.com/lpt/a/4524, regarding
> using JUnit with Eclipse. The article wants the creation of the test
> before the class exists, according to XP practices. My version of Eclipse
> won't allow that. That's fine, I can get around that easily.
>
> Is this a new feature? Is this a desired feature?
>
> regards,
> Geoff
>
|
|
|
Re: JUnit Tests w/ no Class to Test [message #148269 is a reply to message #146997] |
Fri, 12 March 2004 04:23  |
Eclipse User |
|
|
|
Originally posted by: markus_keller.ch.ibm.spam.protect.com
The New Test Case wizard was broken in the last integration build
( see https://bugs.eclipse.org/bugs/show_bug.cgi?id=53500 ).
If you want to generate a TestCase on an non-existing class, just leave the
field "Class to test" empty. If that class is not there yet, the wizard
cannot possibly know what stubs to generate.
Markus
P.S. Saying "In I200403xx" instead of "My version" is always informative;-)
Geoff Robinson wrote:
> I was following a tutorial at http://www.onjava.com/lpt/a/4524, regarding
> using JUnit with Eclipse. The article wants the creation of the test
> before the class exists, according to XP practices. My version of Eclipse
> won't allow that. That's fine, I can get around that easily.
>
> Is this a new feature? Is this a desired feature?
>
> regards,
> Geoff
>
|
|
|
Powered by
FUDForum. Page generated in 0.05143 seconds