cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject svn commit: r1569250 - /cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
Date Tue, 18 Feb 2014 10:10:44 GMT
Author: ashakirin
Date: Tue Feb 18 10:10:44 2014
New Revision: 1569250

URL: http://svn.apache.org/r1569250
Log:
Updated JSON provider test to illustrate package-info issue

Modified:
    cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java

Modified: cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java?rev=1569250&r1=1569249&r2=1569250&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
Tue Feb 18 10:10:44 2014
@@ -38,6 +38,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
+import javax.ws.rs.BadRequestException;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
@@ -60,7 +61,6 @@ import javax.xml.stream.XMLStreamWriter;
 import javax.xml.transform.stream.StreamSource;
 
 import org.w3c.dom.Document;
-
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
@@ -76,7 +76,6 @@ import org.apache.cxf.jaxrs.resources.ja
 import org.apache.cxf.jaxrs.resources.jaxb.Book2NoRootElement;
 import org.apache.cxf.staxutils.DelegatingXMLStreamWriter;
 import org.apache.cxf.staxutils.StaxUtils;
-
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -508,7 +507,7 @@ public class JSONProviderTest extends As
         
     }
     
-    @Test
+    @Test(expected=BadRequestException.class)
     public void testIgnoreNamespacesPackageInfo() throws Exception {
         JSONProvider<Book2> p = new JSONProvider<Book2>();
         p.setIgnoreNamespaces(true);
@@ -523,6 +522,9 @@ public class JSONProviderTest extends As
         String s = os.toString();
         assertEquals("{\"thebook2\":{\"id\":123,\"name\":\"CXF\"}}", s);
         
+        p.readFrom(Book2.class, null, Book2.class.getAnnotations(),
+                   MediaType.APPLICATION_JSON_TYPE, null, new ByteArrayInputStream(s.getBytes()));
+        
     }
     
     @Test



Mime
View raw message