From commits-return-42921-archive-asf-public=cust-asf.ponee.io@tomee.apache.org Wed Aug 22 11:24:17 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 778ED180677 for ; Wed, 22 Aug 2018 11:24:16 +0200 (CEST) Received: (qmail 37183 invoked by uid 500); 22 Aug 2018 09:24:12 -0000 Mailing-List: contact commits-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tomee.apache.org Delivered-To: mailing list commits@tomee.apache.org Received: (qmail 37045 invoked by uid 99); 22 Aug 2018 09:24:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2018 09:24:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0DFA4E0255; Wed, 22 Aug 2018 09:24:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jgallimore@apache.org To: commits@tomee.apache.org Date: Wed, 22 Aug 2018 09:24:13 -0000 Message-Id: <03bec729ac8345789509002ae0bc07eb@git.apache.org> In-Reply-To: <07953bdc9b9c48638d189310c8ee0908@git.apache.org> References: <07953bdc9b9c48638d189310c8ee0908@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/5] tomee git commit: TOMEE-2221 - Tests with @JohnzonProperty and @JsonbProperty. 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 Authored: Mon Aug 13 15:40:38 2018 +0100 Committer: Roberto Cortez 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; } } }