wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jra...@apache.org
Subject svn commit: r1028023 - in /incubator/wink/trunk/wink-providers/wink-jackson-provider: ./ src/test/java/org/apache/wink/providers/jackson/internal/ src/test/java/org/apache/wink/providers/jackson/internal/jaxb/ src/test/java/org/apache/wink/server/inter...
Date Wed, 27 Oct 2010 16:11:43 GMT
Author: jramos
Date: Wed Oct 27 16:11:42 2010
New Revision: 1028023

URL: http://svn.apache.org/viewvc?rev=1028023&view=rev
Log:
Add some unit tests to test interoperability between Jackson and new JSON4J code

Added:
    incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJSON4JInteroperabilityTest.java
    incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/server/internal/providers/entity/jackson/jaxb/
Modified:
    incubator/wink/trunk/wink-providers/wink-jackson-provider/pom.xml
    incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JAXBCollectionJSONTest.java
    incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJAXBTest.java
    incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/PolymorphicTest.java
    incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/jaxb/Person.java

Modified: incubator/wink/trunk/wink-providers/wink-jackson-provider/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-providers/wink-jackson-provider/pom.xml?rev=1028023&r1=1028022&r2=1028023&view=diff
==============================================================================
--- incubator/wink/trunk/wink-providers/wink-jackson-provider/pom.xml (original)
+++ incubator/wink/trunk/wink-providers/wink-jackson-provider/pom.xml Wed Oct 27 16:11:42
2010
@@ -88,5 +88,11 @@
             <version>3.2.1</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.wink</groupId>
+            <artifactId>wink-json4j-provider</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 </project>

Modified: incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JAXBCollectionJSONTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JAXBCollectionJSONTest.java?rev=1028023&r1=1028022&r2=1028023&view=diff
==============================================================================
--- incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JAXBCollectionJSONTest.java
(original)
+++ incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JAXBCollectionJSONTest.java
Wed Oct 27 16:11:42 2010
@@ -166,11 +166,13 @@ public class JAXBCollectionJSONTest exte
             Person p = new Person();
             p.setName("My Name");
             p.setDesc("My desc");
+            p.setAge(20);
             people.add(p);
             p = new Person();
             p.setName("My Name 2");
             p.setDesc("My desc 2");
             people.add(p);
+            p.setAge(22);
             return people;
         }
 
@@ -254,7 +256,7 @@ public class JAXBCollectionJSONTest exte
 
         assertTrue(JSONUtils
             .equals(new JSONArray(
-                                  "[{\"desc\":\"My desc\",\"name\":\"My Name\"},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\"}]"),
+                                  "[{\"desc\":\"My desc\",\"name\":\"My Name\",\"age\":20},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\",\"age\":22}]"),
                     new JSONArray(response.getContentAsString())));
 
         request =
@@ -266,7 +268,7 @@ public class JAXBCollectionJSONTest exte
 
         assertTrue(JSONUtils
             .equals(new JSONArray(
-                                  "[{\"desc\":\"My desc\",\"name\":\"My Name\"},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\"}]"),
+                                  "[{\"desc\":\"My desc\",\"name\":\"My Name\",\"age\":20},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\",\"age\":22}]"),
                     new JSONArray(response.getContentAsString())));
 
         request =
@@ -278,7 +280,7 @@ public class JAXBCollectionJSONTest exte
 
         assertTrue(JSONUtils
             .equals(new JSONArray(
-                                  "[{\"name\":\"person\",\"declaredType\":\"org.apache.wink.providers.jackson.internal.jaxb.Person\",\"scope\":\"javax.xml.bind.JAXBElement$GlobalScope\",\"value\":{\"name\":\"My
Name\",\"desc\":\"My desc\"},\"nil\":false, \"typeSubstituted\":false,\"globalScope\":true},{\"name\":\"person\",\"declaredType\":\"org.apache.wink.providers.jackson.internal.jaxb.Person\",\"scope\":\"javax.xml.bind.JAXBElement$GlobalScope\",\"value\":{\"name\":\"My
Name 2\",\"desc\":\"My desc 2\"},\"nil\":false, \"typeSubstituted\":false,\"globalScope\":true}]"),
+                                  "[{\"name\":\"person\",\"declaredType\":\"org.apache.wink.providers.jackson.internal.jaxb.Person\",\"scope\":\"javax.xml.bind.JAXBElement$GlobalScope\",\"value\":{\"name\":\"My
Name\",\"desc\":\"My desc\",\"age\":20},\"nil\":false, \"typeSubstituted\":false,\"globalScope\":true},{\"name\":\"person\",\"declaredType\":\"org.apache.wink.providers.jackson.internal.jaxb.Person\",\"scope\":\"javax.xml.bind.JAXBElement$GlobalScope\",\"value\":{\"name\":\"My
Name 2\",\"desc\":\"My desc 2\",\"age\":22},\"nil\":false, \"typeSubstituted\":false,\"globalScope\":true}]"),
                     new JSONArray(response.getContentAsString())));
     }
 
