olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [40/50] [abbrv] olingo-odata4 git commit: [OLINGO-564] Renamed 'OData*' to 'Client*' classes
Date Thu, 30 Apr 2015 15:02:53 GMT
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
index 5beec7b..8a19000 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
@@ -53,17 +53,17 @@ import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse
 import org.apache.olingo.client.api.edm.xml.Reference;
 import org.apache.olingo.client.api.edm.xml.XMLMetadata;
 import org.apache.olingo.client.core.ODataClientFactory;
-import org.apache.olingo.commons.api.domain.ODataAnnotation;
-import org.apache.olingo.commons.api.domain.ODataComplexValue;
-import org.apache.olingo.commons.api.domain.ODataEntity;
-import org.apache.olingo.commons.api.domain.ODataEntitySet;
-import org.apache.olingo.commons.api.domain.ODataError;
-import org.apache.olingo.commons.api.domain.ODataInlineEntity;
-import org.apache.olingo.commons.api.domain.ODataInlineEntitySet;
-import org.apache.olingo.commons.api.domain.ODataObjectFactory;
-import org.apache.olingo.commons.api.domain.ODataProperty;
-import org.apache.olingo.commons.api.domain.ODataServiceDocument;
-import org.apache.olingo.commons.api.domain.ODataValue;
+import org.apache.olingo.commons.api.domain.ClientAnnotation;
+import org.apache.olingo.commons.api.domain.ClientComplexValue;
+import org.apache.olingo.commons.api.domain.ClientEntity;
+import org.apache.olingo.commons.api.domain.ClientEntitySet;
+import org.apache.olingo.commons.api.domain.ClientError;
+import org.apache.olingo.commons.api.domain.ClientInlineEntity;
+import org.apache.olingo.commons.api.domain.ClientInlineEntitySet;
+import org.apache.olingo.commons.api.domain.ClientObjectFactory;
+import org.apache.olingo.commons.api.domain.ClientProperty;
+import org.apache.olingo.commons.api.domain.ClientServiceDocument;
+import org.apache.olingo.commons.api.domain.ClientValue;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
@@ -85,10 +85,10 @@ public class BasicITCase extends AbstractBaseTestITCase {
         .getServiceDocumentRequest(SERVICE_URI);
     assertNotNull(request);
 
-    ODataRetrieveResponse<ODataServiceDocument> response = request.execute();
+    ODataRetrieveResponse<ClientServiceDocument> response = request.execute();
     assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
 
-    ODataServiceDocument serviceDocument = response.getBody();
+    ClientServiceDocument serviceDocument = response.getBody();
     assertNotNull(serviceDocument);
 
     assertThat(serviceDocument.getEntitySetNames(), hasItem("ESAllPrim"));
@@ -134,29 +134,29 @@ public class BasicITCase extends AbstractBaseTestITCase {
 
   @Test
   public void readEntitySet() {
-    final ODataEntitySetRequest<ODataEntitySet> request = getClient().getRetrieveRequestFactory()
+    final ODataEntitySetRequest<ClientEntitySet> request = getClient().getRetrieveRequestFactory()
         .getEntitySetRequest(getClient().newURIBuilder(SERVICE_URI)
             .appendEntitySetSegment("ESMixPrimCollComp").build());
     assertNotNull(request);
 
-    final ODataRetrieveResponse<ODataEntitySet> response = request.execute();
+    final ODataRetrieveResponse<ClientEntitySet> response = request.execute();
     assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
     assertThat(response.getContentType(), containsString(ContentType.APPLICATION_JSON.toContentTypeString()));
 
-    final ODataEntitySet entitySet = response.getBody();
+    final ClientEntitySet entitySet = response.getBody();
     assertNotNull(entitySet);
 
     assertNull(entitySet.getCount());
     assertNull(entitySet.getNext());
-    assertEquals(Collections.<ODataAnnotation> emptyList(), entitySet.getAnnotations());
+    assertEquals(Collections.<ClientAnnotation> emptyList(), entitySet.getAnnotations());
     assertNull(entitySet.getDeltaLink());
 
-    final List<ODataEntity> entities = entitySet.getEntities();
+    final List<ClientEntity> entities = entitySet.getEntities();
     assertNotNull(entities);
     assertEquals(3, entities.size());
-    final ODataEntity entity = entities.get(2);
+    final ClientEntity entity = entities.get(2);
     assertNotNull(entity);
-    final ODataProperty property = entity.getProperty("PropertyInt16");
+    final ClientProperty property = entity.getProperty("PropertyInt16");
     assertNotNull(property);
     assertNotNull(property.getPrimitiveValue());
     assertEquals(0, property.getPrimitiveValue().toValue());
@@ -164,7 +164,7 @@ public class BasicITCase extends AbstractBaseTestITCase {
 
   @Test
   public void readException() throws Exception {
-    final ODataEntityRequest<ODataEntity> request = getClient().getRetrieveRequestFactory()
+    final ODataEntityRequest<ClientEntity> request = getClient().getRetrieveRequestFactory()
         .getEntityRequest(getClient().newURIBuilder(SERVICE_URI)
             .appendEntitySetSegment("ESMixPrimCollComp").appendKeySegment("42").build());
     assertNotNull(request);
@@ -174,29 +174,29 @@ public class BasicITCase extends AbstractBaseTestITCase {
       fail("Expected Exception not thrown!");
     } catch (final ODataClientErrorException e) {
       assertEquals(HttpStatusCode.BAD_REQUEST.getStatusCode(), e.getStatusLine().getStatusCode());
-      final ODataError error = e.getODataError();
+      final ClientError error = e.getODataError();
       assertThat(error.getMessage(), containsString("key property"));
     }
   }
 
   @Test
   public void readEntity() throws Exception {
-    final ODataEntityRequest<ODataEntity> request = getClient().getRetrieveRequestFactory()
+    final ODataEntityRequest<ClientEntity> request = getClient().getRetrieveRequestFactory()
         .getEntityRequest(getClient().newURIBuilder(SERVICE_URI)
             .appendEntitySetSegment("ESCollAllPrim").appendKeySegment(1).build());
     assertNotNull(request);
 
-    final ODataRetrieveResponse<ODataEntity> response = request.execute();
+    final ODataRetrieveResponse<ClientEntity> response = request.execute();
     assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
     assertThat(response.getContentType(), containsString(ContentType.APPLICATION_JSON.toContentTypeString()));
 
-    final ODataEntity entity = response.getBody();
+    final ClientEntity entity = response.getBody();
     assertNotNull(entity);
-    final ODataProperty property = entity.getProperty("CollPropertyInt16");
+    final ClientProperty property = entity.getProperty("CollPropertyInt16");
     assertNotNull(property);
     assertNotNull(property.getCollectionValue());
     assertEquals(3, property.getCollectionValue().size());
-    Iterator<ODataValue> iterator = property.getCollectionValue().iterator();
+    Iterator<ClientValue> iterator = property.getCollectionValue().iterator();
     assertEquals(1000, iterator.next().asPrimitive().toValue());
     assertEquals(2000, iterator.next().asPrimitive().toValue());
     assertEquals(30112, iterator.next().asPrimitive().toValue());
@@ -213,7 +213,7 @@ public class BasicITCase extends AbstractBaseTestITCase {
 
     // Check that the deleted entity is really gone.
     // This check has to be in the same session in order to access the same data provider.
-    ODataEntityRequest<ODataEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
     entityRequest.addCustomHeader(HttpHeader.COOKIE, response.getHeader(HttpHeader.SET_COOKIE).iterator().next());
     try {
       entityRequest.execute();
@@ -226,8 +226,8 @@ public class BasicITCase extends AbstractBaseTestITCase {
   @Test
   public void patchEntity() throws Exception {
     final ODataClient client = getClient();
-    final ODataObjectFactory factory = client.getObjectFactory();
-    ODataEntity patchEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETAllPrim"));
+    final ClientObjectFactory factory = client.getObjectFactory();
+    ClientEntity patchEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETAllPrim"));
     patchEntity.getProperties().add(factory.newPrimitiveProperty("PropertyString",
         factory.newPrimitiveValueBuilder().buildString("new")));
     patchEntity.getProperties().add(factory.newPrimitiveProperty("PropertyDecimal",
@@ -236,29 +236,29 @@ public class BasicITCase extends AbstractBaseTestITCase {
         factory.newPrimitiveValueBuilder().buildInt64(null)));
     final URI uri = client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESAllPrim").appendKeySegment(32767)
         .build();
-    final ODataEntityUpdateRequest<ODataEntity> request = client.getCUDRequestFactory().getEntityUpdateRequest(
+    final ODataEntityUpdateRequest<ClientEntity> request = client.getCUDRequestFactory().getEntityUpdateRequest(
         uri, UpdateType.PATCH, patchEntity);
-    final ODataEntityUpdateResponse<ODataEntity> response = request.execute();
+    final ODataEntityUpdateResponse<ClientEntity> response = request.execute();
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
 
     // Check that the patched properties have changed and the other properties not.
     // This check has to be in the same session in order to access the same data provider.
-    ODataEntityRequest<ODataEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
     entityRequest.addCustomHeader(HttpHeader.COOKIE, response.getHeader(HttpHeader.SET_COOKIE).iterator().next());
-    final ODataRetrieveResponse<ODataEntity> entityResponse = entityRequest.execute();
+    final ODataRetrieveResponse<ClientEntity> entityResponse = entityRequest.execute();
     assertEquals(HttpStatusCode.OK.getStatusCode(), entityResponse.getStatusCode());
-    final ODataEntity entity = entityResponse.getBody();
+    final ClientEntity entity = entityResponse.getBody();
     assertNotNull(entity);
-    final ODataProperty property1 = entity.getProperty("PropertyString");
+    final ClientProperty property1 = entity.getProperty("PropertyString");
     assertNotNull(property1);
     assertEquals("new", property1.getPrimitiveValue().toValue());
-    final ODataProperty property2 = entity.getProperty("PropertyDecimal");
+    final ClientProperty property2 = entity.getProperty("PropertyDecimal");
     assertNotNull(property2);
     assertEquals(42.875, property2.getPrimitiveValue().toValue());
-    final ODataProperty property3 = entity.getProperty("PropertyInt64");
+    final ClientProperty property3 = entity.getProperty("PropertyInt64");
     assertNotNull(property3);
     assertNull(property3.getPrimitiveValue());
-    final ODataProperty property4 = entity.getProperty("PropertyDuration");
+    final ClientProperty property4 = entity.getProperty("PropertyDuration");
     assertNotNull(property4);
     assertEquals("PT6S", property4.getPrimitiveValue().toValue());
   }
@@ -266,30 +266,30 @@ public class BasicITCase extends AbstractBaseTestITCase {
   @Test
   public void updateEntity() throws Exception {
     final ODataClient client = getClient();
-    final ODataObjectFactory factory = client.getObjectFactory();
-    ODataEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETAllPrim"));
+    final ClientObjectFactory factory = client.getObjectFactory();
+    ClientEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETAllPrim"));
     newEntity.getProperties().add(factory.newPrimitiveProperty("PropertyInt64",
         factory.newPrimitiveValueBuilder().buildInt32(42)));
-    
+
     final URI uri = client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESAllPrim").appendKeySegment(32767)
         .build();
-    final ODataEntityUpdateRequest<ODataEntity> request = client.getCUDRequestFactory().getEntityUpdateRequest(
+    final ODataEntityUpdateRequest<ClientEntity> request = client.getCUDRequestFactory().getEntityUpdateRequest(
         uri, UpdateType.REPLACE, newEntity);
-    final ODataEntityUpdateResponse<ODataEntity> response = request.execute();
+    final ODataEntityUpdateResponse<ClientEntity> response = request.execute();
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
 
     // Check that the updated properties have changed and that other properties have their default values.
     // This check has to be in the same session in order to access the same data provider.
-    ODataEntityRequest<ODataEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
     entityRequest.addCustomHeader(HttpHeader.COOKIE, response.getHeader(HttpHeader.SET_COOKIE).iterator().next());
-    final ODataRetrieveResponse<ODataEntity> entityResponse = entityRequest.execute();
+    final ODataRetrieveResponse<ClientEntity> entityResponse = entityRequest.execute();
     assertEquals(HttpStatusCode.OK.getStatusCode(), entityResponse.getStatusCode());
-    final ODataEntity entity = entityResponse.getBody();
+    final ClientEntity entity = entityResponse.getBody();
     assertNotNull(entity);
-    final ODataProperty property1 = entity.getProperty("PropertyInt64");
+    final ClientProperty property1 = entity.getProperty("PropertyInt64");
     assertNotNull(property1);
     assertEquals(42, property1.getPrimitiveValue().toValue());
-    final ODataProperty property2 = entity.getProperty("PropertyDecimal");
+    final ClientProperty property2 = entity.getProperty("PropertyDecimal");
     assertNotNull(property2);
     assertNull(property2.getPrimitiveValue());
   }
@@ -297,8 +297,8 @@ public class BasicITCase extends AbstractBaseTestITCase {
   @Test
   public void patchEntityWithComplex() throws Exception {
     final ODataClient client = getClient();
-    final ODataObjectFactory factory = client.getObjectFactory();
-    ODataEntity patchEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETCompComp"));
+    final ClientObjectFactory factory = client.getObjectFactory();
+    ClientEntity patchEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETCompComp"));
     patchEntity.getProperties().add(factory.newComplexProperty("PropertyComp",
         factory.newComplexValue("olingo.odata.test1.CTCompComp").add(
             factory.newComplexProperty("PropertyComp",
@@ -306,26 +306,26 @@ public class BasicITCase extends AbstractBaseTestITCase {
                     factory.newPrimitiveProperty("PropertyInt16",
                         factory.newPrimitiveValueBuilder().buildInt32(42)))))));
     final URI uri = client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESCompComp").appendKeySegment(1).build();
-    final ODataEntityUpdateRequest<ODataEntity> request = client.getCUDRequestFactory().getEntityUpdateRequest(
+    final ODataEntityUpdateRequest<ClientEntity> request = client.getCUDRequestFactory().getEntityUpdateRequest(
         uri, UpdateType.PATCH, patchEntity);
-    final ODataEntityUpdateResponse<ODataEntity> response = request.execute();
+    final ODataEntityUpdateResponse<ClientEntity> response = request.execute();
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
 
     // Check that the patched properties have changed and the other properties not.
     // This check has to be in the same session in order to access the same data provider.
-    ODataEntityRequest<ODataEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
     entityRequest.addCustomHeader(HttpHeader.COOKIE, response.getHeader(HttpHeader.SET_COOKIE).iterator().next());
-    final ODataRetrieveResponse<ODataEntity> entityResponse = entityRequest.execute();
+    final ODataRetrieveResponse<ClientEntity> entityResponse = entityRequest.execute();
     assertEquals(HttpStatusCode.OK.getStatusCode(), entityResponse.getStatusCode());
-    final ODataEntity entity = entityResponse.getBody();
+    final ClientEntity entity = entityResponse.getBody();
     assertNotNull(entity);
-    final ODataComplexValue complex = entity.getProperty("PropertyComp").getComplexValue()
+    final ClientComplexValue complex = entity.getProperty("PropertyComp").getComplexValue()
         .get("PropertyComp").getComplexValue();
     assertNotNull(complex);
-    final ODataProperty property1 = complex.get("PropertyInt16");
+    final ClientProperty property1 = complex.get("PropertyInt16");
     assertNotNull(property1);
     assertEquals(42, property1.getPrimitiveValue().toValue());
-    final ODataProperty property2 = complex.get("PropertyString");
+    final ClientProperty property2 = complex.get("PropertyString");
     assertNotNull(property2);
     assertEquals("String 1", property2.getPrimitiveValue().toValue());
   }
@@ -333,8 +333,8 @@ public class BasicITCase extends AbstractBaseTestITCase {
   @Test
   public void updateEntityWithComplex() throws Exception {
     final ODataClient client = getClient();
-    final ODataObjectFactory factory = client.getObjectFactory();
-    ODataEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
+    final ClientObjectFactory factory = client.getObjectFactory();
+    ClientEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
     newEntity.getProperties().add(factory.newComplexProperty("PropertyCompCompNav", null));
     // The following properties must not be null
     newEntity.getProperties().add(factory.newPrimitiveProperty("PropertyString",
@@ -350,23 +350,23 @@ public class BasicITCase extends AbstractBaseTestITCase {
                     factory.newPrimitiveValueBuilder().buildString("Test2")))));
 
     final URI uri = client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESKeyNav").appendKeySegment(1).build();
-    final ODataEntityUpdateRequest<ODataEntity> request = client.getCUDRequestFactory().getEntityUpdateRequest(
+    final ODataEntityUpdateRequest<ClientEntity> request = client.getCUDRequestFactory().getEntityUpdateRequest(
         uri, UpdateType.REPLACE, newEntity);
-    final ODataEntityUpdateResponse<ODataEntity> response = request.execute();
+    final ODataEntityUpdateResponse<ClientEntity> response = request.execute();
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
 
     // Check that the complex-property hierarchy is still there and that all primitive values are now null.
     // This check has to be in the same session in order to access the same data provider.
-    ODataEntityRequest<ODataEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory().getEntityRequest(uri);
     entityRequest.addCustomHeader(HttpHeader.COOKIE, response.getHeader(HttpHeader.SET_COOKIE).iterator().next());
-    final ODataRetrieveResponse<ODataEntity> entityResponse = entityRequest.execute();
+    final ODataRetrieveResponse<ClientEntity> entityResponse = entityRequest.execute();
     assertEquals(HttpStatusCode.OK.getStatusCode(), entityResponse.getStatusCode());
-    final ODataEntity entity = entityResponse.getBody();
+    final ClientEntity entity = entityResponse.getBody();
     assertNotNull(entity);
-    final ODataComplexValue complex = entity.getProperty("PropertyCompCompNav").getComplexValue()
+    final ClientComplexValue complex = entity.getProperty("PropertyCompCompNav").getComplexValue()
         .get("PropertyCompNav").getComplexValue();
     assertNotNull(complex);
-    final ODataProperty property = complex.get("PropertyInt16");
+    final ClientProperty property = complex.get("PropertyInt16");
     assertNotNull(property);
     assertNull(property.getPrimitiveValue());
   }
@@ -374,30 +374,30 @@ public class BasicITCase extends AbstractBaseTestITCase {
   @Test
   public void createEntity() throws Exception {
     final ODataClient client = getClient();
-    final ODataObjectFactory factory = client.getObjectFactory();
-    ODataEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETAllPrim"));
+    final ClientObjectFactory factory = client.getObjectFactory();
+    ClientEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETAllPrim"));
     newEntity.getProperties().add(factory.newPrimitiveProperty("PropertyInt64",
         factory.newPrimitiveValueBuilder().buildInt32(42)));
-    newEntity.addLink(factory.newEntityNavigationLink("NavPropertyETTwoPrimOne", 
-                          client.newURIBuilder(SERVICE_URI)
-                                .appendEntitySetSegment("ESTwoPrim")
-                                .appendKeySegment(32766)
-                                .build()));
-    
-    final ODataEntityCreateRequest<ODataEntity> createRequest = client.getCUDRequestFactory().getEntityCreateRequest(
+    newEntity.addLink(factory.newEntityNavigationLink("NavPropertyETTwoPrimOne",
+        client.newURIBuilder(SERVICE_URI)
+            .appendEntitySetSegment("ESTwoPrim")
+            .appendKeySegment(32766)
+            .build()));
+
+    final ODataEntityCreateRequest<ClientEntity> createRequest = client.getCUDRequestFactory().getEntityCreateRequest(
         client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESAllPrim").build(),
         newEntity);
     assertNotNull(createRequest);
-    final ODataEntityCreateResponse<ODataEntity> createResponse = createRequest.execute();
+    final ODataEntityCreateResponse<ClientEntity> createResponse = createRequest.execute();
 
     assertEquals(HttpStatusCode.CREATED.getStatusCode(), createResponse.getStatusCode());
     assertEquals(SERVICE_URI + "/ESAllPrim(1)", createResponse.getHeader(HttpHeader.LOCATION).iterator().next());
-    final ODataEntity createdEntity = createResponse.getBody();
+    final ClientEntity createdEntity = createResponse.getBody();
     assertNotNull(createdEntity);
-    final ODataProperty property1 = createdEntity.getProperty("PropertyInt64");
+    final ClientProperty property1 = createdEntity.getProperty("PropertyInt64");
     assertNotNull(property1);
     assertEquals(42, property1.getPrimitiveValue().toValue());
-    final ODataProperty property2 = createdEntity.getProperty("PropertyDecimal");
+    final ClientProperty property2 = createdEntity.getProperty("PropertyDecimal");
     assertNotNull(property2);
     assertNull(property2.getPrimitiveValue());
   }
@@ -406,140 +406,169 @@ public class BasicITCase extends AbstractBaseTestITCase {
   public void readEntityWithExpandedNavigationProperty() {
     final ODataClient client = ODataClientFactory.getEdmEnabledClient(SERVICE_URI);
     client.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
-    
+
     final URI uri = client.newURIBuilder(SERVICE_URI)
         .appendEntitySetSegment("ESKeyNav")
         .appendKeySegment(1)
         .expand("NavPropertyETKeyNavOne", "NavPropertyETKeyNavMany")
         .build();
-    
-    final ODataRetrieveResponse<ODataEntity> response = client.getRetrieveRequestFactory()
-                                                              .getEntityRequest(uri)
-                                                              .execute();
-    
+
+    final ODataRetrieveResponse<ClientEntity> response = client.getRetrieveRequestFactory()
+        .getEntityRequest(uri)
+        .execute();
+
     assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
-    
+
     // Check if all inlined entities are available
     // NavPropertyETKeyNavOne
     assertNotNull(response.getBody().getNavigationLink("NavPropertyETKeyNavOne"));
-    final ODataInlineEntity inlineEntity = response.getBody()
-                                                   .getNavigationLink("NavPropertyETKeyNavOne")
-                                                   .asInlineEntity();
+    final ClientInlineEntity inlineEntity = response.getBody()
+        .getNavigationLink("NavPropertyETKeyNavOne")
+        .asInlineEntity();
     assertNotNull(inlineEntity);
     assertEquals(Integer.valueOf(2), inlineEntity.getEntity()
-                                                  .getProperty("PropertyInt16")
-                                                  .getPrimitiveValue()
-                                                  .toValue());
-    
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
     // NavPropertyETKeyNavMany
     assertNotNull(response.getBody().getNavigationLink("NavPropertyETKeyNavMany"));
-    final ODataInlineEntitySet inlineEntitySet = response.getBody()
-                                                         .getNavigationLink("NavPropertyETKeyNavMany")
-                                                         .asInlineEntitySet();
+    final ClientInlineEntitySet inlineEntitySet = response.getBody()
+        .getNavigationLink("NavPropertyETKeyNavMany")
+        .asInlineEntitySet();
     assertNotNull(inlineEntitySet);
     assertEquals(2, inlineEntitySet.getEntitySet().getEntities().size());
     assertEquals(1, inlineEntitySet.getEntitySet()
-                                   .getEntities()
-                                   .get(0)
-                                   .getProperty("PropertyInt16")
-                                   .getPrimitiveValue()
-                                   .toValue());
-    
+        .getEntities()
+        .get(0)
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
     assertEquals(2, inlineEntitySet.getEntitySet()
-                                   .getEntities()
-                                   .get(1)
-                                   .getProperty("PropertyInt16")
-                                   .getPrimitiveValue()
-                                   .toValue());  
+        .getEntities()
+        .get(1)
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
   }
-  
+
   @Test
   public void updateCollectionOfComplexCollection() {
-    final ODataObjectFactory of = getClient().getObjectFactory();
-    final ODataEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
-
-    entity.getProperties().add(of.newCollectionProperty("CollPropertyComp", 
-        of.newCollectionValue("CTPrimComp")
-          .add(of.newComplexValue("CTPrimComp")
-              .add(of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16((short)42)))
-              .add(of.newComplexProperty("PropertyComp", of.newComplexValue("CTAllPrim")
-                  .add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder().buildString("42"))))))
-          .add(of.newComplexValue("CTPrimComp")
-              .add(of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16((short)43)))
-              .add(of.newComplexProperty("PropertyComp", of.newComplexValue("CTAllPrim")
-                  .add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder().buildString("43"))))))));
-    
+    final ClientObjectFactory of = getClient().getObjectFactory();
+    final ClientEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
+
+    entity.getProperties().add(
+        of.newCollectionProperty("CollPropertyComp",
+            of.newCollectionValue("CTPrimComp")
+                .add(
+                    of.newComplexValue("CTPrimComp")
+                        .add(
+                            of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16(
+                                (short) 42)))
+                        .add(
+                            of.newComplexProperty("PropertyComp", of.newComplexValue("CTAllPrim")
+                                .add(
+                                    of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder()
+                                        .buildString("42"))))))
+                .add(
+                    of.newComplexValue("CTPrimComp")
+                        .add(
+                            of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16(
+                                (short) 43)))
+                        .add(
+                            of.newComplexProperty("PropertyComp", of.newComplexValue("CTAllPrim")
+                                .add(
+                                    of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder()
+                                        .buildString("43"))))))));
+
     final URI uri = getClient().newURIBuilder(SERVICE_URI)
-                               .appendEntitySetSegment("ESKeyNav")
-                               .appendKeySegment(3)
-                               .build();
-    
-    final ODataEntityUpdateResponse<ODataEntity> response = getClient().getCUDRequestFactory()
-                                                                       .getEntityUpdateRequest(uri, 
-                                                                                               UpdateType.PATCH, 
-                                                                                               entity)
-                                                                       .execute();
-    
+        .appendEntitySetSegment("ESKeyNav")
+        .appendKeySegment(3)
+        .build();
+
+    final ODataEntityUpdateResponse<ClientEntity> response = getClient().getCUDRequestFactory()
+        .getEntityUpdateRequest(uri,
+            UpdateType.PATCH,
+            entity)
+        .execute();
+
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
     final String cookie = response.getHeader(HttpHeader.SET_COOKIE).iterator().next();
-    
+
     // Check if entity has changed
-    final ODataEntityRequest<ODataEntity> entityRequest = getClient().getRetrieveRequestFactory().getEntityRequest(uri);
+    final ODataEntityRequest<ClientEntity> entityRequest =
+        getClient().getRetrieveRequestFactory().getEntityRequest(uri);
     entityRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
-    final ODataRetrieveResponse<ODataEntity> entityResponse = entityRequest.execute();
-    
+    final ODataRetrieveResponse<ClientEntity> entityResponse = entityRequest.execute();
+
     assertEquals(HttpStatusCode.OK.getStatusCode(), entityResponse.getStatusCode());
     assertNotNull(entityResponse.getBody().getProperty("CollPropertyComp"));
     assertEquals(2, entityResponse.getBody().getProperty("CollPropertyComp").getCollectionValue().size());
-    
-    final Iterator<ODataValue> collectionIterator = entityResponse.getBody()
-                                                                  .getProperty("CollPropertyComp")
-                                                                  .getCollectionValue()
-                                                                  .iterator();
-    
-    ODataComplexValue complexProperty = collectionIterator.next().asComplex();
+
+    final Iterator<ClientValue> collectionIterator = entityResponse.getBody()
+        .getProperty("CollPropertyComp")
+        .getCollectionValue()
+        .iterator();
+
+    ClientComplexValue complexProperty = collectionIterator.next().asComplex();
     assertEquals(42, complexProperty.get("PropertyInt16").getPrimitiveValue().toValue());
     assertNotNull(complexProperty.get("PropertyComp"));
-    
-    ODataComplexValue innerComplexProperty = complexProperty.get("PropertyComp").getComplexValue();
+
+    ClientComplexValue innerComplexProperty = complexProperty.get("PropertyComp").getComplexValue();
     assertEquals("42", innerComplexProperty.get("PropertyString").getPrimitiveValue().toValue());
-    
+
     complexProperty = collectionIterator.next().asComplex();
     assertEquals(43, complexProperty.get("PropertyInt16").getPrimitiveValue().toValue());
     assertNotNull(complexProperty.get("PropertyComp"));
-    
+
     innerComplexProperty = complexProperty.get("PropertyComp").getComplexValue();
     assertEquals("43", innerComplexProperty.get("PropertyString").getPrimitiveValue().toValue());
   }
-  
+
   @Test
   public void createCollectionOfComplexCollection() {
     /*
      * Create a new entity which contains a collection of complex collections
      * Check if all not filled fields are created by the server
      */
-    final ODataObjectFactory of = getClient().getObjectFactory();
-    final ODataEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
+    final ClientObjectFactory of = getClient().getObjectFactory();
+    final ClientEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
     entity.getProperties().add(
-        of.newPrimitiveProperty("PropertyString", 
-                                of.newPrimitiveValueBuilder().buildString("Complex collection test")));
-    entity.getProperties().add(of.newComplexProperty("PropertyCompTwoPrim", 
-         of.newComplexValue("CTTwoPrim")
-           .add(of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16((short) 1)))
-           .add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder().buildString("1")))));
-    
-    entity.getProperties().add(of.newCollectionProperty("CollPropertyComp", 
-        of.newCollectionValue("CTPrimComp")
-          .add(of.newComplexValue("CTPrimComp")
-              .add(of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16((short)1)))
-              .add(of.newComplexProperty("PropertyComp", of.newComplexValue("CTAllPrim")
-                  .add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder().buildString("1"))))))
-          .add(of.newComplexValue("CTPrimComp")
-              .add(of.newComplexProperty("PropertyComp", of.newComplexValue("CTAllPrim")
-                  .add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder().buildString("2")))
-                  .add(of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16((short) 2)))
-                  .add(of.newPrimitiveProperty("PropertySingle", of.newPrimitiveValueBuilder().buildSingle(2.0f))))))));
-    
+        of.newPrimitiveProperty("PropertyString",
+            of.newPrimitiveValueBuilder().buildString("Complex collection test")));
+    entity.getProperties().add(of.newComplexProperty("PropertyCompTwoPrim",
+        of.newComplexValue("CTTwoPrim")
+            .add(of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16((short) 1)))
+            .add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder().buildString("1")))));
+
+    entity.getProperties().add(
+        of.newCollectionProperty("CollPropertyComp",
+            of.newCollectionValue("CTPrimComp")
+                .add(
+                    of.newComplexValue("CTPrimComp")
+                        .add(
+                            of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder()
+                                .buildInt16((short) 1)))
+                        .add(
+                            of.newComplexProperty("PropertyComp", of.newComplexValue("CTAllPrim")
+                                .add(
+                                    of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder()
+                                        .buildString("1"))))))
+                .add(
+                    of.newComplexValue("CTPrimComp")
+                        .add(
+                            of.newComplexProperty("PropertyComp", of.newComplexValue("CTAllPrim")
+                                .add(
+                                    of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder()
+                                        .buildString("2")))
+                                .add(
+                                    of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16(
+                                        (short) 2)))
+                                .add(
+                                    of.newPrimitiveProperty("PropertySingle", of.newPrimitiveValueBuilder()
+                                        .buildSingle(2.0f))))))));
+
     entity.addLink(of.newEntityNavigationLink("NavPropertyETTwoKeyNavOne",
         getClient().newURIBuilder(SERVICE_URI)
             .appendEntitySetSegment("ESTwoKeyNav")
@@ -551,22 +580,21 @@ public class BasicITCase extends AbstractBaseTestITCase {
                 put("PropertyString", "1");
               }
             }).build()));
