< prev index next >

test/javax/xml/jaxp/unittest/sax/Bug7057778Test.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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.

@@ -36,12 +36,15 @@
 
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
-import org.testng.annotations.Test;
+import jaxp.library.JAXPTestUtilities;
+
 import org.testng.Assert;
+import org.testng.annotations.Listeners;
+import org.testng.annotations.Test;
 import org.xml.sax.Attributes;
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;

@@ -49,19 +52,20 @@
 
 /*
  * @bug 7057778
  * @summary Test the file can be deleted after SAXParser.parse(File, DefaultHandler).
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class Bug7057778Test {
 
     static final String xml = "Bug7057778.xml";
     static final String xml1 = "Bug7057778_1.xml";
 
     @Test
     public void testParse() {
         File src = new File(getClass().getResource(xml).getFile());
-        File dst = new File(src.getParent() + File.separator + xml1);
+        File dst = new File(xml1);
         try {
             copyFile(src, dst);
             SAXParserFactory spf = SAXParserFactory.newInstance();
             SAXParser parser = spf.newSAXParser();
             XMLReader xmlReader = parser.getXMLReader();
< prev index next >