Merge
authorlana
Thu, 11 Aug 2016 17:02:17 +0000
changeset 40293 5cb21ed83e3d
parent 40289 f26b656c2224 (current diff)
parent 40292 bcb68f9b7b34 (diff)
child 40294 c75a04d91fda
child 40489 4572e3dce7ba
Merge
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties	Thu Aug 11 15:47:08 2016 +0000
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties	Thu Aug 11 17:02:17 2016 +0000
@@ -37,5 +37,3 @@
 parser.quantifier.3=Invalid quantifier. A digit or '}' is expected.
 parser.quantifier.4=Invalid quantifier. A min quantity must be <= a max quantity.
 parser.quantifier.5=Invalid quantifier. A quantity value overflow.
-null
-null
--- a/jaxp/test/TEST.ROOT	Thu Aug 11 15:47:08 2016 +0000
+++ b/jaxp/test/TEST.ROOT	Thu Aug 11 17:02:17 2016 +0000
@@ -23,4 +23,7 @@
 groups=TEST.groups
 
 # Minimum jtreg version
-requiredVersion=4.2 b02
+requiredVersion=4.2 b03
+
+# Use new module options
+useNewOptions=true
--- a/jaxp/test/javax/xml/jaxp/libs/jaxp/library/BasePolicy.java	Thu Aug 11 15:47:08 2016 +0000
+++ b/jaxp/test/javax/xml/jaxp/libs/jaxp/library/BasePolicy.java	Thu Aug 11 17:02:17 2016 +0000
@@ -37,7 +37,7 @@
         try {
             JAXPPolicyManager.teardownPolicyManager();
         } catch (Exception e) {
-            throw new RuntimeException("Failed to teardonw the policy manager", e);
+            throw new RuntimeException("Failed to teardown the policy manager", e);
         }
     }
 
--- a/jaxp/test/javax/xml/jaxp/unittest/validation/Bug6773084Test.java	Thu Aug 11 15:47:08 2016 +0000
+++ b/jaxp/test/javax/xml/jaxp/unittest/validation/Bug6773084Test.java	Thu Aug 11 17:02:17 2016 +0000
@@ -32,11 +32,10 @@
 import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
 
 import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamSource;
@@ -69,6 +68,7 @@
     private static final ExecutorService EXEC = Executors.newCachedThreadPool();
 
     private static final CyclicBarrier BARRIER = new CyclicBarrier(NTHREADS);
+    private static final int TIMEOUT = 110;
 
     public static final String IN_FOLDER = Bug6773084Test.class.getResource("Bug6773084In").getPath();
     public static final String XSD_PATH = Bug6773084Test.class.getResource("Bug6773084.xsd").getPath();
@@ -93,20 +93,23 @@
             }
         });
 
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+
         for (int i = 0; i < files.length; i++) {
-            EXEC.execute(new XMLValiddator(files[i], i));
+            EXEC.execute(new XMLValiddator(dbf.newDocumentBuilder().parse(files[i]), i));
         }
         runWithAllPerm(() -> EXEC.shutdown());
-
+        EXEC.awaitTermination(TIMEOUT, TimeUnit.SECONDS);
     }
 
     private static class XMLValiddator implements Runnable {
 
-        private File file;
+        private Document document;
         private int index;
 
-        public XMLValiddator(File file, int index) {
-            this.file = file;
+        public XMLValiddator(Document document, int index) {
+            this.document = document;
             this.index = index;
         }
 
@@ -117,23 +120,14 @@
                 BARRIER.await();
                 System.out.println("Validating....");
 
-                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-                factory.setNamespaceAware(true);
-
-                DocumentBuilder builder = factory.newDocumentBuilder();
-                Document document = builder.parse(file);
-
                 Validator validator = schema.newValidator();
                 validator.setErrorHandler(new ErrorHandlerImpl());
                 validator.validate(new DOMSource(document));
-
             } catch (IOException e) {
                 e.printStackTrace();
             } catch (SAXException e) {
                 e.printStackTrace();
                 Assert.fail("Test failed.");
-            } catch (ParserConfigurationException e) {
-                e.printStackTrace();
             } catch (BrokenBarrierException e) {
                 e.printStackTrace();
             } catch (InterruptedException e) {