-    
-    final ODataEntityCreateResponse<ODataEntity> response = getClient().getCUDRequestFactory().getEntityCreateRequest(
+
+    final ODataEntityCreateResponse<ClientEntity> response = getClient().getCUDRequestFactory().getEntityCreateRequest(
         getClient().newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESKeyNav").build(),
         entity).execute();
-    
-    
+
     // Check if not declared fields are also available
     assertEquals(HttpStatusCode.CREATED.getStatusCode(), response.getStatusCode());
-    final ODataEntity newEntity = response.getBody();
-    
+    final ClientEntity newEntity = response.getBody();
+
     assertEquals(2, newEntity.getProperty("CollPropertyComp").getCollectionValue().size());
-    final Iterator<ODataValue> iter = newEntity.getProperty("CollPropertyComp").getCollectionValue().iterator();
-    final ODataComplexValue complexProperty1 = iter.next().asComplex();
+    final Iterator<ClientValue> iter = newEntity.getProperty("CollPropertyComp").getCollectionValue().iterator();
+    final ClientComplexValue complexProperty1 = iter.next().asComplex();
     assertEquals(1, complexProperty1.get("PropertyInt16").getPrimitiveValue().toValue());
     assertNotNull(complexProperty1.get("PropertyComp"));
-    final ODataComplexValue innerComplexProperty1 = complexProperty1.get("PropertyComp").getComplexValue();
+    final ClientComplexValue innerComplexProperty1 = complexProperty1.get("PropertyComp").getComplexValue();
     assertEquals("1", innerComplexProperty1.get("PropertyString").getPrimitiveValue().toValue());
     assertTrue(innerComplexProperty1.get("PropertyBinary").hasNullValue());
     assertTrue(innerComplexProperty1.get("PropertyBoolean").hasNullValue());
@@ -584,11 +612,11 @@ public class BasicITCase extends AbstractBaseTestITCase {
     assertTrue(innerComplexProperty1.get("PropertyTimeOfDay").hasNullValue());
     assertTrue(innerComplexProperty1.get("PropertyInt16").hasNullValue());
     assertTrue(innerComplexProperty1.get("PropertySingle").hasNullValue());
-    
-    final ODataComplexValue complexProperty2 = iter.next().asComplex();
+
+    final ClientComplexValue complexProperty2 = iter.next().asComplex();
     assertTrue(complexProperty2.get("PropertyInt16").hasNullValue());
     assertNotNull(complexProperty2.get("PropertyComp"));
-    final ODataComplexValue innerComplexProperty2 = complexProperty2.get("PropertyComp").getComplexValue();
+    final ClientComplexValue innerComplexProperty2 = complexProperty2.get("PropertyComp").getComplexValue();
     assertEquals("2", innerComplexProperty2.get("PropertyString").getPrimitiveValue().toValue());
     assertEquals(2, innerComplexProperty2.get("PropertyInt16").getPrimitiveValue().toValue());
     assertEquals(Double.valueOf(2), innerComplexProperty2.get("PropertySingle").getPrimitiveValue().toValue());
@@ -605,20 +633,20 @@ public class BasicITCase extends AbstractBaseTestITCase {
     assertTrue(innerComplexProperty2.get("PropertyInt64").hasNullValue());
     assertTrue(innerComplexProperty2.get("PropertySByte").hasNullValue());
     assertTrue(innerComplexProperty2.get("PropertyTimeOfDay").hasNullValue());
-    
+
     // Check if not available properties return null
     assertNull(innerComplexProperty2.get("NotAvailableProperty"));
   }
-  
+
   @Test
   public void testComplexPropertyWithNotNullablePrimitiveValue() {
     final EdmEnabledODataClient client = ODataClientFactory.getEdmEnabledClient(SERVICE_URI);
-    final ODataObjectFactory of = client.getObjectFactory();
-    
+    final ClientObjectFactory of = client.getObjectFactory();
+
     // PropertyComp is null, but the primitive values in PropertyComp must not be null
-    final ODataEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETMixPrimCollComp"));
+    final ClientEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETMixPrimCollComp"));
     final URI targetURI = client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESMixPrimCollComp").build();
-    
+
     try {
       client.getCUDRequestFactory().getEntityCreateRequest(targetURI, entity).execute();
       fail("Expecting bad request");
@@ -626,192 +654,192 @@ public class BasicITCase extends AbstractBaseTestITCase {
       assertEquals(HttpStatusCode.BAD_REQUEST.getStatusCode(), e.getStatusLine().getStatusCode());
     }
   }
-  
+
   @Test
   public void testUpsert() throws EdmPrimitiveTypeException {
     final EdmEnabledODataClient client = ODataClientFactory.getEdmEnabledClient(SERVICE_URI);
-    final ODataObjectFactory of = client.getObjectFactory();
-  
-    final ODataEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETTwoPrim"));
+    final ClientObjectFactory of = client.getObjectFactory();
+
+    final ClientEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETTwoPrim"));
     entity.getProperties().add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder()
-                                                                           .buildString("Test")));
-    
+        .buildString("Test")));
+
     final URI uri = client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESTwoPrim").appendKeySegment(33).build();
