Quizzes Index
By Vincent Massol April 2004
Test your JUnit knowledge with this quiz which is based on all chapters of the book, JUnit in Action; the majority of questions are focused on chapter 7. If you don't know the answer, take your best guess.
testProcessRequestException()
testProcessRequestWhenNoMatchingHandlerFound()
handleNoMatchingHandlerWhenCallingProcessRequest()
setup()
assertNotNull("The response cannot be null", response);
assertNotNull(response);
if (response == null) { throw newException("The response cannot be null"); }
public void testErrorCase() throws Exception { methodToTest(); // Asserts here }
public void testErrorCase() { try { methodToTest(); } catch (Exception expected) { // Asserts here } }
public void testErrorCase() { try { methodToTest(); fail("Should not reach this point"); } catch (Exception expected) { // Asserts here } }