@org.junit.Test
annotation before the test method.You can run your testing class by invoking main method from JUnitCore like this:
java org.junit.runner.JUnitCore TestClass1 TestClass2 ...
If you expect certain Exception have to thrown by a JUnit test method, you can annotate the method like this:
@Test(expected = IndexOutOfBoundsException.class) public void empty() {
new ArrayList<object>().get(0);
}
No comments:
Post a Comment