tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject [3/5] tomee git commit: TOMEE-2221 - Tests with @JohnzonProperty and @JsonbProperty.
Date Wed, 22 Aug 2018 09:24:13 GMT
TOMEE-2221 - Tests with @JohnzonProperty and @JsonbProperty.

(cherry picked from commit 4c7fd4a)


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/75d0efc4
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/75d0efc4
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/75d0efc4

Branch: refs/heads/tomee-7.1.x
Commit: 75d0efc4e8ab2df53b7ea570b6ecba4cddc4c4da
Parents: 8247205
Author: Roberto Cortez <radcortez@yahoo.com>
Authored: Mon Aug 13 15:40:38 2018 +0100
Committer: Roberto Cortez <radcortez@yahoo.com>
Committed: Tue Aug 21 12:24:25 2018 +0100

----------------------------------------------------------------------
 .../cxf/rs/johnzon/JsonbJaxrsProviderTest.java  | 50 +++++++++++++++-----
 1 file changed, 37 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/75d0efc4/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/johnzon/JsonbJaxrsProviderTest.java
----------------------------------------------------------------------
diff --git a/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/johnzon/JsonbJaxrsProviderTest.java
b/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/johnzon/JsonbJaxrsProviderTest.java
index 0c4a451..98b6b8e 100644
--- a/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/johnzon/JsonbJaxrsProviderTest.java
+++ b/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/johnzon/JsonbJaxrsProviderTest.java
@@ -17,6 +17,7 @@
 package org.apache.openejb.server.cxf.rs.johnzon;
 
 import org.apache.johnzon.mapper.JohnzonIgnore;
+import org.apache.johnzon.mapper.JohnzonProperty;
 import org.apache.openejb.jee.EjbJar;
 import org.apache.openejb.jee.SingletonBean;
 import org.apache.openejb.junit.ApplicationComposer;
@@ -27,6 +28,7 @@ import org.apache.openejb.testing.RandomPort;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import javax.json.bind.annotation.JsonbProperty;
 import javax.json.bind.annotation.JsonbTransient;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -52,7 +54,7 @@ public class JsonbJaxrsProviderTest {
 
     @Test
     public void run() throws IOException {
-        assertEquals("{\"value\":\"value\"}",
+        assertEquals("{\"johnzon\":\"johnzon\",\"jsonb\":\"jsonb\",\"value\":\"value\"}",
                      IO.slurp(new URL(base.toExternalForm() + getClass().getSimpleName()
+ "/test")));
     }
 
@@ -63,8 +65,10 @@ public class JsonbJaxrsProviderTest {
         public Model get() {
             final Model model = new Model();
             model.setValue("value");
-            model.setIgnoreJohnzon("ignoreJohnzon");
-            model.setIgnoreJsonb("ignoreJsonb");
+            model.setJohnzonIgnore("ignoreJohnzon");
+            model.setJsonbIgnore("ignoreJsonb");
+            model.setJohnzonProperty("johnzon");
+            model.setJsonbProperty("jsonb");
             return model;
         }
     }
@@ -72,9 +76,13 @@ public class JsonbJaxrsProviderTest {
     public static class Model {
         private String value;
         @JohnzonIgnore
-        private String ignoreJohnzon;
+        private String johnzonIgnore;
         @JsonbTransient
-        private String ignoreJsonb;
+        private String jsonbIgnore;
+        @JohnzonProperty("johnzon")
+        private String johnzonProperty;
+        @JsonbProperty("jsonb")
+        private String jsonbProperty;
 
         public String getValue() {
             return value;
@@ -84,20 +92,36 @@ public class JsonbJaxrsProviderTest {
             this.value = value;
         }
 
-        public String getIgnoreJohnzon() {
-            return ignoreJohnzon;
+        public String getJohnzonIgnore() {
+            return johnzonIgnore;
         }
 
-        public void setIgnoreJohnzon(final String ignoreJohnzon) {
-            this.ignoreJohnzon = ignoreJohnzon;
+        public void setJohnzonIgnore(final String johnzonIgnore) {
+            this.johnzonIgnore = johnzonIgnore;
         }
 
-        public String getIgnoreJsonb() {
-            return ignoreJsonb;
+        public String getJsonbIgnore() {
+            return jsonbIgnore;
         }
 
-        public void setIgnoreJsonb(final String ignoreJsonb) {
-            this.ignoreJsonb = ignoreJsonb;
+        public void setJsonbIgnore(final String jsonbIgnore) {
+            this.jsonbIgnore = jsonbIgnore;
+        }
+
+        public String getJohnzonProperty() {
+            return johnzonProperty;
+        }
+
+        public void setJohnzonProperty(final String johnzonProperty) {
+            this.johnzonProperty = johnzonProperty;
+        }
+
+        public String getJsonbProperty() {
+            return jsonbProperty;
+        }
+
+        public void setJsonbProperty(final String jsonbProperty) {
+            this.jsonbProperty = jsonbProperty;
         }
     }
 }


Mime
View raw message