< prev index next >

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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -20,36 +20,38 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.fail;
+
 import java.io.File;
-import java.io.FilePermission;
+
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.sax.SAXResult;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPBaseTest;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.fail;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /**
  *  Basic test for TransformerException specification.
  */
-public class TransformerExcpTest extends JAXPBaseTest {
+@Listeners({jaxp.library.FilePolicy.class})
+public class TransformerExcpTest {
     /**
      * Transform an unformatted style-sheet file. TransformerException is thrown.
      */
     @Test
     public void tfexception() {
         try {
-            setPermissions(new FilePermission(XML_DIR  + "-", "read"));
             // invalid.xsl has well-formedness error. Therefore transform throws
             // TransformerException
             StreamSource streamSource
                     = new StreamSource(new File(XML_DIR + "invalid.xsl"));
             TransformerFactory tFactory = TransformerFactory.newInstance();

@@ -61,12 +63,10 @@
         } catch (TransformerException e) {
             assertNotNull(e.getCause());
             assertNotNull(e.getException());
             assertNull(e.getLocationAsString());
             assertEquals(e.getMessageAndLocation(),e.getMessage());
-        } finally {
-            setPermissions();
         }
     }
 
 
     /**
< prev index next >