Skip to content
Permalink
Browse files
Updated JSON provider test to illustrate package-info issue
git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1569250 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ashakirin-apache committed Feb 18, 2014
1 parent 252626f commit 4c597e7103f79859ab74b4938e5b2e0495288eb3
Showing 1 changed file with 5 additions and 3 deletions.
@@ -38,6 +38,7 @@
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.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.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 void testWriteToSingleTag2NoNs() throws Exception {

}

@Test
@Test(expected=BadRequestException.class)
public void testIgnoreNamespacesPackageInfo() throws Exception {
JSONProvider<Book2> p = new JSONProvider<Book2>();
p.setIgnoreNamespaces(true);
@@ -523,6 +522,9 @@ public void testIgnoreNamespacesPackageInfo() throws Exception {
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

0 comments on commit 4c597e7

Please sign in to comment.