-    final ODataEntityUpdateResponse<ODataEntity> updateResponse = 
+    final ODataEntityUpdateResponse<ClientEntity> updateResponse =
         client.getCUDRequestFactory().getEntityUpdateRequest(uri, UpdateType.PATCH, entity).execute();
-    
+
     assertEquals(HttpStatusCode.CREATED.getStatusCode(), updateResponse.getStatusCode());
     assertEquals("Test", updateResponse.getBody().getProperty("PropertyString").getPrimitiveValue().toValue());
-    
+
     final String cookie = updateResponse.getHeader(HttpHeader.SET_COOKIE).iterator().next();
     final Short key = updateResponse.getBody().getProperty("PropertyInt16")
-                                              .getPrimitiveValue()
-                                              .toCastValue(Short.class);
-    
-    final ODataEntityRequest<ODataEntity> entityRequest = client.getRetrieveRequestFactory()
-                                                                .getEntityRequest(client.newURIBuilder()
-                                                                    .appendEntitySetSegment("ESTwoPrim")
-                                                                    .appendKeySegment(key)
-                                                                    .build());
+        .getPrimitiveValue()
+        .toCastValue(Short.class);
+
+    final ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory()
+        .getEntityRequest(client.newURIBuilder()
+            .appendEntitySetSegment("ESTwoPrim")
+            .appendKeySegment(key)
+            .build());
     entityRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
