You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2015/04/21 17:02:41 UTC

[1/2] olingo-odata4 git commit: [OLINGO-424] Fix: The client proxy sets entity type segements to the right position

Repository: olingo-odata4
Updated Branches:
  refs/heads/master cd23eb96f -> 05cbf674f


[OLINGO-424] Fix: The client proxy sets entity type segements to the right position


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

Branch: refs/heads/master
Commit: 935a9b84b9ac2a6b2fafa73ac0ad7cfabf3f36c5
Parents: cd23eb9
Author: Christian Holzer <c....@sap.com>
Authored: Thu Apr 16 16:32:33 2015 +0200
Committer: Christian Holzer <c....@sap.com>
Committed: Tue Apr 21 16:57:29 2015 +0200

----------------------------------------------------------------------
 .../commons/EntitySetInvocationHandler.java     |   9 +-
 .../org/apache/olingo/fit/AbstractServices.java |  62 ++--
 .../java/org/apache/olingo/fit/V4Services.java  |   2 +-
 .../filter/(PersonID lt 4).full.json            |  84 +++++
 .../filter/(PersonID lt 4).xml                  |  68 ++++
 .../feed.full.json                              | 333 +++++++++++++++++++
 .../feed.xml                                    | 219 ++++++++++++
 .../olingo/fit/proxy/v4/FilterTestITCase.java   |  23 +-
 8 files changed, 770 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/935a9b84/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
index 6b7ff9c..2f943d6 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
@@ -169,20 +169,19 @@ public class EntitySetInvocationHandler<
     final Class<S> oref = (Class<S>) ClassUtils.extractTypeArg(this.collItemRef,
             AbstractEntitySet.class, AbstractSingleton.class, EntityCollection.class);
 
-    final URIBuilder uriBuilder = getClient().newURIBuilder(this.uri.build().toASCIIString());
-
+    
     if (!oref.equals(ref)) {
-      uriBuilder.appendDerivedEntityTypeSegment(new FullQualifiedName(
+      uri.appendDerivedEntityTypeSegment(new FullQualifiedName(
               ClassUtils.getNamespace(ref), ClassUtils.getEntityTypeName(ref)).toString());
     }
 
     final List<ODataAnnotation> anns = new ArrayList<ODataAnnotation>();
 
-    final Triple<List<T>, URI, List<ODataAnnotation>> entitySet = fetchPartial(uriBuilder.build(), (Class<T>) ref);
+    final Triple<List<T>, URI, List<ODataAnnotation>> entitySet = fetchPartial(uri.build(), (Class<T>) ref);
     anns.addAll(entitySet.getRight());
 
     final EntityCollectionInvocationHandler<S> entityCollectionHandler = new EntityCollectionInvocationHandler<S>(
-            service, (List<S>) entitySet.getLeft(), collTypeRef, this.baseURI, uriBuilder);
+            service, (List<S>) entitySet.getLeft(), collTypeRef, this.baseURI, uri);
     entityCollectionHandler.setAnnotations(anns);
 
     entityCollectionHandler.nextPageURI = entitySet.getMiddle();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/935a9b84/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
index 01f0d92..b04e7ed 100644
--- a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
+++ b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
@@ -927,23 +927,10 @@ public abstract class AbstractServices {
       return xml.createFaultResponse(accept, e);
     }
   }
-
-  /**
-   * Retrieve entity set or function execution sample.
-   *
-   * @param accept Accept header.
-   * @param name entity set or function name.
-   * @param format format query option.
-   * @param count inlinecount query option.
-   * @param filter filter query option.
-   * @param orderby orderby query option.
-   * @param skiptoken skiptoken query option.
-   * @return entity set or function result.
-   */
+  
   @GET
