Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // I Junit 3:
- public void testMethod() {
- Exception e = null;
- try {
- doStuff();
- } catch (Exception e_) {
- e = e_;
- }
- assertNotNull(e);
- }
- // I JUnit 4:
- @Test(expected = SomeException.class)
- void testMethod() throws Exception {
- doStuff();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement