コード例 #1
0
 @Test
 public void cannotAddNullFormatAttribute() {
   try {
     Library.newBuilder().addFormatAttribute("foo", null);
     fail("No exception thrown!!");
   } catch (NullPointerException e) {
     assertEquals(e.getMessage(), BUNDLE.getKey("nullAttribute"));
   }
 }
コード例 #2
0
 @Test
 public void cannotRemoveFormatAttributeWithNullName() {
   try {
     Library.newBuilder().removeFormatAttribute(null);
     fail("No exception thrown!!");
   } catch (NullPointerException e) {
     assertEquals(e.getMessage(), BUNDLE.getKey("nullFormat"));
   }
 }
コード例 #3
0
 @Test
 public void cannotRemoveNullKeyword() {
   try {
     Library.newBuilder().removeKeyword(null);
     fail("No exception thrown!!");
   } catch (NullPointerException e) {
     assertEquals(e.getMessage(), BUNDLE.getKey("nullName"));
   }
 }