-  @Path("/{name}")
-  public Response getEntitySet(
-      @Context final UriInfo uriInfo,
+  @Path("/{name}/{type:[a-zA-Z].*}")
+  public Response getEntitySet(@Context final UriInfo uriInfo,
       @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
       @PathParam("name") final String name,
       @QueryParam("$top") @DefaultValue(StringUtils.EMPTY) final String top,
@@ -952,8 +939,9 @@ public abstract class AbstractServices {
       @QueryParam("$inlinecount") @DefaultValue(StringUtils.EMPTY) final String count,
       @QueryParam("$filter") @DefaultValue(StringUtils.EMPTY) final String filter,
       @QueryParam("$orderby") @DefaultValue(StringUtils.EMPTY) final String orderby,
-      @QueryParam("$skiptoken") @DefaultValue(StringUtils.EMPTY) final String skiptoken) {
-
+      @QueryParam("$skiptoken") @DefaultValue(StringUtils.EMPTY) final String skiptoken,
+      @PathParam("type") final String type) {
+    
     try {
       final Accept acceptType;
       if (StringUtils.isNotBlank(format)) {
@@ -971,13 +959,17 @@ public abstract class AbstractServices {
         if (acceptType == Accept.XML || acceptType == Accept.TEXT) {
           throw new UnsupportedMediaTypeException("Unsupported media type");
         }
-
+        
         // search for entitySet ...
         final String basePath = name + File.separatorChar;
 
         final StringBuilder builder = new StringBuilder();
         builder.append(basePath);
-
+        
+        if(type != null) {
+          builder.append(type).append(File.separatorChar);
+        }
+        
         if (StringUtils.isNotBlank(orderby)) {
           builder.append(Constants.get(ConstantKey.ORDERBY)).append(File.separatorChar).
               append(orderby).append(File.separatorChar);
@@ -1039,6 +1031,36 @@ public abstract class AbstractServices {
       return xml.createFaultResponse(accept, e);
     }
   }
+  
+  
+  /**
+   * Retrieve entity set or function execution sample.
+   *
+   * @param accept Accept header.
+   * @param name entity set or function name.
+   * @param format format query option.
+   * @param count inlinecount query option.
+   * @param filter filter query option.
+   * @param orderby orderby query option.
+   * @param skiptoken skiptoken query option.
+   * @return entity set or function result.
+   */
+  @GET
+  @Path("/{name}")
+  public Response getEntitySet(
+      @Context final UriInfo uriInfo,
+      @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+      @PathParam("name") final String name,
+      @QueryParam("$top") @DefaultValue(StringUtils.EMPTY) final String top,
+      @QueryParam("$skip") @DefaultValue(StringUtils.EMPTY) final String skip,
+      @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
+      @QueryParam("$inlinecount") @DefaultValue(StringUtils.EMPTY) final String count,
+      @QueryParam("$filter") @DefaultValue(StringUtils.EMPTY) final String filter,
+      @QueryParam("$orderby") @DefaultValue(StringUtils.EMPTY) final String orderby,
+      @QueryParam("$skiptoken") @DefaultValue(StringUtils.EMPTY) final String skiptoken) {
+
+    return getEntitySet(uriInfo, accept, name, top, skip, format, count, filter, orderby, skiptoken, null);
+  }
 
   protected abstract void setInlineCount(final EntityCollection feed, final String count);
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/935a9b84/fit/src/main/java/org/apache/olingo/fit/V4Services.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/V4Services.java b/fit/src/main/java/org/apache/olingo/fit/V4Services.java
index 4a41002..711cdf0 100644
--- a/fit/src/main/java/org/apache/olingo/fit/V4Services.java
+++ b/fit/src/main/java/org/apache/olingo/fit/V4Services.java
@@ -395,7 +395,7 @@ public class V4Services extends AbstractServices {
             ? super.getEntityInternal(
                 uriInfo.getRequestUri().toASCIIString(), accept, "People", type, format, null, null)
             : super.getEntitySet(accept, "People", type)
-        : super.getEntitySet(uriInfo, accept, "People", top, skip, format, count, filter, orderby, skiptoken);
+        : super.getEntitySet(uriInfo, accept, "People", top, skip, format, count, filter, orderby, skiptoken, type);
   }
 
   @GET

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/935a9b84/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/filter/(PersonID lt 4).full.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/filter/(PersonID lt 4).full.json b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/filter/(PersonID lt 4).full.json
new file mode 100644
index 0000000..60ce2fe
--- /dev/null
+++ b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/filter/(PersonID lt 4).full.json	
@@ -0,0 +1,84 @@
+{
+  "@odata.context": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/$metadata#People",
+  "value":
+          [
+            {
+              "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Employee",
+              "@odata.id": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)",
+              "@odata.editLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee",
+              "PersonID": 3,
+              "FirstName": "Jacob",
+              "LastName": "Zip",
+              "MiddleName": null,
+              "HomeAddress":
+                      {
+                        "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Address",
+                        "Street": "1 Microsoft Way",
+                        "City": "Sydney",
+                        "PostalCode": "98052"
+                      },
+              "Home@odata.type": "#GeographyPoint",
+              "Home":
+                      {
+                        "type": "Point",
+                        "coordinates":
+                                [
+                                  161.8,
+                                  15
+                                ],
+                        "crs":
+                                {
+                                  "type": "name",
+                                  "properties":
+                                          {
+                                            "name": "EPSG:4326"
+                                          }
+                                }
+                      },
+              "Numbers@odata.type": "#Collection(String)",
+              "Numbers":
+                      [
+                        "333-333-3333"
+                      ],
+              "Emails@odata.type": "#Collection(String)",
+              "Emails":
+                      [
+                        null
+                      ],
+              "DateHired@odata.type": "#DateTimeOffset",
+              "DateHired": "2010-12-13T00:00:00Z",
+              "Office@odata.type": "#GeographyPoint",
+              "Office":
+                      {
+                        "type": "Point",
+                        "coordinates":
+                                [
+                                  162,
+                                  15
+                                ],
+                        "crs":
+                                {
+                                  "type": "name",
+                                  "properties":
+                                          {
+                                            "name": "EPSG:4326"
+                                          }
+                                }
+                      },
+              "Parent@odata.associationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent/$ref",
+              "Parent@odata.navigationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent",
+              "Company@odata.associationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company/$ref",
+              "Company@odata.navigationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company",
+              "#Microsoft.Test.OData.Services.ODataWCFService.ResetAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.ResetAddress",
+                        "target": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress"
+                      },
+              "#Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress",
+                        "target": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress"
+                      }
+            }
+          ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/935a9b84/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/filter/(PersonID lt 4).xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/filter/(PersonID lt 4).xml b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/filter/(PersonID lt 4).xml
new file mode 100644
index 0000000..ff9c952
--- /dev/null
+++ b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/filter/(PersonID lt 4).xml	
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<feed xml:base="http://odatae2etest.azurewebsites.net/javatest/DefaultService/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://docs.oasis-open.org/odata/ns/data" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:context="http://odatae2etest.azurewebsites.net/javatest/DefaultService/$metadata#People">
+  <id>http://odatae2etest.azurewebsites.net/javatest/DefaultService/People</id>
+  <title />
+  <updated>2014-05-08T16:18:03Z</updated>
+  <entry>
+    <id>http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)</id>
+    <category term="#Microsoft.Test.OData.Services.ODataWCFService.Employee" scheme="http://docs.oasis-open.org/odata/ns/scheme" />
+    <link rel="edit" href="http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Parent" type="application/atom+xml;type=entry" title="Parent" href="http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Company" type="application/atom+xml;type=entry" title="Company" href="http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company" />
+    <title />
+    <updated>2014-05-08T16:18:03Z</updated>
+    <author>
+      <name />
+    </author>
+    <content type="application/xml">
+      <m:properties>
+        <d:PersonID m:type="Int32">3</d:PersonID>
+        <d:FirstName>Jacob</d:FirstName>
+        <d:LastName>Zip</d:LastName>
+        <d:MiddleName m:null="true" />
+        <d:HomeAddress m:type="#Microsoft.Test.OData.Services.ODataWCFService.Address">
+          <d:Street>1 Microsoft Way</d:Street>
+          <d:City>Sydney</d:City>
+          <d:PostalCode>98052</d:PostalCode>
+        </d:HomeAddress>
+        <d:Home m:type="GeographyPoint">
+          <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+            <gml:pos>15 161.8</gml:pos>
+          </gml:Point>
+        </d:Home>
+        <d:Numbers m:type="#Collection(String)">
+          <m:element>333-333-3333</m:element>
+        </d:Numbers>
+        <d:Emails m:type="#Collection(String)">
+          <m:element m:null="true" />
+        </d:Emails>
+        <d:DateHired m:type="DateTimeOffset">2010-12-13T00:00:00Z</d:DateHired>
+        <d:Office m:type="GeographyPoint">
+          <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+            <gml:pos>15 162</gml:pos>
+          </gml:Point>
+        </d:Office>
+      </m:properties>
+    </content>
+  </entry>
+</feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/935a9b84/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Person/feed.full.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Person/feed.full.json b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Person/feed.full.json
new file mode 100644
index 0000000..3e0dda8
--- /dev/null
+++ b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Person/feed.full.json
@@ -0,0 +1,333 @@
+{
+  "@odata.context": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#People",
+  "value":
+          [
+            {
+              "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Customer",
+              "@odata.id": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)",
+              "@odata.editLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer",
+              "PersonID": 1,
+              "FirstName": "Bob",
+              "LastName": "Cat",
+              "MiddleName": null,
+              "HomeAddress":
+                      {
+                        "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.HomeAddress",
+                        "Street": "1 Microsoft Way",
+                        "City": "London",
+                        "PostalCode": "98052",
+                        "FamilyName": "Cats"
+                      },
+              "Home@odata.type": "#GeographyPoint",
+              "Home":
+                      {
+                        "type": "Point",
+                        "coordinates":
+                                [
+                                  23.1,
+                                  32.1
+                                ],
+                        "crs":
+                                {
+                                  "type": "name",
+                                  "properties":
+                                          {
+                                            "name": "EPSG:4326"
+                                          }
+                                }
+                      },
+              "Numbers@odata.type": "#Collection(String)",
+              "Numbers":
+                      [
+                        "111-111-1111"
+                      ],
+              "Emails@odata.type": "#Collection(String)",
+              "Emails":
+                      [
+                        "abc@abc.com"
+                      ],
+              "City": "London",
+              "Birthday@odata.type": "#DateTimeOffset",
+              "Birthday": "1957-04-03T00:00:00Z",
+              "TimeBetweenLastTwoOrders@odata.type": "#Duration",
+              "TimeBetweenLastTwoOrders": "PT0.0000001S",
+              "Parent@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent/$ref",
+              "Parent@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent",
+              "Orders@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders/$ref",
+              "Orders@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders",
+              "Company@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company/$ref",
+              "Company@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company",
+              "#Microsoft.Test.OData.Services.ODataWCFService.ResetAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.ResetAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress"
+                      },
+              "#Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress"
+                      }
+            },
+            {
+              "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Customer",
+              "@odata.id": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)",
+              "@odata.editLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer",
+              "PersonID": 2,
+              "FirstName": "Jill",
+              "LastName": "Jones",
+              "MiddleName": null,
+              "HomeAddress": null,
+              "Home@odata.type": "#GeographyPoint",
+              "Home":
+                      {
+                        "type": "Point",
+                        "coordinates":
+                                [
+                                  161.8,
+                                  15
+                                ],
+                        "crs":
+                                {
+                                  "type": "name",
+                                  "properties":
+                                          {
+                                            "name": "EPSG:4326"
+                                          }
+                                }
+                      },
+              "Numbers@odata.type": "#Collection(String)",
+              "Numbers":
+                      [
+                      ],
+              "Emails@odata.type": "#Collection(String)",
+              "Emails":
+                      [
+                      ],
+              "City": "Sydney",
+              "Birthday@odata.type": "#DateTimeOffset",
+              "Birthday": "1983-01-15T00:00:00Z",
+              "TimeBetweenLastTwoOrders@odata.type": "#Duration",
+              "TimeBetweenLastTwoOrders": "PT0.0000002S",
+              "Parent@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent/$ref",
+              "Parent@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent",
+              "Orders@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders/$ref",
+              "Orders@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders",
+              "Company@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company/$ref",
+              "Company@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company",
+              "#Microsoft.Test.OData.Services.ODataWCFService.ResetAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.ResetAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress"
+                      },
+              "#Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress"
+                      }
+            },
+            {
+              "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Employee",
+              "@odata.id": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)",
+              "@odata.editLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee",
+              "PersonID": 3,
+              "FirstName": "Jacob",
+              "LastName": "Zip",
+              "MiddleName": null,
+              "HomeAddress":
+                      {
+                        "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Address",
+                        "Street": "1 Microsoft Way",
+                        "City": "Sydney",
+                        "PostalCode": "98052"
+                      },
+              "Home@odata.type": "#GeographyPoint",
+              "Home":
+                      {
+                        "type": "Point",
+                        "coordinates":
+                                [
+                                  161.8,
+                                  15
+                                ],
+                        "crs":
+                                {
+                                  "type": "name",
+                                  "properties":
+                                          {
+                                            "name": "EPSG:4326"
+                                          }
+                                }
+                      },
+              "Numbers@odata.type": "#Collection(String)",
+              "Numbers":
+                      [
+                        "333-333-3333"
+                      ],
+              "Emails@odata.type": "#Collection(String)",
+              "Emails":
+                      [
+                        null
+                      ],
+              "DateHired@odata.type": "#DateTimeOffset",
+              "DateHired": "2010-12-13T00:00:00Z",
+              "Office@odata.type": "#GeographyPoint",
+              "Office":
+                      {
+                        "type": "Point",
+                        "coordinates":
+                                [
+                                  162,
+                                  15
+                                ],
+                        "crs":
+                                {
+                                  "type": "name",
+                                  "properties":
+                                          {
+                                            "name": "EPSG:4326"
+                                          }
+                                }
+                      },
+              "Parent@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent/$ref",
+              "Parent@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent",
+              "Company@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company/$ref",
+              "Company@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company",
+              "#Microsoft.Test.OData.Services.ODataWCFService.ResetAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.ResetAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress"
+                      },
+              "#Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress"
+                      }
+            },
+            {
+              "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Employee",
+              "@odata.id": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)",
+              "@odata.editLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee",
+              "PersonID": 4,
+              "FirstName": "Elmo",
+              "LastName": "Rogers",
+              "MiddleName": null,
+              "HomeAddress": null,
+              "Home@odata.type": "#GeographyPoint",
+              "Home":
+                      {
+                        "type": "Point",
+                        "coordinates":
+                                [
+                                  -61.8,
+                                  -15
+                                ],
+                        "crs":
+                                {
+                                  "type": "name",
+                                  "properties":
+                                          {
+                                            "name": "EPSG:4326"
+                                          }
+                                }
+                      },
+              "Numbers@odata.type": "#Collection(String)",
+              "Numbers":
+                      [
+                        "444-444-4444",
+                        "555-555-5555",
+                        "666-666-6666"
+                      ],
+              "Emails@odata.type": "#Collection(String)",
+              "Emails":
+                      [
+                        "def@def.org",
+                        "lmn@lmn.com"
+                      ],
+              "DateHired@odata.type": "#DateTimeOffset",
+              "DateHired": "2008-03-27T00:00:00Z",
+              "Office@odata.type": "#GeographyPoint",
+              "Office":
+                      {
+                        "type": "Point",
+                        "coordinates":
+                                [
+                                  -62,
+                                  -15
+                                ],
+                        "crs":
+                                {
+                                  "type": "name",
+                                  "properties":
+                                          {
+                                            "name": "EPSG:4326"
+                                          }
+                                }
+                      },
+              "Parent@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent/$ref",
+              "Parent@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent",
+              "Company@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company/$ref",
+              "Company@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company",
+              "#Microsoft.Test.OData.Services.ODataWCFService.ResetAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.ResetAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress"
+                      },
+              "#Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress"
+                      }
+            },
+            {
+              "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Person",
+              "@odata.id": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(5)",
+              "@odata.editLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(5)",
+              "PersonID": 5,
+              "FirstName": "Peter",
+              "LastName": "Bee",
+              "MiddleName": null,
+              "HomeAddress": null,
+              "Home@odata.type": "#GeographyPoint",
+              "Home":
+                      {
+                        "type": "Point",
+                        "coordinates":
+                                [
+                                  -261.8,
+                                  -16
+                                ],
+                        "crs":
+                                {
+                                  "type": "name",
+                                  "properties":
+                                          {
+                                            "name": "EPSG:4326"
+                                          }
+                                }
+                      },
+              "Numbers@odata.type": "#Collection(String)",
+              "Numbers":
+                      [
+                        "555-555-5555"
+                      ],
+              "Emails@odata.type": "#Collection(String)",
+              "Emails":
+                      [
+                        "def@test.msn"
+                      ],
+              "Parent@odata.associationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(5)/Parent/$ref",
+              "Parent@odata.navigationLink": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(5)/Parent",
+              "#Microsoft.Test.OData.Services.ODataWCFService.ResetAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.ResetAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(5)/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress"
+                      },
+              "#Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress":
+                      {
+                        "title": "Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress",
+                        "target": "http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(5)/Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress"
+                      }
+            }
+          ],
+  "odata.nextLink": "People?$skiptoken=5"
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/935a9b84/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Person/feed.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Person/feed.xml b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Person/feed.xml
new file mode 100644
index 0000000..ee58f0a
--- /dev/null
+++ b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Person/feed.xml
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<feed xml:base="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/" 
+      xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://docs.oasis-open.org/odata/ns/data" 
+      xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" 
+      xmlns:georss="http://www.georss.org/georss" 
+      xmlns:gml="http://www.opengis.net/gml" 
+      m:context="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#People">
+  <id>http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People</id>
+  <title />
+  <updated>2014-03-20T14:31:00Z</updated>
+  <entry>
+    <id>http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)</id>
+    <category term="#Microsoft.Test.OData.Services.ODataWCFService.Customer" scheme="http://docs.oasis-open.org/odata/ns/scheme" />
+    <link rel="edit" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Parent" type="application/atom+xml;type=entry" title="Parent" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Orders" type="application/atom+xml;type=feed" title="Orders" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Company" type="application/atom+xml;type=entry" title="Company" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(1)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company" />
+    <title />
+    <updated>2014-03-20T14:31:00Z</updated>
+    <author>
+      <name />
+    </author>
+    <content type="application/xml">
+      <m:properties>
+        <d:PersonID m:type="Int32">1</d:PersonID>
+        <d:FirstName>Bob</d:FirstName>
+        <d:LastName>Cat</d:LastName>
+        <d:MiddleName m:null="true" />
+        <d:HomeAddress m:type="#Microsoft.Test.OData.Services.ODataWCFService.HomeAddress">
+          <d:Street>1 Microsoft Way</d:Street>
+          <d:City>London</d:City>
+          <d:PostalCode>98052</d:PostalCode>
+          <d:FamilyName>Cats</d:FamilyName>
+        </d:HomeAddress>
+        <d:Home m:type="GeographyPoint">
+          <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+            <gml:pos>32.1 23.1</gml:pos>
+          </gml:Point>
+        </d:Home>
+        <d:Numbers m:type="#Collection(String)">
+          <m:element>111-111-1111</m:element>
+        </d:Numbers>
+        <d:Emails m:type="#Collection(String)">
+          <m:element>abc@abc.com</m:element>
+        </d:Emails>
+        <d:City>London</d:City>
+        <d:Birthday m:type="DateTimeOffset">1957-04-03T00:00:00Z</d:Birthday>
+        <d:TimeBetweenLastTwoOrders m:type="Duration">PT0.0000001S</d:TimeBetweenLastTwoOrders>
+      </m:properties>
+    </content>
+  </entry>
+  <entry>
+    <id>http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)</id>
+    <category term="#Microsoft.Test.OData.Services.ODataWCFService.Customer" scheme="http://docs.oasis-open.org/odata/ns/scheme" />
+    <link rel="edit" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Parent" type="application/atom+xml;type=entry" title="Parent" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Orders" type="application/atom+xml;type=feed" title="Orders" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Company" type="application/atom+xml;type=entry" title="Company" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(2)/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company" />
+    <title />
+    <updated>2014-03-20T14:31:00Z</updated>
+    <author>
+      <name />
+    </author>
+    <content type="application/xml">
+      <m:properties>
+        <d:PersonID m:type="Int32">2</d:PersonID>
+        <d:FirstName>Jill</d:FirstName>
+        <d:LastName>Jones</d:LastName>
+        <d:MiddleName m:null="true" />
+        <d:HomeAddress m:null="true" />
+        <d:Home m:type="GeographyPoint">
+          <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+            <gml:pos>15 161.8</gml:pos>
+          </gml:Point>
+        </d:Home>
+        <d:Numbers m:type="#Collection(String)" />
+        <d:Emails m:type="#Collection(String)" />
+        <d:City>Sydney</d:City>
+        <d:Birthday m:type="DateTimeOffset">1983-01-15T00:00:00Z</d:Birthday>
+        <d:TimeBetweenLastTwoOrders m:type="Duration">PT0.0000002S</d:TimeBetweenLastTwoOrders>
+      </m:properties>
+    </content>
+  </entry>
+  <entry>
+    <id>http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)</id>
+    <category term="#Microsoft.Test.OData.Services.ODataWCFService.Employee" scheme="http://docs.oasis-open.org/odata/ns/scheme" />
+    <link rel="edit" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Parent" type="application/atom+xml;type=entry" title="Parent" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Company" type="application/atom+xml;type=entry" title="Company" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company" />
+    <title />
+    <updated>2014-03-20T14:31:00Z</updated>
+    <author>
+      <name />
+    </author>
+    <content type="application/xml">
+      <m:properties>
+        <d:PersonID m:type="Int32">3</d:PersonID>
+        <d:FirstName>Jacob</d:FirstName>
+        <d:LastName>Zip</d:LastName>
+        <d:MiddleName m:null="true" />
+        <d:HomeAddress m:type="#Microsoft.Test.OData.Services.ODataWCFService.Address">
+          <d:Street>1 Microsoft Way</d:Street>
+          <d:City>Sydney</d:City>
+          <d:PostalCode>98052</d:PostalCode>
+        </d:HomeAddress>
+        <d:Home m:type="GeographyPoint">
+          <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+            <gml:pos>15 161.8</gml:pos>
+          </gml:Point>
+        </d:Home>
+        <d:Numbers m:type="#Collection(String)">
+          <m:element>333-333-3333</m:element>
+        </d:Numbers>
+        <d:Emails m:type="#Collection(String)">
+          <m:element m:null="true" />
+        </d:Emails>
+        <d:DateHired m:type="DateTimeOffset">2010-12-13T00:00:00Z</d:DateHired>
+        <d:Office m:type="GeographyPoint">
+          <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+            <gml:pos>15 162</gml:pos>
+          </gml:Point>
+        </d:Office>
+      </m:properties>
+    </content>
+  </entry>
+  <entry>
+    <id>http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)</id>
+    <category term="#Microsoft.Test.OData.Services.ODataWCFService.Employee" scheme="http://docs.oasis-open.org/odata/ns/scheme" />
+    <link rel="edit" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Parent" type="application/atom+xml;type=entry" title="Parent" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Company" type="application/atom+xml;type=entry" title="Company" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company" />
+    <title />
+    <updated>2014-03-20T14:31:00Z</updated>
+    <author>
+      <name />
+    </author>
+    <content type="application/xml">
+      <m:properties>
+        <d:PersonID m:type="Int32">4</d:PersonID>
+        <d:FirstName>Elmo</d:FirstName>
+        <d:LastName>Rogers</d:LastName>
+        <d:MiddleName m:null="true" />
+        <d:HomeAddress m:null="true" />
+        <d:Home m:type="GeographyPoint">
+          <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+            <gml:pos>-15 -61.8</gml:pos>
+          </gml:Point>
+        </d:Home>
+        <d:Numbers m:type="#Collection(String)">
+          <m:element>444-444-4444</m:element>
+          <m:element>555-555-5555</m:element>
+          <m:element>666-666-6666</m:element>
+        </d:Numbers>
+        <d:Emails m:type="#Collection(String)">
+          <m:element>def@def.org</m:element>
+          <m:element>lmn@lmn.com</m:element>
+        </d:Emails>
+        <d:DateHired m:type="DateTimeOffset">2008-03-27T00:00:00Z</d:DateHired>
+        <d:Office m:type="GeographyPoint">
+          <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+            <gml:pos>-15 -62</gml:pos>
+          </gml:Point>
+        </d:Office>
+      </m:properties>
+    </content>
+  </entry>
+  <entry>
+    <id>http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(5)</id>
+    <category term="#Microsoft.Test.OData.Services.ODataWCFService.Person" scheme="http://docs.oasis-open.org/odata/ns/scheme" />
+    <link rel="edit" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(5)" />
+    <link rel="http://docs.oasis-open.org/odata/ns/related/Parent" type="application/atom+xml;type=entry" title="Parent" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People(5)/Parent" />
+    <title />
+    <updated>2014-03-20T14:31:00Z</updated>
+    <author>
+      <name />
+    </author>
+    <content type="application/xml">
+      <m:properties>
+        <d:PersonID m:type="Int32">5</d:PersonID>
+        <d:FirstName>Peter</d:FirstName>
+        <d:LastName>Bee</d:LastName>
+        <d:MiddleName m:null="true" />
+        <d:HomeAddress m:null="true" />
+        <d:Home m:type="GeographyPoint">
+          <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+            <gml:pos>-16 -261.8</gml:pos>
+          </gml:Point>
+        </d:Home>
+        <d:Numbers m:type="#Collection(String)">
+          <m:element>555-555-5555</m:element>
+        </d:Numbers>
+        <d:Emails m:type="#Collection(String)">
+          <m:element>def@test.msn</m:element>
+        </d:Emails>
+      </m:properties>
+    </content>
+  </entry>
+  <link rel="next" href="http://localhost:${tomcat.servlet.port}/stub/StaticService/V40/Static.svc/People?$skiptoken=5"/>
+</feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/935a9b84/fit/src/test/java/org/apache/olingo/fit/proxy/v4/FilterTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/FilterTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/FilterTestITCase.java
index 9c826d9..f889fd2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/FilterTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/FilterTestITCase.java
@@ -22,28 +22,43 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-import org.apache.olingo.ext.proxy.api.Search;
-import org.apache.olingo.ext.proxy.api.Sort;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import org.junit.Test;
 
