コード例 #1
0
 public void testSetInvalidPropertyException() {
   boolean caughtException = false;
   try {
     validator.setProperty("thisIsAnInvalidProperty", "thisIsAnInvalidValue");
   } catch (PropertyException e) {
     caughtException = true;
   } catch (Exception e) {
   }
   assertTrue("JAXBValidator did not throw PropertyException as expected.", caughtException);
 }
コード例 #2
0
 public void testSetNullPropertyException() {
   boolean caughtException = false;
   try {
     validator.setProperty(null, null);
   } catch (IllegalArgumentException e) {
     caughtException = true;
   } catch (Exception e) {
   }
   assertTrue(
       "JAXBValidator did not throw IllegalArgumentException as expected.", caughtException);
 }