cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r939675 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/PrimitiveTextProviderTest.java
Date Fri, 30 Apr 2010 13:50:36 GMT
Author: sergeyb
Date: Fri Apr 30 13:50:36 2010
New Revision: 939675

URL: http://svn.apache.org/viewvc?rev=939675&view=rev
Log:
Merged revisions 939664 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r939664 | sergeyb | 2010-04-30 14:33:35 +0100 (Fri, 30 Apr 2010) | 1 line
  
  Fixing JAXRS test, verified on Linux
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/PrimitiveTextProviderTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 30 13:50:36 2010
@@ -1 +1 @@
-/cxf/trunk:935945,935995,936318,937409,938804,939012,939079
+/cxf/trunk:935945,935995,936318,937409,938804,939012,939079,939664

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/PrimitiveTextProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/PrimitiveTextProviderTest.java?rev=939675&r1=939674&r2=939675&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/PrimitiveTextProviderTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/PrimitiveTextProviderTest.java
Fri Apr 30 13:50:36 2010
@@ -21,6 +21,7 @@ package org.apache.cxf.jaxrs.provider;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.nio.charset.Charset;
 import java.util.Arrays;
 
 import javax.ws.rs.core.MediaType;
@@ -105,10 +106,21 @@ public class PrimitiveTextProviderTest e
         MessageBodyWriter p = new PrimitiveTextProvider();
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         MultivaluedMap<String, Object> headers = new MetadataMap<String, Object>();
-        p.writeTo("Hello, my name is Félix Agnès", 
+        
+        String eWithAcute = "\u00E9";
+        String helloStringUTF16 = "Hello, my name is F" + eWithAcute + "lix Agn" + eWithAcute
+ "s";
+        
+        p.writeTo(helloStringUTF16, 
                   String.class, String.class, null, MediaType.valueOf("text/plain;charset=ISO-8859-1"),
                   headers, os);
-        assertEquals("Hello, my name is Félix Agnès", os.toString("ISO-8859-1")); 
+        
+        Charset iso88591charset = Charset.forName("ISO-8859-1");
+        byte[] iso88591bytes = helloStringUTF16.getBytes(iso88591charset);
+        String helloStringISO88591 = new String(iso88591bytes, iso88591charset);
+        
+        System.out.println(helloStringISO88591);
+        
+        assertEquals(helloStringISO88591, os.toString("ISO-8859-1")); 
     }
     
         



Mime
View raw message