+import org.apache.olingo.ext.proxy.api.Search;
+import org.apache.olingo.ext.proxy.api.Sort;
 //CHECKSTYLE:OFF (Maven checkstyle)
 import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.People;
+import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Employee;
+import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.EmployeeCollection;
 import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person;
 import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.PersonCollection;
+import org.junit.Test;
 //CHECKSTYLE:ON (Maven checkstyle)
 
 public class FilterTestITCase extends AbstractTestITCase {
 
   @Test
+  public void testFilterWithEntityType() {
+    final People people = container.getPeople();
+    final EmployeeCollection response = people.filter(service.getClient().getFilterFactory().lt("PersonID", 4))
+                                                                         .execute(EmployeeCollection.class);
+    
+    assertEquals(1, response.size());
+    
+    for(final Employee employee : response) {
+      assertEquals(Integer.valueOf(3), employee.getPersonID());
+    }
+  }
+  
+  @Test
   public void filterOrderby() {
     final People people = container.getPeople();
 
     PersonCollection result =
             people.filter(service.getClient().getFilterFactory().lt("PersonID", 3)).execute();
-
+    
     // 1. check that result looks as expected
     assertEquals(2, result.size());
 


[2/2] olingo-odata4 git commit: [OLINGO-622] Fix: EDM getter methods support concurrent access

Posted by ch...@apache.org.
[OLINGO-622] Fix: EDM getter methods support concurrent access


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

Branch: refs/heads/master
Commit: 05cbf674fbcb473beb5e403d2ac00cff376874da
Parents: 935a9b8
Author: Christian Holzer <c....@sap.com>
Authored: Thu Apr 16 10:44:20 2015 +0200
Committer: Christian Holzer <c....@sap.com>
Committed: Tue Apr 21 16:57:30 2015 +0200

----------------------------------------------------------------------
 .../core/domain/ODataCollectionValueImpl.java   |  6 +-
 .../core/domain/ODataComplexValueImpl.java      |  6 +-
 .../olingo/commons/core/edm/AbstractEdm.java    | 49 ++++++++-------
 .../EdmConstantAnnotationExpressionImpl.java    |  3 +-
 .../edm/provider/AbstractEdmAnnotatable.java    |  8 ++-
 .../edm/provider/AbstractEdmBindingTarget.java  |  9 ++-
 .../core/edm/provider/AbstractEdmOperation.java | 25 ++++----
 .../edm/provider/AbstractEdmStructuredType.java | 44 ++++++++------
 .../core/edm/provider/EdmAnnotationsImpl.java   | 51 +++++++++-------
 .../edm/provider/EdmEntityContainerImpl.java    | 63 +++++++++++---------
 .../core/edm/provider/EdmEntityTypeImpl.java    |  5 +-
 .../core/edm/provider/EdmEnumTypeImpl.java      | 11 ++--
 .../edm/provider/EdmNavigationPropertyImpl.java |  6 +-
 .../core/edm/provider/EdmProviderImpl.java      |  6 +-
 .../core/edm/provider/EdmSchemaImpl.java        |  1 -
 .../commons/core/edm/provider/EdmTermImpl.java  |  6 +-
 16 files changed, 170 insertions(+), 129 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataCollectionValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataCollectionValueImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataCollectionValueImpl.java
index bd58713..c608313 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataCollectionValueImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataCollectionValueImpl.java
@@ -40,10 +40,6 @@ public class ODataCollectionValueImpl<OV extends ODataValue> extends AbstractODa
     super(typeName == null || typeName.startsWith("Collection(") ? typeName : "Collection(" + typeName + ")");
   }
 
-  protected ODataCollectionValueImpl getThis() {
-    return this;
-  }
-
   @Override
   public boolean isEnum() {
     return false;
@@ -91,7 +87,7 @@ public class ODataCollectionValueImpl<OV extends ODataValue> extends AbstractODa
   @SuppressWarnings("unchecked")
   public ODataCollectionValue<OV> add(final ODataValue value) {
     values.add((OV) value);
-    return getThis();
+    return this;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java
index 677d34b..efb5744 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java
@@ -59,10 +59,6 @@ public class ODataComplexValueImpl extends AbstractODataValue implements ODataCo
     super(typeName);
   }
 
-  protected ODataComplexValue getThis() {
-    return this;
-  }
-
   @Override
   public boolean isEnum() {
     return false;
@@ -172,7 +168,7 @@ public class ODataComplexValueImpl extends AbstractODataValue implements ODataCo
   @Override
   public ODataComplexValue add(final ODataProperty field) {
     fields.put(field.getName(), field);
-    return getThis();
+    return this;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdm.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdm.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdm.java
index e865aa6..8880c8a 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdm.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdm.java
@@ -45,38 +45,47 @@ public abstract class AbstractEdm implements Edm {
   protected List<EdmSchema> schemaList;
 
   private final Map<FullQualifiedName, EdmEntityContainer> entityContainers =
-      new HashMap<FullQualifiedName, EdmEntityContainer>();
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, EdmEntityContainer>());
 
-  private final Map<FullQualifiedName, EdmEnumType> enumTypes = new HashMap<FullQualifiedName, EdmEnumType>();
+  private final Map<FullQualifiedName, EdmEnumType> enumTypes = 
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, EdmEnumType>());
 
   private final Map<FullQualifiedName, EdmTypeDefinition> typeDefinitions =
-      new HashMap<FullQualifiedName, EdmTypeDefinition>();
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, EdmTypeDefinition>());
 
-  private final Map<FullQualifiedName, EdmEntityType> entityTypes = new HashMap<FullQualifiedName, EdmEntityType>();
+  private final Map<FullQualifiedName, EdmEntityType> entityTypes = 
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, EdmEntityType>());
 
-  private final Map<FullQualifiedName, EdmComplexType> complexTypes = new HashMap<FullQualifiedName, EdmComplexType>();
+  private final Map<FullQualifiedName, EdmComplexType> complexTypes = 
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, EdmComplexType>());
 
