You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/06/13 12:58:24 UTC

[04/21] [OLINGO-317] First presentable state

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java
index 46a6995..dd5057d 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java
@@ -18,19 +18,20 @@
  */
 package org.apache.olingo.client.core.v3;
 
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
+
 import org.apache.olingo.client.api.v3.ODataClient;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
 import org.apache.olingo.client.core.AbstractTest;
 import org.apache.olingo.commons.api.data.EntitySet;
 import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.domain.v3.ODataEntitySet;
-import org.apache.olingo.commons.core.op.ResourceFactory;
+import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.junit.Test;
 
 public class EntitySetTest extends AbstractTest {
@@ -40,28 +41,27 @@ public class EntitySetTest extends AbstractTest {
     return v3Client;
   }
 
-  private void read(final ODataPubFormat format) throws IOException {
+  private void read(final ODataPubFormat format) throws IOException, ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("Customer." + getSuffix(format));
     final ODataEntitySet entitySet = getClient().getBinder().getODataEntitySet(
-            getClient().getDeserializer().toEntitySet(input, format));
+        getClient().getDeserializer(format).toEntitySet(input));
     assertNotNull(entitySet);
 
     assertEquals(2, entitySet.getEntities().size());
     assertNotNull(entitySet.getNext());
 
     final ODataEntitySet written = getClient().getBinder().getODataEntitySet(new ResWrap<EntitySet>((URI) null, null,
-            getClient().getBinder().getEntitySet(
-                    entitySet, ResourceFactory.entitySetClassForFormat(format == ODataPubFormat.ATOM))));
+        getClient().getBinder().getEntitySet(entitySet)));
     assertEquals(entitySet, written);
   }
 
   @Test