@@ -289,13 +291,13 @@ public class JAXBCollectionJSONTest exte
                                                         "application/json");
         request.setContentType("application/json");
         request
-            .setContent("[{\"desc\":\"My desc 1\",\"name\":\"My Name 1\"},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\"}]"
+            .setContent("[{\"desc\":\"My desc 1\",\"name\":\"My Name 1\",\"age\":20},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\",\"age\":22}]"
                 .getBytes());
         MockHttpServletResponse response = invoke(request);
         assertEquals(200, response.getStatus());
         assertTrue(JSONUtils
             .equals(new JSONArray(
-                                  "[{\"desc\":\"My desc 1\",\"name\":\"My Name 1\"},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\"}]"),
+                                  "[{\"desc\":\"My desc 1\",\"name\":\"My Name 1\",\"age\":20},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\",\"age\":22}]"),
                     new JSONArray(response.getContentAsString())));
 
         request =
@@ -304,13 +306,13 @@ public class JAXBCollectionJSONTest exte
                                                         "application/json");
         request.setContentType("application/json");
         request
-            .setContent("[{\"desc\":\"My desc 1\",\"name\":\"My Name 1\"},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\"}]"
+            .setContent("[{\"desc\":\"My desc 1\",\"name\":\"My Name 1\",\"age\":20},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\",\"age\":22}]"
                 .getBytes());
         response = invoke(request);
         assertEquals(200, response.getStatus());
         assertTrue(JSONUtils
             .equals(new JSONArray(
-                                  "[{\"desc\":\"My desc 1\",\"name\":\"My Name 1\"},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\"}]"),
+                                  "[{\"desc\":\"My desc 1\",\"name\":\"My Name 1\",\"age\":20},{\"desc\":\"My
desc 2\",\"name\":\"My Name 2\",\"age\":22}]"),
                     new JSONArray(response.getContentAsString())));
 
     }

Modified: incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJAXBTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJAXBTest.java?rev=1028023&r1=1028022&r2=1028023&view=diff
==============================================================================
--- incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJAXBTest.java
(original)
+++ incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJAXBTest.java
Wed Oct 27 16:11:42 2010
@@ -22,6 +22,7 @@ package org.apache.wink.providers.jackso
 
 import java.io.IOException;
 import java.io.StringReader;
+import java.util.GregorianCalendar;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
@@ -29,6 +30,9 @@ import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.xml.bind.JAXBElement;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
 
 import org.apache.wink.common.model.atom.AtomEntry;
 import org.apache.wink.common.model.synd.SyndEntry;
@@ -64,6 +68,7 @@ public class JacksonJAXBTest extends Moc
             Person p = new Person();
             p.setName("My Name");
             p.setDesc("My desc");
+            p.setAge(100);
             return p;
         }
 
@@ -138,7 +143,7 @@ public class JacksonJAXBTest extends Moc
         MockHttpServletResponse response = invoke(request);
         assertEquals(200, response.getStatus());
 
