Repository: olingo-odata2
Updated Branches:
  refs/heads/master b96a9d152 -> 04a45ec92


[OLINGO-1283]Facet info for Function Import parameters not honored


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/04a45ec9
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/04a45ec9
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/04a45ec9

Branch: refs/heads/master
Commit: 04a45ec92e0ff1b29887ac281349b9777e281978
Parents: b96a9d1
Author: Archana Rai <archana....@sap.com>
Authored: Mon Aug 20 18:14:33 2018 +0530
Committer: Archana Rai <archana....@sap.com>
Committed: Mon Aug 20 18:14:33 2018 +0530

----------------------------------------------------------------------
 .../core/ep/consumer/XmlPropertyConsumer.java     |  2 +-
 .../core/ep/consumer/XmlEntityConsumerTest.java   | 18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/04a45ec9/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java
 
b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java
index 8a052cb..557191c 100644
--- 
a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java
+++ 
b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java
@@ -159,7 +159,7 @@ public class XmlPropertyConsumer {
 
       if (TRUE.equals(nullAttribute)) {
         if ((readProperties == null || readProperties.isValidatingFacets()) && 
propertyInfo.isMandatory()) {
-          throw new 
EntityProviderException(EntityProviderException.INVALID_PROPERTY_VALUE.addContent(name));
+          throw new 
EdmSimpleTypeException(EdmSimpleTypeException.VALUE_NULL_NOT_ALLOWED.addContent(name));
         }
         reader.nextTag();
       } else if (propertyInfo.isComplex()) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/04a45ec9/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
----------------------------------------------------------------------
diff --git 
a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
 
b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
index b8ba340..4f51fcd 100644
--- 
a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
+++ 
b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
@@ -2033,7 +2033,23 @@ public class XmlEntityConsumerTest extends 
AbstractXmlConsumerTest {
     assertTrue(properties.containsKey("EntryDate"));
     assertNull(properties.get("EntryDate"));
   }
-
+  
+  @Test(expected = EntityProviderException.class)
+  public void readEntryNullId() throws Exception {
+    final EdmEntitySet entitySet = 
MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees");
+    final String content = 
EMPLOYEE_1_XML.replace("<d:EmployeeId>1</d:EmployeeId>",
+        "<d:EmployeeId m:null='true' />");
+    InputStream contentBody = createContentAsStream(content);
+    try {
+      new XmlEntityConsumer().readEntry(entitySet, contentBody, 
EntityProviderReadProperties.init().mergeSemantic(
+          true).build());
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.EXCEPTION_OCCURRED.getKey(), 
e.getMessageReference().getKey());
+      assertEquals("EdmSimpleTypeException", 
e.getMessageReference().getContent().get(0));
+      throw e;
+    }
+  }
+  
   @Test(expected = EntityProviderException.class)
   public void readEntryTooManyValues() throws Exception {
     // prepare

Reply via email to