-  public void fromAtom() throws IOException {
+  public void fromAtom() throws Exception {
     read(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void fromJSON() throws IOException {
+  public void fromJSON() throws Exception {
     read(ODataPubFormat.JSON);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java
index b73dc0d..1d4a04f 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java
@@ -24,19 +24,20 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.InputStream;
 import java.net.URI;
+
 import org.apache.olingo.client.api.v3.ODataClient;
-import org.apache.olingo.commons.api.domain.ODataLink;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
 import org.apache.olingo.client.core.AbstractTest;
 import org.apache.olingo.commons.api.data.Entity;
 import org.apache.olingo.commons.api.data.ResWrap;
+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.ODataProperty;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.core.op.ResourceFactory;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.geo.Geospatial;
 import org.apache.olingo.commons.api.edm.geo.GeospatialCollection;
+import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.junit.Test;
 
 public class EntityTest extends AbstractTest {
@@ -46,10 +47,10 @@ public class EntityTest extends AbstractTest {
     return v3Client;
   }
 
-  private void readAndWrite(final ODataPubFormat format) {
+  private void readAndWrite(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("Customer_-10." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+        getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     assertEquals("Microsoft.Test.OData.Services.AstoriaDefaultService.Customer", entity.getTypeName().toString());
@@ -68,25 +69,24 @@ public class EntityTest extends AbstractTest {
     assertTrue(check);
 
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().
-            getBinder().getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+        new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void fromAtom() {
+  public void fromAtom() throws Exception {
     readAndWrite(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void fromJSON() {
+  public void fromJSON() throws Exception {
     readAndWrite(ODataPubFormat.JSON_FULL_METADATA);
   }
 
-  private void readGeospatial(final ODataPubFormat format) {
+  private void readGeospatial(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("AllGeoTypesSet_-8." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+        getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     boolean found = false;
@@ -100,78 +100,75 @@ public class EntityTest extends AbstractTest {
     assertTrue(found);
 
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().
-            getBinder().getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+        new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void withGeospatialFromAtom() {
+  public void withGeospatialFromAtom() throws Exception {
     readGeospatial(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void withGeospatialFromJSON() {
+  public void withGeospatialFromJSON() throws Exception {
     // this needs to be full, otherwise there is no mean to recognize geospatial types
     readGeospatial(ODataPubFormat.JSON_FULL_METADATA);
   }
 
-  private void withActions(final ODataPubFormat format) {
+  private void withActions(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("ComputerDetail_-10." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+        getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     assertEquals(1, entity.getOperations().size());
     assertEquals("ResetComputerDetailsSpecifications", entity.getOperations().get(0).getTitle());
 
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().
-            getBinder().getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+        new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     entity.getOperations().clear();
     assertEquals(entity, written);
   }
 
   @Test
-  public void withActionsFromAtom() {
+  public void withActionsFromAtom() throws Exception {
     withActions(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void withActionsFromJSON() {
+  public void withActionsFromJSON() throws Exception {
     // this needs to be full, otherwise actions will not be provided
     withActions(ODataPubFormat.JSON_FULL_METADATA);
   }
 
-  private void mediaEntity(final ODataPubFormat format) {
+  private void mediaEntity(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("Car_16." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+        getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
     assertTrue(entity.isMediaEntity());
     assertNotNull(entity.getMediaContentSource());
     assertNotNull(entity.getMediaContentType());
 
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().
-            getBinder().getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+        new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void mediaEntityFromAtom() {
+  public void mediaEntityFromAtom() throws Exception {
     mediaEntity(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void mediaEntityFromJSON() {
+  public void mediaEntityFromJSON() throws Exception {
     mediaEntity(ODataPubFormat.JSON_FULL_METADATA);
   }
 
-  private void issue128(final ODataPubFormat format) throws EdmPrimitiveTypeException {
+  private void issue128(final ODataPubFormat format) throws EdmPrimitiveTypeException, ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("AllGeoTypesSet_-5." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+        getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     final ODataProperty geogCollection = entity.getProperty("GeogCollection");
@@ -186,12 +183,12 @@ public class EntityTest extends AbstractTest {
   }
 
   @Test
-  public void issue128FromAtom() throws EdmPrimitiveTypeException {
+  public void issue128FromAtom() throws Exception {
     issue128(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void issue128FromJSON() throws EdmPrimitiveTypeException {
+  public void issue128FromJSON() throws Exception {
     issue128(ODataPubFormat.JSON_FULL_METADATA);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ErrorTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ErrorTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ErrorTest.java
index b2cf8e3..1b340e9 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ErrorTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ErrorTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertNotNull;
 import org.apache.olingo.client.api.v3.ODataClient;
 import org.apache.olingo.commons.api.domain.ODataError;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.apache.olingo.client.core.AbstractTest;
 import org.junit.Test;
 
@@ -34,40 +35,40 @@ public class ErrorTest extends AbstractTest {
     return v3Client;
   }
 
-  private ODataError error(final String name, final ODataPubFormat format) {
-    final ODataError error = getClient().getDeserializer().toError(
-            getClass().getResourceAsStream(name + "." + getSuffix(format)), format == ODataPubFormat.ATOM);
+  private ODataError error(final String name, final ODataPubFormat format) throws ODataDeserializerException {
+    final ODataError error = getClient().getDeserializer(format).toError(
+            getClass().getResourceAsStream(name + "." + getSuffix(format)));
     assertNotNull(error);
     return error;
   }
 
-  private void simple(final ODataPubFormat format) {
+  private void simple(final ODataPubFormat format) throws ODataDeserializerException {
     final ODataError error = error("error", format);
     assertEquals("The URL representing the root of the service only supports GET requests.", error.getMessage());
   }
 
   @Test
-  public void jsonSimple() {
+  public void jsonSimple() throws Exception {
     simple(ODataPubFormat.JSON);
   }
 
   @Test
-  public void atomSimple() {
+  public void atomSimple() throws Exception {
     simple(ODataPubFormat.ATOM);
   }
 
-  private void stacktrace(final ODataPubFormat format) {
+  private void stacktrace(final ODataPubFormat format) throws ODataDeserializerException {
     final ODataError error = error("stacktrace", format);
     assertEquals("Unsupported media type requested.", error.getMessage());
   }
 
   @Test
-  public void jsonStacktrace() {
+  public void jsonStacktrace() throws Exception {
     stacktrace(ODataPubFormat.JSON);
   }
 
   @Test
-  public void atomStacktrace() {
+  public void atomStacktrace() throws Exception {
     stacktrace(ODataPubFormat.ATOM);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java
index ecd261c..ee83862 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java
@@ -53,6 +53,7 @@ import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.EdmReturnType;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
 import org.junit.Test;
 
@@ -175,7 +176,7 @@ public class MetadataTest extends AbstractTest {
 
   @Test
   public void parseWithXMLMetadata() {
-    final XMLMetadata metadata = getClient().getDeserializer().
+    final XMLMetadata metadata = getClient().getDeserializer(ODataFormat.XML).
             toMetadata(getClass().getResourceAsStream("metadata.xml"));
     assertNotNull(metadata);
 
@@ -212,7 +213,7 @@ public class MetadataTest extends AbstractTest {
 
   @Test
   public void multipleSchemas() {
-    final XMLMetadata metadata = getClient().getDeserializer().
+    final XMLMetadata metadata = getClient().getDeserializer(ODataFormat.XML).
             toMetadata(getClass().getResourceAsStream("northwind-metadata.xml"));
     assertNotNull(metadata);
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java
index 317d1ac..b561f28 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertTrue;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Iterator;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.olingo.client.api.v3.ODataClient;
 import org.apache.olingo.client.core.AbstractTest;
@@ -36,7 +37,8 @@ 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.ODataFormat;
-
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
+import org.apache.olingo.commons.api.op.ODataSerializerException;
 import org.junit.Test;
 
 public class PropertyTest extends AbstractTest {
@@ -58,7 +60,8 @@ public class PropertyTest extends AbstractTest {
     assertEquals("-10", value.toString());
   }
 
-  private void primitive(final ODataFormat format) throws IOException, EdmPrimitiveTypeException {
+  private void primitive(final ODataFormat format)
+      throws EdmPrimitiveTypeException, ODataDeserializerException, ODataSerializerException {
     final InputStream input = getClass().getResourceAsStream("Customer_-10_CustomerId." + getSuffix(format));
     final ODataProperty property = getClient().getReader().readProperty(input, format);
     assertNotNull(property);
@@ -83,16 +86,16 @@ public class PropertyTest extends AbstractTest {
   }
 
   @Test
-  public void xmlPrimitive() throws IOException, EdmPrimitiveTypeException {
+  public void xmlPrimitive() throws Exception {
     primitive(ODataFormat.XML);
   }
 
   @Test
-  public void jsonPrimitive() throws IOException, EdmPrimitiveTypeException {
+  public void jsonPrimitive() throws Exception {
     primitive(ODataFormat.JSON);
   }
 
-  private void complex(final ODataFormat format) throws IOException {
+  private void complex(final ODataFormat format) throws ODataDeserializerException, ODataSerializerException {
     final InputStream input = getClass().getResourceAsStream("Customer_-10_PrimaryContactInfo." + getSuffix(format));
     final ODataProperty property = getClient().getReader().readProperty(input, format);
     assertNotNull(property);
@@ -119,16 +122,16 @@ public class PropertyTest extends AbstractTest {
   }
 
   @Test
-  public void xmlComplex() throws IOException {
+  public void xmlComplex() throws Exception {
     complex(ODataFormat.XML);
   }
 
   @Test
-  public void jsonComplex() throws IOException {
+  public void jsonComplex() throws Exception {
     complex(ODataFormat.JSON);
   }
 
-  private void collection(final ODataFormat format) throws IOException {
+  private void collection(final ODataFormat format) throws ODataDeserializerException, ODataSerializerException {
     final InputStream input = getClass().getResourceAsStream("Customer_-10_BackupContactInfo." + getSuffix(format));
     final ODataProperty property = getClient().getReader().readProperty(input, format);
     assertNotNull(property);
@@ -155,12 +158,12 @@ public class PropertyTest extends AbstractTest {
   }
 
   @Test
-  public void xmlCollection() throws IOException {
+  public void xmlCollection() throws Exception {
     collection(ODataFormat.XML);
   }
 
   @Test
-  public void jsonCollection() throws IOException {
+  public void jsonCollection() throws Exception {
     collection(ODataFormat.JSON);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ServiceDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ServiceDocumentTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ServiceDocumentTest.java
index 0929741..b14c635 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ServiceDocumentTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ServiceDocumentTest.java
@@ -21,6 +21,7 @@ package org.apache.olingo.client.core.v3;
 import org.apache.olingo.client.api.v3.ODataClient;
 import org.apache.olingo.commons.api.domain.ODataServiceDocument;
 import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.apache.olingo.client.core.AbstractTest;
 
 import static org.junit.Assert.assertNotNull;
@@ -39,7 +40,7 @@ public class ServiceDocumentTest extends AbstractTest {
     return format == ODataFormat.XML ? "xml" : "json";
   }
 
-  private void parse(final ODataFormat format) {
+  private void parse(final ODataFormat format) throws ODataDeserializerException {
     final ODataServiceDocument serviceDocument = getClient().getReader().readServiceDocument(
             getClass().getResourceAsStream("serviceDocument." + getFileExtension(format)), format);
     assertNotNull(serviceDocument);
@@ -47,12 +48,12 @@ public class ServiceDocumentTest extends AbstractTest {
   }
 
   @Test
-  public void json() {
+  public void json() throws Exception {
     parse(ODataFormat.JSON);
   }
 
   @Test
-  public void xml() {
+  public void xml() throws Exception {
     parse(ODataFormat.XML);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java
index 5338e50..453a8ab 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertNull;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
+
 import org.apache.olingo.client.api.v4.ODataClient;
 import org.apache.olingo.client.core.AbstractTest;
 import org.apache.olingo.commons.api.data.EntitySet;
@@ -32,7 +33,7 @@ import org.apache.olingo.commons.api.data.ResWrap;
 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.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.junit.Test;
 
 public class EntitySetTest extends AbstractTest {
@@ -42,35 +43,34 @@ public class EntitySetTest extends AbstractTest {
     return v4Client;
   }
 
-  private void read(final ODataPubFormat format) throws IOException {
+  private void read(final ODataPubFormat format) throws IOException, ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("Customers." + getSuffix(format));
     final ODataEntitySet entitySet = getClient().getBinder().getODataEntitySet(
-            getClient().getDeserializer().toEntitySet(input, format));
+            getClient().getDeserializer(format).toEntitySet(input));
     assertNotNull(entitySet);
 
     assertEquals(2, entitySet.getEntities().size());
     assertNull(entitySet.getNext());
 
     final ODataEntitySet written = getClient().getBinder().getODataEntitySet(new ResWrap<EntitySet>((URI) null, null,
-            getClient().getBinder().getEntitySet(
-                    entitySet, ResourceFactory.entitySetClassForFormat(format == ODataPubFormat.ATOM))));
+            getClient().getBinder().getEntitySet(entitySet)));
     assertEquals(entitySet, written);
   }
 
   @Test
-  public void fromAtom() throws IOException {
+  public void fromAtom() throws Exception {
     read(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void fromJSON() throws IOException {
+  public void fromJSON() throws Exception {
     read(ODataPubFormat.JSON);
   }
 
-  private void ref(final ODataPubFormat format) {
+  private void ref(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("collectionOfEntityReferences." + getSuffix(format));
     final ODataEntitySet entitySet = getClient().getBinder().getODataEntitySet(
-            getClient().getDeserializer().toEntitySet(input, format));
+            getClient().getDeserializer(format).toEntitySet(input));
     assertNotNull(entitySet);
 
     for (ODataEntity entity : entitySet.getEntities()) {
@@ -79,18 +79,17 @@ public class EntitySetTest extends AbstractTest {
     entitySet.setCount(entitySet.getEntities().size());
 
     final ODataEntitySet written = getClient().getBinder().getODataEntitySet(new ResWrap<EntitySet>((URI) null, null,
-            getClient().getBinder().getEntitySet(
-                    entitySet, ResourceFactory.entitySetClassForFormat(format == ODataPubFormat.ATOM))));
+            getClient().getBinder().getEntitySet(entitySet)));
     assertEquals(entitySet, written);
   }
 
   @Test
-  public void atomRef() {
+  public void atomRef() throws Exception {
     ref(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void jsonRef() {
+  public void jsonRef() throws Exception {
     ref(ODataPubFormat.JSON);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java
index 0fc3495..38cbd8d 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertTrue;
 import java.io.InputStream;
 import java.net.URI;
 import java.util.Iterator;
+
 import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
 import org.apache.olingo.client.api.v4.ODataClient;
 import org.apache.olingo.client.core.AbstractTest;
@@ -43,9 +44,9 @@ import org.apache.olingo.commons.api.domain.v4.ODataValue;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmDateTimeOffset;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmDuration;
-import org.apache.olingo.commons.core.op.ResourceFactory;
 import org.junit.Test;
 
 public class EntityTest extends AbstractTest {
@@ -76,10 +77,10 @@ public class EntityTest extends AbstractTest {
     };
   }
 
-  private void singleton(final ODataPubFormat format) {
+  private void singleton(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("VipCustomer." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+            getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     assertEquals("Microsoft.Test.OData.Services.ODataWCFService.Customer", entity.getTypeName().toString());
@@ -120,25 +121,24 @@ public class EntityTest extends AbstractTest {
     // operations won't get serialized
     entity.getOperations().clear();
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().getBinder().
-                    getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void atomSingleton() {
+  public void atomSingleton() throws Exception {
     singleton(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void jsonSingleton() {
+  public void jsonSingleton() throws Exception {
     singleton(ODataPubFormat.JSON_FULL_METADATA);
   }
 
-  private void withEnums(final ODataPubFormat format) {
+  private void withEnums(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("Products_5." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+            getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     final ODataProperty skinColor = entity.getProperty("SkinColor");
@@ -156,26 +156,25 @@ public class EntityTest extends AbstractTest {
     // operations won't get serialized
     entity.getOperations().clear();
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().getBinder().
-                    getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void atomWithEnums() {
+  public void atomWithEnums() throws Exception {
     withEnums(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void jsonWithEnums() {
+  public void jsonWithEnums() throws Exception {
     withEnums(ODataPubFormat.JSON_FULL_METADATA);
   }
 
-  private void withInlineEntitySet(final ODataPubFormat format) {
+  private void withInlineEntitySet(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream(
             "Accounts_101_expand_MyPaymentInstruments." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+            getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     final ODataLink instruments = entity.getNavigationLink("MyPaymentInstruments");
@@ -191,26 +190,25 @@ public class EntityTest extends AbstractTest {
     // operations won't get serialized
     entity.getOperations().clear();
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().getBinder().
-                    getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void atomWithInlineEntitySet() {
+  public void atomWithInlineEntitySet() throws Exception {
     withInlineEntitySet(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void jsonWithInlineEntitySet() {
+  public void jsonWithInlineEntitySet() throws Exception {
     withInlineEntitySet(ODataPubFormat.JSON_FULL_METADATA);
   }
 
-  private void mediaEntity(final ODataPubFormat format) {
+  private void mediaEntity(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream(
             "Advertisements_f89dee73-af9f-4cd4-b330-db93c25ff3c7." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+            getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     assertTrue(entity.isMediaEntity());
@@ -218,25 +216,24 @@ public class EntityTest extends AbstractTest {
     assertEquals("\"8zOOKKvgOtptr4gt8IrnapX3jds=\"", entity.getMediaETag());
 
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().getBinder().
-                    getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void atomMediaEntity() {
+  public void atomMediaEntity() throws Exception {
     mediaEntity(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void jsonMediaEntity() {
+  public void jsonMediaEntity() throws Exception {
     mediaEntity(ODataPubFormat.JSON_FULL_METADATA);
   }
 
-  private void withStream(final ODataPubFormat format) {
+  private void withStream(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("PersonDetails_1." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+            getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     assertFalse(entity.isMediaEntity());
@@ -245,49 +242,47 @@ public class EntityTest extends AbstractTest {
     assertNotNull(editMedia);
 
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().getBinder().
-                    getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void atomWithStream() {
+  public void atomWithStream() throws Exception {
     withStream(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void jsonWithStream() {
+  public void jsonWithStream() throws Exception {
     withStream(ODataPubFormat.JSON_FULL_METADATA);
   }
 
-  private void ref(final ODataPubFormat format) {
+  private void ref(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("entityReference." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+            getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     assertNotNull(entity.getId());
 
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().getBinder().
-                    getEntity(entity, ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void atomRef() {
+  public void atomRef() throws Exception {
     ref(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void jsonRef() {
+  public void jsonRef() throws Exception {
     ref(ODataPubFormat.JSON);
   }
 
-  private void complexNavigationProperties(final ODataPubFormat format) {
+  private void complexNavigationProperties(final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("entity.withcomplexnavigation." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+            getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     final ODataLinkedComplexValue addressValue = entity.getProperty("Address").getLinkedComplexValue();
@@ -297,25 +292,24 @@ public class EntityTest extends AbstractTest {
     // ETag is not serialized
     entity.setETag(null);
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity,
-                            ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void atomComplexNavigationProperties() {
+  public void atomComplexNavigationProperties() throws Exception {
     complexNavigationProperties(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void jsonComplexNavigationProperties() {
+  public void jsonComplexNavigationProperties() throws Exception {
     complexNavigationProperties(ODataPubFormat.JSON);
   }
 
-  private void annotated(final ODataPubFormat format) throws EdmPrimitiveTypeException {
+  private void annotated(final ODataPubFormat format) throws EdmPrimitiveTypeException, ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("annotated." + getSuffix(format));
     final ODataEntity entity = getClient().getBinder().getODataEntity(
-            getClient().getDeserializer().toEntity(input, format));
+            getClient().getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     assertFalse(entity.getAnnotations().isEmpty());
@@ -343,24 +337,23 @@ public class EntityTest extends AbstractTest {
             annotation.getValue().asLinkedComplex().get("order").getPrimitiveValue().toCastValue(Integer.class), 0);
 
     final ODataEntity written = getClient().getBinder().getODataEntity(
-            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity,
-                            ResourceFactory.entityClassForFormat(format == ODataPubFormat.ATOM))));
+            new ResWrap<Entity>((URI) null, null, getClient().getBinder().getEntity(entity)));
     assertEquals(entity, written);
   }
 
   @Test
-  public void atomAnnotated() {
+  public void atomAnnotated() throws Exception {
     complexNavigationProperties(ODataPubFormat.ATOM);
   }
 
   @Test
-  public void jsonAnnotated() {
+  public void jsonAnnotated() throws Exception {
     complexNavigationProperties(ODataPubFormat.JSON);
   }
 
-  private void derived(final ODataClient client, final ODataPubFormat format) {
+  private void derived(final ODataClient client, final ODataPubFormat format) throws ODataDeserializerException {
     final InputStream input = getClass().getResourceAsStream("Customer." + getSuffix(format));    
-    final ODataEntity entity = client.getBinder().getODataEntity(client.getDeserializer().toEntity(input, format));
+    final ODataEntity entity = client.getBinder().getODataEntity(client.getDeserializer(format).toEntity(input));
     assertNotNull(entity);
 
     assertEquals("Microsoft.Test.OData.Services.ODataWCFService.Customer", entity.getTypeName().toString());
@@ -369,17 +362,17 @@ public class EntityTest extends AbstractTest {
   }
 
   @Test
-  public void derivedFromAtom() {
+  public void derivedFromAtom() throws Exception {
     derived(getClient(), ODataPubFormat.ATOM);
   }
 
   @Test
-  public void derivedFromJSON() {
+  public void derivedFromJSON() throws Exception {
     derived(getEdmEnabledClient(), ODataPubFormat.JSON);
   }
 
   @Test
-  public void derivedFromFullJSON() {
+  public void derivedFromFullJSON() throws Exception {
     derived(getClient(), ODataPubFormat.JSON_FULL_METADATA);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java
index c89fa39..b221ade 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertNotNull;
 import org.apache.olingo.client.api.v4.ODataClient;
 import org.apache.olingo.commons.api.domain.ODataError;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.apache.olingo.client.core.AbstractTest;
 import org.junit.Test;
 
@@ -34,14 +35,14 @@ public class ErrorTest extends AbstractTest {
     return v4Client;
   }
 
-  private ODataError error(final String name, final ODataPubFormat format) {
-    final ODataError error = getClient().getDeserializer().toError(
-            getClass().getResourceAsStream(name + "." + getSuffix(format)), format == ODataPubFormat.ATOM);
+  private ODataError error(final String name, final ODataPubFormat format) throws ODataDeserializerException {
+    final ODataError error = getClient().getDeserializer(format).toError(
+            getClass().getResourceAsStream(name + "." + getSuffix(format)));
     assertNotNull(error);
     return error;
   }
 
-  private void simple(final ODataPubFormat format) {
+  private void simple(final ODataPubFormat format) throws ODataDeserializerException {
     final ODataError error = error("error", format);
     assertEquals("501", error.getCode());
     assertEquals("Unsupported functionality", error.getMessage());
@@ -49,12 +50,12 @@ public class ErrorTest extends AbstractTest {
   }
 
   @Test
-  public void jsonSimple() {
+  public void jsonSimple() throws Exception {
     simple(ODataPubFormat.JSON);
   }
 
   @Test
-  public void atomSimple() {
+  public void atomSimple() throws Exception {
     simple(ODataPubFormat.ATOM);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java
index 39e7a1e..20967b9 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java
@@ -92,16 +92,16 @@ public class JSONTest extends AbstractTest {
       final Map.Entry<String, JsonNode> field = itor.next();
 
       if (field.getKey().charAt(0) == '#'
-              || field.getKey().endsWith(
-                      getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_TYPE))
-              || field.getKey().endsWith(
-                      getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_MEDIAEDIT_LINK))
-              || field.getKey().endsWith(
-                      getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_MEDIA_CONTENT_TYPE))
-              || field.getKey().endsWith(
-                      getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_ASSOCIATION_LINK))
-              || field.getKey().endsWith(
-                      getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_MEDIA_ETAG))) {
+          || field.getKey().endsWith(
+              getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_TYPE))
+          || field.getKey().endsWith(
+              getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_MEDIAEDIT_LINK))
+          || field.getKey().endsWith(
+              getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_MEDIA_CONTENT_TYPE))
+          || field.getKey().endsWith(
+              getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_ASSOCIATION_LINK))
+          || field.getKey().endsWith(
+              getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_MEDIA_ETAG))) {
 
         toRemove.add(field.getKey());
       } else if (field.getValue().isObject()) {
@@ -120,8 +120,8 @@ public class JSONTest extends AbstractTest {
 
   protected void assertSimilar(final String filename, final String actual) throws Exception {
     final JsonNode expected = OBJECT_MAPPER.readTree(IOUtils.toString(getClass().getResourceAsStream(filename)).
-            replace(getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_NAVIGATION_LINK),
-                    Constants.JSON_BIND_LINK_SUFFIX));
+        replace(getClient().getServiceVersion().getJSONMap().get(ODataServiceVersion.JSON_NAVIGATION_LINK),
+            Constants.JSON_BIND_LINK_SUFFIX));
     cleanup((ObjectNode) expected);
     final ObjectNode actualNode = (ObjectNode) OBJECT_MAPPER.readTree(new ByteArrayInputStream(actual.getBytes()));
     cleanup(actualNode);
@@ -130,8 +130,8 @@ public class JSONTest extends AbstractTest {
 
   protected void entitySet(final String filename, final ODataPubFormat format) throws Exception {
     final StringWriter writer = new StringWriter();
-    getClient().getSerializer().entitySet(getClient().getDeserializer().toEntitySet(
-            getClass().getResourceAsStream(filename + "." + getSuffix(format)), format).getPayload(), writer);
+    getClient().getSerializer(format).write(writer, getClient().getDeserializer(format).toEntitySet(
+        getClass().getResourceAsStream(filename + "." + getSuffix(format))).getPayload());
 
     assertSimilar(filename + "." + getSuffix(format), writer.toString());
   }
@@ -144,8 +144,8 @@ public class JSONTest extends AbstractTest {
 
   protected void entity(final String filename, final ODataPubFormat format) throws Exception {
     final StringWriter writer = new StringWriter();
-    getClient().getSerializer().entity(getClient().getDeserializer().toEntity(
-            getClass().getResourceAsStream(filename + "." + getSuffix(format)), format).getPayload(), writer);
+    getClient().getSerializer(format).write(writer, getClient().getDeserializer(format).toEntity(
+        getClass().getResourceAsStream(filename + "." + getSuffix(format))).getPayload());
 
     assertSimilar(filename + "." + getSuffix(format), writer.toString());
   }
@@ -171,9 +171,8 @@ public class JSONTest extends AbstractTest {
 
   protected void property(final String filename, final ODataFormat format) throws Exception {
     final StringWriter writer = new StringWriter();
-    getClient().getSerializer().property(getClient().getDeserializer().
-            toProperty(getClass().getResourceAsStream(filename + "." + getSuffix(format)), format).getPayload(),
-            writer);
+    getClient().getSerializer(format).write(writer, getClient().getDeserializer(format).
+        toProperty(getClass().getResourceAsStream(filename + "." + getSuffix(format))).getPayload());
 
     assertSimilar(filename + "." + getSuffix(format), writer.toString());
   }
@@ -188,13 +187,13 @@ public class JSONTest extends AbstractTest {
 
   @Test
   public void crossjoin() throws Exception {
-    assertNotNull(getClient().getDeserializer().toEntitySet(
-            getClass().getResourceAsStream("crossjoin.json"), ODataPubFormat.JSON_FULL_METADATA));
+    assertNotNull(getClient().getDeserializer(ODataPubFormat.JSON_FULL_METADATA).toEntitySet(
+        getClass().getResourceAsStream("crossjoin.json")));
   }
 
   protected void delta(final String filename, final ODataPubFormat format) throws Exception {
-    final Delta delta = getClient().getDeserializer().toDelta(
-            getClass().getResourceAsStream(filename + "." + getSuffix(format)), format).getPayload();
+    final Delta delta = getClient().getDeserializer(format).toDelta(
+        getClass().getResourceAsStream(filename + "." + getSuffix(format))).getPayload();
     assertNotNull(delta);
     assertNotNull(delta.getDeltaLink());
     assertEquals(5, delta.getCount(), 0);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java
index 8ca024a..dd69685 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java
@@ -62,6 +62,7 @@ import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.edm.annotation.EdmUrlRef;
 import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmDecimal;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmInt32;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
@@ -137,7 +138,7 @@ public class MetadataTest extends AbstractTest {
 
   @Test
   public void demo() {
-    final XMLMetadata metadata = getClient().getDeserializer().
+    final XMLMetadata metadata = getClient().getDeserializer(ODataFormat.XML).
             toMetadata(getClass().getResourceAsStream("demo-metadata.xml"));
     assertNotNull(metadata);
 
@@ -178,7 +179,7 @@ public class MetadataTest extends AbstractTest {
 
   @Test
   public void multipleSchemas() {
-    final XMLMetadata metadata = getClient().getDeserializer().
+    final XMLMetadata metadata = getClient().getDeserializer(ODataFormat.XML).
             toMetadata(getClass().getResourceAsStream("northwind-metadata.xml"));
     assertNotNull(metadata);
 
@@ -199,7 +200,7 @@ public class MetadataTest extends AbstractTest {
    */
   @Test
   public void fromdoc1() {
-    final XMLMetadata metadata = getClient().getDeserializer().
+    final XMLMetadata metadata = getClient().getDeserializer(ODataFormat.XML).
             toMetadata(getClass().getResourceAsStream("fromdoc1-metadata.xml"));
     assertNotNull(metadata);
 
@@ -270,8 +271,8 @@ public class MetadataTest extends AbstractTest {
    */
   @Test
   public void fromdoc2() {
-    final XMLMetadata metadata = getClient().getDeserializer().
-            toMetadata(getClass().getResourceAsStream("fromdoc2-metadata.xml"));
+    final XMLMetadata metadata = getClient().getDeserializer(ODataFormat.XML)
+            .toMetadata(getClass().getResourceAsStream("fromdoc2-metadata.xml"));
     assertNotNull(metadata);
 
     // Check displayName
@@ -334,7 +335,7 @@ public class MetadataTest extends AbstractTest {
    */
   @Test
   public void fromdoc4() {
-    final XMLMetadata metadata = getClient().getDeserializer().
+    final XMLMetadata metadata = getClient().getDeserializer(ODataFormat.XML).
             toMetadata(getClass().getResourceAsStream("fromdoc4-metadata.xml"));
     assertNotNull(metadata);
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java
index 022496c..1535355 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java
@@ -18,21 +18,22 @@
  */
 package org.apache.olingo.client.core.v4;
 
-import java.io.IOException;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import java.io.InputStream;
 import java.util.Iterator;
+
 import org.apache.olingo.client.api.v4.ODataClient;
 import org.apache.olingo.client.core.AbstractTest;
 import org.apache.olingo.commons.api.domain.ODataCollectionValue;
 import org.apache.olingo.commons.api.domain.ODataComplexValue;
 import org.apache.olingo.commons.api.domain.v4.ODataProperty;
 import org.apache.olingo.commons.api.domain.v4.ODataValue;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.format.ODataFormat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
+import org.apache.olingo.commons.api.op.ODataSerializerException;
 import org.junit.Test;
 
 public class PropertyTest extends AbstractTest {
@@ -42,7 +43,7 @@ public class PropertyTest extends AbstractTest {
     return v4Client;
   }
 
-  private void _enum(final ODataFormat format) {
+  private void _enum(final ODataFormat format) throws ODataDeserializerException, ODataSerializerException {
     final InputStream input = getClass().getResourceAsStream("Products_5_SkinColor." + getSuffix(format));
     final ODataProperty property = getClient().getReader().readProperty(input, format);
     assertNotNull(property);
@@ -61,16 +62,16 @@ public class PropertyTest extends AbstractTest {
   }
 
   @Test
-  public void xmlEnum() throws IOException, EdmPrimitiveTypeException {
+  public void xmlEnum() throws Exception {
     _enum(ODataFormat.XML);
   }
 
   @Test
-  public void jsonEnum() throws IOException, EdmPrimitiveTypeException {
+  public void jsonEnum() throws Exception {
     _enum(ODataFormat.JSON);
   }
 
-  private void complex(final ODataFormat format) throws IOException {
+  private void complex(final ODataFormat format) throws ODataDeserializerException, ODataSerializerException {
     final InputStream input = getClass().getResourceAsStream("Employees_3_HomeAddress." + getSuffix(format));
     final ODataProperty property = getClient().getReader().readProperty(input, format);
     assertNotNull(property);
@@ -93,16 +94,16 @@ public class PropertyTest extends AbstractTest {
   }
 
   @Test
-  public void xmlComplex() throws IOException {
+  public void xmlComplex() throws Exception {
     complex(ODataFormat.XML);
   }
 
   @Test
-  public void jsonComplex() throws IOException {
+  public void jsonComplex() throws Exception {
     complex(ODataFormat.JSON);
   }
 
-  private void collection(final ODataFormat format) throws IOException {
+  private void collection(final ODataFormat format) throws ODataDeserializerException, ODataSerializerException {
     final InputStream input = getClass().getResourceAsStream("Products_5_CoverColors." + getSuffix(format));
     final ODataProperty property = getClient().getReader().readProperty(input, format);
     assertNotNull(property);
@@ -127,12 +128,12 @@ public class PropertyTest extends AbstractTest {
   }
 
   @Test
-  public void xmlCollection() throws IOException {
+  public void xmlCollection() throws Exception {
     collection(ODataFormat.XML);
   }
 
   @Test
-  public void jsonCollection() throws IOException {
+  public void jsonCollection() throws Exception {
     collection(ODataFormat.JSON);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java
index f515bdc..403fbcf 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java
@@ -23,10 +23,12 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.net.URI;
+
 import org.apache.olingo.client.api.data.ServiceDocument;
 import org.apache.olingo.client.api.v4.ODataClient;
 import org.apache.olingo.commons.api.domain.ODataServiceDocument;
 import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.op.ODataDeserializerException;
 import org.apache.olingo.client.core.AbstractTest;
 import org.apache.olingo.commons.api.data.ResWrap;
 import org.junit.Test;
@@ -42,9 +44,9 @@ public class ServiceDocumentTest extends AbstractTest {
     return format == ODataFormat.XML ? "xml" : "json";
   }
 
-  private ODataServiceDocument parse(final ODataFormat format) {
-    ResWrap<ServiceDocument> service = getClient().getDeserializer().toServiceDocument(
-            getClass().getResourceAsStream("serviceDocument." + getFileExtension(format)), format);
+  private ODataServiceDocument parse(final ODataFormat format) throws ODataDeserializerException {
+    ResWrap<ServiceDocument> service = getClient().getDeserializer(format).toServiceDocument(
+            getClass().getResourceAsStream("serviceDocument." + getFileExtension(format)));
 
     assertEquals(URI.create("http://host/service/$metadata"), service.getContextURL().getURI());
     assertEquals("W/\"MjAxMy0wNS0xM1QxNDo1NFo=\"", service.getMetadataETag());
@@ -62,12 +64,12 @@ public class ServiceDocumentTest extends AbstractTest {
   }
 
   @Test
-  public void json() {
+  public void json() throws Exception {
     parse(ODataFormat.JSON);
   }
 
   @Test
-  public void xml() {
+  public void xml() throws Exception {
     parse(ODataFormat.XML);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/CommonODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/CommonODataDeserializer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/CommonODataDeserializer.java
deleted file mode 100644
index a0d9a87..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/CommonODataDeserializer.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.op;
-
-import java.io.InputStream;
-import java.io.Serializable;
-import org.apache.olingo.commons.api.data.ResWrap;
-import org.apache.olingo.commons.api.data.Entity;
-import org.apache.olingo.commons.api.domain.ODataError;
-import org.apache.olingo.commons.api.data.EntitySet;
-import org.apache.olingo.commons.api.data.Property;
-import org.apache.olingo.commons.api.format.ODataFormat;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
-
-/**
- * Interface for de-serialization.
- */
-public interface CommonODataDeserializer extends Serializable {
-
-  /**
-   * Gets an entity set object from the given InputStream.
-   *
-   * @param input stream to be de-serialized.
-   * @param format Atom or JSON
-   * @return {@link EntitySet} instance.
-   */
-  ResWrap<EntitySet> toEntitySet(InputStream input, ODataPubFormat format);
-
-  /**
-   * Gets an entity object from the given InputStream.
-   *
-   * @param input stream to be de-serialized.
-   * @param format Atom or JSON
-   * @return {@link Entity} instance.
-   */
-  ResWrap<Entity> toEntity(InputStream input, ODataPubFormat format);
-
-  /**
-   * Gets a property object from the given InputStream.
-   *
-   * @param input stream to be de-serialized.
-   * @param format XML or JSON
-   * @return Property instance.
-   */
-  ResWrap<Property> toProperty(InputStream input, ODataFormat format);
-
-  /**
-   * Gets the ODataError object represented by the given InputStream.
-   *
-   * @param input stream to be parsed and de-serialized.
-   * @param isXML 'TRUE' if the error is represented by XML; 'FALSE' otherwise.
-   * @return
-   */
-  ODataError toError(InputStream input, boolean isXML);
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataDeserializer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataDeserializer.java
new file mode 100755
index 0000000..9b6bd5a
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataDeserializer.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.op;
+
+import java.io.InputStream;
+
+import org.apache.olingo.commons.api.data.Entity;
+import org.apache.olingo.commons.api.data.EntitySet;
+import org.apache.olingo.commons.api.data.Property;
+import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.domain.ODataError;
+
+/**
+ * Interface for de-serialization.
+ */
+public interface ODataDeserializer {
+
+  /**
+   * Gets an entity set object from the given InputStream.
+   *
+   * @param input stream to be de-serialized.
+   * @return {@link EntitySet} instance.
+   */
+  ResWrap<EntitySet> toEntitySet(InputStream input) throws ODataDeserializerException;
+
+  /**
+   * Gets an entity object from the given InputStream.
+   *
+   * @param input stream to be de-serialized.
+   * @return {@link Entity} instance.
+   */
+  ResWrap<Entity> toEntity(InputStream input) throws ODataDeserializerException;
+
+  /**
+   * Gets a property object from the given InputStream.
+   *
+   * @param input stream to be de-serialized.
+   * @return Property instance.
+   */
+  ResWrap<Property> toProperty(InputStream input) throws ODataDeserializerException;
+
+  /**
+   * Gets the ODataError object represented by the given InputStream.
+   *
+   * @param input stream to be parsed and de-serialized.
+   * @return
+   */
+  ODataError toError(InputStream input) throws ODataDeserializerException;
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataDeserializerException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataDeserializerException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataDeserializerException.java
new file mode 100755
index 0000000..7852a5f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataDeserializerException.java
@@ -0,0 +1,38 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.op;
+
+import org.apache.olingo.commons.api.ODataException;
+
+public class ODataDeserializerException extends ODataException {
+
+  private static final long serialVersionUID = -3236099963180859670L;
+
+  public ODataDeserializerException(final String msg) {
+    super(msg);
+  }
+
+  public ODataDeserializerException(final Throwable cause) {
+    super(cause);
+  }
+
+  public ODataDeserializerException(final String msg, final Throwable cause) {
+    super(msg, cause);
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataSerializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataSerializer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataSerializer.java
index c8a02cf..6fc95da 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataSerializer.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataSerializer.java
@@ -18,83 +18,16 @@
  */
 package org.apache.olingo.commons.api.op;
 
-import java.io.OutputStream;
-import java.io.Serializable;
 import java.io.Writer;
-import org.apache.olingo.commons.api.data.Entity;
-import org.apache.olingo.commons.api.data.EntitySet;
-import org.apache.olingo.commons.api.data.Link;
-import org.apache.olingo.commons.api.data.Property;
-import org.apache.olingo.commons.api.format.ODataFormat;
+
+import org.apache.olingo.commons.api.data.ResWrap;
 
 /**
- * Utility class for serialization.
+ * Interface for serialization.
  */
-public interface ODataSerializer extends Serializable {
-
-  /**
-   * Writes entity set object onto the given stream.
-   *
-   * @param obj object to be streamed.
-   * @param out output stream.
-   */
-  void entitySet(EntitySet obj, OutputStream out);
-
-  /**
-   * Writes entity set object by the given writer.
-   *
-   * @param obj object to be streamed.
-   * @param writer writer.
-   */
-  void entitySet(EntitySet obj, Writer writer);
-
-  /**
-   * Writes entity object onto the given stream.
-   *
-   * @param obj object to be streamed.
-   * @param out output stream.
-   */
-  void entity(Entity obj, OutputStream out);
-
-  /**
-   * Writes entity object by the given writer.
-   *
-   * @param obj object to be streamed.
-   * @param writer writer.
-   */
-  void entity(Entity obj, Writer writer);
-
-  /**
-   * Writes the property object onto the given stream.
-   *
-   * @param property object to be streamed.
-   * @param out output stream.
-   */
-  void property(Property property, OutputStream out);
-
-  /**
-   * Writes the property object by the given writer.
-   *
-   * @param property object to be streamed.
-   * @param writer writer.
-   */
-  void property(Property property, Writer writer);
+public interface ODataSerializer {
 
-  /**
-   * Writes link onto the given stream.
-   *
-   * @param link OData link to be streamed.
-   * @param format streaming format.
-   * @param out output stream.
-   */
-  void link(Link link, ODataFormat format, OutputStream out);
+  public <T> void write(final Writer writer, final T obj) throws ODataSerializerException;
 
-  /**
-   * Writes link by the given writer.
-   *
-   * @param link OData link to be streamed.
-   * @param format streaming format.
-   * @param writer writer.
-   */
-  void link(Link link, ODataFormat format, Writer writer);
+  public <T> void write(final Writer writer, final ResWrap<T> container) throws ODataSerializerException;
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataSerializerException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataSerializerException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataSerializerException.java
new file mode 100755
index 0000000..69b5c3f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/op/ODataSerializerException.java
@@ -0,0 +1,38 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.op;
+
+import org.apache.olingo.commons.api.ODataException;
+
+public class ODataSerializerException extends ODataException {
+
+  private static final long serialVersionUID = -3236099963180859670L;
+
+  public ODataSerializerException(final String msg) {
+    super(msg);
+  }
+
+  public ODataSerializerException(final Throwable cause) {
+    super(cause);
+  }
+
+  public ODataSerializerException(final String msg, final Throwable cause) {
+    super(msg, cause);
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractEntity.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractEntity.java
deleted file mode 100644
index 7bc3fd5..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractEntity.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.core.data;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.commons.api.data.Entity;
-import org.apache.olingo.commons.api.data.Link;
-import org.apache.olingo.commons.api.data.Property;
-import org.apache.olingo.commons.api.domain.ODataOperation;
-
-/**
- * Abstract base for classes implementing an OData entity in Atom and JSON.
- */
-public abstract class AbstractEntity extends AbstractODataObject implements Entity {
-
-  private static final long serialVersionUID = 2127764552600969783L;
-
-  private String eTag;
-
-  private String type;
-
-  private Link readLink;
-
-  private Link editLink;
-
-  private final List<Link> associationLinks = new ArrayList<Link>();
-
-  private final List<Link> navigationLinks = new ArrayList<Link>();
-
-  private final List<Link> mediaEditLinks = new ArrayList<Link>();
-
-  private final List<ODataOperation> operations = new ArrayList<ODataOperation>();
-
-  private final List<Property> properties = new ArrayList<Property>();
-
-  private URI mediaContentSource;
-
-  private String mediaContentType;
-
-  private String mediaETag;
-
-  @Override
-  public String getETag() {
-    return eTag;
-  }
-
-  public void setETag(final String eTag) {
-    this.eTag = eTag;
-  }
-
-  @Override
-  public String getType() {
-    return type;
-  }
-
-  @Override
-  public void setType(final String type) {
-    this.type = type;
-  }
-
-  @Override
-  public Link getSelfLink() {
-    return readLink;
-  }
-
-  @Override
-  public void setSelfLink(final Link readLink) {
-    this.readLink = readLink;
-  }
-
-  @Override
-  public Link getEditLink() {
-    return editLink;
-  }
-
-  @Override
-  public void setEditLink(final Link editLink) {
-    this.editLink = editLink;
-  }
-
-  private Link getOneByTitle(final String name, final List<Link> links) {
-    Link result = null;
-
-    for (Link link : links) {
-      if (name.equals(link.getTitle())) {
-        result = link;
-      }
-    }
-
-    return result;
-  }
-
-  @Override
-  public Link getAssociationLink(final String name) {
-    return getOneByTitle(name, associationLinks);
-  }
-
-  @Override
-  public List<Link> getAssociationLinks() {
-    return associationLinks;
-  }
-
-  @Override
-  public Link getNavigationLink(final String name) {
-    return getOneByTitle(name, navigationLinks);
-  }
-
-  @Override
-  public List<Link> getNavigationLinks() {
-    return navigationLinks;
-  }
-
-  @Override
-  public List<Link> getMediaEditLinks() {
-    return mediaEditLinks;
-  }
-
-  @Override
-  public List<ODataOperation> getOperations() {
-    return operations;
-  }
-
-  @Override
-  public List<Property> getProperties() {
-    return properties;
-  }
-
-  @Override
-  public Property getProperty(final String name) {
-    Property result = null;
-
-    for (Property property : properties) {
-      if (name.equals(property.getName())) {
-        result = property;
-      }
-    }
-
-    return result;
-  }
-
-  @Override
-  public String getMediaContentType() {
-    return this.mediaContentType;
-  }
-
-  @Override
-  public void setMediaContentType(final String mediaContentType) {
-    this.mediaContentType = mediaContentType;
-  }
-
-  @Override
-  public URI getMediaContentSource() {
-    return this.mediaContentSource;
-  }
-
-  @Override
-  public void setMediaContentSource(final URI mediaContentSource) {
-    this.mediaContentSource = mediaContentSource;
-  }
-
-  @Override
-  public String getMediaETag() {
-    return mediaETag;
-  }
-
-  @Override
-  public void setMediaETag(final String eTag) {
-    this.mediaETag = eTag;
-  }
-
-  @Override
-  public boolean isMediaEntity() {
-    return this.mediaContentSource != null;
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/46a34178/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractEntitySet.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractEntitySet.java
deleted file mode 100644
index 510c22a..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractEntitySet.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.core.data;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.commons.api.data.Entity;
-import org.apache.olingo.commons.api.data.EntitySet;
-
-public abstract class AbstractEntitySet extends AbstractODataObject implements EntitySet {
-
-  private static final long serialVersionUID = -9159884750819150969L;
-
-  private Integer count;
-
-  private final List<Entity> entities = new ArrayList<Entity>();
-
-  private URI next;
-
-  private URI deltaLink;
-
-  @Override
-  public void setCount(final Integer count) {
-    this.count = count;
-  }
-
-  @Override
-  public Integer getCount() {
-    return count;
-  }
-
-  @Override
-  public List<Entity> getEntities() {
-    return entities;
-  }
-
-  @Override
-  public void setNext(final URI next) {
-    this.next = next;
-  }
-
-  @Override
-  public URI getNext() {
-    return next;
-  }
-
-  @Override
-  public URI getDeltaLink() {
-    return deltaLink;
-  }
-
-  @Override
-  public void setDeltaLink(final URI deltaLink) {
-    this.deltaLink = deltaLink;
-  }
-
-}