-        assertTrue(JSONUtils.equals(new JSONObject("{\"desc\":\"My desc\",\"name\":\"My Name\"}"),
+        assertTrue(JSONUtils.equals(new JSONObject("{\"desc\":\"My desc\",\"name\":\"My Name\",\"age\":100}"),
                                     new JSONObject(response.getContentAsString())));
     }
 
@@ -151,10 +156,10 @@ public class JacksonJAXBTest extends Moc
         MockHttpServletRequest request =
             MockRequestConstructor.constructMockRequest("POST", "/test/person", "application/json");
         request.setContentType("application/json");
-        request.setContent("{\"desc\":\"My desc\",\"name\":\"My Name\"}".getBytes());
+        request.setContent("{\"desc\":\"My desc\",\"name\":\"My Name\",\"age\":100}".getBytes());
         MockHttpServletResponse response = invoke(request);
         assertEquals(200, response.getStatus());
-        assertTrue(JSONUtils.equals(new JSONObject("{\"desc\":\"My desc\",\"name\":\"My Name\"}"),
+        assertTrue(JSONUtils.equals(new JSONObject("{\"desc\":\"My desc\",\"name\":\"My Name\",\"age\":100}"),
                                     new JSONObject(response.getContentAsString())));
     }
 
@@ -165,6 +170,9 @@ public class JacksonJAXBTest extends Moc
                                                         "application/json");
         MockHttpServletResponse response = invoke(request);
         assertEquals(200, response.getStatus());
+        System.out.println(JSONUtils.objectForString(ENTRY_JSON));
+        System.out.println(JSONUtils
+            .objectForString(response.getContentAsString()));
         assertTrue(JSONUtils.equals(JSONUtils.objectForString(ENTRY_JSON), JSONUtils
             .objectForString(response.getContentAsString())));
     }
@@ -238,8 +246,10 @@ public class JacksonJAXBTest extends Moc
     private static final String ENTRY_JSON_POST;
 
     static {
+
         ENTRY_JSON = ENTRY_STR_JSON;
         ENTRY_JSON_POST = ENTRY_STR_JSON_POST;
+
     }
 
 }

