olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [39/51] [abbrv] [OLINGO-200] V4 ODataValue full reachable via API
Date Tue, 01 Apr 2014 14:19:06 GMT
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java
index 3dc766e..325f2dd 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java
@@ -19,11 +19,72 @@
 package org.apache.olingo.client.core.it.v3;
 
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.communication.ODataClientErrorException;
+import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
+import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
+import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateRequest;
+import org.apache.olingo.client.api.communication.request.cud.UpdateType;
+import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
+import org.apache.olingo.client.api.communication.response.ODataDeleteResponse;
+import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse;
+import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
+import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
+import org.apache.olingo.client.api.http.HttpMethod;
+import org.apache.olingo.client.api.uri.CommonURIBuilder;
 import org.apache.olingo.client.api.v3.ODataClient;
 import org.apache.olingo.client.core.ODataClientFactory;
+import org.apache.olingo.client.core.uri.URIUtils;
+import org.apache.olingo.commons.api.data.Entry;
+import org.apache.olingo.commons.api.data.Feed;
+import org.apache.olingo.commons.api.domain.CommonODataEntity;
+import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
+import org.apache.olingo.commons.api.domain.CommonODataProperty;
+import org.apache.olingo.commons.api.domain.ODataCollectionValue;
+import org.apache.olingo.commons.api.domain.ODataComplexValue;
+import org.apache.olingo.commons.api.domain.ODataInlineEntity;
+import org.apache.olingo.commons.api.domain.ODataInlineEntitySet;
+import org.apache.olingo.commons.api.domain.ODataLink;
+import org.apache.olingo.commons.api.domain.ODataValue;
+import org.apache.olingo.commons.api.domain.v3.ODataEntity;
+import org.apache.olingo.commons.api.domain.v3.ODataProperty;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.core.data.AtomEntryImpl;
+import org.apache.olingo.commons.core.data.JSONEntryImpl;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractTestITCase {
+
+  /**
+   * Logger.
+   */
+  protected static final Logger LOG = LoggerFactory.getLogger(AbstractTestITCase.class);
+
+  protected static final String TEST_PRODUCT_TYPE = "Microsoft.Test.OData.Services.AstoriaDefaultService.Product";
 
-public abstract class AbstractTestITCase extends org.apache.olingo.client.core.it.AbstractTestITCase {
+  protected static final String servicesODataServiceRootURL =
+          "http://services.odata.org/V3/(S(csquyjnoaywmz5xcdbfhlc1p))/OData/OData.svc/";
 
   protected static ODataClient client;
 
@@ -45,8 +106,473 @@ public abstract class AbstractTestITCase extends org.apache.olingo.client.core.i
     client = ODataClientFactory.getV3();
   }
 
-  @Override
   protected ODataClient getClient() {
     return client;
   }
+
+  protected void checkLinks(final Collection<ODataLink> original, final Collection<ODataLink> actual) {
+    assertTrue(original.size() <= actual.size());
+
+    for (ODataLink originalLink : original) {
+      ODataLink foundOriginal = null;
+      ODataLink foundActual = null;
+
+      for (ODataLink actualLink : actual) {
+
+        if (actualLink.getType() == originalLink.getType()
+                && (originalLink.getLink() == null
+                || actualLink.getLink().toASCIIString().endsWith(originalLink.getLink().toASCIIString()))
+                && actualLink.getName().equals(originalLink.getName())) {
+
+          foundOriginal = originalLink;
+          foundActual = actualLink;
+        }
+      }
+
+      assertNotNull(foundOriginal);
+      assertNotNull(foundActual);
+
+      if (foundOriginal instanceof ODataInlineEntity && foundActual instanceof ODataInlineEntity) {
+        final CommonODataEntity originalInline = ((ODataInlineEntity) foundOriginal).getEntity();
+        assertNotNull(originalInline);
+
+        final CommonODataEntity actualInline = ((ODataInlineEntity) foundActual).getEntity();
+        assertNotNull(actualInline);
+
+        checkProperties(originalInline.getProperties(), actualInline.getProperties());
+      }
+    }
+  }
+
+  protected void checkProperties(final Collection<? extends CommonODataProperty> original,
+          final Collection<? extends CommonODataProperty> actual) {
+
+    assertTrue(original.size() <= actual.size());
+
+    // re-organize actual properties into a Map<String, ODataProperty>
+    final Map<String, CommonODataProperty> actualProps = new HashMap<String, CommonODataProperty>(actual.size());
+
+    for (CommonODataProperty prop : actual) {
+      assertFalse(actualProps.containsKey(prop.getName()));
+      actualProps.put(prop.getName(), prop);
+    }
+
+    assertTrue(actual.size() <= actualProps.size());
+
+    for (CommonODataProperty prop : original) {
+      assertNotNull(prop);
+      if (actualProps.containsKey(prop.getName())) {
+        final CommonODataProperty actualProp = actualProps.get(prop.getName());
+        assertNotNull(actualProp);
+
+        if (prop.getValue() != null && actualProp.getValue() != null) {
+          checkPropertyValue(prop.getName(), prop.getValue(), actualProp.getValue());
+        }
+      } else {
+        // nothing ... maybe :FC_KeepInContent="false"
+        // ..... no assert can be done ....
+      }
+    }
+  }
+
+  protected void checkPropertyValue(final String propertyName,
+          final ODataValue original, final ODataValue actual) {
+
+    assertNotNull("Null original value for " + propertyName, original);
+    assertNotNull("Null actual value for " + propertyName, actual);
+
+    assertEquals("Type mismatch for '" + propertyName + "': "
+            + original.getClass().getSimpleName() + "-" + actual.getClass().getSimpleName(),
+            original.getClass().getSimpleName(), actual.getClass().getSimpleName());
+
+    if (original.isComplex()) {
+      final List<CommonODataProperty> originalFileds = new ArrayList<CommonODataProperty>();
+      for (CommonODataProperty prop : original.asComplex()) {
+        originalFileds.add(prop);
+      }
+
+      final List<CommonODataProperty> actualFileds = new ArrayList<CommonODataProperty>();
+      for (CommonODataProperty prop : actual.asComplex()) {
+        actualFileds.add(prop);
+      }
+
+      checkProperties(originalFileds, actualFileds);
+    } else if (original.isCollection()) {
+      assertTrue(original.asCollection().size() <= actual.asCollection().size());
+
+      boolean found = original.asCollection().isEmpty();
+
+      for (ODataValue originalValue : original.asCollection()) {
+        for (ODataValue actualValue : actual.asCollection()) {
+          try {
+            checkPropertyValue(propertyName, originalValue, actualValue);
+            found = true;
+          } catch (AssertionError ignore) {
+            // ignore
+          }
+        }
+      }
+
+      assertTrue("Found " + actual + " but expected " + original, found);
+    } else {
+      assertTrue("Primitive value for '" + propertyName + "' type mismatch: " + original.asPrimitive().
+              getTypeKind() + "-" + actual.asPrimitive().getTypeKind(),
+              original.asPrimitive().getTypeKind().equals(actual.asPrimitive().getTypeKind()));
+
+      assertEquals("Primitive value for '" + propertyName + "' mismatch: " + original.asPrimitive().toString()
+              + "-" + actual.asPrimitive().toString(),
+              original.asPrimitive().toString(), actual.asPrimitive().toString());
+    }
+  }
+
+  protected ODataEntity getSampleCustomerInfo(final int id, final String sampleinfo) {
+    final ODataEntity entity = getClient().getObjectFactory().newEntity(
+            "Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo");
+    entity.setMediaEntity(true);
+
+    getClient().getBinder().add(entity,
+            getClient().getObjectFactory().newPrimitiveProperty("Information",
+                    getClient().getObjectFactory().newPrimitiveValueBuilder().setText(sampleinfo).
+                    setType(EdmPrimitiveTypeKind.String).build()));
+
+    return entity;
+  }
+
+  protected ODataEntity getSampleCustomerProfile(
+          final int id, final String sampleName, final boolean withInlineInfo) {
+
+    final ODataEntity entity =
+            getClient().getObjectFactory().newEntity("Microsoft.Test.OData.Services.AstoriaDefaultService.Customer");
+
+    // add name attribute
+    getClient().getBinder().add(entity,
+            getClient().getObjectFactory().newPrimitiveProperty("Name",
+                    getClient().getObjectFactory().newPrimitiveValueBuilder().setText(sampleName).
+                    setType(EdmPrimitiveTypeKind.String).build()));
+
+    // add key attribute
+    getClient().getBinder().add(entity,
+            getClient().getObjectFactory().newPrimitiveProperty("CustomerId",
+                    getClient().getObjectFactory().newPrimitiveValueBuilder().setText(String.valueOf(id)).
+                    setType(EdmPrimitiveTypeKind.Int32).build()));
+
+    // add BackupContactInfo attribute (collection)
+    final ODataCollectionValue<ODataValue> backupContactInfoValue = getClient().getObjectFactory().newCollectionValue(
+            "Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails)");
+    getClient().getBinder().add(entity,
+            getClient().getObjectFactory().newCollectionProperty("BackupContactInfo", backupContactInfoValue));
+
+    // add BackupContactInfo.ContactDetails attribute (complex)
+    final ODataComplexValue<ODataProperty> contactDetails = getClient().getObjectFactory().newComplexValue(
+            "Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails");
+    backupContactInfoValue.add(contactDetails);
+
+    // add BackupContactInfo.ContactDetails.AlternativeNames attribute (collection)
+    final ODataCollectionValue<ODataValue> altNamesValue = getClient().getObjectFactory().
+            newCollectionValue("Collection(Edm.String)");
+    altNamesValue.add(getClient().getObjectFactory().newPrimitiveValueBuilder().
+            setText("myname").setType(EdmPrimitiveTypeKind.String).build());
+    contactDetails.add(getClient().getObjectFactory().newCollectionProperty("AlternativeNames", altNamesValue));
+
+    // add BackupContactInfo.ContactDetails.EmailBag attribute (collection)
+    final ODataCollectionValue<ODataValue> emailBagValue = getClient().getObjectFactory().
+            newCollectionValue("Collection(Edm.String)");
+    emailBagValue.add(getClient().getObjectFactory().newPrimitiveValueBuilder().
+            setText("myname@mydomain.com").setType(EdmPrimitiveTypeKind.String).build());
+    contactDetails.add(getClient().getObjectFactory().newCollectionProperty("EmailBag", emailBagValue));
+
+    // add BackupContactInfo.ContactDetails.ContactAlias attribute (complex)
+    final ODataComplexValue<ODataProperty> contactAliasValue = getClient().getObjectFactory().newComplexValue(
+            "Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases");
+    contactDetails.add(getClient().getObjectFactory().newComplexProperty("ContactAlias", contactAliasValue));
+
+    // add BackupContactInfo.ContactDetails.ContactAlias.AlternativeNames attribute (collection)
+    final ODataCollectionValue<ODataValue> aliasAltNamesValue = getClient().getObjectFactory().
+            newCollectionValue("Collection(Edm.String)");
+    aliasAltNamesValue.add(getClient().getObjectFactory().newPrimitiveValueBuilder().
+            setText("myAlternativeName").setType(EdmPrimitiveTypeKind.String).build());
+    contactAliasValue.add(getClient().getObjectFactory().newCollectionProperty("AlternativeNames", aliasAltNamesValue));
+
+    if (withInlineInfo) {
+      final ODataInlineEntity inlineInfo = getClient().getObjectFactory().newInlineEntity(
+              "Info",
+              URI.create("Customer(" + id + ")/Info"),
+              getSampleCustomerInfo(id, sampleName + "_Info"));
+      inlineInfo.getEntity().setMediaEntity(true);
+      entity.addLink(inlineInfo);
+    }
+
+    return entity;
+  }
+
+  protected void debugEntry(final Entry entry, final String message) {
+    if (LOG.isDebugEnabled()) {
+      final StringWriter writer = new StringWriter();
+      getClient().getSerializer().entry(entry, writer);
+      writer.flush();
+      LOG.debug(message + "\n{}", writer.toString());
+    }
+  }
+
+  protected void debugFeed(final Feed feed, final String message) {
+    if (LOG.isDebugEnabled()) {
+      final StringWriter writer = new StringWriter();
+      getClient().getSerializer().feed(feed, writer);
+      writer.flush();
+      LOG.debug(message + "\n{}", writer.toString());
+    }
+  }
+
+  protected void debugODataProperty(final ODataProperty property, final String message) {
+    LOG.debug(message + "\n{}", property.toString());
+  }
+
+  protected void debugODataValue(final ODataValue value, final String message) {
+    LOG.debug(message + "\n{}", value.toString());
+  }
+
+  protected void debugODataEntity(final ODataEntity entity, final String message) {
+    if (LOG.isDebugEnabled()) {
+      StringWriter writer = new StringWriter();
+      getClient().getSerializer().entry(getClient().getBinder().getEntry(entity, AtomEntryImpl.class), writer);
+      writer.flush();
+      LOG.debug(message + " (Atom)\n{}", writer.toString());
+
+      writer = new StringWriter();
+      getClient().getSerializer().entry(getClient().getBinder().getEntry(entity, JSONEntryImpl.class), writer);
+      writer.flush();
+      LOG.debug(message + " (JSON)\n{}", writer.toString());
+    }
+  }
+
+  protected void debugInputStream(final InputStream input, final String message) {
+    if (LOG.isDebugEnabled()) {
+      try {
+        LOG.debug(message + "\n{}", IOUtils.toString(input));
+      } catch (IOException e) {
+        LOG.error("Error writing stream", e);
+      } finally {
+        IOUtils.closeQuietly(input);
+      }
+    }
+  }
+
+  protected String getETag(final URI uri) {
+    final ODataRetrieveResponse<ODataEntity> res = getClient().getRetrieveRequestFactory().
+            getEntityRequest(uri).execute();
+    try {
+      return res.getEtag();
+    } finally {
+      res.close();
+    }
+  }
+
+  protected ODataEntity read(final ODataPubFormat format, final URI editLink) {
+    final ODataEntityRequest<ODataEntity> req = getClient().getRetrieveRequestFactory().
+            getEntityRequest(editLink);
+    req.setFormat(format);
+
+    final ODataRetrieveResponse<ODataEntity> res = req.execute();
+    final ODataEntity entity = res.getBody();
+
+    assertNotNull(entity);
+
+    if (ODataPubFormat.JSON_FULL_METADATA == format || ODataPubFormat.ATOM == format) {
+      assertEquals(req.getURI(), entity.getEditLink());
+    }
+
+    return entity;
+  }
+
+  protected ODataEntity createEntity(
+          final String serviceRootURL,
+          final ODataPubFormat format,
+          final ODataEntity original,
+          final String entitySetName) {
+
+    final CommonURIBuilder<?> uriBuilder = getClient().getURIBuilder(serviceRootURL).
+            appendEntitySetSegment(entitySetName);
+
+    debugODataEntity(original, "About to create");
+
+    final ODataEntityCreateRequest<ODataEntity> createReq =
+            getClient().getCUDRequestFactory().getEntityCreateRequest(uriBuilder.build(), original);
+    createReq.setFormat(format);
+
+    final ODataEntityCreateResponse<ODataEntity> createRes = createReq.execute();
+    assertEquals(201, createRes.getStatusCode());
+    assertEquals("Created", createRes.getStatusMessage());
+
+    final ODataEntity created = createRes.getBody();
+    assertNotNull(created);
+
+    debugODataEntity(created, "Just created");
+
+    return created;
+  }
+
+  protected ODataEntity compareEntities(final String serviceRootURL,
+          final ODataPubFormat format,
+          final ODataEntity original,
+          final int actualObjectId,
+          final Collection<String> expands) {
+
+    final CommonURIBuilder<?> uriBuilder = getClient().getURIBuilder(serviceRootURL).
+            appendEntitySetSegment("Customer").appendKeySegment(actualObjectId);
+
+    // search expanded
+    if (expands != null) {
+      for (String expand : expands) {
+        uriBuilder.expand(expand);
+      }
+    }
+
+    final ODataEntityRequest<ODataEntity> req = getClient().getRetrieveRequestFactory().
+            getEntityRequest(uriBuilder.build());
+    req.setFormat(format);
+
+    final ODataRetrieveResponse<ODataEntity> res = req.execute();
+    assertEquals(200, res.getStatusCode());
+
+    final ODataEntity actual = res.getBody();
+    assertNotNull(actual);
+
+    // check defined links
+    checkLinks(original.getAssociationLinks(), actual.getAssociationLinks());
+    checkLinks(original.getEditMediaLinks(), actual.getEditMediaLinks());
+    checkLinks(original.getNavigationLinks(), actual.getNavigationLinks());
+
+    // check defined properties equality
+    checkProperties(original.getProperties(), actual.getProperties());
+
+    return actual;
+  }
+
+  protected void cleanAfterCreate(
+          final ODataPubFormat format,
+          final ODataEntity created,
+          final boolean includeInline,
+          final String baseUri) {
+
+    final Set<URI> toBeDeleted = new HashSet<URI>();
+    toBeDeleted.add(created.getEditLink());
+
+    if (includeInline) {
+      for (ODataLink link : created.getNavigationLinks()) {
+        if (link instanceof ODataInlineEntity) {
+          final CommonODataEntity inline = ((ODataInlineEntity) link).getEntity();
+          if (inline.getEditLink() != null) {
+            toBeDeleted.add(URIUtils.getURI(baseUri, inline.getEditLink().toASCIIString()));
+          }
+        }
+
+        if (link instanceof ODataInlineEntitySet) {
+          final CommonODataEntitySet inline = ((ODataInlineEntitySet) link).getEntitySet();
+          for (CommonODataEntity entity : inline.getEntities()) {
+            if (entity.getEditLink() != null) {
+              toBeDeleted.add(URIUtils.getURI(baseUri, entity.getEditLink().toASCIIString()));
+            }
+          }
+        }
+      }
+    }
+
+    assertFalse(toBeDeleted.isEmpty());
+
+    for (URI link : toBeDeleted) {
+      final ODataDeleteRequest deleteReq = getClient().getCUDRequestFactory().getDeleteRequest(link);
+      final ODataDeleteResponse deleteRes = deleteReq.execute();
+
+      assertEquals(204, deleteRes.getStatusCode());
+      assertEquals("No Content", deleteRes.getStatusMessage());
+
+      deleteRes.close();
+
+      final ODataEntityRequest<ODataEntity> retrieveReq = getClient().getRetrieveRequestFactory().
+              getEntityRequest(link);
+      // bug that needs to be fixed on the SampleService - cannot get entity not found with header
+      // Accept: application/json;odata=minimalmetadata
+      retrieveReq.setFormat(format == ODataPubFormat.JSON_FULL_METADATA ? ODataPubFormat.JSON : format);
+
+      Exception exception = null;
+      try {
+        retrieveReq.execute();
+        fail();
+      } catch (ODataClientErrorException e) {
+        exception = e;
+        assertEquals(404, e.getStatusLine().getStatusCode());
+      }
+      assertNotNull(exception);
+    }
+  }
+
+  protected void updateEntityDescription(
+          final ODataPubFormat format, final ODataEntity changes, final UpdateType type) {
+
+    updateEntityDescription(format, changes, type, null);
+  }
+
+  protected void updateEntityDescription(
+          final ODataPubFormat format, final ODataEntity changes, final UpdateType type, final String etag) {
+
+    updateEntityStringProperty("Description", format, changes, type, etag);
+  }
+
+  protected void updateEntityStringProperty(final String propertyName,
+          final ODataPubFormat format, final ODataEntity changes, final UpdateType type, final String etag) {
+
+    final URI editLink = changes.getEditLink();
+
+    final String newm = "New " + propertyName + "(" + System.currentTimeMillis() + ")";
+
+    ODataProperty propertyValue = changes.getProperty(propertyName);
+
+    final String oldm;
+    if (propertyValue == null) {
+      oldm = null;
+    } else {
+      oldm = propertyValue.getValue().toString();
+      changes.getProperties().remove(propertyValue);
+    }
+
+    assertNotEquals(newm, oldm);
+
+    getClient().getBinder().add(changes,
+            getClient().getObjectFactory().newPrimitiveProperty(propertyName,
+                    getClient().getObjectFactory().newPrimitiveValueBuilder().setText(newm).build()));
+
+    update(type, changes, format, etag);
+
+    final ODataEntity actual = read(format, editLink);
+
+    propertyValue = null;
+
+    for (ODataProperty prop : actual.getProperties()) {
+      if (prop.getName().equals(propertyName)) {
+        propertyValue = prop;
+      }
+    }
+
+    assertNotNull(propertyValue);
+    assertEquals(newm, propertyValue.getValue().toString());
+  }
+
+  protected void update(
+          final UpdateType type, final ODataEntity changes, final ODataPubFormat format, final String etag) {
+    final ODataEntityUpdateRequest req = getClient().getCUDRequestFactory().getEntityUpdateRequest(type, changes);
+
+    if (getClient().getConfiguration().isUseXHTTPMethod()) {
+      assertEquals(HttpMethod.POST, req.getMethod());
+    } else {
+      assertEquals(type.getMethod(), req.getMethod());
+    }
+    req.setFormat(format);
+
+    if (StringUtils.isNotBlank(etag)) {
+      req.setIfMatch(etag); // Product include ETag header into the response .....
+    }
+
+    final ODataEntityUpdateResponse res = req.execute();
+    assertEquals(204, res.getStatusCode());
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityCreateTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityCreateTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityCreateTestITCase.java
index 2a4efee..c6a7c15 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityCreateTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityCreateTestITCase.java
@@ -18,6 +18,11 @@
  */
 package org.apache.olingo.client.core.it.v3;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.net.URI;
 import java.util.Collections;
 import java.util.HashSet;
@@ -37,21 +42,14 @@ import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse
 import org.apache.olingo.client.api.http.NoContentException;
 import org.apache.olingo.client.api.uri.CommonURIBuilder;
 import org.apache.olingo.client.core.uri.URIUtils;
-import org.apache.olingo.commons.api.domain.CommonODataEntity;
-import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
-import org.apache.olingo.commons.api.domain.CommonODataProperty;
 import org.apache.olingo.commons.api.domain.ODataInlineEntitySet;
 import org.apache.olingo.commons.api.domain.ODataLink;
 import org.apache.olingo.commons.api.domain.v3.ODataEntity;
 import org.apache.olingo.commons.api.domain.v3.ODataEntitySet;
+import org.apache.olingo.commons.api.domain.v3.ODataProperty;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -68,10 +66,10 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   public void createAsAtom() {
     final ODataPubFormat format = ODataPubFormat.ATOM;
     final int id = 1;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
+    final ODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
 
     createEntity(getServiceRoot(), format, original, "Customer");
-    final CommonODataEntity actual = compareEntities(getServiceRoot(), format, original, id, null);
+    final ODataEntity actual = compareEntities(getServiceRoot(), format, original, id, null);
 
     cleanAfterCreate(format, actual, false, getServiceRoot());
   }
@@ -80,10 +78,10 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   public void createAsJSON() {
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
     final int id = 2;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
+    final ODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
 
     createEntity(getServiceRoot(), format, original, "Customer");
-    final CommonODataEntity actual = compareEntities(getServiceRoot(), format, original, id, null);
+    final ODataEntity actual = compareEntities(getServiceRoot(), format, original, id, null);
 
     cleanAfterCreate(format, actual, false, getServiceRoot());
   }
@@ -92,10 +90,10 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   public void createWithInlineAsAtom() {
     final ODataPubFormat format = ODataPubFormat.ATOM;
     final int id = 3;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer", true);
+    final ODataEntity original = getSampleCustomerProfile(id, "Sample customer", true);
 
     createEntity(getServiceRoot(), format, original, "Customer");
-    final CommonODataEntity actual =
+    final ODataEntity actual =
             compareEntities(getServiceRoot(), format, original, id, Collections.<String>singleton("Info"));
 
     cleanAfterCreate(format, actual, true, getServiceRoot());
@@ -106,10 +104,10 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
     // this needs to be full, otherwise there is no mean to recognize links
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
     final int id = 4;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer", true);
+    final ODataEntity original = getSampleCustomerProfile(id, "Sample customer", true);
 
     createEntity(getServiceRoot(), format, original, "Customer");
-    final CommonODataEntity actual =
+    final ODataEntity actual =
             compareEntities(getServiceRoot(), format, original, id, Collections.<String>singleton("Info"));
 
     cleanAfterCreate(format, actual, true, getServiceRoot());
@@ -119,13 +117,13 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   public void createInlineWithoutLinkAsAtom() {
     final ODataPubFormat format = ODataPubFormat.ATOM;
     final int id = 5;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
+    final ODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
 
     original.addLink(client.getObjectFactory().newInlineEntity(
             "Info", null, getSampleCustomerInfo(id, "Sample Customer_Info")));
 
     createEntity(getServiceRoot(), format, original, "Customer");
-    final CommonODataEntity actual =
+    final ODataEntity actual =
             compareEntities(getServiceRoot(), format, original, id, Collections.<String>singleton("Info"));
 
     boolean found = false;
@@ -146,13 +144,13 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   public void createInlineWithoutLinkAsJSON() {
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
     final int id = 6;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
+    final ODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
 
     original.addLink(client.getObjectFactory().newInlineEntity(
             "Info", null, getSampleCustomerInfo(id, "Sample Customer_Info")));
 
     createEntity(getServiceRoot(), format, original, "Customer");
-    final CommonODataEntity actual =
+    final ODataEntity actual =
             compareEntities(getServiceRoot(), format, original, id, Collections.<String>singleton("Info"));
 
     boolean found = false;
@@ -172,7 +170,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   @Test
   public void createWithNavigationAsAtom() {
     final ODataPubFormat format = ODataPubFormat.ATOM;
-    final CommonODataEntity actual = createWithNavigationLink(format, 5);
+    final ODataEntity actual = createWithNavigationLink(format, 5);
     cleanAfterCreate(format, actual, false, getServiceRoot());
   }
 
@@ -180,14 +178,14 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   public void createWithNavigationAsJSON() {
     // this needs to be full, otherwise there is no mean to recognize links
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
-    final CommonODataEntity actual = createWithNavigationLink(format, 6);
+    final ODataEntity actual = createWithNavigationLink(format, 6);
     cleanAfterCreate(format, actual, false, getServiceRoot());
   }
 
   @Test
   public void createWithFeedNavigationAsAtom() throws EdmPrimitiveTypeException {
     final ODataPubFormat format = ODataPubFormat.ATOM;
-    final CommonODataEntity actual = createWithFeedNavigationLink(format, 7);
+    final ODataEntity actual = createWithFeedNavigationLink(format, 7);
     cleanAfterCreate(format, actual, false, getServiceRoot());
   }
 
@@ -195,14 +193,14 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   public void createWithFeedNavigationAsJSON() throws EdmPrimitiveTypeException {
     // this needs to be full, otherwise there is no mean to recognize links
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
-    final CommonODataEntity actual = createWithFeedNavigationLink(format, 8);
+    final ODataEntity actual = createWithFeedNavigationLink(format, 8);
     cleanAfterCreate(format, actual, false, getServiceRoot());
   }
 
   @Test
   public void createWithBackNavigationAsAtom() throws EdmPrimitiveTypeException {
     final ODataPubFormat format = ODataPubFormat.ATOM;
-    final CommonODataEntity actual = createWithBackNavigationLink(format, 9);
+    final ODataEntity actual = createWithBackNavigationLink(format, 9);
     cleanAfterCreate(format, actual, true, getServiceRoot());
   }
 
@@ -210,7 +208,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   public void createWithBackNavigationAsJSON() throws EdmPrimitiveTypeException {
     // this needs to be full, otherwise there is no mean to recognize links
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
-    final CommonODataEntity actual = createWithBackNavigationLink(format, 10);
+    final ODataEntity actual = createWithBackNavigationLink(format, 10);
     cleanAfterCreate(format, actual, true, getServiceRoot());
   }
 
@@ -227,13 +225,13 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   @Test
   public void createReturnNoContent() {
     final int id = 1;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
+    final ODataEntity original = (ODataEntity) getSampleCustomerProfile(id, "Sample customer", false);
 
-    final ODataEntityCreateRequest createReq = client.getCUDRequestFactory().getEntityCreateRequest(
+    final ODataEntityCreateRequest<ODataEntity> createReq = client.getCUDRequestFactory().getEntityCreateRequest(
             client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer").build(), original);
     createReq.setPrefer(new ODataPreferences(client.getServiceVersion()).returnNoContent());
 
-    final ODataEntityCreateResponse createRes = createReq.execute();
+    final ODataEntityCreateResponse<ODataEntity> createRes = createReq.execute();
     assertEquals(204, createRes.getStatusCode());
     assertEquals(new ODataPreferences(client.getServiceVersion()).returnNoContent(),
             createRes.getHeader(HeaderName.preferenceApplied).iterator().next());
@@ -255,10 +253,10 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   @Ignore
   public void issue135() {
     final int id = 2;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer for issue 135", false);
+    final ODataEntity original = (ODataEntity) getSampleCustomerProfile(id, "Sample customer for issue 135", false);
 
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer");
-    final ODataEntityCreateRequest createReq =
+    final ODataEntityCreateRequest<ODataEntity> createReq =
             client.getCUDRequestFactory().getEntityCreateRequest(uriBuilder.build(), original);
     createReq.setFormat(ODataPubFormat.JSON_FULL_METADATA);
     createReq.setContentType(ContentType.APPLICATION_ATOM_XML.getMimeType());
@@ -278,18 +276,18 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
     }
   }
 
-  private CommonODataEntity createWithFeedNavigationLink(final ODataPubFormat format, final int id)
+  private ODataEntity createWithFeedNavigationLink(final ODataPubFormat format, final int id)
           throws EdmPrimitiveTypeException {
 
     final String sampleName = "Sample customer";
-    final CommonODataEntity original = getSampleCustomerProfile(id, sampleName, false);
+    final ODataEntity original = (ODataEntity) getSampleCustomerProfile(id, sampleName, false);
 
     final Set<Integer> keys = new HashSet<Integer>();
     keys.add(-100);
     keys.add(-101);
 
     for (Integer key : keys) {
-      final CommonODataEntity order =
+      final ODataEntity order =
               client.getObjectFactory().newEntity("Microsoft.Test.OData.Services.AstoriaDefaultService.Order");
 
       getClient().getBinder().add(order,
@@ -301,7 +299,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
                       client.getObjectFactory().newPrimitiveValueBuilder().setValue(id).
                       setType(EdmPrimitiveTypeKind.Int32).build()));
 
-      final ODataEntityCreateRequest createReq = client.getCUDRequestFactory().getEntityCreateRequest(
+      final ODataEntityCreateRequest<ODataEntity> createReq = client.getCUDRequestFactory().getEntityCreateRequest(
               client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Order").build(), order);
       createReq.setFormat(format);
 
@@ -310,9 +308,9 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
               createReq.execute().getBody().getEditLink()));
     }
 
-    final CommonODataEntity created = createEntity(getServiceRoot(), format, original, "Customer");
+    final ODataEntity created = (ODataEntity) createEntity(getServiceRoot(), format, original, "Customer");
     // now, compare the created one with the actual one and go deeply into the associated customer info.....
-    final CommonODataEntity actual = compareEntities(getServiceRoot(), format, created, id, null);
+    final ODataEntity actual = (ODataEntity) compareEntities(getServiceRoot(), format, created, id, null);
 
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot());
     uriBuilder.appendEntitySetSegment("Customer").appendKeySegment(id).appendEntitySetSegment("Orders");
@@ -324,11 +322,11 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
     final ODataRetrieveResponse<ODataEntitySet> res = req.execute();
     assertEquals(200, res.getStatusCode());
 
-    final CommonODataEntitySet entitySet = res.getBody();
+    final ODataEntitySet entitySet = res.getBody();
     assertNotNull(entitySet);
     assertEquals(2, entitySet.getCount());
 
-    for (CommonODataEntity entity : entitySet.getEntities()) {
+    for (ODataEntity entity : entitySet.getEntities()) {
       final Integer key = entity.getProperty("OrderId").getPrimitiveValue().toCastValue(Integer.class);
       final Integer customerId = entity.getProperty("CustomerId").getPrimitiveValue().toCastValue(Integer.class);
       assertTrue(keys.contains(key));
@@ -345,16 +343,16 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
     return actual;
   }
 
-  private CommonODataEntity createWithNavigationLink(final ODataPubFormat format, final int id) {
+  private ODataEntity createWithNavigationLink(final ODataPubFormat format, final int id) {
     final String sampleName = "Sample customer";
 
-    final CommonODataEntity original = getSampleCustomerProfile(id, sampleName, false);
+    final ODataEntity original = getSampleCustomerProfile(id, sampleName, false);
     original.addLink(client.getObjectFactory().newEntityNavigationLink(
             "Info", URI.create(getServiceRoot() + "/CustomerInfo(12)")));
 
-    final CommonODataEntity created = createEntity(getServiceRoot(), format, original, "Customer");
+    final ODataEntity created = createEntity(getServiceRoot(), format, original, "Customer");
     // now, compare the created one with the actual one and go deeply into the associated customer info.....
-    final CommonODataEntity actual = compareEntities(getServiceRoot(), format, created, id, null);
+    final ODataEntity actual = compareEntities(getServiceRoot(), format, created, id, null);
 
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot());
     uriBuilder.appendEntitySetSegment("Customer").appendKeySegment(id).appendEntitySetSegment("Info");
@@ -365,12 +363,12 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
     final ODataRetrieveResponse<ODataEntity> res = req.execute();
     assertEquals(200, res.getStatusCode());
 
-    final CommonODataEntity info = res.getBody();
+    final ODataEntity info = res.getBody();
     assertNotNull(info);
 
     boolean found = false;
 
-    for (CommonODataProperty prop : info.getProperties()) {
+    for (ODataProperty prop : info.getProperties()) {
       if ("CustomerInfoId".equals(prop.getName())) {
         assertEquals("12", prop.getValue().toString());
         found = true;
@@ -382,7 +380,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
     return actual;
   }
 
-  private CommonODataEntity createWithBackNavigationLink(final ODataPubFormat format, final int id)
+  private ODataEntity createWithBackNavigationLink(final ODataPubFormat format, final int id)
           throws EdmPrimitiveTypeException {
 
     final String sampleName = "Sample customer";
@@ -451,7 +449,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
   }
 
   private void multiKey(final ODataPubFormat format) {
-    final CommonODataEntity message = client.getObjectFactory().newEntity(
+    final ODataEntity message = client.getObjectFactory().newEntity(
             "Microsoft.Test.OData.Services.AstoriaDefaultService.Message");
 
     getClient().getBinder().add(message,
@@ -481,11 +479,11 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
 
     final CommonURIBuilder<?> builder =
             client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Message");
-    final ODataEntityCreateRequest req = client.getCUDRequestFactory().getEntityCreateRequest(builder.build(),
-            message);
+    final ODataEntityCreateRequest<ODataEntity> req = client.getCUDRequestFactory().
+            getEntityCreateRequest(builder.build(), message);
     req.setFormat(format);
 
-    final ODataEntityCreateResponse res = req.execute();
+    final ODataEntityCreateResponse<ODataEntity> res = req.execute();
     assertNotNull(res);
     assertEquals(201, res.getStatusCode());
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityUpdateTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityUpdateTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityUpdateTestITCase.java
index 6ed898d..223f908 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityUpdateTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/EntityUpdateTestITCase.java
@@ -27,7 +27,6 @@ import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateR
 import org.apache.olingo.client.api.communication.request.cud.v3.UpdateType;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
 import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
-import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.domain.v3.ODataEntity;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
@@ -53,7 +52,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
     final URI uri = client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Product").appendKeySegment(-10).build();
     final String etag = getETag(uri);
-    final CommonODataEntity merge = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
+    final ODataEntity merge = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
     merge.setEditLink(uri);
     updateEntityDescription(format, merge, UpdateType.MERGE, etag);
   }
@@ -64,7 +63,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
     final URI uri = client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Product").appendKeySegment(-10).build();
     final String etag = getETag(uri);
-    final CommonODataEntity merge = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
+    final ODataEntity merge = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
     merge.setEditLink(uri);
     updateEntityDescription(format, merge, UpdateType.MERGE, etag);
   }
@@ -75,7 +74,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
     final URI uri = client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Product").appendKeySegment(-10).build();
     final String etag = getETag(uri);
-    final CommonODataEntity patch = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
+    final ODataEntity patch = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
     patch.setEditLink(uri);
     updateEntityDescription(format, patch, UpdateType.PATCH, etag);
   }
@@ -86,7 +85,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
     final URI uri = client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Product").appendKeySegment(-10).build();
     final String etag = getETag(uri);
-    final CommonODataEntity patch = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
+    final ODataEntity patch = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
     patch.setEditLink(uri);
     updateEntityDescription(format, patch, UpdateType.PATCH, etag);
   }
@@ -94,7 +93,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
   @Test
   public void replaceAsAtom() {
     final ODataPubFormat format = ODataPubFormat.ATOM;
-    final CommonODataEntity changes = read(format, client.getURIBuilder(getServiceRoot()).
+    final ODataEntity changes = read(format, client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Car").appendKeySegment(14).build());
     updateEntityDescription(format, changes, UpdateType.REPLACE);
   }
@@ -102,7 +101,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
   @Test
   public void replaceAsJSON() {
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
-    final CommonODataEntity changes = read(format, client.getURIBuilder(getServiceRoot()).
+    final ODataEntity changes = read(format, client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Car").appendKeySegment(14).build());
     updateEntityDescription(format, changes, UpdateType.REPLACE);
   }
@@ -121,7 +120,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
     final URI uri = client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Customer").appendKeySegment(-10).build();
 
-    final CommonODataEntity patch =
+    final ODataEntity patch =
             client.getObjectFactory().newEntity("Microsoft.Test.OData.Services.AstoriaDefaultService.Customer");
     patch.setEditLink(uri);
 
@@ -141,7 +140,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
     ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(customerInfoURI);
     req.setFormat(format);
 
-    CommonODataEntity newInfo = req.execute().getBody();
+    ODataEntity newInfo = req.execute().getBody();
 
     assertEquals(Integer.valueOf(12),
             newInfo.getProperty("CustomerInfoId").getPrimitiveValue().toCastValue(Integer.class));
@@ -179,7 +178,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
     final LinkedHashMap<String, Object> multiKey = new LinkedHashMap<String, Object>();
     multiKey.put("FromUsername", "1");
     multiKey.put("MessageId", -10);
-    final CommonODataEntity message = read(format, client.getURIBuilder(getServiceRoot()).
+    final ODataEntity message = read(format, client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Message").appendKeySegment(multiKey).build());
     message.getAssociationLinks().clear();
     message.getNavigationLinks().clear();
@@ -226,7 +225,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
     final URI uri = client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Product").appendKeySegment(-10).build();
     String etag = getETag(uri);
-    final CommonODataEntity product = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
+    final ODataEntity product = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
     product.setEditLink(uri);
     updateEntityStringProperty("BaseConcurrency",
             client.getConfiguration().getDefaultPubFormat(), product, UpdateType.MERGE, etag);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/KeyAsSegmentTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/KeyAsSegmentTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/KeyAsSegmentTestITCase.java
index 4a9d05f..1b4892d 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/KeyAsSegmentTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/KeyAsSegmentTestITCase.java
@@ -22,7 +22,6 @@ import org.apache.olingo.client.api.communication.request.cud.v3.UpdateType;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
 import org.apache.olingo.client.api.uri.CommonURIBuilder;
-import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.domain.v3.ODataEntity;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
 import org.junit.AfterClass;
@@ -68,10 +67,10 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
   public void createODataEntityAsAtom() {
     final ODataPubFormat format = ODataPubFormat.ATOM;
     final int id = 1;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
+    final ODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
 
     createEntity(testStaticServiceRootURL, format, original, "Customer");
-    final CommonODataEntity actual = compareEntities(testStaticServiceRootURL, format, original, id, null);
+    final ODataEntity actual = compareEntities(testStaticServiceRootURL, format, original, id, null);
 
     cleanAfterCreate(format, actual, false, testStaticServiceRootURL);
   }
@@ -80,10 +79,10 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
   public void createODataEntityAsJSON() {
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
     final int id = 2;
-    final CommonODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
+    final ODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
 
     createEntity(testStaticServiceRootURL, format, original, "Customer");
-    final CommonODataEntity actual = compareEntities(testStaticServiceRootURL, format, original, id, null);
+    final ODataEntity actual = compareEntities(testStaticServiceRootURL, format, original, id, null);
 
     cleanAfterCreate(format, actual, false, testStaticServiceRootURL);
   }
@@ -91,7 +90,7 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
   @Test
   public void replaceODataEntityAsAtom() {
     final ODataPubFormat format = ODataPubFormat.ATOM;
-    final CommonODataEntity changes = read(format, client.getURIBuilder(testStaticServiceRootURL).
+    final ODataEntity changes = read(format, client.getURIBuilder(testStaticServiceRootURL).
             appendEntitySetSegment("Car").appendKeySegment(14).build());
     updateEntityDescription(format, changes, UpdateType.REPLACE);
   }
@@ -99,7 +98,7 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
   @Test
   public void replaceODataEntityAsJSON() {
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
-    final CommonODataEntity changes = read(format, client.getURIBuilder(testStaticServiceRootURL).
+    final ODataEntity changes = read(format, client.getURIBuilder(testStaticServiceRootURL).
             appendEntitySetSegment("Car").appendKeySegment(14).build());
     updateEntityDescription(format, changes, UpdateType.REPLACE);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/NavigationLinkCreateTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/NavigationLinkCreateTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/NavigationLinkCreateTestITCase.java
index 3b518d9..1972fec 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/NavigationLinkCreateTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/NavigationLinkCreateTestITCase.java
@@ -18,6 +18,11 @@
  */
 package org.apache.olingo.client.core.it.v3;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -39,22 +44,18 @@ import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
 import org.apache.olingo.commons.api.domain.CommonODataProperty;
-import org.apache.olingo.commons.api.domain.ODataValue;
 import org.apache.olingo.commons.api.domain.ODataCollectionValue;
 import org.apache.olingo.commons.api.domain.ODataComplexValue;
 import org.apache.olingo.commons.api.domain.ODataInlineEntity;
 import org.apache.olingo.commons.api.domain.ODataInlineEntitySet;
 import org.apache.olingo.commons.api.domain.ODataLink;
+import org.apache.olingo.commons.api.domain.ODataValue;
 import org.apache.olingo.commons.api.domain.v3.ODataEntity;
 import org.apache.olingo.commons.api.domain.v3.ODataEntitySet;
 import org.apache.olingo.commons.api.domain.v3.ODataProperty;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -66,7 +67,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
     final ODataPubFormat format = ODataPubFormat.ATOM;
     final String contentType = "application/atom+xml";
     final String prefer = "return-content";
-    final CommonODataEntity actual = createNavigation(format, 20, contentType, prefer);
+    final ODataEntity actual = createNavigation(format, 20, contentType, prefer);
     delete(format, actual, false, testStaticServiceRootURL);
   }
   // create navigation link with JSON full metadata
@@ -76,7 +77,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
     final String contentType = "application/json;odata=fullmetadata";
     final String prefer = "return-content";
-    final CommonODataEntity actual = createNavigation(format, 21, contentType, prefer);
+    final ODataEntity actual = createNavigation(format, 21, contentType, prefer);
     delete(format, actual, false, testStaticServiceRootURL);
   }
   // throws Null pointer exception when the format is JSON No metadata
@@ -86,7 +87,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
     final ODataPubFormat format = ODataPubFormat.JSON_NO_METADATA;
     final String contentType = "application/json;odata=nometadata";
     final String prefer = "return-content";
-    final CommonODataEntity actual = createNavigation(format, 22, contentType, prefer);
+    final ODataEntity actual = createNavigation(format, 22, contentType, prefer);
     delete(format, actual, false, testStaticServiceRootURL);
   }
   // test with JSON accept and atom content type
@@ -97,7 +98,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
     final String contentType = "application/atom+xml";
     final String prefer = "return-content";
-    final CommonODataEntity actual = createNavigation(format, 23, contentType, prefer);
+    final ODataEntity actual = createNavigation(format, 23, contentType, prefer);
     delete(format, actual, false, testStaticServiceRootURL);
   }
   // test with JSON full metadata in format and json no metadata in content type
@@ -107,7 +108,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
     final String contentType = "application/json;odata=nometadata";
     final String prefer = "return-content";
-    final CommonODataEntity actual = createNavigation(format, 24, contentType, prefer);
+    final ODataEntity actual = createNavigation(format, 24, contentType, prefer);
     delete(format, actual, false, testStaticServiceRootURL);
   }
   // test with JSON no metadata format and json no metadata in content type
@@ -117,7 +118,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
     final ODataPubFormat format = ODataPubFormat.JSON_NO_METADATA;
     final String contentType = "application/json;odata=fullmetadata";
     final String prefer = "return-content";
-    final CommonODataEntity actual = createNavigation(format, 25, contentType, prefer);
+    final ODataEntity actual = createNavigation(format, 25, contentType, prefer);
     delete(format, actual, false, testStaticServiceRootURL);
   }
   // create collection navigation link with ATOM
@@ -127,7 +128,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
     final ODataPubFormat format = ODataPubFormat.ATOM;
     final String contentType = "application/atom+xml";
     final String prefer = "return-content";
-    final CommonODataEntity actual = createCollectionNavigation(format, 55, contentType, prefer);
+    final ODataEntity actual = createCollectionNavigation(format, 55, contentType, prefer);
     delete(format, actual, false, testStaticServiceRootURL);
   }
   // create collection navigation link with JSON
@@ -137,22 +138,22 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
     final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
     final String contentType = "application/json;odata=fullmetadata";
     final String prefer = "return-content";
-    final CommonODataEntity actual = createCollectionNavigation(format, 77, contentType, prefer);
+    final ODataEntity actual = createCollectionNavigation(format, 77, contentType, prefer);
     delete(format, actual, false, testStaticServiceRootURL);
   }
 
   // create a navigation link
-  public CommonODataEntity createNavigation(final ODataPubFormat format, final int id, final String contenttype,
+  public ODataEntity createNavigation(final ODataPubFormat format, final int id, final String contenttype,
           final String prefer) {
     final String name = "Customer Navigation test";
 
-    final CommonODataEntity original = getNewCustomer(id, name, false);
+    final ODataEntity original = getNewCustomer(id, name, false);
     original.addLink(client.getObjectFactory().newEntityNavigationLink(
             "Info", URI.create(testStaticServiceRootURL + "/CustomerInfo(11)")));
-    final CommonODataEntity created = createNav(testStaticServiceRootURL, format, original, "Customer", contenttype,
+    final ODataEntity created = createNav(testStaticServiceRootURL, format, original, "Customer", contenttype,
             prefer);
 
-    final CommonODataEntity actual = validateEntities(testStaticServiceRootURL, format, created, id, null, "Customer");
+    final ODataEntity actual = validateEntities(testStaticServiceRootURL, format, created, id, null, "Customer");
 
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(testStaticServiceRootURL);
     uriBuilder.appendEntitySetSegment("Customer").appendKeySegment(id).appendEntitySetSegment("Info");
@@ -175,38 +176,38 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
   }
 
   // create a navigation link
-  public CommonODataEntity createNav(final String url, final ODataPubFormat format, final CommonODataEntity original,
+  public ODataEntity createNav(final String url, final ODataPubFormat format, final ODataEntity original,
           final String entitySetName, final String contentType, final String prefer) {
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(url);
     uriBuilder.appendEntitySetSegment(entitySetName);
-    final ODataEntityCreateRequest createReq =
+    final ODataEntityCreateRequest<ODataEntity> createReq =
             client.getCUDRequestFactory().getEntityCreateRequest(uriBuilder.build(), original);
     createReq.setFormat(format);
     createReq.setContentType(contentType);
     createReq.setPrefer(prefer);
-    final ODataEntityCreateResponse createRes = createReq.execute();
+    final ODataEntityCreateResponse<ODataEntity> createRes = createReq.execute();
     assertEquals(201, createRes.getStatusCode());
 
     assertEquals("Created", createRes.getStatusMessage());
 
-    final CommonODataEntity created = createRes.getBody();
+    final ODataEntity created = createRes.getBody();
     assertNotNull(created);
     return created;
   }
   // create collection navigation link
 
-  public CommonODataEntity createCollectionNavigation(final ODataPubFormat format, final int id,
+  public ODataEntity createCollectionNavigation(final ODataPubFormat format, final int id,
           final String contentType, final String prefer) throws EdmPrimitiveTypeException {
     {
       final String name = "Collection Navigation Key Customer";
-      final CommonODataEntity original = getNewCustomer(id, name, false);
+      final ODataEntity original = getNewCustomer(id, name, false);
 
       final Set<Integer> navigationKeys = new HashSet<Integer>();
       navigationKeys.add(-118);
       navigationKeys.add(-119);
 
       for (Integer key : navigationKeys) {
-        final CommonODataEntity orderEntity =
+        final ODataEntity orderEntity =
                 client.getObjectFactory().newEntity("Microsoft.Test.OData.Services.AstoriaDefaultService.Order");
 
         getClient().getBinder().add(orderEntity,
@@ -218,7 +219,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
                         client.getObjectFactory().newPrimitiveValueBuilder().setValue(id).
                         setType(EdmPrimitiveTypeKind.Int32).build()));
 
-        final ODataEntityCreateRequest createReq = client.getCUDRequestFactory().getEntityCreateRequest(
+        final ODataEntityCreateRequest<ODataEntity> createReq = client.getCUDRequestFactory().getEntityCreateRequest(
                 client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Order").build(),
                 orderEntity);
         createReq.setFormat(format);
@@ -227,9 +228,9 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
                 "Orders",
                 createReq.execute().getBody().getEditLink()));
       }
-      final CommonODataEntity createdEntity = createNav(testStaticServiceRootURL, format, original, "Customer",
+      final ODataEntity createdEntity = createNav(testStaticServiceRootURL, format, original, "Customer",
               contentType, prefer);
-      final CommonODataEntity actualEntity =
+      final ODataEntity actualEntity =
               validateEntities(testStaticServiceRootURL, format, createdEntity, id, null, "Customer");
 
       final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(testStaticServiceRootURL);
@@ -242,12 +243,12 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
       final ODataRetrieveResponse<ODataEntitySet> res = req.execute();
       assertEquals(200, res.getStatusCode());
 
-      final CommonODataEntitySet entitySet = res.getBody();
+      final ODataEntitySet entitySet = res.getBody();
       assertNotNull(entitySet);
 
       assertEquals(2, entitySet.getCount());
 
-      for (CommonODataEntity entity : entitySet.getEntities()) {
+      for (ODataEntity entity : entitySet.getEntities()) {
         final Integer key = entity.getProperty("OrderId").getPrimitiveValue().toCastValue(Integer.class);
         final Integer customerId = entity.getProperty("CustomerId").getPrimitiveValue().toCastValue(Integer.class);
         assertTrue(navigationKeys.contains(key));
@@ -265,10 +266,10 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
   }
   // get a Customer entity to be created
 
-  public CommonODataEntity getNewCustomer(
+  public ODataEntity getNewCustomer(
           final int id, final String name, final boolean withInlineInfo) {
 
-    final CommonODataEntity entity =
+    final ODataEntity entity =
             client.getObjectFactory().newEntity("Microsoft.Test.OData.Services.AstoriaDefaultService.Customer");
 
     // add name attribute
@@ -284,35 +285,35 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
                       client.getObjectFactory().newPrimitiveValueBuilder().setText(String.valueOf(id)).
                       setType(EdmPrimitiveTypeKind.Int32).build()));
     }
-    final ODataCollectionValue backupContactInfoValue = getClient().getObjectFactory().newCollectionValue(
+    final ODataCollectionValue<ODataValue> backupContactInfoValue = getClient().getObjectFactory().newCollectionValue(
             "Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails)");
 
-    final ODataComplexValue contactDetails = getClient().getObjectFactory().newComplexValue(
+    final ODataComplexValue<ODataProperty> contactDetails = getClient().getObjectFactory().newComplexValue(
             "Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails");
 
-    final ODataCollectionValue altNamesValue = getClient().getObjectFactory().
+    final ODataCollectionValue<ODataValue> altNamesValue = getClient().getObjectFactory().
             newCollectionValue("Collection(Edm.String)");
     altNamesValue.add(client.getObjectFactory().newPrimitiveValueBuilder().
             setText("My Alternative name").setType(EdmPrimitiveTypeKind.String).build());
     contactDetails.add(client.getObjectFactory().newCollectionProperty("AlternativeNames", altNamesValue));
 
-    final ODataCollectionValue emailBagValue = getClient().getObjectFactory().
+    final ODataCollectionValue<ODataValue> emailBagValue = getClient().getObjectFactory().
             newCollectionValue("Collection(Edm.String)");
     emailBagValue.add(client.getObjectFactory().newPrimitiveValueBuilder().
             setText("altname@mydomain.com").setType(EdmPrimitiveTypeKind.String).build());
     contactDetails.add(client.getObjectFactory().newCollectionProperty("EmailBag", emailBagValue));
 
-    final ODataComplexValue contactAliasValue = getClient().getObjectFactory().newComplexValue(
+    final ODataComplexValue<ODataProperty> contactAliasValue = getClient().getObjectFactory().newComplexValue(
             "Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases");
     contactDetails.add(client.getObjectFactory().newComplexProperty("ContactAlias", contactAliasValue));
 
-    final ODataCollectionValue aliasAltNamesValue = getClient().getObjectFactory().
+    final ODataCollectionValue<ODataValue> aliasAltNamesValue = getClient().getObjectFactory().
             newCollectionValue("Collection(Edm.String)");
     aliasAltNamesValue.add(client.getObjectFactory().newPrimitiveValueBuilder().
             setText("myAlternativeName").setType(EdmPrimitiveTypeKind.String).build());
     contactAliasValue.add(client.getObjectFactory().newCollectionProperty("AlternativeNames", aliasAltNamesValue));
 
-    final ODataComplexValue homePhone = getClient().getObjectFactory().newComplexValue(
+    final ODataComplexValue<ODataProperty> homePhone = getClient().getObjectFactory().newComplexValue(
             "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone");
     homePhone.add(client.getObjectFactory().newPrimitiveProperty("PhoneNumber",
             client.getObjectFactory().newPrimitiveValueBuilder().setText("8437568356834568").
@@ -338,7 +339,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
   }
   //delete an entity and associated links after creation
 
-  public void delete(final ODataPubFormat format, final CommonODataEntity created, final boolean includeInline,
+  public void delete(final ODataPubFormat format, final ODataEntity created, final boolean includeInline,
           final String baseUri) {
     final Set<URI> toBeDeleted = new HashSet<URI>();
     toBeDeleted.add(created.getEditLink());
@@ -376,8 +377,8 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
   }
   // add Information property
 
-  public CommonODataEntity getInfo(final int id, final String info) {
-    final CommonODataEntity entity =
+  public ODataEntity getInfo(final int id, final String info) {
+    final ODataEntity entity =
             client.getObjectFactory().newEntity("Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo");
     entity.setMediaEntity(true);
 
@@ -388,9 +389,9 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
   }
   // validate newly created entities
 
-  public CommonODataEntity validateEntities(final String serviceRootURL,
+  public ODataEntity validateEntities(final String serviceRootURL,
           final ODataPubFormat format,
-          final CommonODataEntity original,
+          final ODataEntity original,
           final int actualObjectId,
           final Collection<String> expands, final String entitySetName) {
 
@@ -501,7 +502,7 @@ public class NavigationLinkCreateTestITCase extends AbstractTestITCase {
       }
 
       final List<CommonODataProperty> actualPropertyValue = new ArrayList<CommonODataProperty>();
-      for (CommonODataProperty prop : (ODataComplexValue) actual) {
+      for (CommonODataProperty prop : actual.asComplex()) {
         actualPropertyValue.add(prop);
       }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java
index f576a03..3a90d70 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java
@@ -18,9 +18,6 @@
  */
 package org.apache.olingo.client.core.it.v3;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -28,10 +25,11 @@ import java.util.UUID;
 import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
 import org.apache.olingo.client.api.communication.response.ODataDeleteResponse;
 import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse;
-import org.apache.olingo.commons.api.domain.ODataComplexValue;
+import org.apache.olingo.client.api.uri.v3.URIBuilder;
 import org.apache.olingo.commons.api.domain.CommonODataEntity;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
-import org.apache.olingo.client.api.uri.CommonURIBuilder;
+import org.apache.olingo.commons.api.domain.ODataComplexValue;
+import org.apache.olingo.commons.api.domain.v3.ODataEntity;
+import org.apache.olingo.commons.api.domain.v3.ODataProperty;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.EdmSchema;
@@ -43,6 +41,10 @@ import org.apache.olingo.commons.api.edm.geo.MultiPoint;
 import org.apache.olingo.commons.api.edm.geo.MultiPolygon;
 import org.apache.olingo.commons.api.edm.geo.Point;
 import org.apache.olingo.commons.api.edm.geo.Polygon;
+import org.apache.olingo.commons.api.format.ODataPubFormat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -61,10 +63,10 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
 //        assertTrue(metadata.getEntityType(new FullQualifiedName(schema.getNamespace(), "RowIndex")).isOpenType());
   }
 
-  private CommonODataEntity readRow(final ODataPubFormat format, final String uuid) {
-    final CommonURIBuilder<?> builder = client.getURIBuilder(testStaticServiceRootURL).
+  private ODataEntity readRow(final ODataPubFormat format, final String uuid) {
+    final URIBuilder builder = client.getURIBuilder(testStaticServiceRootURL).
             appendEntitySetSegment("Row").appendKeySegment(UUID.fromString(uuid));
-    return read(format, builder.build());
+    return (ODataEntity) read(format, builder.build());
   }
 
   private void read(final ODataPubFormat format) {
@@ -91,7 +93,7 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
   private void cud(final ODataPubFormat format) {
     final UUID guid = UUID.randomUUID();
 
-    CommonODataEntity row = client.getObjectFactory().newEntity("Microsoft.Test.OData.Services.OpenTypesService.Row");
+    ODataEntity row = client.getObjectFactory().newEntity("Microsoft.Test.OData.Services.OpenTypesService.Row");
     getClient().getBinder().add(row,
             client.getObjectFactory().newPrimitiveProperty("Id",
                     client.getObjectFactory().newPrimitiveValueBuilder().
@@ -192,7 +194,7 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
                     setType(EdmPrimitiveTypeKind.GeographyCollection).
                     setValue(geoColl).build()));
 
-    final ODataComplexValue contactDetails = client.getObjectFactory().newComplexValue(
+    final ODataComplexValue<ODataProperty> contactDetails = client.getObjectFactory().newComplexValue(
             "Microsoft.Test.OData.Services.OpenTypesService.ContactDetails");
     contactDetails.add(client.getObjectFactory().newPrimitiveProperty("FirstContacted",
             client.getObjectFactory().newPrimitiveValueBuilder().
@@ -233,11 +235,11 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
     getClient().getBinder().add(row,
             client.getObjectFactory().newComplexProperty("aContact", contactDetails));
 
-    final ODataEntityCreateRequest createReq = client.getCUDRequestFactory().
+    final ODataEntityCreateRequest<ODataEntity> createReq = client.getCUDRequestFactory().
             getEntityCreateRequest(client.getURIBuilder(testStaticServiceRootURL).
                     appendEntitySetSegment("Row").build(), row);
     createReq.setFormat(format);
-    final ODataEntityCreateResponse createRes = createReq.execute();
+    final ODataEntityCreateResponse<ODataEntity> createRes = createReq.execute();
     assertEquals(201, createRes.getStatusCode());
 
     row = readRow(format, guid.toString());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/PropertyTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/PropertyTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/PropertyTestITCase.java
index 9d10d24..f98e12a 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/PropertyTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/PropertyTestITCase.java
@@ -18,6 +18,11 @@
  */
 package org.apache.olingo.client.core.it.v3;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import java.io.IOException;
 import org.apache.olingo.client.api.communication.ODataClientErrorException;
 import org.apache.olingo.client.api.communication.request.cud.ODataPropertyUpdateRequest;
@@ -36,14 +41,11 @@ import org.apache.olingo.client.api.uri.CommonURIBuilder;
 import org.apache.olingo.commons.api.domain.CommonODataProperty;
 import org.apache.olingo.commons.api.domain.ODataCollectionValue;
 import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
+import org.apache.olingo.commons.api.domain.ODataValue;
 import org.apache.olingo.commons.api.domain.v3.ODataProperty;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.api.format.ODataValueFormat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 import org.junit.Test;
 
 /**
@@ -218,7 +220,7 @@ public class PropertyTestITCase extends AbstractTestITCase {
 
     final String newItem = "new item " + System.currentTimeMillis();
 
-    final ODataCollectionValue originalValue =
+    final ODataCollectionValue<ODataValue> originalValue =
             primaryContactInfo.getComplexValue().get("EmailBag").getCollectionValue();
 
     final int origSize = originalValue.size();
@@ -266,7 +268,7 @@ public class PropertyTestITCase extends AbstractTestITCase {
 
     final String newItem = "new item " + System.currentTimeMillis();
 
-    final ODataCollectionValue originalValue = alternativeNames.getCollectionValue();
+    final ODataCollectionValue<ODataValue> originalValue = alternativeNames.getCollectionValue();
 
     final int origSize = originalValue.size();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/AbstractTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/AbstractTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/AbstractTestITCase.java
index a745380..28cb871 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/AbstractTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/AbstractTestITCase.java
@@ -23,7 +23,7 @@ import org.apache.olingo.client.api.v4.ODataClient;
 import org.apache.olingo.client.core.ODataClientFactory;
 import org.junit.BeforeClass;
 
-public abstract class AbstractTestITCase extends org.apache.olingo.client.core.it.AbstractTestITCase {
+public abstract class AbstractTestITCase {
 
   protected static ODataClient client;
 
@@ -45,7 +45,6 @@ public abstract class AbstractTestITCase extends org.apache.olingo.client.core.i
     client = ODataClientFactory.getV4();
   }
 
-  @Override
   protected ODataClient getClient() {
     return client;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java
index 7806fd0..989dd98 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java
@@ -18,6 +18,11 @@
  */
 package org.apache.olingo.client.core.it.v4;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.net.URI;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -27,7 +32,6 @@ import org.apache.olingo.client.api.communication.request.retrieve.ODataRawReque
 import org.apache.olingo.client.api.communication.response.ODataRawResponse;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
 import org.apache.olingo.client.api.uri.CommonURIBuilder;
-import static org.apache.olingo.client.core.it.v4.AbstractTestITCase.client;
 import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
 import org.apache.olingo.commons.api.domain.CommonODataProperty;
@@ -38,12 +42,6 @@ import org.apache.olingo.commons.api.domain.v4.ODataEntity;
 import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
-import org.apache.olingo.commons.core.op.ResourceFactory;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -81,9 +79,6 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
         final CommonODataEntity inline = ((ODataInlineEntity) link).getEntity();
         assertNotNull(inline);
 
-        debugEntry(client.getBinder().getEntry(
-                inline, ResourceFactory.entryClassForFormat(format == ODataPubFormat.ATOM)), "Just read");
-
         final List<? extends CommonODataProperty> properties = inline.getProperties();
         assertEquals(5, properties.size());
 
@@ -136,9 +131,6 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
         final CommonODataEntitySet inline = ((ODataInlineEntitySet) link).getEntitySet();
         assertNotNull(inline);
 
-        debugFeed(client.getBinder().getFeed(inline, ResourceFactory.feedClassForFormat(
-                format == ODataPubFormat.ATOM)), "Just read");
-
         found = true;
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dc2922c9/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java
index c354a1d..bc0905c 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java
@@ -36,7 +36,6 @@ import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
 import org.apache.olingo.commons.api.domain.v4.ODataEntity;
 import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
-import org.apache.olingo.commons.core.op.ResourceFactory;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -109,9 +108,6 @@ public class EntitySetTestITCase extends AbstractTestITCase {
 
     assertTrue(res.getContextURL().toASCIIString().endsWith("$metadata#People"));
 
-    debugFeed(client.getBinder().getFeed(feed, ResourceFactory.feedClassForFormat(
-            ODataPubFormat.ATOM == format)), "Just retrieved feed");
-
     assertEquals(5, feed.getEntities().size());
     assertNotNull(feed.getNext());
 


Mime
View raw message