jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r947986 - in /jackrabbit/trunk: jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java
Date Tue, 25 May 2010 09:50:34 GMT
Author: jukka
Date: Tue May 25 09:50:34 2010
New Revision: 947986

URL: http://svn.apache.org/viewvc?rev=947986&view=rev
Log:
JCR-2636: Litmus prophighunicode test failure on JRE 1.5

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java
    jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java?rev=947986&r1=947985&r2=947986&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java
Tue May 25 09:50:34 2010
@@ -52,7 +52,7 @@ public class LitmusTest extends TestCase
             try {
                 SocketConnector connector = new SocketConnector();
                 connector.setHost("localhost");
-                connector.setPort(0);
+                connector.setPort(12345);
 
                 Server server = new Server();
                 server.addConnector(connector);
@@ -79,7 +79,7 @@ public class LitmusTest extends TestCase
                     ProcessBuilder builder =
                         new ProcessBuilder(litmus, url, "admin", "admin");
                     builder.environment().put(
-                            "TESTS", "basic http"); // props copymove locks
+                            "TESTS", "basic http props"); // copymove locks
                     builder.directory(dir);
                     builder.redirectErrorStream();
 

Modified: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java?rev=947986&r1=947985&r2=947986&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java
Tue May 25 09:50:34 2010
@@ -45,7 +45,9 @@ import javax.xml.transform.dom.DOMSource
 import javax.xml.transform.sax.SAXResult;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
+import java.io.Writer;
 import java.util.Locale;
 
 /**
@@ -158,12 +160,18 @@ public class WebdavResponseImpl implemen
                 Document doc = DomUtil.BUILDER_FACTORY.newDocumentBuilder().newDocument();
                 doc.appendChild(serializable.toXml(doc));
 
+                // JCR-2636: Need to use an explicit OutputStreamWriter
+                // instead of relying on the built-in UTF-8 serialisation
+                // to avoid problems with surrogate pairs on Sun JRE 1.5.
+                Writer writer = new OutputStreamWriter(
+                        out, SerializingContentHandler.ENCODING);
                 ContentHandler handler =
-                    SerializingContentHandler.getSerializer(out);
+                    SerializingContentHandler.getSerializer(writer);
                 TransformerFactory factory = TransformerFactory.newInstance();
                 Transformer transformer = factory.newTransformer();
                 transformer.transform(
                         new DOMSource(doc), new SAXResult(handler));
+                writer.flush();
 
                 // TODO: Should this be application/xml? See JCR-1621
                 httpResponse.setContentType(



Mime
View raw message