Repository: olingo-odata4
Updated Branches:
  refs/heads/master eea324d5a -> d9aff6300


[OLINGO-1246] Including key properties in context url and response payload even 
if select clause does not include key properties


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

Branch: refs/heads/master
Commit: d9aff6300f61750d7f1a20d8ae58c322d8cde4e3
Parents: eea324d
Author: ramya vasanth <[email protected]>
Authored: Wed Mar 21 09:52:07 2018 +0530
Committer: ramya vasanth <[email protected]>
Committed: Wed Mar 21 09:52:07 2018 +0530

----------------------------------------------------------------------
 .../fit/tecsvc/client/ExpandSelectITCase.java   |  4 +--
 .../server/example/TripPinServiceTest.java      |  6 ++--
 .../serializer/json/ODataJsonSerializer.java    | 12 +++++++
 .../core/serializer/utils/ContextURLHelper.java | 16 ++++++---
 .../core/serializer/xml/ODataXmlSerializer.java | 12 +++++++
 .../processor/TechnicalEntityProcessor.java     |  2 +-
 .../json/JsonDeltaSerializerTest.java           |  2 +-
 .../JsonDeltaSerializerWithNavigationsTest.java |  5 +--
 .../json/ODataJsonSerializerTest.java           | 38 +++++++++++---------
 .../json/ODataJsonSerializerv01Test.java        | 36 ++++++++++---------
 .../serializer/utils/ContextURLHelperTest.java  | 36 ++++++++++++-------
 .../serializer/xml/ODataXmlSerializerTest.java  | 21 +++++++----
 12 files changed, 125 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java
