Re: JUnit Newbie trouble
- From: Hunter Gratzner <a24900@xxxxxxxxxxxxxx>
- Date: Mon, 29 Oct 2007 23:24:21 -0000
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.
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.
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: news
- Re: JUnit Newbie trouble
- References:
- JUnit Newbie trouble
- From: Are Nybakk
- JUnit Newbie trouble
- Prev by Date: Re: Importing javax.faces.context.FacesContext for Glassfish
- Next by Date: Re: On a certain denizen
- Previous by thread: JUnit Newbie trouble
- Next by thread: Re: JUnit Newbie trouble
- Index(es):
Relevant Pages
|
|