2006/unicorn/org/w3c/unicorn/tests UnicornCallTest.java,1.2,1.3

Update of /sources/public/2006/unicorn/org/w3c/unicorn/tests
In directory hutz:/tmp/cvs-serv7785/org/w3c/unicorn/tests

Modified Files:
	UnicornCallTest.java 
Log Message:
fixed a bug with special characters caused by a deprecated class (now using a StringBuilder)

Index: UnicornCallTest.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tests/UnicornCallTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- UnicornCallTest.java	2 Sep 2008 13:22:16 -0000	1.2
+++ UnicornCallTest.java	10 Sep 2008 10:14:30 -0000	1.3
@@ -18,6 +18,8 @@
 import org.w3c.unicorn.input.InputFactory;
 import org.w3c.unicorn.input.InputModule;
 import org.w3c.unicorn.request.Request;
+import org.w3c.unicorn.response.Response;
+
 import org.xml.sax.InputSource;
 
 public class UnicornCallTest {
@@ -100,27 +102,13 @@
 			req.addParameter("output", "ucn");
 			System.out.println("request created");
 			System.out.println(req.getResponseType());
-			req.doRequest();
+			Response res = req.doRequest();
 			System.out.println("request done");
-			
-			
-			String xmlStr = req.getResponseBuffer().toString();
-		
-		            DocumentBuilderFactory xmlFact =
-		
-		                DocumentBuilderFactory.newInstance();
-		
-		            xmlFact.setNamespaceAware(false);
-		
-		            DocumentBuilder builder = xmlFact.
-		
-		                newDocumentBuilder();
-		
-		            Document doc = builder.parse(
-		
-		                    new java.io.ByteArrayInputStream(
-		
-		                            xmlStr.getBytes()));
+					
+      DocumentBuilderFactory xmlFact = DocumentBuilderFactory.newInstance();
+      xmlFact.setNamespaceAware(false);
+      DocumentBuilder builder = xmlFact.newDocumentBuilder();
+      Document doc = builder.parse(res.getXml().toString());
 		
 		           
 		

Received on Wednesday, 10 September 2008 10:15:09 UTC