----------------------------------------------------------------------
diff --git 
a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java 
b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java
index 149966c..939cd58 100644
--- 
a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java
+++ 
b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java
@@ -90,7 +90,7 @@ public class ExpandSelectITCase extends 
AbstractParamTecSvcITCase {
     final ClientEntity entity = response.getBody();
     assertNotNull(entity);
 
-    assertNull(entity.getProperty("PropertyInt16"));
+    assertNotNull(entity.getProperty("PropertyInt16"));
 
     final ClientProperty property = entity.getProperty("PropertyString");
     assertNotNull(property);
@@ -114,7 +114,7 @@ public class ExpandSelectITCase extends 
AbstractParamTecSvcITCase {
     assertNotNull(entities);
     assertEquals(2, entities.size());
     final ClientEntity inlineEntity = entities.get(0);
-    assertEquals(2, inlineEntity.getProperties().size());
+    assertEquals(3, inlineEntity.getProperties().size());
     assertShortOrInt(-128, 
inlineEntity.getProperty("PropertySByte").getPrimitiveValue().toValue());
     Calendar time = Calendar.getInstance();
     time.clear();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServiceTest.java
----------------------------------------------------------------------
diff --git 
a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServiceTest.java
 
b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServiceTest.java
index 5d7e2b2..270b161 100644
--- 
a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServiceTest.java
+++ 
b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServiceTest.java
@@ -357,7 +357,7 @@ public class TripPinServiceTest {
   public void testSelectOption() throws Exception {
     HttpResponse response = httpGET(baseURL + 
"/People('russellwhyte')?$select=FirstName,LastName", 200);
     JsonNode node = getJSONNode(response);
-    assertEquals("$metadata#People(FirstName,LastName)/$entity", 
node.get("@odata.context").asText());
+    assertEquals("$metadata#People(UserName,FirstName,LastName)/$entity", 
node.get("@odata.context").asText());
     assertEquals("Russell", node.get("FirstName").asText());
   }
 
@@ -432,13 +432,13 @@ public class TripPinServiceTest {
     HttpResponse response = httpGET(baseURL+"/$entity?$id="+baseURL 
         + "/People('kristakemp')&$select=FirstName", 200);
     JsonNode node = getJSONNode(response);
-    assertEquals("$metadata#People(FirstName)/$entity", 
node.get("@odata.context").asText());
+    assertEquals("$metadata#People(UserName,FirstName)/$entity", 
node.get("@odata.context").asText());
     assertEquals("Krista", node.get("FirstName").asText());
 
     // using relative URL
     response = 
httpGET(baseURL+"/$entity?$id="+"People('kristakemp')&$select=FirstName", 200);
     node = getJSONNode(response);
-    assertEquals("$metadata#People(FirstName)/$entity", 
node.get("@odata.context").asText());
+    assertEquals("$metadata#People(UserName,FirstName)/$entity", 
node.get("@odata.context").asText());
     assertEquals("Krista", node.get("FirstName").asText());
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
----------------------------------------------------------------------
diff --git 
a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
 
b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
index 9d9c47a..970d0c2 100644
--- 
a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
+++ 
b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
@@ -530,6 +530,7 @@ public class ODataJsonSerializer extends 
AbstractODataSerializer {
     final boolean all = ExpandSelectHelper.isAll(select);
     final Set<String> selected = all ? new HashSet<String>() :
         ExpandSelectHelper.getSelectedPropertyNames(select.getSelectItems());
+    addKeyPropertiesToSelected(selected, type);
     for (final String propertyName : type.getPropertyNames()) {
       if (all || selected.contains(propertyName)) {
         final EdmProperty edmProperty = 
type.getStructuralProperty(propertyName);
@@ -540,6 +541,17 @@ public class ODataJsonSerializer extends 
AbstractODataSerializer {
       }
     }
   }
+  
+  private void addKeyPropertiesToSelected(Set<String> selected, 
EdmStructuredType type) {
+    if (!selected.isEmpty() && type instanceof EdmEntityType) {
+      List<String> keyNames = ((EdmEntityType) type).getKeyPredicateNames();
+      for (String key : keyNames) {
+        if (!selected.contains(key)) {
+          selected.add(key);
+        }
+      }
+    }
+  }
 
   protected void writeNavigationProperties(final ServiceMetadata metadata,
       final EdmStructuredType type, final Linked linked, final ExpandOption 
expand, final Integer toDepth,

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
----------------------------------------------------------------------
diff --git 
a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
 
b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
index 10e21b6..8e2a1be 100644
--- 
a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
+++ 
b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java
@@ -27,6 +27,7 @@ import org.apache.olingo.commons.api.edm.EdmAction;
 import org.apache.olingo.commons.api.edm.EdmComplexType;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
 import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
 import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
 import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.EdmStructuredType;
@@ -85,10 +86,7 @@ public final class ContextURLHelper {
       for (final String propertyName : type.getNavigationPropertyNames()) {
         constructSelectItemList(type, result, selectItems, 
selectedPropertyNames, propertyName);
       }
-      if ((result.toString().length() == 0 && !selectItems.isEmpty()) ||
-          (result.toString().split(",").length < selectItems.size())) {
-        constructSelectItemListForActionsAndFunctions(type, result, 
selectItems);
-      }
+      constructSelectItemListForActionsAndFunctions(type, result, selectItems);
     }
   }
 
@@ -202,6 +200,16 @@ public final class ContextURLHelper {
           }
         }
       }
+    } else {
+      if (type instanceof EdmEntityType) {
+        final List<String> keyNames = ((EdmEntityType) 
type).getKeyPredicateNames();
+        if (keyNames.contains(propertyName)) {
+          if (result.length() > 0) {
+            result.append(',');
+          }
+          result.append(Encoder.encode(propertyName));
+        }
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
----------------------------------------------------------------------
diff --git 
a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
 
b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
index 4c1524b..120638c 100644
--- 
a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
+++ 
b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java
@@ -630,6 +630,7 @@ public class ODataXmlSerializer extends 
AbstractODataSerializer {
     final boolean all = ExpandSelectHelper.isAll(select);
     final Set<String> selected = all ? new HashSet<String>() :
         ExpandSelectHelper.getSelectedPropertyNames(select.getSelectItems());
+    addKeyPropertiesToSelected(selected, type);
     for (final String propertyName : type.getPropertyNames()) {
       if (all || selected.contains(propertyName)) {
         final EdmProperty edmProperty = 
type.getStructuralProperty(propertyName);
@@ -641,6 +642,17 @@ public class ODataXmlSerializer extends 
AbstractODataSerializer {
     }
   }
 
+  private void addKeyPropertiesToSelected(Set<String> selected, 
EdmStructuredType type) {
+    if (!selected.isEmpty() && type instanceof EdmEntityType) {
+      List<String> keyNames = ((EdmEntityType) type).getKeyPredicateNames();
+      for (String key : keyNames) {
+        if (!selected.contains(key)) {
+          selected.add(key);
+        }
+      }
+    }
+  }
+  
   protected void writeNavigationProperties(final ServiceMetadata metadata,
       final EdmStructuredType type, final Linked linked, final ExpandOption 
expand, final Integer toDepth,
       final String xml10InvalidCharReplacement, final Set<String> ancestors, 
String name, final XMLStreamWriter writer) 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
----------------------------------------------------------------------
diff --git 
a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
 
b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
index f7bf618..dd7041b 100644
--- 
a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
+++ 
b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
@@ -892,7 +892,7 @@ public class TechnicalEntityProcessor extends 
TechnicalProcessor
       throws ODataLibraryException {
 
     ContextURL contextUrl = isODataMetadataNone(requestedFormat) ? null :
-        getContextUrl(request.getRawODataPath(), edmEntitySet, edmEntityType, 
true, expand, null,isContNav);
+        getContextUrl(request.getRawODataPath(), edmEntitySet, edmEntityType, 
true, expand, select,isContNav);
     return odata.createSerializer(requestedFormat, 
request.getHeaders(HttpHeader.ODATA_VERSION)).entity(
         serviceMetadata,
         edmEntityType,

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerTest.java
----------------------------------------------------------------------
diff --git 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerTest.java
 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerTest.java
index af4c683..3e221d6 100644
--- 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerTest.java
+++ 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerTest.java
@@ -453,7 +453,7 @@ public class JsonDeltaSerializerTest {
            .select(select).build()).getContent();
           String jsonString = IOUtils.toString(stream);
     Assert.assertEquals("{"
-        
+"\"@odata.context\":\"$metadata#ESDelta(PropertyString)/$entity/$delta\","
+        
+"\"@odata.context\":\"$metadata#ESDelta(PropertyInt16,PropertyString)/$entity/$delta\","
         + 
"\"value\":[{\"@odata.id\":\"ESDelta(32767)\",\"PropertyString\":\"Number:32767\"},"
         + 
"{\"@odata.id\":\"ESDelta(-32768)\",\"PropertyString\":\"Number:-32768\"}]}",
         jsonString);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerWithNavigationsTest.java
----------------------------------------------------------------------
diff --git 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerWithNavigationsTest.java
 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerWithNavigationsTest.java
index 46c791c..c09caf9 100644
--- 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerWithNavigationsTest.java
+++ 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDeltaSerializerWithNavigationsTest.java
@@ -608,7 +608,8 @@ public class JsonDeltaSerializerWithNavigationsTest {
            .build()).getContent();
           String jsonString = IOUtils.toString(stream);
     Assert.assertEquals("{"
-        + 
"\"@context\":\"$metadata#ESDelta(PropertyString,NavPropertyETAllPrimOne(PropertyString))/$delta\","
+        + 
"\"@context\":\"$metadata#ESDelta(PropertyInt16,PropertyString,NavPropertyETAllPrimOne("
+        + "PropertyInt16,PropertyString))/$delta\","
         + 
"\"value\":[{\"@id\":\"ESDelta(100)\",\"PropertyInt16\":100,\"PropertyString\":\"Number:100\","
         + "\"NavPropertyETAllPrimOne@delta\":{\"@id\":\"ESAllPrim(32767)\","
         + "\"PropertyString\":\"First Resource - positive values\"}}]}",
@@ -642,7 +643,7 @@ public class JsonDeltaSerializerWithNavigationsTest {
            .select(select).build()).getContent();
           String jsonString = IOUtils.toString(stream);
     Assert.assertEquals("{"
-        +"\"@context\":\"$metadata#ESDelta(PropertyString)/$entity/$delta\","
+        
+"\"@context\":\"$metadata#ESDelta(PropertyInt16,PropertyString)/$entity/$delta\","
         + 
"\"value\":[{\"@id\":\"ESDelta(32767)\",\"PropertyString\":\"Number:32767\"},"
         + 
"{\"@id\":\"ESDelta(-32768)\",\"PropertyString\":\"Number:-32768\"}]}",
         jsonString);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
----------------------------------------------------------------------
diff --git 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
index c540693..378ad1d 100644
--- 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
+++ 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
@@ -1162,9 +1162,9 @@ public class ODataJsonSerializerTest {
                 .build()).getContent();
     final String resultString = IOUtils.toString(result);
     final String expectedResult = "{"
-        + 
"\"@odata.context\":\"$metadata#ESAllPrim(PropertyBoolean,PropertyDate)/$entity\","
+        + 
"\"@odata.context\":\"$metadata#ESAllPrim(PropertyInt16,PropertyBoolean,PropertyDate)/$entity\","
         + "\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\","
-        + "\"@odata.id\":\"ESAllPrim(32767)\","
+        + "\"@odata.id\":\"ESAllPrim(32767)\",\"PropertyInt16\":32767,"
         + "\"PropertyBoolean\":true,\"PropertyDate\":\"2012-12-03\"}";
     Assert.assertEquals(expectedResult, resultString);
   }
@@ -1275,11 +1275,11 @@ public class ODataJsonSerializerTest {
     
     String expected = "{"
             + "\"@odata.context\":\"$metadata#ESFourKeyAlias"
-            +   
"(PropertyComp/PropertyString,PropertyCompComp/PropertyComp)\","
+            +   
"(PropertyInt16,PropertyComp/PropertyString,PropertyCompComp/PropertyComp)\","
             + "\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\","
             + "\"value\":[{"
                 + 
"\"@odata.id\":\"ESFourKeyAlias(PropertyInt16=1,KeyAlias1=11,KeyAlias2='Num11',KeyAlias3='Num111')\","
-                + "\"PropertyComp\":{"
+                + "\"PropertyInt16\":1,\"PropertyComp\":{"
                     + "\"PropertyString\":\"Num11\""
                 + "},"
                 + "\"PropertyCompComp\":{"
@@ -1433,9 +1433,10 @@ public class ODataJsonSerializerTest {
                 .build()).getContent();
           Assert.assertNotNull(result);   
           final String resultString = IOUtils.toString(result);
-           Assert.assertEquals(  
"{\"@odata.context\":\"$metadata#ESAllPrim(PropertyBoolean,PropertyDate)/$entity\","+
+           Assert.assertEquals(  
"{\"@odata.context\":\"$metadata#ESAllPrim(PropertyInt16,"
+                  + "PropertyBoolean,PropertyDate)/$entity\","+
            
"\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\",\"@odata.id\":\"ESAllPrim(32767)\","+
-            "\"PropertyBoolean\":true,\"PropertyDate\":\"2012-12-03\"}",
+            
"\"PropertyInt16\":32767,\"PropertyBoolean\":true,\"PropertyDate\":\"2012-12-03\"}",
           resultString);   
   }
 
@@ -1493,10 +1494,12 @@ public class ODataJsonSerializerTest {
                 .expand(expand)
                 .build()).getContent());
     Assert.assertEquals("{"
-        + 
"\"@odata.context\":\"$metadata#ESTwoPrim(NavPropertyETAllPrimOne(PropertyDate))/$entity\","
+        + "\"@odata.context\":\"$metadata#ESTwoPrim(PropertyInt16,"
+               + 
"NavPropertyETAllPrimOne(PropertyInt16,PropertyDate))/$entity\","
         + "\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\","
         + "\"PropertyInt16\":32767,\"PropertyString\":\"Test String4\","
-        + 
"\"NavPropertyETAllPrimOne\":{\"@odata.id\":\"ESAllPrim(32767)\",\"PropertyDate\":\"2012-12-03\"}}",
+        + "\"NavPropertyETAllPrimOne\":{\"@odata.id\":\"ESAllPrim(32767)\","
+               + "\"PropertyInt16\":32767,\"PropertyDate\":\"2012-12-03\"}}",
         resultString);
   }
 
@@ -1522,9 +1525,9 @@ public class ODataJsonSerializerTest {
                 .select(select)
                 .build()).getContent());
     Assert.assertEquals("{"
-        + "\"@odata.context\":\"$metadata#ESAllPrim(PropertySByte)/$entity\","
+        + 
"\"@odata.context\":\"$metadata#ESAllPrim(PropertyInt16,PropertySByte)/$entity\","
         + "\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\","
-        + "\"@odata.id\":\"ESAllPrim(32767)\","
+        + "\"@odata.id\":\"ESAllPrim(32767)\",\"PropertyInt16\":32767,"
         + "\"PropertySByte\":127,"
         + 
"\"NavPropertyETTwoPrimOne\":{\"PropertyInt16\":32767,\"PropertyString\":\"Test 
String4\"},"
         + 
"\"NavPropertyETTwoPrimMany\":[{\"PropertyInt16\":-365,\"PropertyString\":\"Test
 String2\"}]}",
@@ -1551,9 +1554,9 @@ public class ODataJsonSerializerTest {
                 .select(select)
                 .build()).getContent());
     Assert.assertEquals("{"
-        + 
"\"@odata.context\":\"$metadata#ESAllPrim(PropertyTimeOfDay)/$entity\","
+        + 
"\"@odata.context\":\"$metadata#ESAllPrim(PropertyInt16,PropertyTimeOfDay)/$entity\","
         + "\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\","
-        + "\"@odata.id\":\"ESAllPrim(-32768)\","
+        + "\"@odata.id\":\"ESAllPrim(-32768)\",\"PropertyInt16\":-32768,"
         + "\"PropertyTimeOfDay\":\"23:49:14\","
         + "\"NavPropertyETTwoPrimOne\":null,\"NavPropertyETTwoPrimMany\":[]}",
         resultString);
@@ -1583,13 +1586,14 @@ public class ODataJsonSerializerTest {
                 .expand(expand)
                 .build()).getContent());
     Assert.assertEquals("{"
-        + 
"\"@odata.context\":\"$metadata#ESTwoPrim(NavPropertyETAllPrimMany(PropertyInt32))/$entity\","
+        + "\"@odata.context\":\"$metadata#ESTwoPrim(PropertyInt16,"
+               + 
"NavPropertyETAllPrimMany(PropertyInt16,PropertyInt32))/$entity\","
         + "\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\","
         + "\"PropertyInt16\":-365,\"PropertyString\":\"Test String2\","
         + "\"NavPropertyETAllPrimMany\":["
-        + "{\"@odata.id\":\"ESAllPrim(-32768)\",\"PropertyInt32\":-2147483648,"
+        + 
"{\"@odata.id\":\"ESAllPrim(-32768)\",\"PropertyInt16\":-32768,\"PropertyInt32\":-2147483648,"
         + "\"NavPropertyETTwoPrimOne\":null,\"NavPropertyETTwoPrimMany\":[]},"
-        + 
"{\"@odata.id\":\"ESAllPrim(0)\",\"PropertyInt32\":0,\"NavPropertyETTwoPrimOne\":{"
+        + 
"{\"@odata.id\":\"ESAllPrim(0)\",\"PropertyInt16\":0,\"PropertyInt32\":0,\"NavPropertyETTwoPrimOne\":{"
         + 
"\"@odata.type\":\"#olingo.odata.test1.ETBase\",\"PropertyInt16\":111,"
         + "\"PropertyString\":\"TEST A\",\"AdditionalPropertyString_5\":\"TEST 
A 0815\"},"
         + "\"NavPropertyETTwoPrimMany\":["
@@ -1621,7 +1625,7 @@ public class ODataJsonSerializerTest {
                     .suffix(Suffix.ENTITY).build())
                 .expand(expand)
                 .build()).getContent());
-    Assert.assertEquals("{\"@odata.context\":\"$metadata#ESTwoPrim/$entity\","
+    
Assert.assertEquals("{\"@odata.context\":\"$metadata#ESTwoPrim(PropertyInt16)/$entity\","
         + "\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\","
         + "\"PropertyInt16\":-365,\"PropertyString\":\"Test String2\","
         + "\"NavPropertyETAllPrimOne\":null,"
@@ -2693,7 +2697,7 @@ public class ODataJsonSerializerTest {
     final String expectedResult = 
"{\"@odata.context\":\"$metadata#ESTwoKeyNav/$entity\","
         + "\"@odata.metadataEtag\":\"W/\\\"metadataETag\\\"\","
         + "\"@odata.id\":\"ESTwoKeyNav(PropertyInt16=1,PropertyString='1')\","
-        + "\"CollPropertyCompNav\":[{}]}";
+        + 
"\"PropertyInt16\":1,\"PropertyString\":\"1\",\"CollPropertyCompNav\":[{}]}";
     Assert.assertEquals(expectedResult, resultString);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerv01Test.java
----------------------------------------------------------------------
diff --git 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerv01Test.java
 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerv01Test.java
index 3b41873..193758c 100644
--- 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerv01Test.java
+++ 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerv01Test.java
@@ -1175,9 +1175,9 @@ public class ODataJsonSerializerv01Test {
                 .build()).getContent();
     final String resultString = IOUtils.toString(result);
     final String expectedResult = "{"
-        + 
"\"@context\":\"$metadata#ESAllPrim(PropertyBoolean,PropertyDate)/$entity\","
+        + 
"\"@context\":\"$metadata#ESAllPrim(PropertyInt16,PropertyBoolean,PropertyDate)/$entity\","
         + "\"@metadataEtag\":\"W/\\\"metadataETag\\\"\","
-        + "\"@id\":\"ESAllPrim(32767)\","
+        + "\"@id\":\"ESAllPrim(32767)\",\"PropertyInt16\":32767,"
         + "\"PropertyBoolean\":true,\"PropertyDate\":\"2012-12-03\"}";
     Assert.assertEquals(expectedResult, resultString);
   }
@@ -1288,11 +1288,11 @@ public class ODataJsonSerializerv01Test {
     
     String expected = "{"
             + "\"@context\":\"$metadata#ESFourKeyAlias"
-            +   
"(PropertyComp/PropertyString,PropertyCompComp/PropertyComp)\","
+            +   
"(PropertyInt16,PropertyComp/PropertyString,PropertyCompComp/PropertyComp)\","
             + "\"@metadataEtag\":\"W/\\\"metadataETag\\\"\","
             + "\"value\":[{"
                 + 
"\"@id\":\"ESFourKeyAlias(PropertyInt16=1,KeyAlias1=11,KeyAlias2='Num11',KeyAlias3='Num111')\","
-                + "\"PropertyComp\":{"
+                + "\"PropertyInt16\":1,\"PropertyComp\":{"
                     + "\"PropertyString\":\"Num11\""
                 + "},"
                 + "\"PropertyCompComp\":{"
@@ -1446,9 +1446,10 @@ public class ODataJsonSerializerv01Test {
                 .build()).getContent();
           Assert.assertNotNull(result);   
           final String resultString = IOUtils.toString(result);
-           Assert.assertEquals(  
"{\"@context\":\"$metadata#ESAllPrim(PropertyBoolean,PropertyDate)/$entity\","+
+           Assert.assertEquals(  
"{\"@context\":\"$metadata#ESAllPrim(PropertyInt16,"
+               + "PropertyBoolean,PropertyDate)/$entity\","+
            
"\"@metadataEtag\":\"W/\\\"metadataETag\\\"\",\"@id\":\"ESAllPrim(32767)\","+
-            "\"PropertyBoolean\":true,\"PropertyDate\":\"2012-12-03\"}",
+            
"\"PropertyInt16\":32767,\"PropertyBoolean\":true,\"PropertyDate\":\"2012-12-03\"}",
           resultString);   
   }
 
@@ -1506,10 +1507,12 @@ public class ODataJsonSerializerv01Test {
                 .expand(expand)
                 .build()).getContent());
     Assert.assertEquals("{"
-        + 
"\"@context\":\"$metadata#ESTwoPrim(NavPropertyETAllPrimOne(PropertyDate))/$entity\","
+        + "\"@context\":\"$metadata#ESTwoPrim(PropertyInt16,"
+        + "NavPropertyETAllPrimOne(PropertyInt16,PropertyDate))/$entity\","
         + "\"@metadataEtag\":\"W/\\\"metadataETag\\\"\","
         + "\"PropertyInt16\":32767,\"PropertyString\":\"Test String4\","
-        + 
"\"NavPropertyETAllPrimOne\":{\"@id\":\"ESAllPrim(32767)\",\"PropertyDate\":\"2012-12-03\"}}",
+        + "\"NavPropertyETAllPrimOne\":{\"@id\":\"ESAllPrim(32767)\","
+        + "\"PropertyInt16\":32767,\"PropertyDate\":\"2012-12-03\"}}",
         resultString);
   }
 
@@ -1535,9 +1538,9 @@ public class ODataJsonSerializerv01Test {
                 .select(select)
                 .build()).getContent());
     Assert.assertEquals("{"
-        + "\"@context\":\"$metadata#ESAllPrim(PropertySByte)/$entity\","
+        + 
"\"@context\":\"$metadata#ESAllPrim(PropertyInt16,PropertySByte)/$entity\","
         + "\"@metadataEtag\":\"W/\\\"metadataETag\\\"\","
-        + "\"@id\":\"ESAllPrim(32767)\","
+        + "\"@id\":\"ESAllPrim(32767)\",\"PropertyInt16\":32767,"
         + "\"PropertySByte\":127,"
         + 
"\"NavPropertyETTwoPrimOne\":{\"PropertyInt16\":32767,\"PropertyString\":\"Test 
String4\"},"
         + 
"\"NavPropertyETTwoPrimMany\":[{\"PropertyInt16\":-365,\"PropertyString\":\"Test
 String2\"}]}",
@@ -1564,9 +1567,9 @@ public class ODataJsonSerializerv01Test {
                 .select(select)
                 .build()).getContent());
     Assert.assertEquals("{"
-        + "\"@context\":\"$metadata#ESAllPrim(PropertyTimeOfDay)/$entity\","
+        + 
"\"@context\":\"$metadata#ESAllPrim(PropertyInt16,PropertyTimeOfDay)/$entity\","
         + "\"@metadataEtag\":\"W/\\\"metadataETag\\\"\","
-        + "\"@id\":\"ESAllPrim(-32768)\","
+        + "\"@id\":\"ESAllPrim(-32768)\",\"PropertyInt16\":-32768,"
         + "\"PropertyTimeOfDay\":\"23:49:14\","
         + "\"NavPropertyETTwoPrimOne\":null,\"NavPropertyETTwoPrimMany\":[]}",
         resultString);
@@ -1596,13 +1599,14 @@ public class ODataJsonSerializerv01Test {
                 .expand(expand)
                 .build()).getContent());
     Assert.assertEquals("{"
-        + 
"\"@context\":\"$metadata#ESTwoPrim(NavPropertyETAllPrimMany(PropertyInt32))/$entity\","
+        + "\"@context\":\"$metadata#ESTwoPrim(PropertyInt16,"
+        + "NavPropertyETAllPrimMany(PropertyInt16,PropertyInt32))/$entity\","
         + "\"@metadataEtag\":\"W/\\\"metadataETag\\\"\","
         + "\"PropertyInt16\":-365,\"PropertyString\":\"Test String2\","
         + "\"NavPropertyETAllPrimMany\":["
-        + "{\"@id\":\"ESAllPrim(-32768)\",\"PropertyInt32\":-2147483648,"
+        + 
"{\"@id\":\"ESAllPrim(-32768)\",\"PropertyInt16\":-32768,\"PropertyInt32\":-2147483648,"
         + "\"NavPropertyETTwoPrimOne\":null,\"NavPropertyETTwoPrimMany\":[]},"
-        + 
"{\"@id\":\"ESAllPrim(0)\",\"PropertyInt32\":0,\"NavPropertyETTwoPrimOne\":{"
+        + 
"{\"@id\":\"ESAllPrim(0)\",\"PropertyInt16\":0,\"PropertyInt32\":0,\"NavPropertyETTwoPrimOne\":{"
         + "\"@type\":\"#olingo.odata.test1.ETBase\",\"PropertyInt16\":111,"
         + "\"PropertyString\":\"TEST A\",\"AdditionalPropertyString_5\":\"TEST 
A 0815\"},"
         + "\"NavPropertyETTwoPrimMany\":["
@@ -1634,7 +1638,7 @@ public class ODataJsonSerializerv01Test {
                     .suffix(Suffix.ENTITY).build())
                 .expand(expand)
                 .build()).getContent());
-    Assert.assertEquals("{\"@context\":\"$metadata#ESTwoPrim/$entity\","
+    
Assert.assertEquals("{\"@context\":\"$metadata#ESTwoPrim(PropertyInt16)/$entity\","
         + "\"@metadataEtag\":\"W/\\\"metadataETag\\\"\","
         + "\"PropertyInt16\":-365,\"PropertyString\":\"Test String2\","
         + "\"NavPropertyETAllPrimOne\":null,"

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelperTest.java
----------------------------------------------------------------------
diff --git 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelperTest.java
 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelperTest.java
index 95bc600..acbf2e4 100644
--- 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelperTest.java
+++ 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelperTest.java
@@ -223,8 +223,8 @@ public class ContextURLHelperTest {
     final SelectOption select = 
ExpandSelectMock.mockSelectOption(Arrays.asList(selectItem));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), expand, 
select)).build();
-    
assertEquals("$metadata#ESTwoPrim(PropertyString,NavPropertyETAllPrimOne(),"
-        + "NavPropertyETAllPrimMany(PropertyInt32))",
+    
assertEquals("$metadata#ESTwoPrim(PropertyInt16,PropertyString,NavPropertyETAllPrimOne(),"
+        + "NavPropertyETAllPrimMany(PropertyInt16,PropertyInt32))",
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
 
@@ -342,7 +342,8 @@ public class ContextURLHelperTest {
     final SelectOption select = 
ExpandSelectMock.mockSelectOption(Arrays.asList(selectItem));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    
assertEquals("$metadata#ESCompCollDerived(PropertyCompAno/olingo.odata.test1.CTBaseAno/AdditionalPropString)",
 
+    assertEquals("$metadata#ESCompCollDerived(PropertyInt16,PropertyCompAno/"
+        + "olingo.odata.test1.CTBaseAno/AdditionalPropString)", 
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
   
@@ -356,7 +357,7 @@ public class ContextURLHelperTest {
     final SelectOption select = 
ExpandSelectMock.mockSelectOption(Arrays.asList(selectItem));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    assertEquals("$metadata#ESCompCollComp(PropertyComp/CollPropertyComp/"
+    
assertEquals("$metadata#ESCompCollComp(PropertyInt16,PropertyComp/CollPropertyComp/"
         + "olingo.odata.test1.CTBase/AdditionalPropString)", 
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
@@ -372,7 +373,9 @@ public class ContextURLHelperTest {
     final SelectOption select = 
ExpandSelectMock.mockSelectOption(Arrays.asList(selectItem));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    
assertEquals("$metadata#ESTwoKeyNav(olingo.odata.test1.ETBaseTwoKeyNav/NavPropertyETBaseTwoKeyNavOne)",
 
+    assertEquals("$metadata#ESTwoKeyNav(PropertyInt16,PropertyString,"
+        + "olingo.odata.test1.ETBaseTwoKeyNav/"
+        + "NavPropertyETBaseTwoKeyNavOne)", 
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
   
@@ -387,7 +390,8 @@ public class ContextURLHelperTest {
     final SelectOption select = 
ExpandSelectMock.mockSelectOption(Arrays.asList(selectItem));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    
assertEquals("$metadata#ESTwoKeyNav(olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate)",
 
+    assertEquals("$metadata#ESTwoKeyNav(PropertyInt16,PropertyString,"
+        + "olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate)", 
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
   
@@ -403,7 +407,8 @@ public class ContextURLHelperTest {
     final SelectOption select = 
ExpandSelectMock.mockSelectOption(Arrays.asList(selectItem1, selectItem2));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    
assertEquals("$metadata#ESTwoKeyNav(CollPropertyComp,olingo.odata.test1.ETBaseTwoKeyNav/"
+    assertEquals("$metadata#ESTwoKeyNav(PropertyInt16,PropertyString,"
+        + "CollPropertyComp,olingo.odata.test1.ETBaseTwoKeyNav/"
         + "NavPropertyETTwoBaseTwoKeyNavOne)", 
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
@@ -421,7 +426,8 @@ public class ContextURLHelperTest {
     final SelectOption select = 
ExpandSelectMock.mockSelectOption(Arrays.asList(selectItem));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    
assertEquals("$metadata#ESTwoKeyNav(olingo.odata.test1.ETBaseTwoKeyNav/CollPropertyComp/"
+    assertEquals("$metadata#ESTwoKeyNav(PropertyInt16,PropertyString,"
+        + "olingo.odata.test1.ETBaseTwoKeyNav/CollPropertyComp/"
         + "olingo.odata.test1.CTBasePrimCompNav/NavPropertyETTwoKeyNavOne)", 
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
@@ -443,7 +449,7 @@ public class ContextURLHelperTest {
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), expand, 
null)).build();
     assertEquals("$metadata#ESKeyNavCont(NavPropertyETTwoKeyNavContOne("
-        + "olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate))", 
+        + 
"PropertyInt16,PropertyString,olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate))",
 
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
   
@@ -456,7 +462,8 @@ public class ContextURLHelperTest {
         selectItem));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    
assertEquals("$metadata#ESTwoKeyNav(CollPropertyCompNav/NavPropertyETTwoKeyNavMany)",
+    assertEquals("$metadata#ESTwoKeyNav(PropertyInt16,PropertyString,"
+        + "CollPropertyCompNav/NavPropertyETTwoKeyNavMany)",
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
   
@@ -472,7 +479,8 @@ public class ContextURLHelperTest {
         selectItem));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    
assertEquals("$metadata#ESTwoKeyNav(olingo.odata.test1.BAESTwoKeyNavRTESTwoKeyNav)",
+    assertEquals("$metadata#ESTwoKeyNav(PropertyInt16,PropertyString,"
+        + "olingo.odata.test1.BAESTwoKeyNavRTESTwoKeyNav)",
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
   
@@ -490,7 +498,8 @@ public class ContextURLHelperTest {
         selectItem1, selectItem2));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    
assertEquals("$metadata#ESTwoKeyNav(PropertyString,olingo.odata.test1.BAESTwoKeyNavRTESTwoKeyNav)",
+    assertEquals("$metadata#ESTwoKeyNav(PropertyInt16,PropertyString,"
+        + "olingo.odata.test1.BAESTwoKeyNavRTESTwoKeyNav)",
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
   
@@ -506,7 +515,8 @@ public class ContextURLHelperTest {
         selectItem));
     final ContextURL contextURL = ContextURL.with().entitySet(entitySet)
         
.selectList(ContextURLHelper.buildSelectList(entitySet.getEntityType(), null, 
select)).build();
-    
assertEquals("$metadata#ESTwoKeyNav(olingo.odata.test1.BFCESTwoKeyNavRTString)",
+    assertEquals("$metadata#ESTwoKeyNav(PropertyInt16,PropertyString,"
+        + "olingo.odata.test1.BFCESTwoKeyNavRTString)",
         ContextURLBuilder.create(contextURL).toASCIIString());
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9aff630/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java
----------------------------------------------------------------------
diff --git 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java
 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java
index c1f112d..40fa334 100644
--- 
a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java
+++ 
b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializerTest.java
@@ -1521,7 +1521,7 @@ public class ODataXmlSerializerTest {
         "<a:entry xmlns:a=\"http://www.w3.org/2005/Atom\"\n"; +
         "  xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n"; +
         "  xmlns:d=\"http://docs.oasis-open.org/odata/ns/data\"; " +
-        "  
m:context=\"$metadata#ESAllPrim(PropertyBoolean,PropertyDate)/$entity\"\n" +
+        "  
m:context=\"$metadata#ESAllPrim(PropertyInt16,PropertyBoolean,PropertyDate)/$entity\"\n"
 +
         "  m:metadata-etag=\"metadataETag\">\n" +
         "  <a:id>ESAllPrim(32767)</a:id>\n" +
         "  <a:title />\n" +
@@ -1543,6 +1543,7 @@ public class ODataXmlSerializerTest {
         "    term=\"#olingo.odata.test1.ETAllPrim\" />\n" +
         "  <a:content type=\"application/xml\">\n" +
         "    <m:properties>\n" +
+        "      <d:PropertyInt16 m:type=\"Int16\">32767</d:PropertyInt16>" +
         "      <d:PropertyBoolean 
m:type=\"Boolean\">true</d:PropertyBoolean>\n" +
         "      <d:PropertyDate m:type=\"Date\">2012-12-03</d:PropertyDate>\n" +
         "    </m:properties>\n" +
@@ -1685,7 +1686,7 @@ public class ODataXmlSerializerTest {
             "xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n"; +
             "xmlns:d=\"http://docs.oasis-open.org/odata/ns/data\"; \n" +
             "m:context=\"$metadata#ESFourKeyAlias" + 
-            "(PropertyComp/PropertyString,PropertyCompComp/PropertyComp)\"\n" +
+            
"(PropertyInt16,PropertyComp/PropertyString,PropertyCompComp/PropertyComp)\"\n" 
+
             "m:metadata-etag=\"metadataETag\">\n" +
             "<a:id>http://host/svc/ESFourKeyAlias</a:id>\n" +
             "<a:entry>\n" +
@@ -1702,6 +1703,7 @@ public class ODataXmlSerializerTest {
                  "term=\"#olingo.odata.test1.ETFourKeyAlias\"/>\n" +
                 "<a:content type=\"application/xml\">\n" +
                     "<m:properties>\n" +
+                "        <d:PropertyInt16 
m:type=\"Int16\">1</d:PropertyInt16>" +
                         "<d:PropertyComp 
m:type=\"#olingo.odata.test1.CTTwoPrim\">\n" +
                             "<d:PropertyString>Num11</d:PropertyString>\n" +
                         "</d:PropertyComp>\n" +
@@ -1951,7 +1953,8 @@ public class ODataXmlSerializerTest {
         "<a:entry xmlns:a=\"http://www.w3.org/2005/Atom\"; "
         + "xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n"; +
         "  xmlns:d=\"http://docs.oasis-open.org/odata/ns/data\"\n"; +
-        "  
m:context=\"$metadata#ESTwoPrim(NavPropertyETAllPrimOne(PropertyDate))/$entity\"\n"
 +
+        "  m:context=\"$metadata#ESTwoPrim(PropertyInt16,"
+        + "NavPropertyETAllPrimOne(PropertyInt16,PropertyDate))/$entity\"\n" +
         "  m:metadata-etag=\"metadataETag\">\n" +
         "  <a:id>ESTwoPrim(32767)</a:id>\n" +
         "  <a:title />\n" +
@@ -1987,6 +1990,7 @@ public class ODataXmlSerializerTest {
         "          term=\"#olingo.odata.test1.ETAllPrim\" />\n" +
         "        <a:content type=\"application/xml\">\n" +
         "          <m:properties>\n" +
+        "            <d:PropertyInt16 
m:type=\"Int16\">32767</d:PropertyInt16>" +
         "            <d:PropertyDate 
m:type=\"Date\">2012-12-03</d:PropertyDate>\n" +
         "          </m:properties>\n" +
         "        </a:content>\n" +
@@ -2051,7 +2055,7 @@ public class ODataXmlSerializerTest {
         "<a:entry xmlns:a=\"http://www.w3.org/2005/Atom\"\n"; +
         "  xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n"; +
         "  xmlns:d=\"http://docs.oasis-open.org/odata/ns/data\"; "
-        + "m:context=\"$metadata#ESAllPrim(PropertySByte)/$entity\"\n" +
+        + 
"m:context=\"$metadata#ESAllPrim(PropertyInt16,PropertySByte)/$entity\"\n" +
         "  m:metadata-etag=\"metadataETag\">\n" +
         "  <a:id>ESAllPrim(32767)</a:id>\n" +
         "  <a:title />\n" +
@@ -2159,6 +2163,7 @@ public class ODataXmlSerializerTest {
         "    term=\"#olingo.odata.test1.ETAllPrim\" />\n" +
         "  <a:content type=\"application/xml\">\n" +
         "    <m:properties>\n" +
+        "      <d:PropertyInt16 m:type=\"Int16\">32767</d:PropertyInt16>" +
         "      <d:PropertySByte m:type=\"SByte\">127</d:PropertySByte>\n" +
         "    </m:properties>\n" +
         "  </a:content>\n" +
@@ -2195,7 +2200,7 @@ public class ODataXmlSerializerTest {
         "<a:entry xmlns:a=\"http://www.w3.org/2005/Atom\"; "
         + "xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n"; +
         "  xmlns:d=\"http://docs.oasis-open.org/odata/ns/data\"; "
-        + "m:context=\"$metadata#ESAllPrim(PropertyTimeOfDay)/$entity\"\n" +
+        + 
"m:context=\"$metadata#ESAllPrim(PropertyInt16,PropertyTimeOfDay)/$entity\"\n" +
         "  m:metadata-etag=\"metadataETag\">\n" +
         "  <a:id>ESAllPrim(-32768)</a:id>\n" +
         "  <a:title />\n" +
@@ -2223,6 +2228,7 @@ public class ODataXmlSerializerTest {
         "    term=\"#olingo.odata.test1.ETAllPrim\" />\n" +
         "  <a:content type=\"application/xml\">\n" +
         "    <m:properties>\n" +
+        "      <d:PropertyInt16 m:type=\"Int16\">-32768</d:PropertyInt16>" +
         "      <d:PropertyTimeOfDay m:type=\"TimeOfDay\">23:49:14\n" +
         "      </d:PropertyTimeOfDay>\n" +
         "    </m:properties>\n" +
@@ -2263,7 +2269,8 @@ public class ODataXmlSerializerTest {
         "<a:entry xmlns:a=\"http://www.w3.org/2005/Atom\"; "
         + "xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n"; +
         "  xmlns:d=\"http://docs.oasis-open.org/odata/ns/data\"\n"; +
-        "  
m:context=\"$metadata#ESTwoPrim(NavPropertyETAllPrimMany(PropertyInt32))/$entity\"\n"
 +
+        "  m:context=\"$metadata#ESTwoPrim(PropertyInt16,"
+        + "NavPropertyETAllPrimMany(PropertyInt16,PropertyInt32))/$entity\"\n" 
+
         "  m:metadata-etag=\"metadataETag\">\n" +
         "  <a:id>ESTwoPrim(-365)</a:id>\n" +
         "  <a:title />\n" +
@@ -2311,6 +2318,7 @@ public class ODataXmlSerializerTest {
         "            term=\"#olingo.odata.test1.ETAllPrim\" />\n" +
         "          <a:content type=\"application/xml\">\n" +
         "            <m:properties>\n" +
+        "              <d:PropertyInt16 
m:type=\"Int16\">-32768</d:PropertyInt16>" +
         "              <d:PropertyInt32 
m:type=\"Int32\">-2147483648</d:PropertyInt32>\n" +
         "            </m:properties>\n" +
         "          </a:content>\n" +
@@ -2494,6 +2502,7 @@ public class ODataXmlSerializerTest {
         "            term=\"#olingo.odata.test1.ETAllPrim\" />\n" +
         "          <a:content type=\"application/xml\">\n" +
         "            <m:properties>\n" +
+        "              <d:PropertyInt16 m:type=\"Int16\">0</d:PropertyInt16>" +
         "              <d:PropertyInt32 
m:type=\"Int32\">0</d:PropertyInt32>\n" +
         "            </m:properties>\n" +
         "          </a:content>\n" +

Reply via email to