cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r835919 - /cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
Date Fri, 13 Nov 2009 16:55:45 GMT
Author: sergeyb
Date: Fri Nov 13 16:55:45 2009
New Revision: 835919

URL: http://svn.apache.org/viewvc?rev=835919&view=rev
Log:
Fixing failing JSONProvider tests on the 2.2.x branch (some code will need to be merged from
the trunk later on)

Modified:
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java?rev=835919&r1=835918&r2=835919&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
Fri Nov 13 16:55:45 2009
@@ -763,6 +763,10 @@
         Map<String, String> map = new HashMap<String, String>();
         map.put("tagVO", "{http://tagsvo2}t");
         provider.setOutAppendElements(map);
+        Map<String, String> nsmap = new HashMap<String, String>();
+        nsmap.put("http://tagsvo2", "ps1");
+        provider.setNamespaceMap(nsmap);
+        
         TagVO tag = new TagVO("A", "B");
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         provider.writeTo(tag, TagVO.class, TagVO.class,
@@ -805,11 +809,14 @@
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}thetag", "{http://tagsvo2}t");
         provider.setOutAppendElements(map);
+        Map<String, String> nsmap = new HashMap<String, String>();
+        nsmap.put("http://tagsvo2", "ps1");
+        provider.setNamespaceMap(nsmap);
         TagVO2 tag = new TagVO2("A", "B");
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         provider.writeTo(tag, TagVO2.class, TagVO2.class,
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String,
Object>(), bos);
-        String expected = "{\"ps1.t\":{\"ns1.thetag\":{\"group\":\"B\",\"name\":\"A\"}}}";
+        String expected = "{\"ps1.t\":{\"ns2.thetag\":{\"group\":\"B\",\"name\":\"A\"}}}";
         assertEquals(expected, bos.toString());
     }
     
@@ -818,6 +825,9 @@
         JSONProvider provider = new JSONProvider();
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}thetag", "{http://tagsvo2}t");
+        Map<String, String> nsmap = new HashMap<String, String>();
+        nsmap.put("http://tagsvo2", "ns2");
+        provider.setNamespaceMap(nsmap);
         provider.setOutTransformElements(map);
         TagVO2 tag = new TagVO2("A", "B");
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -850,6 +860,9 @@
         Map<String, String> map = new HashMap<String, String>();
         map.put("tagVO", "{http://tags}thetag");
         provider.setOutTransformElements(map);
+        Map<String, String> nsmap = new HashMap<String, String>();
+        nsmap.put("http://tags", "ps1");
+        provider.setNamespaceMap(nsmap);
         TagVO tag = new TagVO("A", "B");
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         provider.writeTo(tag, TagVO.class, TagVO.class,



Mime
View raw message