-    final ODataRetrieveResponse<ODataEntity> responseEntityRequest = entityRequest.execute();
+    final ODataRetrieveResponse<ClientEntity> responseEntityRequest = entityRequest.execute();
     assertEquals(HttpStatusCode.OK.getStatusCode(), responseEntityRequest.getStatusCode());
     assertEquals("Test", responseEntityRequest.getBody().getProperty("PropertyString").getPrimitiveValue().toValue());
   }
-  
+
   @Test
   public void testUpdatePropertyWithNull() {
     final EdmEnabledODataClient client = ODataClientFactory.getEdmEnabledClient(SERVICE_URI);
-    final ODataObjectFactory of = client.getObjectFactory();
-  
+    final ClientObjectFactory of = client.getObjectFactory();
+
     final URI targetURI = client.newURIBuilder(SERVICE_URI)
-                                .appendEntitySetSegment("ESAllPrim")
-                                .appendKeySegment(32767)
-                                .build();
-    
-    final ODataEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETAllPrim"));
+        .appendEntitySetSegment("ESAllPrim")
+        .appendKeySegment(32767)
+        .build();
+
+    final ClientEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETAllPrim"));
     entity.getProperties().add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder()
-                                                                            .buildString(null)));
-    
-    final ODataEntityUpdateResponse<ODataEntity> updateResponse = client.getCUDRequestFactory()
-        .getEntityUpdateRequest(targetURI,  UpdateType.PATCH, entity)
+        .buildString(null)));
+
+    final ODataEntityUpdateResponse<ClientEntity> updateResponse = client.getCUDRequestFactory()
+        .getEntityUpdateRequest(targetURI, UpdateType.PATCH, entity)
         .execute();