Added: incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJSON4JInteroperabilityTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJSON4JInteroperabilityTest.java?rev=1028023&view=auto
==============================================================================
--- incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJSON4JInteroperabilityTest.java
(added)
+++ incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/JacksonJSON4JInteroperabilityTest.java
Wed Oct 27 16:11:42 2010
@@ -0,0 +1,277 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *  
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *  
+ *******************************************************************************/
+
+package org.apache.wink.providers.jackson.internal;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.wink.json4j.JSONArray;
+import org.apache.wink.json4j.JSONObject;
+import org.apache.wink.providers.jackson.WinkJacksonJaxbJsonProvider;
+import org.apache.wink.providers.jackson.internal.jaxb.Person;
+import org.apache.wink.providers.json.JSONUtils;
+import org.apache.wink.providers.json4j.JSON4JArrayProvider;
+import org.apache.wink.providers.json4j.JSON4JObjectProvider;
+import org.apache.wink.server.internal.servlet.MockServletInvocationTest;
+import org.apache.wink.test.mock.MockRequestConstructor;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
+
+public class JacksonJSON4JInteroperabilityTest extends MockServletInvocationTest {
+
+    private WinkJacksonJaxbJsonProvider jacksonProvider      = new WinkJacksonJaxbJsonProvider();
+    private JSON4JObjectProvider        json4jObjectProvider = new JSON4JObjectProvider();
+    private JSON4JArrayProvider         json4jArrayProvider  = new JSON4JArrayProvider();
+
+    public static class PersonPOJO {
+        String first;
+        String last;
+        int    age;
+
+        public String getFirst() {
+            return first;
+        }
+
+        public void setFirst(String first) {
+            this.first = first;
+        }
+
+        public String getLast() {
+            return last;
+        }
+
+        public void setLast(String last) {
+            this.last = last;
+        }
+
+        public int getAge() {
+            return age;
+        }
+
+        public void setAge(int age) {
+            this.age = age;
+        }
+    }
+
+    @Override
+    protected Class<?>[] getClasses() {
+        return new Class[] {PersonResource.class};
+    }
+
+    @Path("/person")
+    public static class PersonResource {
+
+        @GET
+        public Person getPerson() {
+            Person p = new Person();
+            p.setName("myName");
+            p.setDesc("myDescription");
+            p.setAge(100);
+            return p;
+        }
+    }
+
+    public void testPOJOInteroperabilityJacksonToJSON4J() throws Exception {
+        PersonPOJO p = new PersonPOJO();
+        p.setFirst("Joe");
+        p.setLast("Shmoe");
+        p.setAge(100);
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        jacksonProvider.writeTo(p,
+                                p.getClass(),
+                                p.getClass(),
+                                null,
+                                MediaType.APPLICATION_JSON_TYPE,
+                                null,
+                                os);
+        InputStream is = new ByteArrayInputStream(os.toByteArray());
+        JSONObject jsonObject =
+            json4jObjectProvider.readFrom(JSONObject.class,
+                                          JSONObject.class,
+                                          null,
+                                          MediaType.APPLICATION_JSON_TYPE,
+                                          null,
+                                          is);
+        assertEquals("Joe", jsonObject.get("first"));
+        assertEquals("Shmoe", jsonObject.get("last"));
+        assertEquals(100, jsonObject.get("age"));
+    }
+
+    public void testPOJOInteroperabilityJSON4JToJackson() throws Exception {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("first", "Joe");
+        jsonObject.put("last", "Shmoe");
+        jsonObject.put("age", 100);
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        json4jObjectProvider.writeTo(jsonObject,
+                                     JSONObject.class,
+                                     JSONObject.class,
+                                     null,
+                                     MediaType.APPLICATION_JSON_TYPE,
+                                     null,
+                                     os);
+        InputStream is = new ByteArrayInputStream(os.toByteArray());
+        PersonPOJO p =
+            (PersonPOJO)jacksonProvider.readFrom(Object.class,
+                                                 PersonPOJO.class,
+                                                 null,
+                                                 MediaType.APPLICATION_JSON_TYPE,
+                                                 null,
+                                                 is);
+        assertEquals("Joe", p.getFirst());
+        assertEquals("Shmoe", p.getLast());
+        assertEquals(100, p.getAge());
+
+        jsonObject = new JSONObject();
+        jsonObject.put("first", "Joe");
+        jsonObject.put("last", "Shmoe");
+        jsonObject.put("age", "100"); // this is the only change to see if an
+        // integer as a String works
+        os = new ByteArrayOutputStream();
+        json4jObjectProvider.writeTo(jsonObject,
+                                     JSONObject.class,
+                                     JSONObject.class,
+                                     null,
+                                     MediaType.APPLICATION_JSON_TYPE,
+                                     null,
+                                     os);
+        is = new ByteArrayInputStream(os.toByteArray());
+        p =
+            (PersonPOJO)jacksonProvider.readFrom(Object.class,
+                                                 PersonPOJO.class,
+                                                 null,
+                                                 MediaType.APPLICATION_JSON_TYPE,
+                                                 null,
+                                                 is);
+        assertEquals("Joe", p.getFirst());
+        assertEquals("Shmoe", p.getLast());
+        assertEquals(100, p.getAge());
+    }
+
+    public void testJAXBInteroperabilityJSON4JToJackson() throws Exception {
+        // we need to use the mock servlet for this one test because the
+        // JSON4JJAXBProvider uses @Context injection
+        MockHttpServletRequest request =
+            MockRequestConstructor.constructMockRequest("GET", "/person", "application/json");
+        MockHttpServletResponse response = invoke(request);
+        assertEquals(200, response.getStatus());
+        assertTrue(JSONUtils
+            .equals(new org.json.JSONObject(
+                                            "{\"person\":{\"name\":\"myName\", \"desc\":\"myDescription\",
\"age\":\"100\"}}"),
+                    new org.json.JSONObject(response.getContentAsString())));
+        JSONObject result = new JSONObject(new ByteArrayInputStream(response.getContentAsByteArray()));
+        JSONObject person = (JSONObject)result.get("person");
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("name", person.get("name"));
+        jsonObject.put("desc", person.get("desc"));
+        jsonObject.put("age", person.get("age"));
+        Person p =
+            (Person)jacksonProvider.readFrom(Object.class,
+                                             Person.class,
+                                             null,
+                                             MediaType.APPLICATION_JSON_TYPE,
+                                             null,
+                                             new ByteArrayInputStream(jsonObject.toString()
+                                                 .getBytes()));
+        assertEquals("myName", p.getName());
+        assertEquals("myDescription", p.getDesc());
+        assertEquals(100, p.getAge());
+    }
+
+    public void testArrayInteroperabilityJacksonToJSON4J() throws Exception {
+        PersonPOJO p1 = new PersonPOJO();
+        p1.setFirst("firstName");
+        p1.setLast("lastName");
+        p1.setAge(45);
+        PersonPOJO p2 = new PersonPOJO();
+        p2.setFirst("firstName2");
+        p2.setLast("lastName2");
+        p2.setAge(46);
+        PersonPOJO[] people = new PersonPOJO[] {p1, p2};
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        jacksonProvider.writeTo(people,
+                                PersonPOJO[].class,
+                                PersonPOJO[].class,
+                                null,
+                                MediaType.APPLICATION_JSON_TYPE,
+                                null,
+                                os);
+        InputStream is = new ByteArrayInputStream(os.toByteArray());
+        JSONArray jsonArray =
+            (JSONArray)json4jArrayProvider.readFrom(JSONArray.class,
+                                                    JSONArray.class,
+                                                    null,
+                                                    MediaType.APPLICATION_JSON_TYPE,
+                                                    null,
+                                                    is);
+        assertEquals(2, jsonArray.size());
+        assertEquals("firstName", ((JSONObject)jsonArray.get(0)).get("first"));
+        assertEquals("lastName", ((JSONObject)jsonArray.get(0)).get("last"));
+        assertEquals(45, ((JSONObject)jsonArray.get(0)).get("age"));
+        assertEquals("firstName2", ((JSONObject)jsonArray.get(1)).get("first"));
+        assertEquals("lastName2", ((JSONObject)jsonArray.get(1)).get("last"));
+        assertEquals(46, ((JSONObject)jsonArray.get(1)).get("age"));
+    }
+
+    public void testArrayInteroperabilityJSON4JToJackson() throws Exception {
+        JSONArray jsonArray = new JSONArray();
+        JSONObject jsonObject1 = new JSONObject();
+        JSONObject jsonObject2 = new JSONObject();
+        jsonObject1.put("first", "firstName");
+        jsonObject1.put("last", "lastName");
+        jsonObject1.put("age", 45);
+        jsonObject2.put("first", "firstName2");
+        jsonObject2.put("last", "lastName2");
+        jsonObject2.put("age", 46);
+        jsonArray.add(jsonObject1);
+        jsonArray.add(jsonObject2);
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        json4jArrayProvider.writeTo(jsonArray,
+                                    JSONArray.class,
+                                    JSONArray.class,
+                                    null,
+                                    MediaType.APPLICATION_JSON_TYPE,
+                                    null,
+                                    os);
+        InputStream is = new ByteArrayInputStream(os.toByteArray());
+        PersonPOJO[] people =
+            (PersonPOJO[])jacksonProvider.readFrom(Object.class,
+                                                   PersonPOJO[].class,
+                                                   null,
+                                                   MediaType.APPLICATION_JSON_TYPE,
+                                                   null,
+                                                   is);
+        PersonPOJO p = people[0];
+        assertEquals(2, people.length);
+        assertEquals("firstName", p.getFirst());
+        assertEquals("lastName", p.getLast());
+        assertEquals(45, p.getAge());
+        p = people[1];
+        assertEquals("firstName2", p.getFirst());
+        assertEquals("lastName2", p.getLast());
+        assertEquals(46, p.getAge());
+    }
+}

