jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/othervm/TFCErrorTest.java
changeset 28445 5a87f52ca380
parent 27216 e63176413817
child 40223 64662417aa2d
equal deleted inserted replaced
28344:722378bc599e 28445:5a87f52ca380
     1 /*
     1 /*
     2  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 package javax.xml.transform.ptests.othervm;
    23 package javax.xml.transform.ptests.othervm;
    24 
    24 
    25 import javax.xml.transform.*;
    25 import javax.xml.transform.*;
       
    26 import jaxp.library.JAXPBaseTest;
       
    27 import static org.testng.Assert.fail;
    26 import org.testng.annotations.Test;
    28 import org.testng.annotations.Test;
    27 
    29 
    28 /**
    30 /**
    29  * Negative test for set invalid TransformerFactory property.
    31  * Negative test for set invalid TransformerFactory property.
    30  */
    32  */
    31 public class TFCErrorTest{
    33 public class TFCErrorTest  extends JAXPBaseTest {
    32     @Test(expectedExceptions = ClassNotFoundException.class)
    34     @Test(expectedExceptions = ClassNotFoundException.class)
    33     public void tfce01() throws Exception {
    35     public void tfce01() throws Exception {
    34         try{
    36         try{
    35             System.setProperty("javax.xml.transform.TransformerFactory","xx");
    37             setSystemProperty("javax.xml.transform.TransformerFactory","xx");
    36             TransformerFactory tFactory = TransformerFactory.newInstance();
    38             TransformerFactory.newInstance();
    37         } catch (TransformerFactoryConfigurationError error) {
    39             fail("Expect TransformerFactoryConfigurationError here");
    38             throw error.getException();
    40         } catch (TransformerFactoryConfigurationError expected) {
       
    41             throw expected.getException();
    39         }
    42         }
    40     }
    43     }
    41 }
    44 }