You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ve...@apache.org on 2003/11/17 14:37:04 UTC
cvs commit: xml-xerces/java/tests/dom/serialize TestNS.java TestXmlns.java
venu 2003/11/17 05:37:04
Modified: java/tests/dom/dom3 Test.java
java/tests/dom/range TestCompare.java
java/tests/dom/serialize TestNS.java TestXmlns.java
Log:
DOM3 LS CR changes bug #24742 . Submitted by Ramesh Mandava
Revision Changes Path
1.13 +12 -12 xml-xerces/java/tests/dom/dom3/Test.java
Index: Test.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/tests/dom/dom3/Test.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Test.java 13 Nov 2003 22:49:35 -0000 1.12
+++ Test.java 17 Nov 2003 13:37:04 -0000 1.13
@@ -79,22 +79,22 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
-import org.w3c.dom.ls.DOMParser;
-import org.w3c.dom.ls.DOMResourceResolver;
+import org.w3c.dom.ls.LSParser;
+import org.w3c.dom.ls.LSResourceResolver;
import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.DOMInput;
-import org.w3c.dom.ls.DOMSerializer;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSSerializer;
import dom.util.Assertion;
/**
* The program tests vacarious DOM Level 3 functionality
*/
-public class Test implements DOMErrorHandler, DOMResourceResolver{
+public class Test implements DOMErrorHandler, LSResourceResolver{
static int errorCounter = 0;
static DOMErrorHandler errorHandler = new Test();
- static DOMResourceResolver resolver = new Test();
+ static LSResourceResolver resolver = new Test();
public static void main( String[] argv) {
try {
@@ -107,10 +107,10 @@
Assertion.verify(impl!=null, "domImplementation != null");
- DOMParser builder = impl.createDOMParser(DOMImplementationLS.MODE_SYNCHRONOUS,
+ LSParser builder = impl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS,
null);
- DOMSerializer writer = impl.createDOMSerializer();
+ LSSerializer writer = impl.createLSSerializer();
DOMConfiguration config = writer.getConfig();
config.setParameter("namespaces",(namespaces)?Boolean.TRUE:Boolean.FALSE);
config.setParameter("validate",Boolean.FALSE);
@@ -421,7 +421,7 @@
writer.getConfig().setParameter("namespaces", Boolean.TRUE);
String xmlData = writer.writeToString(doc);
Reader r = new StringReader(xmlData);
- DOMInput in = impl.createDOMInput();
+ LSInput in = impl.createLSInput();
in.setCharacterStream(r);
doc = builder.parse(in);
@@ -673,14 +673,14 @@
}
/**
- * @see org.w3c.dom.ls.DOMEntityResolver#resolveEntity(String, String, String)
+ * @see org.w3c.dom.ls.DOMEntityResolver#resolveEntity(String, String, String, String, String)
*/
- public DOMInput resolveResource(String publicId, String systemId, String baseURI) {
+ public LSInput resolveResource(String type, String namespace, String publicId, String systemId, String baseURI) {
try {
DOMImplementationLS impl =
(DOMImplementationLS) DOMImplementationRegistry.newInstance().getDOMImplementation(
"LS");
- DOMInput source = impl.createDOMInput();
+ LSInput source = impl.createLSInput();
if (systemId.equals("personal.xsd")) {
source.setSystemId("data/personal.xsd");
}
1.2 +1 -4 xml-xerces/java/tests/dom/range/TestCompare.java
Index: TestCompare.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/tests/dom/range/TestCompare.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestCompare.java 20 Dec 2000 00:53:41 -0000 1.1
+++ TestCompare.java 17 Nov 2003 13:37:04 -0000 1.2
@@ -206,10 +206,7 @@
for( int j=0; j<ranges.length; ++j )
{
int result = ranges[i].compareBoundaryPoints( how, ranges[j] );
- assert(
- "Compare returned the wrong value i="+i+" j="+j + " result="+result,
- result == results[i][j]
- );
+ assert( "Compare returned the wrong value i="+i+" j="+j + " result="+result, result == results[i][j] );
}
}
}
1.12 +6 -6 xml-xerces/java/tests/dom/serialize/TestNS.java
Index: TestNS.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/tests/dom/serialize/TestNS.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- TestNS.java 30 Jul 2003 13:38:53 -0000 1.11
+++ TestNS.java 17 Nov 2003 13:37:04 -0000 1.12
@@ -59,8 +59,8 @@
import org.w3c.dom.*;
import org.apache.xerces.dom.*;
-import org.w3c.dom.ls.DOMSerializer;
-import org.w3c.dom.ls.DOMOutput;
+import org.w3c.dom.ls.LSSerializer;
+import org.w3c.dom.ls.LSOutput;
import org.w3c.dom.ls.DOMImplementationLS;
import org.apache.xerces.parsers.*;
import org.apache.xml.serialize.*;
@@ -71,7 +71,7 @@
* This class is testing namespace algorithm during serialization.
* The class takes as a parameter xml document, parses it using the DOM parser.
* By default it will perform modifications to the tree, and then serialize
- * the document using DOMSerializer.
+ * the document using LSSerializer.
*
* @author Elena Litani, IBM
* @version $Id$
@@ -82,7 +82,7 @@
System.out.println("DOM Serializer test for namespace algorithm.");
DOMParser parser = new DOMParser();
- DOMOutput dOut = new DOMOutputImpl();
+ LSOutput dOut = new DOMOutputImpl();
if (argv.length == 0) {
printUsage();
@@ -366,7 +366,7 @@
// create DOM Serializer
- DOMSerializer writer = ((DOMImplementationLS)DOMImplementationImpl.getDOMImplementation()).createDOMSerializer();
+ LSSerializer writer = ((DOMImplementationLS)DOMImplementationImpl.getDOMImplementation()).createLSSerializer();
// Serializer that ouputs tree in not pretty print format
1.5 +4 -4 xml-xerces/java/tests/dom/serialize/TestXmlns.java
Index: TestXmlns.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/tests/dom/serialize/TestXmlns.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestXmlns.java 30 Jul 2003 13:38:53 -0000 1.4
+++ TestXmlns.java 17 Nov 2003 13:37:04 -0000 1.5
@@ -61,7 +61,7 @@
import java.io.Writer;
import org.apache.xerces.dom.DocumentImpl;
-import org.w3c.dom.ls.DOMSerializer;
+import org.w3c.dom.ls.LSSerializer;
import org.w3c.dom.ls.DOMImplementationLS;
import org.apache.xerces.dom.DOMImplementationImpl;
import org.apache.xml.serialize.OutputFormat;
@@ -69,7 +69,7 @@
import org.apache.xml.serialize.SerializerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.ls.DOMOutput;
+import org.w3c.dom.ls.LSOutput;
import org.apache.xerces.dom.DOMOutputImpl;
/**
@@ -114,10 +114,10 @@
// create DOM Serializer
System.out.println("\n---DOMWriter output---");
- DOMSerializer domWriter = ((DOMImplementationLS)DOMImplementationImpl.getDOMImplementation()).createDOMSerializer();
+ LSSerializer domWriter = ((DOMImplementationLS)DOMImplementationImpl.getDOMImplementation()).createLSSerializer();
try {
- DOMOutput dOut = new DOMOutputImpl();
+ LSOutput dOut = new DOMOutputImpl();
dOut.setByteStream(System.out);
domWriter.write(document,dOut);
} catch (Exception e){
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org