Re: JUnit Newbie trouble
- From: news@xxxxxxxxxxxxx
- Date: Tue, 30 Oct 2007 03:06:33 -0700
On 30 Okt, 00:24, Hunter Gratzner <a24...@xxxxxxxxxxxxxx> wrote:
On Oct 29, 10:40 pm, Are Nybakk <n...@xxxxxxxxxxxxx> wrote:
Hi.
I havn't really been seriously into testing yet and therefore I was
looking into JUnit as it seems it is much used. Also version 4 uses
annotations which looked very much simpler than previous versions.
NetBeans doesn't support JUnit 4. Run your JUnit 4 tests as a normal
application, run them outside of the IDE, or use the supported Junit
3.
I have tested it with NetBeans 6, which supposedly, supports JUnit 4.
The JUnit 4.1 library is included in the IDE. The code I wrote gave no
result there either.
As a side question, how is this testing usually performed? Is it common
to add testing from the very beginning
Yes. Before you write the code you write the unit test.
and are they left in the code
after the tests has been conducted?
Unit tests are not in the production code. Unit tests are right from
the beginning supposed to be in own, separate classes.
I thought the thing about JUnit 4 was that one doesn't have to make a
separate test class?
Open a class in NetBeans. Press Shift-Ctrl-U. See how NetBeans creates
a separate test class for your class. Implement the unit tests for
your class in that separate test class.
It's clutter in a sense I guess, but
on the other hand it could become quite a lot to remove?
Unit tests are not removed, because they are not in the production
code. They are in separate classes which one usually doesn't ship.
.
- Follow-Ups:
- Re: JUnit Newbie trouble
- From: EricF
- Re: JUnit Newbie trouble
- References:
- JUnit Newbie trouble
- From: Are Nybakk
- Re: JUnit Newbie trouble
- From: Hunter Gratzner
- JUnit Newbie trouble
- Prev by Date: Re: Importing javax.faces.context.FacesContext for Glassfish
- Next by Date: Re: JUnit Newbie trouble
- Previous by thread: Re: JUnit Newbie trouble
- Next by thread: Re: JUnit Newbie trouble
- Index(es):
Relevant Pages
|
|