Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D63B3200CFE for ; Fri, 8 Sep 2017 14:55:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D4D451609C5; Fri, 8 Sep 2017 12:55:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 26B9B1609BF for ; Fri, 8 Sep 2017 14:55:18 +0200 (CEST) Received: (qmail 84783 invoked by uid 500); 8 Sep 2017 12:55:16 -0000 Mailing-List: contact commits-help@olingo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@olingo.apache.org Delivered-To: mailing list commits@olingo.apache.org Received: (qmail 84774 invoked by uid 99); 8 Sep 2017 12:55:15 -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; Fri, 08 Sep 2017 12:55:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DFF6EDF99E; Fri, 8 Sep 2017 12:55:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chrisam@apache.org To: commits@olingo.apache.org Date: Fri, 08 Sep 2017 12:55:14 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] olingo-odata4 git commit: [OLINGO-1152] Test case for null enum values archived-at: Fri, 08 Sep 2017 12:55:19 -0000 [OLINGO-1152] Test case for null enum values Signed-off-by: Christian Amend Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/0a2ebd79 Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/0a2ebd79 Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/0a2ebd79 Branch: refs/heads/master Commit: 0a2ebd7953c95eded80c0d050a33c2c036cfa014 Parents: 6b34920 Author: Tom van Wietmarschen Authored: Tue Aug 22 15:08:20 2017 +0200 Committer: Christian Amend Committed: Fri Sep 8 14:51:40 2017 +0200 ---------------------------------------------------------------------- .../java/org/apache/olingo/client/core/JSONTest.java | 15 +++++++++++++++ .../org/apache/olingo/client/core/olingo1152.json | 6 ++++++ 2 files changed, 21 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0a2ebd79/lib/client-core/src/test/java/org/apache/olingo/client/core/JSONTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/JSONTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/JSONTest.java index caef339..646c562 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/JSONTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/JSONTest.java @@ -36,6 +36,7 @@ import org.apache.olingo.client.api.data.ResWrap; import org.apache.olingo.client.api.domain.ClientCollectionValue; import org.apache.olingo.client.api.domain.ClientComplexValue; import org.apache.olingo.client.api.domain.ClientEntity; +import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.client.api.domain.ClientValue; import org.apache.olingo.client.core.serialization.JsonDeserializer; import org.apache.olingo.commons.api.Constants; @@ -482,4 +483,18 @@ public class JSONTest extends AbstractTest { i++; } } + + @Test + public void issueOLINGO1152() throws Exception { + InputStream inputStream = getClass().getResourceAsStream( + "olingo1152" + "." + getSuffix(ContentType.APPLICATION_JSON)); + ClientEntity entity = client.getReader().readEntity(inputStream, ContentType.APPLICATION_JSON); + assertNotNull(entity); + ClientProperty prop = entity.getProperty("Gender"); + assertNotNull(prop); + ClientValue value = prop.getValue(); + assertNotNull(value); + assertTrue(value.asEnum() == null); + + } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0a2ebd79/lib/client-core/src/test/resources/org/apache/olingo/client/core/olingo1152.json ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/olingo1152.json b/lib/client-core/src/test/resources/org/apache/olingo/client/core/olingo1152.json new file mode 100644 index 0000000..7f288c1 --- /dev/null +++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/olingo1152.json @@ -0,0 +1,6 @@ +{ + "@odata.type": "#Microsoft.OData.SampleService.Models.TripPin.Person", + "@odata.id": "http://services.odata.org/V4/(S(fe5rsnxo3fkkkk2bvmh1nl1y))/TripPinServiceRW/People('russellwhyte')", + "Gender@odata.type": "#Microsoft.OData.SampleService.Models.TripPin.PersonGender", + "Gender": null +} \ No newline at end of file