-    
+
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), updateResponse.getStatusCode());
     final String cookie = updateResponse.getHeader(HttpHeader.SET_COOKIE).iterator().next();
-    
-    final ODataEntityRequest<ODataEntity> entityRequest = client.getRetrieveRequestFactory()
-                                                                .getEntityRequest(targetURI);
+
+    final ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory()
+        .getEntityRequest(targetURI);
     entityRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
-    final ODataRetrieveResponse<ODataEntity> entityResponse = entityRequest.execute();
+    final ODataRetrieveResponse<ClientEntity> entityResponse = entityRequest.execute();
     assertEquals(HttpStatusCode.OK.getStatusCode(), entityResponse.getStatusCode());
-    
+
     assertTrue(entityResponse.getBody().getProperty("PropertyString").hasNullValue());
     assertEquals(34, entityResponse.getBody().getProperty("PropertyDecimal").getPrimitiveValue().toValue());
   }
-  
-  @Test(expected=ODataClientErrorException.class)
+
+  @Test(expected = ODataClientErrorException.class)
   public void testUpdatePropertyWithNullNotAllowed() {
     final EdmEnabledODataClient client = ODataClientFactory.getEdmEnabledClient(SERVICE_URI);
-    final ODataObjectFactory of = client.getObjectFactory();
-  
+    final ClientObjectFactory of = client.getObjectFactory();
+
     final URI targetURI = client.newURIBuilder(SERVICE_URI)
-                                .appendEntitySetSegment("ESKeyNav")
-                                .appendKeySegment(32767)
-                                .build();
-    
-    final ODataEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
+        .appendEntitySetSegment("ESKeyNav")
+        .appendKeySegment(32767)
+        .build();
+
+    final ClientEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
     entity.getProperties().add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder()
-                                                                            .buildString(null)));
-    
-    client.getCUDRequestFactory().getEntityUpdateRequest(targetURI,  UpdateType.PATCH, entity).execute();
+        .buildString(null)));
+
+    client.getCUDRequestFactory().getEntityUpdateRequest(targetURI, UpdateType.PATCH, entity).execute();
   }