Modified: incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/PolymorphicTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/PolymorphicTest.java?rev=1028023&r1=1028022&r2=1028023&view=diff
==============================================================================
--- incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/PolymorphicTest.java
(original)
+++ incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/PolymorphicTest.java
Wed Oct 27 16:11:42 2010
@@ -39,6 +39,11 @@ import org.apache.wink.server.internal.s
 import org.apache.wink.test.mock.MockRequestConstructor;
 import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
 import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
+import org.codehaus.jackson.map.AnnotationIntrospector;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
+import org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector;
+import org.codehaus.jackson.xc.JaxbAnnotationIntrospector;
 import org.json.JSONObject;
 import org.junit.Test;
 import org.springframework.mock.web.MockHttpServletRequest;

Modified: incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/jaxb/Person.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/jaxb/Person.java?rev=1028023&r1=1028022&r2=1028023&view=diff
==============================================================================
--- incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/jaxb/Person.java
(original)
+++ incubator/wink/trunk/wink-providers/wink-jackson-provider/src/test/java/org/apache/wink/providers/jackson/internal/jaxb/Person.java
Wed Oct 27 16:11:42 2010
@@ -27,6 +27,8 @@ public class Person {
     private String name;
 
     private String desc;
+    
+    private int age;
 
     public String getName() {
         return name;
@@ -44,4 +46,12 @@ public class Person {
         this.desc = desc;
     }
 
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
 }



Mime
View raw message