You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2009/02/22 17:08:14 UTC

svn commit: r746747 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ExportSysViewTest.java

Author: jukka
Date: Sun Feb 22 16:08:14 2009
New Revision: 746747

URL: http://svn.apache.org/viewvc?rev=746747&view=rev
Log:
JCR-1994: ExportSysViewTest fails with: System property org.xml.sax.driver not specified

Replace XMLReader with SAXParser to avoid needing a the special system property to be specified.

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ExportSysViewTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ExportSysViewTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ExportSysViewTest.java?rev=746747&r1=746746&r2=746747&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ExportSysViewTest.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ExportSysViewTest.java Sun Feb 22 16:08:14 2009
@@ -19,13 +19,15 @@
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
 import org.xml.sax.InputSource;
-import org.xml.sax.helpers.XMLReaderFactory;
 
 import javax.jcr.Session;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
 import java.io.File;
 import java.io.IOException;
 import java.io.BufferedOutputStream;
@@ -157,15 +159,18 @@
         // the absolut path to the node which was exported
         String nodePath;
         Node node;
-        XMLReader parser;
+        SAXParser parser;
         SysViewContentHandler handler;
 
         public SysViewParser(String nodePath, Session session, boolean skipBinary, boolean noRecurse)
                 throws SAXException, RepositoryException {
             this.nodePath = nodePath;
             this.handler = new SysViewContentHandler(nodePath, session, skipBinary, noRecurse);
-            parser = XMLReaderFactory.createXMLReader();
-            parser.setContentHandler(this.handler);
+            try {
+                parser = SAXParserFactory.newInstance().newSAXParser();
+            } catch (ParserConfigurationException e) {
+                throw new SAXException(e);
+            }
         }
 
         public void parse(File file) throws IOException, SAXException {
@@ -176,7 +181,7 @@
                 fail("Input file not opened: " + e);
             }
             InputSource source = new InputSource(in);
-            parser.parse(source);
+            parser.parse(source, handler);
         }
     }
 }
\ No newline at end of file