Re: JUnit Newbie trouble



In article <1193738793.089724.117000@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, news@xxxxxxxxxxxxx wrote:
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?

No! You need a test class.

Eric
.



Relevant Pages

  • Re: JUnit Newbie trouble
    ... NetBeans doesn't support JUnit 4. ... Unit tests are not in the production code. ... a separate test class for your class. ...
    (comp.lang.java.help)
  • Re: JUnit Newbie trouble
    ... NetBeans doesn't support JUnit 4. ... Unit tests are not in the production code. ... your class in that separate test class. ...
    (comp.lang.java.help)
  • Re: JUnit Newbie trouble
    ... I've made a new project using NetBeans and have added the latest ... JUnit library for compiling and testing. ... a unit test class needs no main. ... int a = 5; ...
    (comp.lang.java.help)
  • Need Help
    ... I have created Servlets and need to do Unit tests Using JUnit Please ... anyone kindly help me how to use it.I have created servlets in NetBeans ...
    (comp.lang.java.softwaretools)
  • The real advantage of unit testing?
    ... While the interview itself sort of bored me I did pick up a ... Netbeans has supported junit from the moment I started using it. ... using this framework. ... doing unit tests I'd also tell them no. ...
    (comp.lang.java.advocacy)