Java Code Examples for javax.xml.transform.TransformerException#initCause()

The following examples show how to use javax.xml.transform.TransformerException#initCause() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransformerExcpTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Spec says, "if the throwable was created with
 * TransformerException(Throwable), initCause should throw
 * IllegalStateException
 */
@Test(expectedExceptions = IllegalStateException.class)
public void tfexception06() {
    TransformerException te = new TransformerException(new Throwable());
    te.initCause(null);
}
 
Example 2
Source File: TransformerExcpTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Spec says, "if the throwable was created with TransformerException(String,
 * Throwable), initCause should throw IllegalStateException
 */
@Test(expectedExceptions = IllegalStateException.class)
public void tfexception07() {
    TransformerException te = new TransformerException("MyMessage", new Throwable());
    te.initCause(null);
}