-  
+
   @Test
   public void testUpdateMerge() {
     final EdmEnabledODataClient client = ODataClientFactory.getEdmEnabledClient(SERVICE_URI);
-    final ODataObjectFactory of = client.getObjectFactory();
-  
+    final ClientObjectFactory of = client.getObjectFactory();
+
     final URI targetURI = client.newURIBuilder(SERVICE_URI)
-                                .appendEntitySetSegment("ESKeyNav")
-                                .appendKeySegment(1)
-                                .build();
+        .appendEntitySetSegment("ESKeyNav")
+        .appendKeySegment(1)
+        .build();
 
-    final ODataEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
+    final ClientEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
     entity.addLink(of.newEntityNavigationLink("NavPropertyETKeyNavOne", targetURI));
     entity.addLink(of.newEntitySetNavigationLink("NavPropertyETKeyNavMany", client.newURIBuilder(SERVICE_URI)
         .appendEntitySetSegment("ESKeyNav").appendKeySegment(3).build()));
     entity.getProperties().add(of.newCollectionProperty("CollPropertyString", of.newCollectionValue("Edm.String")
         .add(of.newPrimitiveValueBuilder().buildString("Single entry!"))));
-    entity.getProperties().add(of.newComplexProperty("PropertyCompAllPrim", 
+    entity.getProperties().add(of.newComplexProperty("PropertyCompAllPrim",
         of.newComplexValue("CTAllPrim")
-          .add(of.newPrimitiveProperty("PropertyString", 
-              of.newPrimitiveValueBuilder().buildString("Changed")))));
-    
-    final ODataEntityUpdateResponse<ODataEntity> response = client.getCUDRequestFactory()
-                                                .getEntityUpdateRequest(targetURI,UpdateType.PATCH, entity)
-                                                .execute();
-    
+            .add(of.newPrimitiveProperty("PropertyString",
+                of.newPrimitiveValueBuilder().buildString("Changed")))));
+
+    final ODataEntityUpdateResponse<ClientEntity> response = client.getCUDRequestFactory()
+        .getEntityUpdateRequest(targetURI, UpdateType.PATCH, entity)
+        .execute();
+
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
     final String cookie = response.getHeader(HttpHeader.SET_COOKIE).iterator().next();
-    
-    final ODataEntityRequest<ODataEntity> entityRequest = client.getRetrieveRequestFactory()
-                                                      .getEntityRequest(
-                                                          client.newURIBuilder()
-                                                          .appendEntitySetSegment("ESKeyNav")
-                                                          .appendKeySegment(1)
-                                                          .expand("NavPropertyETKeyNavOne", "NavPropertyETKeyNavMany")
-                                                          .build());
+
+    final ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory()
+        .getEntityRequest(
+            client.newURIBuilder()
+                .appendEntitySetSegment("ESKeyNav")
+                .appendKeySegment(1)
+                .expand("NavPropertyETKeyNavOne", "NavPropertyETKeyNavMany")
+                .build());
     entityRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
-    final ODataRetrieveResponse<ODataEntity> entitytResponse = entityRequest.execute();
-    
+    final ODataRetrieveResponse<ClientEntity> entitytResponse = entityRequest.execute();
+
     assertEquals(HttpStatusCode.OK.getStatusCode(), entitytResponse.getStatusCode());
     assertEquals(1, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavOne")
-                                             .asInlineEntity()
-                                             .getEntity()
-                                             .getProperty("PropertyInt16")
-                                             .getPrimitiveValue()
-                                             .toValue());
-    
+        .asInlineEntity()
+        .getEntity()
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
     assertEquals(3, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavMany")
         .asInlineEntitySet()
         .getEntitySet()
         .getEntities()
         .size());
-    
+
     assertEquals(1, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavMany")
-                                             .asInlineEntitySet()
-                                             .getEntitySet()
-                                             .getEntities()
-                                             .get(0)
-                                             .getProperty("PropertyInt16")
-                                             .getPrimitiveValue()
-                                             .toValue());
-    
+        .asInlineEntitySet()
+        .getEntitySet()
+        .getEntities()
+        .get(0)
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
     assertEquals(2, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavMany")
-                                              .asInlineEntitySet()
-                                              .getEntitySet()
-                                              .getEntities()
-                                              .get(1)
-                                              .getProperty("PropertyInt16")
-                                              .getPrimitiveValue()
-                                              .toValue());
-    
+        .asInlineEntitySet()
+        .getEntitySet()
+        .getEntities()
+        .get(1)
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
     assertEquals(3, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavMany")
-                                              .asInlineEntitySet()
-                                              .getEntitySet()
-                                              .getEntities()
-                                              .get(2)
-                                              .getProperty("PropertyInt16")
-                                              .getPrimitiveValue()
-                                              .toValue());
-    
-    final Iterator<ODataValue> collectionIterator = entitytResponse.getBody()
-                                                                   .getProperty("CollPropertyString")
-                                                                   .getCollectionValue()
-                                                                   .iterator();
+        .asInlineEntitySet()
+        .getEntitySet()
+        .getEntities()
+        .get(2)
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
+    final Iterator<ClientValue> collectionIterator = entitytResponse.getBody()
+        .getProperty("CollPropertyString")
+        .getCollectionValue()
+        .iterator();
     assertTrue(collectionIterator.hasNext());
     assertEquals("Single entry!", collectionIterator.next().asPrimitive().toValue());
     assertFalse(collectionIterator.hasNext());
-    
-    final ODataComplexValue complexValue = entitytResponse.getBody()
-                                                          .getProperty("PropertyCompAllPrim")
-                                                          .getComplexValue();
-    
+
+    final ClientComplexValue complexValue = entitytResponse.getBody()
+        .getProperty("PropertyCompAllPrim")
+        .getComplexValue();
+
     assertEquals("Changed", complexValue.get("PropertyString").getPrimitiveValue().toValue());
   }
-  
+
   @Test
   public void testUpdateReplace() {
     final EdmEnabledODataClient client = ODataClientFactory.getEdmEnabledClient(SERVICE_URI);
-    final ODataObjectFactory of = client.getObjectFactory();
-  
+    final ClientObjectFactory of = client.getObjectFactory();
+
     final URI targetURI = client.newURIBuilder(SERVICE_URI)
-                                .appendEntitySetSegment("ESKeyNav")
-                                .appendKeySegment(1)
-                                .build();
+        .appendEntitySetSegment("ESKeyNav")
+        .appendKeySegment(1)
+        .build();
 
-    final ODataEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
+    final ClientEntity entity = of.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
     entity.addLink(of.newEntityNavigationLink("NavPropertyETKeyNavOne", targetURI));
     entity.addLink(of.newEntitySetNavigationLink("NavPropertyETKeyNavMany", client.newURIBuilder(SERVICE_URI)
         .appendEntitySetSegment("ESKeyNav").appendKeySegment(3).build()));
@@ -819,105 +847,104 @@ public class BasicITCase extends AbstractBaseTestITCase {
         .buildString("Must not be null")));
     entity.getProperties().add(of.newComplexProperty("PropertyCompTwoPrim", of.newComplexValue("CTTwoPrim")
         .add(of.newPrimitiveProperty("PropertyString", of.newPrimitiveValueBuilder()
-                                                          .buildString("Must not be null")))
+            .buildString("Must not be null")))
         .add(of.newPrimitiveProperty("PropertyInt16", of.newPrimitiveValueBuilder().buildInt16((short) 42)))));
     entity.getProperties().add(of.newCollectionProperty("CollPropertyString", of.newCollectionValue("Edm.String")
         .add(of.newPrimitiveValueBuilder().buildString("Single entry!"))));
-    entity.getProperties().add(of.newComplexProperty("PropertyCompAllPrim", 
+    entity.getProperties().add(of.newComplexProperty("PropertyCompAllPrim",
         of.newComplexValue("CTAllPrim")
-          .add(of.newPrimitiveProperty("PropertyString", 
-              of.newPrimitiveValueBuilder().buildString("Changed")))));
-    
-    final ODataEntityUpdateResponse<ODataEntity> response = client.getCUDRequestFactory()
-                                                .getEntityUpdateRequest(targetURI,UpdateType.REPLACE, entity)
-                                                .execute();
-    
+            .add(of.newPrimitiveProperty("PropertyString",
+                of.newPrimitiveValueBuilder().buildString("Changed")))));
+
+    final ODataEntityUpdateResponse<ClientEntity> response = client.getCUDRequestFactory()
+        .getEntityUpdateRequest(targetURI, UpdateType.REPLACE, entity)
+        .execute();
+
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
     final String cookie = response.getHeader(HttpHeader.SET_COOKIE).iterator().next();
-    
-    final ODataEntityRequest<ODataEntity> entityRequest = client.getRetrieveRequestFactory()
-                                                      .getEntityRequest(
-                                                          client.newURIBuilder()
-                                                          .appendEntitySetSegment("ESKeyNav")
-                                                          .appendKeySegment(1)
-                                                          .expand("NavPropertyETKeyNavOne", "NavPropertyETKeyNavMany")
-                                                          .build());
+
+    final ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory()
+        .getEntityRequest(
+            client.newURIBuilder()
+                .appendEntitySetSegment("ESKeyNav")
+                .appendKeySegment(1)
+                .expand("NavPropertyETKeyNavOne", "NavPropertyETKeyNavMany")
+                .build());
     entityRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
-    final ODataRetrieveResponse<ODataEntity> entitytResponse = entityRequest.execute();
-    
+    final ODataRetrieveResponse<ClientEntity> entitytResponse = entityRequest.execute();
+
     assertEquals(HttpStatusCode.OK.getStatusCode(), entitytResponse.getStatusCode());
     assertEquals(1, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavOne")
-                                             .asInlineEntity()
-                                             .getEntity()
-                                             .getProperty("PropertyInt16")
-                                             .getPrimitiveValue()
-                                             .toValue());
-    
+        .asInlineEntity()
+        .getEntity()
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
     assertEquals(3, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavMany")
         .asInlineEntitySet()
         .getEntitySet()
         .getEntities()
         .size());
-    
+
     assertEquals(1, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavMany")
-                                             .asInlineEntitySet()
-                                             .getEntitySet()
-                                             .getEntities()
-                                             .get(0)
-                                             .getProperty("PropertyInt16")
-                                             .getPrimitiveValue()
-                                             .toValue());
-    
+        .asInlineEntitySet()
+        .getEntitySet()
+        .getEntities()
+        .get(0)
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
     assertEquals(2, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavMany")
-                                              .asInlineEntitySet()
-                                              .getEntitySet()
-                                              .getEntities()
-                                              .get(1)
-                                              .getProperty("PropertyInt16")
-                                              .getPrimitiveValue()
-                                              .toValue());
-    
+        .asInlineEntitySet()
+        .getEntitySet()
+        .getEntities()
+        .get(1)
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
     assertEquals(3, entitytResponse.getBody().getNavigationLink("NavPropertyETKeyNavMany")
-                                              .asInlineEntitySet()
-                                              .getEntitySet()
-                                              .getEntities()
-                                              .get(2)
-                                              .getProperty("PropertyInt16")
-                                              .getPrimitiveValue()
-                                              .toValue());
-    
-    final Iterator<ODataValue> collectionIterator = entitytResponse.getBody()
-                                                                   .getProperty("CollPropertyString")
-                                                                   .getCollectionValue()
-                                                                   .iterator();
+        .asInlineEntitySet()
+        .getEntitySet()
+        .getEntities()
+        .get(2)
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+
+    final Iterator<ClientValue> collectionIterator = entitytResponse.getBody()
+        .getProperty("CollPropertyString")
+        .getCollectionValue()
+        .iterator();
     assertTrue(collectionIterator.hasNext());
     assertEquals("Single entry!", collectionIterator.next().asPrimitive().toValue());
     assertFalse(collectionIterator.hasNext());