-  private final Map<FullQualifiedName, EdmAction> unboundActions = new HashMap<FullQualifiedName, EdmAction>();
+  private final Map<FullQualifiedName, EdmAction> unboundActions = 
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, EdmAction>());
 
   private final Map<FullQualifiedName, List<EdmFunction>> unboundFunctionsByName =
-      new HashMap<FullQualifiedName, List<EdmFunction>>();
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, List<EdmFunction>>());
 
-  private final Map<FunctionMapKey, EdmFunction> unboundFunctionsByKey = new HashMap<FunctionMapKey, EdmFunction>();
+  private final Map<FunctionMapKey, EdmFunction> unboundFunctionsByKey = 
+      Collections.synchronizedMap(new HashMap<FunctionMapKey, EdmFunction>());
 
-  private final Map<ActionMapKey, EdmAction> boundActions = new HashMap<ActionMapKey, EdmAction>();
+  private final Map<ActionMapKey, EdmAction> boundActions = 
+      Collections.synchronizedMap(new HashMap<ActionMapKey, EdmAction>());
 
-  private final Map<FunctionMapKey, EdmFunction> boundFunctions = new HashMap<FunctionMapKey, EdmFunction>();
+  private final Map<FunctionMapKey, EdmFunction> boundFunctions = 
+      Collections.synchronizedMap(new HashMap<FunctionMapKey, EdmFunction>());
 
