< prev index next >

test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerExcpTest.java

Print this page




  88 
  89     /**
  90      * Spec says, "if the throwable was created with TransformerException(String,
  91      * Throwable), initCause should throw IllegalStateException
  92      */
  93     @Test(expectedExceptions = IllegalStateException.class)
  94     public void tfexception07() {
  95         TransformerException te = new TransformerException("MyMessage", new Throwable());
  96         te.initCause(null);
  97     }
  98 
  99     /**
 100      * Tests if initCause(null) is allowed in other case.
 101      */
 102     @Test
 103     public void tfexception08() {
 104         TransformerException te = new TransformerException("My Message");
 105         assertNotNull(te.initCause(null));
 106     }
 107 }
 108 
 109 


  88 
  89     /**
  90      * Spec says, "if the throwable was created with TransformerException(String,
  91      * Throwable), initCause should throw IllegalStateException
  92      */
  93     @Test(expectedExceptions = IllegalStateException.class)
  94     public void tfexception07() {
  95         TransformerException te = new TransformerException("MyMessage", new Throwable());
  96         te.initCause(null);
  97     }
  98 
  99     /**
 100      * Tests if initCause(null) is allowed in other case.
 101      */
 102     @Test
 103     public void tfexception08() {
 104         TransformerException te = new TransformerException("My Message");
 105         assertNotNull(te.initCause(null));
 106     }
 107 }


< prev index next >