-    
-    final ODataComplexValue propCompAllPrim = entitytResponse.getBody()
-                                                          .getProperty("PropertyCompAllPrim")
-                                                          .getComplexValue();
-    
+
+    final ClientComplexValue propCompAllPrim = entitytResponse.getBody()
+        .getProperty("PropertyCompAllPrim")
+        .getComplexValue();
+
     assertEquals("Changed", propCompAllPrim.get("PropertyString").getPrimitiveValue().toValue());
     assertTrue(propCompAllPrim.get("PropertyInt16").hasNullValue());
     assertTrue(propCompAllPrim.get("PropertyDate").hasNullValue());
-    
-   final ODataComplexValue propCompTwoPrim = entitytResponse.getBody()
-                                                            .getProperty("PropertyCompTwoPrim")
-                                                            .getComplexValue();
-   
-   assertEquals("Must not be null", propCompTwoPrim.get("PropertyString").getPrimitiveValue().toValue());
-   assertEquals(42, propCompTwoPrim.get("PropertyInt16").getPrimitiveValue().toValue());
-   
-   assertNotNull(entitytResponse.getBody().getProperty("PropertyCompNav").getComplexValue());
-   assertTrue(entitytResponse.getBody()
-                             .getProperty("PropertyCompNav")
-                             .getComplexValue()
-                             .get("PropertyInt16")
-                             .hasNullValue());
+
+    final ClientComplexValue propCompTwoPrim = entitytResponse.getBody()
+        .getProperty("PropertyCompTwoPrim")
+        .getComplexValue();
+
+    assertEquals("Must not be null", propCompTwoPrim.get("PropertyString").getPrimitiveValue().toValue());
+    assertEquals(42, propCompTwoPrim.get("PropertyInt16").getPrimitiveValue().toValue());
+
+    assertNotNull(entitytResponse.getBody().getProperty("PropertyCompNav").getComplexValue());
+    assertTrue(entitytResponse.getBody()
+        .getProperty("PropertyCompNav")
+        .getComplexValue()
+        .get("PropertyInt16")
+        .hasNullValue());
   }
 
-  
   @Override
   protected ODataClient getClient() {
     ODataClient odata = ODataClientFactory.getClient();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java
index 55fa57f..c03490c 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java
@@ -45,9 +45,9 @@ import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse
 import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.client.core.communication.request.batch.ODataChangesetResponseItem;
-import org.apache.olingo.commons.api.domain.ODataEntity;
-import org.apache.olingo.commons.api.domain.ODataEntitySet;
-import org.apache.olingo.commons.api.domain.ODataObjectFactory;
+import org.apache.olingo.commons.api.domain.ClientEntity;
+import org.apache.olingo.commons.api.domain.ClientEntitySet;
+import org.apache.olingo.commons.api.domain.ClientObjectFactory;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.format.ContentType;
@@ -91,10 +91,10 @@ public class BatchClientITCase extends AbstractTestITCase {
      */
 
     final ODataClient client = getClient();
-    final ODataObjectFactory of = client.getObjectFactory();
+    final ClientObjectFactory of = client.getObjectFactory();
 
     // Try to create entity, with invalid type
-    final ODataEntity entity = of.newEntity(ES_NOT_AVAILABLE);
+    final ClientEntity entity = of.newEntity(ES_NOT_AVAILABLE);
     entity.getProperties().add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder()
         .buildString("1")));
     final ODataBatchRequest batchRequest = client.getBatchRequestFactory().getBatchRequest(SERVICE_URI);
