JUnit Newbie trouble



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.

Anyhow, I've made a new project using NetBeans and have added the latest JUnit library (version 4.4) for compiling and testing. The examples I've seen seems very simple however this simple test give me no output, selecting "Test Project" from the right-click menu. The only thing shown in the "JUnit Test Results" window is "JUnit results root node" under statistics. I hope someone can enlighten me :) Code follows:


package junittest;

import org.junit.Test;
import static org.junit.Assert.*;

public class Main {

public Main() {
testmethod();
}

public static void main(String[] args) {
new Main();
}

@Test
private void testmethod() {
int a = 5;
int b = 3;
int c = a + b;
assertEquals("Number error",new Integer(9), new Integer(c));
}

}


As a side question, how is this testing usually performed? Is it common to add testing from the very beginning and are they left in the code after the tests has been conducted? It's clutter in a sense I guess, but on the other hand it could become quite a lot to remove?
.