-  private final Map<FullQualifiedName, EdmTerm> terms = new HashMap<FullQualifiedName, EdmTerm>();
+  private final Map<FullQualifiedName, EdmTerm> terms = 
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, EdmTerm>());
 
   private final Map<FullQualifiedName, EdmAnnotations> annotationGroups =
-      new HashMap<FullQualifiedName, EdmAnnotations>();
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, EdmAnnotations>());
 
   private final Map<FullQualifiedName, List<EdmAnnotation>> annotations =
-      new HashMap<FullQualifiedName, List<EdmAnnotation>>();
-
-  private Map<String, String> aliasToNamespaceInfo;
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, List<EdmAnnotation>>());
 
+  private Map<String, String> aliasToNamespaceInfo = Collections.synchronizedMap(new HashMap<String, String>());
+  private boolean aliasToNamespaceInfoCreated = false;
+  
   @Override
   public List<EdmSchema> getSchemas() {
     if (schemaList == null) {
@@ -93,7 +102,7 @@ public abstract class AbstractEdm implements Edm {
 
     EdmSchema schema = schemas.get(namespace);
     if (schema == null) {
-      if (aliasToNamespaceInfo == null) {
+      if (!aliasToNamespaceInfoCreated) {
         aliasToNamespaceInfo = createAliasToNamespaceInfo();
       }
       schema = schemas.get(aliasToNamespaceInfo.get(namespace));
@@ -103,8 +112,9 @@ public abstract class AbstractEdm implements Edm {
   }
 
   private void initSchemas() {
-    aliasToNamespaceInfo = new HashMap<String, String>();
     schemas = createSchemas();
+    aliasToNamespaceInfoCreated = true;
+    
     if (schemas == null) {
       schemas = Collections.emptyMap();
     }
@@ -329,7 +339,7 @@ public abstract class AbstractEdm implements Edm {
   }
 
   private FullQualifiedName resolvePossibleAlias(final FullQualifiedName namespaceOrAliasFQN) {
-    if (aliasToNamespaceInfo == null) {
+    if (!aliasToNamespaceInfoCreated) {
       aliasToNamespaceInfo = createAliasToNamespaceInfo();
     }
     FullQualifiedName finalFQN = null;
@@ -350,9 +360,6 @@ public abstract class AbstractEdm implements Edm {
   protected abstract Map<String, String> createAliasToNamespaceInfo();
 
   public void cacheAliasNamespaceInfo(String alias, String namespace) {
-    if (aliasToNamespaceInfo == null) {
-      aliasToNamespaceInfo = new HashMap<String, String>();
-    }
     aliasToNamespaceInfo.put(alias, namespace);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java
index 83ad8ec..15658ab 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java
@@ -52,7 +52,8 @@ public class EdmConstantAnnotationExpressionImpl implements EdmConstantAnnotatio
       if (enumValues.size() == 1) {
         value = enumValues.get(0);
       } else {
-        final ODataCollectionValueImpl collValue = new ODataCollectionValueImpl(enumTypeName);
+        final ODataCollectionValueImpl<ODataEnumValue> collValue 
+          = new ODataCollectionValueImpl<ODataEnumValue>(enumTypeName);
         for (ODataValue enumValue : enumValues) {
           collValue.add(enumValue);
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmAnnotatable.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmAnnotatable.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmAnnotatable.java
index ccc8801..0574a4e 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmAnnotatable.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmAnnotatable.java
@@ -55,13 +55,15 @@ public abstract class AbstractEdmAnnotatable implements EdmAnnotatable {
   @Override
   public List<EdmAnnotation> getAnnotations() {
     if (annotations == null) {
-      annotations = new ArrayList<EdmAnnotation>();
+      final List<EdmAnnotation> annotationsLocal = new ArrayList<EdmAnnotation>();
       if (annotatable != null) {
         for (Annotation annotation : annotatable.getAnnotations()) {
-          annotations.add(new EdmAnnotationImpl(edm, annotation));
+          annotationsLocal.add(new EdmAnnotationImpl(edm, annotation));
         }
+        
+        annotations = Collections.unmodifiableList(annotationsLocal);
       }
     }
-    return Collections.unmodifiableList(annotations);
+    return annotations;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmBindingTarget.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmBindingTarget.java
index d64270d..9ef4c74 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmBindingTarget.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmBindingTarget.java
@@ -50,14 +50,17 @@ public abstract class AbstractEdmBindingTarget extends AbstractEdmNamed implemen
   public List<EdmNavigationPropertyBinding> getNavigationPropertyBindings() {
     if (navigationPropertyBindings == null) {
       List<NavigationPropertyBinding> providerBindings = target.getNavigationPropertyBindings();
-      navigationPropertyBindings = new ArrayList<EdmNavigationPropertyBinding>();
+      final List<EdmNavigationPropertyBinding> navigationPropertyBindingsLocal = 
+          new ArrayList<EdmNavigationPropertyBinding>();
       if (providerBindings != null) {
         for (NavigationPropertyBinding binding : providerBindings) {
-          navigationPropertyBindings.add(new EdmNavigationPropertyBindingImpl(binding.getPath(), binding.getTarget()));
+          navigationPropertyBindingsLocal.add(new EdmNavigationPropertyBindingImpl(binding.getPath(), 
+                                                                                   binding.getTarget()));
         }
+        navigationPropertyBindings = Collections.unmodifiableList(navigationPropertyBindingsLocal);
       }
     }
-    return Collections.unmodifiableList(navigationPropertyBindings);
+    return navigationPropertyBindings;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmOperation.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmOperation.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmOperation.java
index 936a5ff..c615376 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmOperation.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmOperation.java
@@ -67,18 +67,21 @@ public abstract class AbstractEdmOperation extends EdmTypeImpl implements EdmOpe
   }
   
   private void createParameters() {
-    parameters = new LinkedHashMap<String, EdmParameter>();
-
-    final List<Parameter> providerParameters = operation.getParameters();
-    if (providerParameters != null) {
-      parameterNames = new ArrayList<String>(providerParameters.size());
-      for (Parameter parameter : providerParameters) {
-        parameters.put(parameter.getName(), new EdmParameterImpl(edm, parameter));
-        parameterNames.add(parameter.getName());
+    if(parameters == null) {
+      final Map<String, EdmParameter> parametersLocal = new LinkedHashMap<String, EdmParameter>();
+      final List<Parameter> providerParameters = operation.getParameters();
+      if (providerParameters != null) {
+        final List<String> parameterNamesLocal = new ArrayList<String>(providerParameters.size());
+        for (Parameter parameter : providerParameters) {
+          parametersLocal.put(parameter.getName(), new EdmParameterImpl(edm, parameter));
+          parameterNamesLocal.add(parameter.getName());
+        }
+        
+        parameters = parametersLocal;
+        parameterNames = parameterNamesLocal;
+      } else {
+        parameterNames = Collections.emptyList();
       }
-
-    } else {
-      parameterNames = Collections.emptyList();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmStructuredType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmStructuredType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmStructuredType.java
index 555652f..29d08ce 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmStructuredType.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/AbstractEdmStructuredType.java
@@ -67,27 +67,29 @@ public abstract class AbstractEdmStructuredType extends EdmTypeImpl implements E
   @Override
   public List<String> getPropertyNames() {
     if (propertyNames == null) {
-      propertyNames = new ArrayList<String>();
+      final List<String> localPropertyNames = new ArrayList<String>();
       checkBaseType();
       if (baseType != null) {
-        propertyNames.addAll(baseType.getPropertyNames());
+        localPropertyNames.addAll(baseType.getPropertyNames());
       }
-      propertyNames.addAll(getProperties().keySet());
+      localPropertyNames.addAll(getProperties().keySet());
+      propertyNames = Collections.unmodifiableList(localPropertyNames);
     }
-    return Collections.unmodifiableList(propertyNames);
+    return propertyNames;
   }
 
   @Override
   public List<String> getNavigationPropertyNames() {
     if (navigationPropertyNames == null) {
-      navigationPropertyNames = new ArrayList<String>();
+      final ArrayList<String> localNavigatinPropertyNames = new ArrayList<String>();
       checkBaseType();
       if (baseType != null) {
-        navigationPropertyNames.addAll(baseType.getNavigationPropertyNames());
+        localNavigatinPropertyNames.addAll(baseType.getNavigationPropertyNames());
       }
-      navigationPropertyNames.addAll(getNavigationProperties().keySet());
+      localNavigatinPropertyNames.addAll(getNavigationProperties().keySet());
+      navigationPropertyNames = Collections.unmodifiableList(localNavigatinPropertyNames);
     }
-    return Collections.unmodifiableList(navigationPropertyNames);
+    return navigationPropertyNames;
   }
 
   @Override
@@ -155,25 +157,33 @@ public abstract class AbstractEdmStructuredType extends EdmTypeImpl implements E
 
   public Map<String, EdmProperty> getProperties() {
     if (properties == null) {
-      properties = new LinkedHashMap<String, EdmProperty>();
-        for (Property property : providerStructuredType.getProperties()) {
-          properties.put(property.getName(), new EdmPropertyImpl(edm, typeName, property));
+      final Map<String, EdmProperty> localPorperties = new LinkedHashMap<String, EdmProperty>();
+      final List<Property> structureTypeProperties = providerStructuredType.getProperties();
+        for (Property property : structureTypeProperties) {
+          localPorperties.put(property.getName(), new EdmPropertyImpl(edm, typeName, property));
       }
+      properties = Collections.unmodifiableMap(localPorperties);
     }
-    return Collections.unmodifiableMap(properties);
+    return properties;
   }
 
   public Map<String, EdmNavigationProperty> getNavigationProperties() {
     if (navigationProperties == null) {
-      navigationProperties = new LinkedHashMap<String, EdmNavigationProperty>();
-      if (providerStructuredType.getNavigationProperties() != null) {
-        for (NavigationProperty navigationProperty : providerStructuredType.getNavigationProperties()) {
-          navigationProperties.put(navigationProperty.getName(),
+      final Map<String, EdmNavigationProperty> localNavigationProperties = 
+          new LinkedHashMap<String, EdmNavigationProperty>();
+      final List<NavigationProperty> structuredTypeNavigationProperties = 
+          providerStructuredType.getNavigationProperties();
+
+      if (structuredTypeNavigationProperties != null) {
+        for (NavigationProperty navigationProperty : structuredTypeNavigationProperties) {
+          localNavigationProperties.put(navigationProperty.getName(),
                   new EdmNavigationPropertyImpl(edm, typeName, navigationProperty));
         }
       }
+      
+      navigationProperties = Collections.unmodifiableMap(localNavigationProperties);
     }
-    return Collections.unmodifiableMap(navigationProperties);
+    return navigationProperties;
   }
 
   public boolean isOpenType() {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationsImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationsImpl.java
index 4de911c..d12010d 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationsImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationsImpl.java
@@ -81,28 +81,29 @@ public class EdmAnnotationsImpl implements EdmAnnotations {
       final String path = splitted.length > 1 ? splitted[1] : null;
 
       final EdmEntityContainer baseEntityContainer = schema.getEntityContainer();
-
-      target = baseEntityContainer == null ? null : baseEntityContainer.getActionImport(path);
-      if (target == null) {
-        target = getTarget(edm.getComplexType(base), path);
-        if (target == null) {
+      
+      EdmAnnotationsTarget localTarget = baseEntityContainer == null ? null 
+                                                                     : baseEntityContainer.getActionImport(path);
+      if (localTarget == null) {
+        localTarget = getTarget(edm.getComplexType(base), path);
+        if (localTarget == null) {
           if(baseEntityContainer != null && baseEntityContainer.getFullQualifiedName().equals(base)){
-            target = baseEntityContainer;
+            localTarget = baseEntityContainer;
           }
-          if (target == null) {
-            target = baseEntityContainer == null ? null : baseEntityContainer.getEntitySet(path);
-            if (target == null) {
-              target = getTarget(edm.getEntityType(base), path);
-              if (target == null) {
-                target = getTarget(edm.getEnumType(base), path);
-                if (target == null) {
-                  target = baseEntityContainer == null ? null : baseEntityContainer.getFunctionImport(path);
-                  if (target == null) {
-                    target = baseEntityContainer == null ? null : baseEntityContainer.getSingleton(path);
-                    if (target == null) {
-                      target = edm.getTerm(base);
-                      if (target == null) {
-                        target = edm.getTypeDefinition(base);
+          if (localTarget == null) {
+            localTarget = baseEntityContainer == null ? null : baseEntityContainer.getEntitySet(path);
+            if (localTarget == null) {
+              localTarget = getTarget(edm.getEntityType(base), path);
+              if (localTarget == null) {
+                localTarget = getTarget(edm.getEnumType(base), path);
+                if (localTarget == null) {
+                  localTarget = baseEntityContainer == null ? null : baseEntityContainer.getFunctionImport(path);
+                  if (localTarget == null) {
+                    localTarget = baseEntityContainer == null ? null : baseEntityContainer.getSingleton(path);
+                    if (localTarget == null) {
+                      localTarget = edm.getTerm(base);
+                      if (localTarget == null) {
+                        localTarget = edm.getTypeDefinition(base);
                       }
                     }
                   }
@@ -112,7 +113,9 @@ public class EdmAnnotationsImpl implements EdmAnnotations {
           }
         }
       }
+      target = localTarget;
     }
+    
     return target;
   }
 
@@ -135,12 +138,14 @@ public class EdmAnnotationsImpl implements EdmAnnotations {
   @Override
   public List<EdmAnnotation> getAnnotations() {
     if (annotations == null) {
-      annotations = new ArrayList<EdmAnnotation>();
+      List<EdmAnnotation> annotationsLocal = new ArrayList<EdmAnnotation>();
       for (Annotation annotation : annotationGroup.getAnnotations()) {
-        annotations.add(new EdmAnnotationImpl(edm, annotation));
+        annotationsLocal.add(new EdmAnnotationImpl(edm, annotation));
       }
+      
+      annotations = Collections.unmodifiableList(annotationsLocal);
     }
-    return Collections.unmodifiableList(annotations);
+    return annotations;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java
index df6adcb..165b5cd 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java
@@ -49,17 +49,18 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit
   private final FullQualifiedName entityContainerName;
   private final FullQualifiedName parentContainerName;
 
-  private final Map<String, EdmSingleton> singletonCache = new LinkedHashMap<String, EdmSingleton>();
   private List<EdmSingleton> singletons;
-
-  private final Map<String, EdmEntitySet> entitySetCache = new LinkedHashMap<String, EdmEntitySet>();
+  private final Map<String, EdmSingleton> singletonCache = Collections.synchronizedMap(
+                                                                    new LinkedHashMap<String, EdmSingleton>());
   private List<EdmEntitySet> entitySets;
-
-  private final Map<String, EdmActionImport> actionImportCache = new LinkedHashMap<String, EdmActionImport>();
+  private final Map<String, EdmEntitySet> entitySetCache = Collections.synchronizedMap(
+                                                                    new LinkedHashMap<String, EdmEntitySet>());
   private List<EdmActionImport> actionImports;
-
-  private final Map<String, EdmFunctionImport> functionImportCache = new LinkedHashMap<String, EdmFunctionImport>();
+  private final Map<String, EdmActionImport> actionImportCache = Collections.synchronizedMap(
+                                                                    new LinkedHashMap<String, EdmActionImport>());
   private List<EdmFunctionImport> functionImports;
+  private final Map<String, EdmFunctionImport> functionImportCache = Collections.synchronizedMap(
+                                                                    new LinkedHashMap<String, EdmFunctionImport>());
 
   public EdmEntityContainerImpl(final Edm edm, final EdmProvider provider,
       final EntityContainerInfo entityContainerInfo) {
@@ -235,55 +236,61 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit
 
   protected void loadAllEntitySets() {
     loadContainer();
-    List<EntitySet> providerEntitySets = container.getEntitySets();
-    entitySets = new ArrayList<EdmEntitySet>();
+    final List<EntitySet> providerEntitySets = container.getEntitySets();
+    final List<EdmEntitySet> entitySetsLocal = new ArrayList<EdmEntitySet>();
+    
     if (providerEntitySets != null) {
       for (EntitySet entitySet : providerEntitySets) {
-        EdmEntitySetImpl impl = new EdmEntitySetImpl(edm, this, entitySet);
+        final EdmEntitySetImpl impl = new EdmEntitySetImpl(edm, this, entitySet);
         entitySetCache.put(impl.getName(), impl);
-        entitySets.add(impl);
+        entitySetsLocal.add(impl);
       }
+      entitySets = entitySetsLocal;
     }
   }
 
   protected void loadAllFunctionImports() {
     loadContainer();
-    List<FunctionImport> providerFunctionImports = container.getFunctionImports();
-    functionImports = new ArrayList<EdmFunctionImport>();
+    final List<FunctionImport> providerFunctionImports = container.getFunctionImports();
+    final ArrayList<EdmFunctionImport> functionImportsLocal = new ArrayList<EdmFunctionImport>();
+    
     if (providerFunctionImports != null) {
       for (FunctionImport functionImport : providerFunctionImports) {
         EdmFunctionImportImpl impl = new EdmFunctionImportImpl(edm, this, functionImport);
         functionImportCache.put(impl.getName(), impl);
-        functionImports.add(impl);
+        functionImportsLocal.add(impl);
       }
+      functionImports = functionImportsLocal;
     }
-
   }
 
   protected void loadAllSingletons() {
     loadContainer();
-    List<Singleton> providerSingletons = container.getSingletons();
-    singletons = new ArrayList<EdmSingleton>();
+    final List<Singleton> providerSingletons = container.getSingletons();
+    final List<EdmSingleton> singletonsLocal = new ArrayList<EdmSingleton>();
+    
     if (providerSingletons != null) {
       for (Singleton singleton : providerSingletons) {
-        EdmSingletonImpl impl = new EdmSingletonImpl(edm, this, singleton);
+        final EdmSingletonImpl impl = new EdmSingletonImpl(edm, this, singleton);
         singletonCache.put(singleton.getName(), impl);
-        singletons.add(impl);
+        singletonsLocal.add(impl);
       }
+      singletons = singletonsLocal;
     }
-
   }
 
   protected void loadAllActionImports() {
     loadContainer();
-    List<ActionImport> providerActionImports = container.getActionImports();
-    actionImports = new ArrayList<EdmActionImport>();
+    final List<ActionImport> providerActionImports = container.getActionImports();
+    final List<EdmActionImport> actionImportsLocal = new ArrayList<EdmActionImport>();
+
     if (providerActionImports != null) {
       for (ActionImport actionImport : providerActionImports) {
-        EdmActionImportImpl impl = new EdmActionImportImpl(edm, this, actionImport);
+        final EdmActionImportImpl impl = new EdmActionImportImpl(edm, this, actionImport);
         actionImportCache.put(actionImport.getName(), impl);
-        actionImports.add(impl);
+        actionImportsLocal.add(impl);
       }
+      actionImports = actionImportsLocal;
     }
 
   }
@@ -291,10 +298,12 @@ public class EdmEntityContainerImpl extends AbstractEdmNamed implements EdmEntit
   private void loadContainer() {
     if (container == null) {
       try {
-        container = provider.getEntityContainer();
-        if (container == null) {
-          container = new EntityContainer().setName(getName());
+        EntityContainer containerLocal = provider.getEntityContainer();
+        if (containerLocal == null) {
+          containerLocal = new EntityContainer().setName(getName());
         }
+        
+        container = containerLocal;
       } catch (ODataException e) {
         throw new EdmException(e);
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java
index ac68499..3040499 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java
@@ -40,8 +40,9 @@ public class EdmEntityTypeImpl extends AbstractEdmStructuredType implements EdmE
   private boolean baseTypeChecked = false;
   private final boolean hasStream;
   protected EdmEntityType entityBaseType;
-  private final List<String> keyPredicateNames = new ArrayList<String>();
-  private final Map<String, EdmKeyPropertyRef> keyPropertyRefs = new LinkedHashMap<String, EdmKeyPropertyRef>();
+  private final List<String> keyPredicateNames = Collections.synchronizedList(new ArrayList<String>());
+  private final Map<String, EdmKeyPropertyRef> keyPropertyRefs = 
+      Collections.synchronizedMap(new LinkedHashMap<String, EdmKeyPropertyRef>());
   private List<EdmKeyPropertyRef> keyPropertyRefsList;
 
   public EdmEntityTypeImpl(final Edm edm, final FullQualifiedName name, final EntityType entityType) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java
index 53650bb..4745c65 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java
@@ -99,13 +99,16 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType {
   }
 
   private void createEdmMembers() {
-    membersMap = new LinkedHashMap<String, EdmMember>();
-    memberNames = new ArrayList<String>();
+    final LinkedHashMap<String, EdmMember> membersMapLocal = new LinkedHashMap<String, EdmMember>();
+    final List<String> memberNamesLocal = new ArrayList<String>();
     if (enumType.getMembers() != null) {
       for (final EnumMember member : enumType.getMembers()) {
-        membersMap.put(member.getName(), new EdmMemberImpl(edm, getFullQualifiedName(), member));
-        memberNames.add(member.getName());
+        membersMapLocal.put(member.getName(), new EdmMemberImpl(edm, getFullQualifiedName(), member));
+        memberNamesLocal.add(member.getName());
       }
+      
+      membersMap = membersMapLocal;
+      memberNames = memberNamesLocal;
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java
index 2dd6dce..d6a56bf 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java
@@ -113,12 +113,14 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNamed implements EdmEl
   public List<EdmReferentialConstraint> getReferentialConstraints() {
     if (referentialConstraints == null) {
       final List<ReferentialConstraint> providerConstraints = navigationProperty.getReferentialConstraints();
-      referentialConstraints = new ArrayList<EdmReferentialConstraint>();
+      final List<EdmReferentialConstraint> referentialConstraintsLocal = new ArrayList<EdmReferentialConstraint>();
       if (providerConstraints != null) {
         for (ReferentialConstraint constraint : providerConstraints) {
-          referentialConstraints.add(new EdmReferentialConstraintImpl(edm, constraint));
+          referentialConstraintsLocal.add(new EdmReferentialConstraintImpl(edm, constraint));
         }
       }
+      
+      referentialConstraints = referentialConstraintsLocal;
     }
     return Collections.unmodifiableList(referentialConstraints);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmProviderImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmProviderImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmProviderImpl.java
index daa0e87..5a11a7b 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmProviderImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmProviderImpl.java
@@ -59,8 +59,10 @@ import org.apache.olingo.commons.core.edm.AbstractEdm;
 public class EdmProviderImpl extends AbstractEdm {
 
   private final EdmProvider provider;
-  private final Map<FullQualifiedName, List<Action>> actionsMap = new HashMap<FullQualifiedName, List<Action>>();
-  private final Map<FullQualifiedName, List<Function>> functionsMap = new HashMap<FullQualifiedName, List<Function>>();
+  private final Map<FullQualifiedName, List<Action>> actionsMap = 
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, List<Action>>());
+  private final Map<FullQualifiedName, List<Function>> functionsMap = 
+      Collections.synchronizedMap(new HashMap<FullQualifiedName, List<Function>>());
 
   public EdmProviderImpl(final EdmProvider provider) {
     this.provider = provider;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmSchemaImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmSchemaImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmSchemaImpl.java
index ea44dc6..4d994f6 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmSchemaImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmSchemaImpl.java
@@ -86,7 +86,6 @@ public class EdmSchemaImpl implements EdmSchema {
     annotationGroups = createAnnotationGroups();
     annotations = createAnnotations();
     terms = createTerms();
-
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/05cbf674/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java
index 146ff7e..f500ec2 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java
@@ -87,14 +87,16 @@ public class EdmTermImpl extends AbstractEdmNamed implements EdmTerm {
   @Override
   public List<Class<?>> getAppliesTo() {
     if (appliesTo == null) {
-      appliesTo = new ArrayList<Class<?>>();
+      final List<Class<?>> appliesToLocal = new ArrayList<Class<?>>();
       for (String element : term.getAppliesTo()) {
         try {
-          appliesTo.add(ClassUtils.getClass(EdmTerm.class.getPackage().getName() + ".Edm" + element));
+          appliesToLocal.add(ClassUtils.getClass(EdmTerm.class.getPackage().getName() + ".Edm" + element));
         } catch (ClassNotFoundException e) {
           LOG.error("Could not load Edm class for {}", element, e);
         }
       }
+      
+      appliesTo = appliesToLocal;
     }
     return appliesTo;
   }