@@ -104,7 +104,7 @@ public class BatchClientITCase extends AbstractTestITCase {
     final URI targetURI = client.newURIBuilder(SERVICE_URI)
         .appendEntitySetSegment(ES_NOT_AVAILABLE_NAME)
         .build();
-    final ODataEntityCreateRequest<ODataEntity> createRequest = client.getCUDRequestFactory()
+    final ODataEntityCreateRequest<ClientEntity> createRequest = client.getCUDRequestFactory()
         .getEntityCreateRequest(targetURI, entity);
     changeset.addRequest(createRequest);
 
@@ -257,7 +257,7 @@ public class BatchClientITCase extends AbstractTestITCase {
 
     final BatchManager payload = request.payloadManager();
     final URI uri = new URI(SERVICE_URI + "/../ESAllPrim(32767)");
-    final ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    final ODataEntityRequest<ClientEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
     queryReq.setFormat(ODataFormat.JSON);
     payload.addRequest(queryReq);
 
@@ -282,7 +282,7 @@ public class BatchClientITCase extends AbstractTestITCase {
 
     final BatchManager payload = request.payloadManager();
     final URI uri = new URI("http://otherhost/odata/ESAllPrim(32767)");
-    final ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    final ODataEntityRequest<ClientEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
     queryReq.setFormat(ODataFormat.JSON);
     payload.addRequest(queryReq);
 
@@ -297,7 +297,7 @@ public class BatchClientITCase extends AbstractTestITCase {
 
     final BatchManager payload = request.payloadManager();
     final URI uri = new URI("/ESAllPrim(32767)");
-    final ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    final ODataEntityRequest<ClientEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
     queryReq.setFormat(ODataFormat.JSON);
     payload.addRequest(queryReq);
 
@@ -366,29 +366,28 @@ public class BatchClientITCase extends AbstractTestITCase {
   public void changesetWithReferences() throws EdmPrimitiveTypeException, URISyntaxException {
     // create your request
     final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(SERVICE_URI);
-    final ODataObjectFactory of = client.getObjectFactory();
+    final ClientObjectFactory of = client.getObjectFactory();
     request.setAccept(ACCEPT);
     final BatchManager streamManager = request.payloadManager();
 
     final ODataChangeset changeset = streamManager.addChangeset();
-    final ODataEntity entityESAllPrim = getClient().getObjectFactory().
+    final ClientEntity entityESAllPrim = getClient().getObjectFactory().
         newEntity(new FullQualifiedName("olingo.odata.test1.ESAllPrim"));
 
     entityESAllPrim.getProperties().add(client.getObjectFactory().newPrimitiveProperty(
         "PropertyDouble",
         client.getObjectFactory().newPrimitiveValueBuilder().buildDouble(3.1415)));
-    
+
     entityESAllPrim.addLink(
         of.newEntityNavigationLink("NavPropertyETTwoPrimOne", client.newURIBuilder(SERVICE_URI)
-                                                                    .appendEntitySetSegment("ESTwoPrim")
-                                                                    .appendKeySegment(-365)
-                                                                    .build()));
-    
-    
+            .appendEntitySetSegment("ESTwoPrim")
+            .appendKeySegment(-365)
+            .build()));
+
     final URIBuilder uriBuilder = client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESAllPrim");
 
     // add create request
-    final ODataEntityCreateRequest<ODataEntity> createReq =
+    final ODataEntityCreateRequest<ClientEntity> createReq =
         client.getCUDRequestFactory().getEntityCreateRequest(uriBuilder.build(), entityESAllPrim);
     createReq.setFormat(ODataFormat.JSON);
     changeset.addRequest(createReq);
@@ -397,21 +396,21 @@ public class BatchClientITCase extends AbstractTestITCase {
     int createRequestRef = changeset.getLastContentId();
 
     // add update request
-    final ODataEntity entityUpdate = client.getObjectFactory().newEntity(entityESAllPrim.getTypeName());
+    final ClientEntity entityUpdate = client.getObjectFactory().newEntity(entityESAllPrim.getTypeName());
     entityUpdate.addLink(client.getObjectFactory().newEntitySetNavigationLink(
         "NavPropertyETTwoPrimMany",
         client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESTwoPrim").appendKeySegment(32767).build()));
 
-    final ODataEntityUpdateRequest<ODataEntity> updateReq = client.getCUDRequestFactory().getEntityUpdateRequest(
+    final ODataEntityUpdateRequest<ClientEntity> updateReq = client.getCUDRequestFactory().getEntityUpdateRequest(
         URI.create("$" + createRequestRef), UpdateType.PATCH, entityUpdate);
     updateReq.setFormat(ODataFormat.JSON);
-    
+
     changeset.addRequest(updateReq);
 
     final ODataBatchResponse response = streamManager.getResponse();
     assertEquals(HttpStatusCode.ACCEPTED.getStatusCode(), response.getStatusCode());
     final String cookie = response.getHeader(HttpHeader.SET_COOKIE).iterator().next();
-    
+
     // verify response payload ...
     final Iterator<ODataBatchResponseItem> bodyIterator = response.getBody();
     final ODataBatchResponseItem item = bodyIterator.next();
@@ -422,31 +421,31 @@ public class BatchClientITCase extends AbstractTestITCase {
     ODataResponse res = chgitem.next();
     assertEquals(HttpStatusCode.CREATED.getStatusCode(), res.getStatusCode());
     assertTrue(res instanceof ODataEntityCreateResponse);
-    final ODataEntityCreateResponse<ODataEntity> createResponse = ((ODataEntityCreateResponse<ODataEntity>) res);
-    
+    final ODataEntityCreateResponse<ClientEntity> createResponse = ((ODataEntityCreateResponse<ClientEntity>) res);
+
     res = chgitem.next();
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), res.getStatusCode());
     assertTrue(res instanceof ODataEntityUpdateResponse);
-    
-    final ODataEntitySetRequest<ODataEntitySet> req = client.getRetrieveRequestFactory().getEntitySetRequest(
+
+    final ODataEntitySetRequest<ClientEntitySet> req = client.getRetrieveRequestFactory().getEntitySetRequest(
         new URI(createResponse.getHeader(HttpHeader.LOCATION).iterator().next() + "/NavPropertyETTwoPrimMany"));
     req.setFormat(ODataFormat.JSON);
     req.addCustomHeader(HttpHeader.COOKIE, cookie);
-    final ODataRetrieveResponse<ODataEntitySet> getResponse = req.execute();
-    
+    final ODataRetrieveResponse<ClientEntitySet> getResponse = req.execute();
+
     assertEquals(32767, getResponse.getBody()
-                               .getEntities()
-                               .get(0)
-                               .getProperty("PropertyInt16")
-                               .getPrimitiveValue()
-                               .toValue());
-  } 
+        .getEntities()
+        .get(0)
+        .getProperty("PropertyInt16")
+        .getPrimitiveValue()
+        .toValue());
+  }
 
   @Test
   @SuppressWarnings("unchecked")
   public void changesetBatchRequest() throws URISyntaxException {
     final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(SERVICE_URI);
-    final ODataObjectFactory of = client.getObjectFactory();
+    final ClientObjectFactory of = client.getObjectFactory();
     request.setAccept(ACCEPT);
 
     final BatchManager payload = request.payloadManager();
@@ -466,18 +465,18 @@ public class BatchClientITCase extends AbstractTestITCase {
         client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESAllPrim");
     URI editLink = targetURI.build();
 
-    ODataEntity postEntity = client.getObjectFactory().newEntity(
+    ClientEntity postEntity = client.getObjectFactory().newEntity(
         new FullQualifiedName("olingo.odata.test1.ESAllPrim"));
     postEntity.addLink(of.newEntityNavigationLink("NavPropertyETTwoPrimOne", client.newURIBuilder(SERVICE_URI)
-                                                                             .appendEntitySetSegment("ESTwoPrim")
-                                                                             .appendKeySegment(32766)
-                                                                             .build()));
+        .appendEntitySetSegment("ESTwoPrim")
+        .appendKeySegment(32766)
+        .build()));
 
     postEntity.getProperties().add(client.getObjectFactory().newPrimitiveProperty(
         "PropertyDouble",
         client.getObjectFactory().newPrimitiveValueBuilder().buildDouble(3.1415)));
 
-    final ODataEntityCreateRequest<ODataEntity> createRequest =
+    final ODataEntityCreateRequest<ClientEntity> createRequest =
         client.getCUDRequestFactory().getEntityCreateRequest(editLink, postEntity);
     createRequest.setFormat(ODataFormat.JSON);
 
@@ -488,15 +487,15 @@ public class BatchClientITCase extends AbstractTestITCase {
     targetURI = client.newURIBuilder(SERVICE_URI).appendEntitySetSegment("ESAllPrim").appendKeySegment(0);
     editLink = targetURI.build();
 
-    ODataEntity patchEntity = client.getObjectFactory()
-              .newEntity(new FullQualifiedName("olingo.odata.test1.ESAllPrim"));
+    ClientEntity patchEntity = client.getObjectFactory()
+        .newEntity(new FullQualifiedName("olingo.odata.test1.ESAllPrim"));
     patchEntity.setEditLink(editLink);
 
     patchEntity.getProperties().add(client.getObjectFactory().newPrimitiveProperty(
         "PropertyDouble",
         client.getObjectFactory().newPrimitiveValueBuilder().buildDouble(3.1415)));
 
-    ODataEntityUpdateRequest<ODataEntity> changeReq =
+    ODataEntityUpdateRequest<ClientEntity> changeReq =
         client.getCUDRequestFactory().getEntityUpdateRequest(UpdateType.PATCH, patchEntity);
     changeReq.setFormat(ODataFormat.JSON);
     changeset.addRequest(changeReq);
@@ -512,12 +511,12 @@ public class BatchClientITCase extends AbstractTestITCase {
     patchEntity.getProperties().add(client.getObjectFactory().newPrimitiveProperty(
         "PropertyDouble",
         client.getObjectFactory().newPrimitiveValueBuilder().buildDouble(3.1415)));
-    
+
     patchEntity.addLink(of.newEntityNavigationLink("NavPropertyETTwoPrimOne", client.newURIBuilder(SERVICE_URI)
         .appendEntitySetSegment("ESTwoPrim")
         .appendKeySegment(32766)
         .build()));
-    
+
     changeReq = client.getCUDRequestFactory().getEntityUpdateRequest(UpdateType.PATCH, patchEntity);
     changeReq.setFormat(ODataFormat.JSON);
     changeset.addRequest(changeReq);
@@ -541,24 +540,24 @@ public class BatchClientITCase extends AbstractTestITCase {
     assertTrue(item.hasNext());
     final ODataResponse response0 = item.next();
     assertTrue(response0 instanceof ODataRetrieveResponse);
-    assertEquals(34, ((ODataRetrieveResponse<ODataEntity>)response0).getBody()
-                                                                    .getProperty("PropertyDecimal")
-                                                                    .getPrimitiveValue()
-                                                                    .toValue());
-    
+    assertEquals(34, ((ODataRetrieveResponse<ClientEntity>) response0).getBody()
+        .getProperty("PropertyDecimal")
+        .getPrimitiveValue()
+        .toValue());
+
     // Check change set
     assertTrue(bodyIterator.hasNext());
     item = bodyIterator.next();
     assertTrue(item.isChangeset());
-    
+
     // Insert
     assertTrue(item.hasNext());
     final ODataResponse response1 = item.next();
     assertEquals(HttpStatusCode.CREATED.getStatusCode(), response1.getStatusCode());
     assertTrue(response1 instanceof ODataEntityCreateResponse);
-    assertEquals(3.1415, ((ODataEntityCreateResponse<ODataEntity>) response1).getBody().getProperty("PropertyDouble")
-                                                                                       .getPrimitiveValue()
-                                                                                       .toValue());
+    assertEquals(3.1415, ((ODataEntityCreateResponse<ClientEntity>) response1).getBody().getProperty("PropertyDouble")
+        .getPrimitiveValue()
+        .toValue());
     // Update
     assertTrue(item.hasNext());
     final ODataResponse response2 = item.next();
@@ -568,12 +567,12 @@ public class BatchClientITCase extends AbstractTestITCase {
     // Upsert
     assertTrue(item.hasNext());
     final ODataResponse response3 = item.next();
-    assertEquals(HttpStatusCode.CREATED.getStatusCode(),response3.getStatusCode());
+    assertEquals(HttpStatusCode.CREATED.getStatusCode(), response3.getStatusCode());
     assertTrue(response3 instanceof ODataEntityUpdateResponse);
-    assertEquals(3.1415, ((ODataEntityUpdateResponse<ODataEntity>) response3).getBody().getProperty("PropertyDouble")
-                                                                                       .getPrimitiveValue()
-                                                                                       .toValue());
-    
+    assertEquals(3.1415, ((ODataEntityUpdateResponse<ClientEntity>) response3).getBody().getProperty("PropertyDouble")
+        .getPrimitiveValue()
+        .toValue());
+
     // Check second get request
     assertTrue(bodyIterator.hasNext());
     item = bodyIterator.next();
@@ -581,18 +580,19 @@ public class BatchClientITCase extends AbstractTestITCase {
     assertTrue(item.hasNext());
     final ODataResponse response4 = item.next();
     assertTrue(response4 instanceof ODataRetrieveResponse);
-    assertEquals(3.1415, ((ODataRetrieveResponse<ODataEntity>)response4).getBody()
-                                                                        .getProperty("PropertyDouble")
-                                                                        .getPrimitiveValue()
-                                                                        .toValue());
+    assertEquals(3.1415, ((ODataRetrieveResponse<ClientEntity>) response4).getBody()
+        .getProperty("PropertyDouble")
+        .getPrimitiveValue()
+        .toValue());
   }
+
   private void appendGetRequest(final BatchManager manager, final String segment, final Object key, boolean isRelative)
       throws URISyntaxException {
     final URIBuilder targetURI = client.newURIBuilder(SERVICE_URI);
     targetURI.appendEntitySetSegment(segment).appendKeySegment(key);
     final URI uri = (isRelative) ? new URI(SERVICE_URI).relativize(targetURI.build()) : targetURI.build();
 
-    ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    ODataEntityRequest<ClientEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
     queryReq.setFormat(ODataFormat.JSON);
     manager.addRequest(queryReq);
   }


Mime
View raw message