olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chr...@apache.org
Subject [08/10] olingo-odata4 git commit: [OLINGO-704] Class ODataFormat removed
Date Wed, 17 Jun 2015 15:55:32 GMT
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java
index 7966495..7813966 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java
@@ -35,24 +35,24 @@ import org.apache.olingo.client.api.domain.ClientLink;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 public class EntityCreateTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomCreateAndDelete() {
-    createAndDeleteOrder(testStaticServiceRootURL, ODataFormat.ATOM, 1000);
+    createAndDeleteOrder(testStaticServiceRootURL, ContentType.APPLICATION_ATOM_XML, 1000);
   }
 
   @Test
   public void jsonCreateAndDelete() {
-    createAndDeleteOrder(testStaticServiceRootURL, ODataFormat.JSON, 1001);
-    createAndDeleteOrder(testStaticServiceRootURL, ODataFormat.JSON_NO_METADATA, 1001);
-    createAndDeleteOrder(testStaticServiceRootURL, ODataFormat.JSON_FULL_METADATA, 1001);
+    createAndDeleteOrder(testStaticServiceRootURL, ContentType.JSON, 1001);
+    createAndDeleteOrder(testStaticServiceRootURL, ContentType.JSON_NO_METADATA, 1001);
+    createAndDeleteOrder(testStaticServiceRootURL, ContentType.JSON_FULL_METADATA, 1001);
   }
 
-  private void onContained(final ODataFormat format) {
+  private void onContained(final ContentType contentType) {
     final URI uri = getClient().newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Accounts").
         appendKeySegment(101).appendNavigationSegment("MyPaymentInstruments").build();
 
@@ -77,7 +77,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
     // 3. create it as contained entity
     final ODataEntityCreateRequest<ClientEntity> req = getClient().getCUDRequestFactory().
         getEntityCreateRequest(uri, instrument);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataEntityCreateResponse<ClientEntity> res = req.execute();
     assertEquals(201, res.getStatusCode());
@@ -102,15 +102,15 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomOnContained() {
-    onContained(ODataFormat.ATOM);
+    onContained(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonOnContained() {
-    onContained(ODataFormat.JSON);
+    onContained(ContentType.JSON);
   }
 
-  private void deepInsert(final ODataFormat format, final int productId, final int productDetailId)
+  private void deepInsert(final ContentType contentType, final int productId, final int productDetailId)
       throws EdmPrimitiveTypeException {
 
     final ClientEntity product = getClient().getObjectFactory().
@@ -161,7 +161,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
 
     final ODataEntityCreateRequest<ClientEntity> req = getClient().getCUDRequestFactory().getEntityCreateRequest(
         getClient().newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Products").build(), product);
-    req.setFormat(format);
+    req.setFormat(contentType);
     final ODataEntityCreateResponse<ClientEntity> res = req.execute();
     assertEquals(201, res.getStatusCode());
 
@@ -181,11 +181,11 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomDeepInsert() throws EdmPrimitiveTypeException {
-    deepInsert(ODataFormat.ATOM, 10, 10);
+    deepInsert(ContentType.APPLICATION_ATOM_XML, 10, 10);
   }
 
   @Test
   public void jsonDeepInsert() throws EdmPrimitiveTypeException {
-    deepInsert(ODataFormat.JSON_FULL_METADATA, 11, 11);
+    deepInsert(ContentType.JSON_FULL_METADATA, 11, 11);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java
index 91461db..903684d 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java
@@ -45,7 +45,8 @@ import org.apache.olingo.client.api.domain.ClientProperty;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
+import org.apache.olingo.commons.api.format.Format;
 import org.junit.Test;
 
 /**
@@ -53,13 +54,13 @@ import org.junit.Test;
  */
 public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
-  private void withInlineEntity(final ODataClient client, final ODataFormat format) {
+  private void withInlineEntity(final ODataClient client, final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Customers").appendKeySegment(1).expand("Company");
 
     final ODataEntityRequest<ClientEntity> req = client.getRetrieveRequestFactory().
         getEntityRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataRetrieveResponse<ClientEntity> res = req.execute();
     final ClientEntity entity = res.getBody();
@@ -70,11 +71,12 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
     assertEquals("Edm.GeographyPoint", entity.getProperty("Home").getPrimitiveValue().getTypeName());
 
     // In JSON with minimal metadata, links are not provided
-    if (format == ODataFormat.ATOM || format == ODataFormat.JSON_FULL_METADATA) {
+    if (contentType.getODataFormat() == Format.ATOM 
+        || contentType.getODataFormat() == Format.JSON_FULL_METADATA) {
       assertEquals(testStaticServiceRootURL + "/Customers(1)", entity.getEditLink().toASCIIString());
       assertEquals(3, entity.getNavigationLinks().size());
 
-      if (ODataFormat.ATOM == format) {
+      if (ContentType.APPLICATION_ATOM_XML == contentType) {
         assertTrue(entity.getAssociationLinks().isEmpty());
         // In JSON, association links for each $ref link will exist.
       }
@@ -110,26 +112,26 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
   @Test
   public void withInlineEntityFromAtom() {
-    withInlineEntity(client, ODataFormat.ATOM);
+    withInlineEntity(client, ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void withInlineEntityFromFullJSON() {
-    withInlineEntity(client, ODataFormat.JSON_FULL_METADATA);
+    withInlineEntity(client, ContentType.JSON_FULL_METADATA);
   }
 
   @Test
   public void withInlineEntityFromJSON() {
-    withInlineEntity(edmClient, ODataFormat.JSON);
+    withInlineEntity(edmClient, ContentType.JSON);
   }
 
-  private void withInlineEntitySet(final ODataClient client, final ODataFormat format) {
+  private void withInlineEntitySet(final ODataClient client, final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Customers").appendKeySegment(1).expand("Orders");
 
     final ODataEntityRequest<ClientEntity> req = client.getRetrieveRequestFactory().
         getEntityRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataRetrieveResponse<ClientEntity> res = req.execute();
     final ClientEntity entity = res.getBody();
@@ -137,7 +139,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
     assertEquals("Microsoft.Test.OData.Services.ODataWCFService.Customer", entity.getTypeName().toString());
 
     // In JSON with minimal metadata, links are not provided
-    if (format == ODataFormat.ATOM || format == ODataFormat.JSON_FULL_METADATA) {
+    if (contentType.equals(ContentType.APPLICATION_ATOM_XML) || contentType.equals(ContentType.JSON_FULL_METADATA)) {
       boolean found = false;
       for (ClientLink link : entity.getNavigationLinks()) {
         if (link instanceof ClientInlineEntitySet) {
@@ -153,25 +155,25 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
   @Test
   public void withInlineEntitySetFromAtom() {
-    withInlineEntitySet(client, ODataFormat.ATOM);
+    withInlineEntitySet(client, ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void withInlineEntitySetFromFullJSON() {
-    withInlineEntitySet(client, ODataFormat.JSON_FULL_METADATA);
+    withInlineEntitySet(client, ContentType.JSON_FULL_METADATA);
   }
 
   @Test
   public void withInlineEntitySetFromJSON() {
-    withInlineEntitySet(edmClient, ODataFormat.JSON);
+    withInlineEntitySet(edmClient, ContentType.JSON);
   }
 
-  private void rawRequest(final ODataFormat format) {
+  private void rawRequest(final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5);
 
     final ODataRawRequest req = client.getRetrieveRequestFactory().getRawRequest(uriBuilder.build());
-    req.setFormat(format.getContentType().toContentTypeString());
+    req.setFormat(contentType.toContentTypeString());
 
     final ODataRawResponse res = req.execute();
     assertNotNull(res);
@@ -185,16 +187,16 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
   @Test
   public void rawRequestAsAtom() {
-    rawRequest(ODataFormat.ATOM);
+    rawRequest(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void rawRequestAsJSON() {
     // this needs to be full, otherwise reference will not be provided
-    rawRequest(ODataFormat.JSON_FULL_METADATA);
+    rawRequest(ContentType.JSON_FULL_METADATA);
   }
 
-  private void multiKey(final ODataFormat format) throws EdmPrimitiveTypeException {
+  private void multiKey(final ContentType contentType) throws EdmPrimitiveTypeException {
     final LinkedHashMap<String, Object> multiKey = new LinkedHashMap<String, Object>();
     multiKey.put("ProductID", "6");
     multiKey.put("ProductDetailID", 1);
@@ -204,7 +206,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
     final ODataEntityRequest<ClientEntity> req =
         client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataRetrieveResponse<ClientEntity> res = req.execute();
     final ClientEntity entity = res.getBody();
@@ -215,21 +217,21 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
   @Test
   public void multiKeyAsAtom() throws EdmPrimitiveTypeException {
-    multiKey(ODataFormat.ATOM);
+    multiKey(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void multiKeyAsJSON() throws EdmPrimitiveTypeException {
-    multiKey(ODataFormat.JSON_FULL_METADATA);
+    multiKey(ContentType.JSON_FULL_METADATA);
   }
 
-  private void checkForETag(final ODataClient client, final ODataFormat format) {
+  private void checkForETag(final ODataClient client, final ContentType contentType) {
     final URIBuilder uriBuilder =
         client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Orders").appendKeySegment(8);
 
     final ODataEntityRequest<ClientEntity> req =
         client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataRetrieveResponse<ClientEntity> res = req.execute();
     assertEquals(200, res.getStatusCode());
@@ -248,17 +250,17 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
   @Test
   public void checkForETagAsAtom() {
-    checkForETag(client, ODataFormat.ATOM);
+    checkForETag(client, ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void checkForETagAsFullJSON() {
-    checkForETag(client, ODataFormat.JSON_FULL_METADATA);
+    checkForETag(client, ContentType.JSON_FULL_METADATA);
   }
 
   @Test
   public void checkForETagAsJSON() {
-    checkForETag(edmClient, ODataFormat.JSON);
+    checkForETag(edmClient, ContentType.JSON);
   }
 
   @Test(expected = IllegalArgumentException.class)
@@ -267,20 +269,20 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
     final ODataEntityRequest<ClientEntity> req =
         client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.JSON);
+    req.setFormat(ContentType.JSON);
 
     // this statement should cause an IllegalArgumentException bearing JsonParseException
     // since we are attempting to parse an EntitySet as if it was an Entity
     req.execute().getBody();
   }
 
-  private void reference(final ODataFormat format) {
+  private void reference(final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Orders").appendKeySegment(8).appendNavigationSegment("CustomerForOrder").
         appendRefSegment();
 
     ODataEntityRequest<ClientEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     ODataRetrieveResponse<ClientEntity> res = req.execute();
     assertNotNull(res);
@@ -293,7 +295,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
         appendEntityIdSegment(entity.getId().toASCIIString()).build();
 
     req = client.getRetrieveRequestFactory().getEntityRequest(referenceURI);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     res = req.execute();
     assertNotNull(res);
@@ -302,20 +304,20 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomReference() {
-    reference(ODataFormat.ATOM);
+    reference(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonReference() {
-    reference(ODataFormat.JSON_FULL_METADATA);
+    reference(ContentType.JSON_FULL_METADATA);
   }
 
-  private void contained(final ODataClient client, final ODataFormat format) throws EdmPrimitiveTypeException {
+  private void contained(final ODataClient client, final ContentType contentType) throws EdmPrimitiveTypeException {
     final URI uri = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Accounts").appendKeySegment(101).
         appendNavigationSegment("MyPaymentInstruments").appendKeySegment(101902).build();
     final ODataEntityRequest<ClientEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uri);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ClientEntity contained = req.execute().getBody();
     assertNotNull(contained);
@@ -328,30 +330,30 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
   @Test
   public void containedFromAtom() throws EdmPrimitiveTypeException {
-    contained(client, ODataFormat.ATOM);
+    contained(client, ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void containedFromFullJSON() throws EdmPrimitiveTypeException {
-    contained(client, ODataFormat.JSON_FULL_METADATA);
+    contained(client, ContentType.JSON_FULL_METADATA);
   }
 
   @Test
   public void containedFromJSON() throws EdmPrimitiveTypeException {
-    contained(edmClient, ODataFormat.JSON);
+    contained(edmClient, ContentType.JSON);
   }
 
-  private void entitySetNavigationLink(final ODataClient client, final ODataFormat format) {
+  private void entitySetNavigationLink(final ODataClient client, final ContentType contentType) {
     final URI uri = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Accounts").appendKeySegment(101).build();
     final ODataEntityRequest<ClientEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uri);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ClientEntity entity = req.execute().getBody();
     assertNotNull(entity);
 
     // With JSON, entity set navigation links are only recognizable via Edm
-    if (format == ODataFormat.ATOM || client instanceof EdmEnabledODataClient) {
+    if (contentType.equals(ContentType.APPLICATION_ATOM_XML) || client instanceof EdmEnabledODataClient) {
       assertEquals(ClientLinkType.ENTITY_SET_NAVIGATION, entity.getNavigationLink("MyPaymentInstruments").getType());
       assertEquals(ClientLinkType.ENTITY_SET_NAVIGATION, entity.getNavigationLink("ActiveSubscriptions").getType());
     }
@@ -359,13 +361,13 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
   @Test
   public void entitySetNavigationLinkFromAtom() {
-    entitySetNavigationLink(client, ODataFormat.ATOM);
+    entitySetNavigationLink(client, ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void entitySetNavigationLinkFromJSON() {
     // only JSON_FULL_METADATA has links, only Edm can recognize entity set navigation
-    entitySetNavigationLink(edmClient, ODataFormat.JSON_FULL_METADATA);
+    entitySetNavigationLink(edmClient, ContentType.JSON_FULL_METADATA);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java
index b94e891..64d425b 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java
@@ -37,7 +37,7 @@ import org.apache.olingo.client.api.domain.ClientEntitySetIterator;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.commons.api.data.ResWrap;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 /**
@@ -45,11 +45,11 @@ import org.junit.Test;
  */
 public class EntitySetTestITCase extends AbstractTestITCase {
 
-  private void rawRequest(final ODataFormat format) {
+  private void rawRequest(final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("People");
 
     final ODataRawRequest req = client.getRetrieveRequestFactory().getRawRequest(uriBuilder.build());
-    req.setFormat(format.getContentType().toContentTypeString());
+    req.setFormat(contentType.toContentTypeString());
 
     final ODataRawResponse res = req.execute();
     assertNotNull(res);
@@ -61,20 +61,20 @@ public class EntitySetTestITCase extends AbstractTestITCase {
 
   @Test
   public void rawRequestAsAtom() throws IOException {
-    rawRequest(ODataFormat.ATOM);
+    rawRequest(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void rawRequestAsJSON() throws IOException {
-    rawRequest(ODataFormat.JSON);
+    rawRequest(ContentType.JSON);
   }
 
-  private void readWithInlineCount(final ODataClient client, final ODataFormat format) {
+  private void readWithInlineCount(final ODataClient client, final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").count(true);
 
     final ODataRawRequest req = client.getRetrieveRequestFactory().getRawRequest(uriBuilder.build());
-    req.setFormat(format.getContentType().toContentTypeString());
+    req.setFormat(contentType.toContentTypeString());
 
     final ODataRawResponse res = req.execute();
     assertNotNull(res);
@@ -88,25 +88,25 @@ public class EntitySetTestITCase extends AbstractTestITCase {
 
   @Test
   public void readWithInlineCountAsJSON() throws IOException {
-    readWithInlineCount(edmClient, ODataFormat.JSON);
+    readWithInlineCount(edmClient, ContentType.JSON);
   }
 
   @Test
   public void readWithInlineCountAsFullJSON() throws IOException {
-    readWithInlineCount(client, ODataFormat.JSON_FULL_METADATA);
+    readWithInlineCount(client, ContentType.JSON_FULL_METADATA);
   }
 
   @Test
   public void readWithInlineCountAsAtom() throws IOException {
-    readWithInlineCount(client, ODataFormat.ATOM);
+    readWithInlineCount(client, ContentType.APPLICATION_ATOM_XML);
   }
 
-  private void readODataEntitySetIterator(final ODataFormat format) {
+  private void readODataEntitySetIterator(final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("People");
 
     final ODataEntitySetIteratorRequest<ClientEntitySet, ClientEntity> req =
         client.getRetrieveRequestFactory().getEntitySetIteratorRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataRetrieveResponse<ClientEntitySetIterator<ClientEntitySet, ClientEntity>> res = req.execute();
     final ClientEntitySetIterator<ClientEntitySet, ClientEntity> feedIterator = res.getBody();
@@ -125,25 +125,25 @@ public class EntitySetTestITCase extends AbstractTestITCase {
 
   @Test
   public void readODataEntitySetIteratorFromAtom() {
-    readODataEntitySetIterator(ODataFormat.ATOM);
+    readODataEntitySetIterator(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void readODataEntitySetIteratorFromJSON() {
-    readODataEntitySetIterator(ODataFormat.JSON);
+    readODataEntitySetIterator(ContentType.JSON);
   }
 
   @Test
   public void readODataEntitySetIteratorFromJSONFull() {
-    readODataEntitySetIterator(ODataFormat.JSON_FULL_METADATA);
+    readODataEntitySetIterator(ContentType.JSON_FULL_METADATA);
   }
 
   @Test
   public void readODataEntitySetIteratorFromJSONNo() {
-    readODataEntitySetIterator(ODataFormat.JSON_NO_METADATA);
+    readODataEntitySetIterator(ContentType.JSON_NO_METADATA);
   }
 
-  private void readWithNext(final ODataFormat format) {
+  private void readWithNext(final ContentType format) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("People");
 
     final ODataEntitySetRequest<ClientEntitySet> req = client.getRetrieveRequestFactory().
@@ -167,12 +167,12 @@ public class EntitySetTestITCase extends AbstractTestITCase {
 
   @Test
   public void readWithNextFromAtom() {
-    readWithNext(ODataFormat.ATOM);
+    readWithNext(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void readWithNextFromJSON() {
-    readWithNext(ODataFormat.JSON_FULL_METADATA);
+    readWithNext(ContentType.JSON_FULL_METADATA);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java
index 6ac0e8d..8750348 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java
@@ -37,13 +37,13 @@ import org.apache.olingo.client.api.domain.ClientLink;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Ignore;
 import org.junit.Test;
 
 public class EntityUpdateTestITCase extends AbstractTestITCase {
 
-  private void upsert(final UpdateType updateType, final ODataFormat format) {
+  private void upsert(final UpdateType updateType, final ContentType contentType) {
     final ClientEntity order = getClient().getObjectFactory().
         newEntity(new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Order"));
 
@@ -61,11 +61,11 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
         appendEntitySetSegment("Orders").appendKeySegment(9).build();
     final ODataEntityUpdateRequest<ClientEntity> req = getClient().getCUDRequestFactory().
         getEntityUpdateRequest(upsertURI, updateType, order);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     req.execute();
     try {
-      final ClientEntity read = read(format, upsertURI);
+      final ClientEntity read = read(contentType, upsertURI);
       assertNotNull(read);
       assertEquals(order.getProperty("OrderID"), read.getProperty("OrderID"));
       assertEquals(order.getProperty("OrderDate").getPrimitiveValue().toString(),
@@ -103,17 +103,17 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomUpsert() {
-    upsert(UpdateType.PATCH, ODataFormat.ATOM);
-    upsert(UpdateType.REPLACE, ODataFormat.ATOM);
+    upsert(UpdateType.PATCH, ContentType.APPLICATION_ATOM_XML);
+    upsert(UpdateType.REPLACE, ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonUpsert() {
-    upsert(UpdateType.PATCH, ODataFormat.JSON);
-    upsert(UpdateType.REPLACE, ODataFormat.JSON);
+    upsert(UpdateType.PATCH, ContentType.JSON);
+    upsert(UpdateType.REPLACE, ContentType.JSON);
   }
 
-  private void onContained(final ODataFormat format) {
+  private void onContained(final ContentType contentType) {
     final String newName = UUID.randomUUID().toString();
     final ClientEntity changes = getClient().getObjectFactory().newEntity(
         new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument"));
@@ -125,7 +125,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
         appendNavigationSegment("MyPaymentInstruments").appendKeySegment(101901).build();
     final ODataEntityUpdateRequest<ClientEntity> req = getClient().getCUDRequestFactory().
         getEntityUpdateRequest(uri, UpdateType.PATCH, changes);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataEntityUpdateResponse<ClientEntity> res = req.execute();
     assertEquals(204, res.getStatusCode());
@@ -137,15 +137,15 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomOnContained() {
-    onContained(ODataFormat.ATOM);
+    onContained(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonOnContained() {
-    onContained(ODataFormat.JSON);
+    onContained(ContentType.JSON);
   }
 
-  private void bindOperation(final ODataFormat format) throws EdmPrimitiveTypeException {
+  private void bindOperation(final ContentType contentType) throws EdmPrimitiveTypeException {
     final ClientEntity changes = getClient().getObjectFactory().newEntity(
         new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Customer"));
     final ClientLink parent = getClient().getObjectFactory().newEntityNavigationLink("Parent",
@@ -157,7 +157,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
         appendEntitySetSegment("People").appendKeySegment(5).build();
     final ODataEntityUpdateRequest<ClientEntity> req = getClient().getCUDRequestFactory().
         getEntityUpdateRequest(uri, UpdateType.PATCH, changes);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataEntityUpdateResponse<ClientEntity> res = req.execute();
     assertEquals(204, res.getStatusCode());
@@ -175,11 +175,11 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomBindOperation() throws EdmPrimitiveTypeException {
-    bindOperation(ODataFormat.ATOM);
+    bindOperation(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonBindOperation() throws EdmPrimitiveTypeException {
-    bindOperation(ODataFormat.JSON);
+    bindOperation(ContentType.JSON);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
index 33d3ba4..9839576 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
@@ -27,7 +27,7 @@ import java.util.Map;
 import org.apache.olingo.client.api.communication.ODataClientErrorException;
 import org.apache.olingo.commons.api.ODataError;
 import org.apache.olingo.commons.api.ODataErrorDetail;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 public class ErrorResponseTestITCase extends AbstractTestITCase {
@@ -39,7 +39,7 @@ public class ErrorResponseTestITCase extends AbstractTestITCase {
         build();
 
     try {
-      read(ODataFormat.JSON, readURI);
+      read(ContentType.JSON, readURI);
       fail("should have got exception");
     } catch (Exception ex) {
       final ODataError err = ((ODataClientErrorException) ex).getODataError();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java
index b7a4f8c..f25cfd3 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java
@@ -27,7 +27,7 @@ import org.apache.olingo.client.api.uri.FilterArgFactory;
 import org.apache.olingo.client.api.uri.FilterFactory;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.client.api.uri.URIFilter;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 public class FilterFactoryTestITCase extends AbstractTestITCase {
@@ -50,7 +50,7 @@ public class FilterFactoryTestITCase extends AbstractTestITCase {
 
     final ODataEntitySetRequest<ClientEntitySet> req =
         client.getRetrieveRequestFactory().getEntitySetRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.JSON_FULL_METADATA);
+    req.setFormat(ContentType.JSON_FULL_METADATA);
 
     final ClientEntitySet feed = req.execute().getBody();
     assertEquals(3, feed.getEntities().size());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java
index 648dcec..f738ed4 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java
@@ -40,7 +40,7 @@ import org.apache.olingo.commons.api.data.EntityCollection;
 import org.apache.olingo.commons.api.data.ResWrap;
 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.format.ContentType;
 import org.junit.Test;
 
 /**
@@ -91,7 +91,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
     final URI uri = edmClient.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Accounts").appendKeySegment(102).build();
     final ODataEntityRequest<ClientEntity> req = edmClient.getRetrieveRequestFactory().getEntityRequest(uri);
-    req.setFormat(ODataFormat.JSON_FULL_METADATA);
+    req.setFormat(ContentType.JSON_FULL_METADATA);
 
     // request format (via Accept header) is set to full metadata
     assertEquals("application/json;odata.metadata=full", req.getAccept());
@@ -148,7 +148,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
         + "\"GeographyPoint\": {\"type\": \"Point\",\"coordinates\":[142.1,64.1]}"
         + "}";
 
-    final ClientEntity entity = client.getReader().readEntity(IOUtils.toInputStream(fromSection71), ODataFormat.JSON);
+    final ClientEntity entity = client.getReader().readEntity(IOUtils.toInputStream(fromSection71), ContentType.JSON);
 
     assertTrue(entity.getProperty("NullValue").hasNullValue());
 
@@ -219,7 +219,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
         + "}";
 
     final ResWrap<Entity> entity =
-        client.getDeserializer(ODataFormat.JSON).toEntity(IOUtils.toInputStream(fromSection45_1));
+        client.getDeserializer(ContentType.JSON).toEntity(IOUtils.toInputStream(fromSection45_1));
 
     assertEquals("http://host/service/$metadata#Customers/$entity", entity.getContextURL().toASCIIString());
     assertEquals("W/\"A1FF3E230954908F\"", entity.getMetadataETag());
@@ -241,7 +241,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
         + "}";
 
     final ResWrap<EntityCollection> entitySet =
-        client.getDeserializer(ODataFormat.JSON).toEntitySet(IOUtils.toInputStream(fromSection45_2));
+        client.getDeserializer(ContentType.JSON).toEntitySet(IOUtils.toInputStream(fromSection45_2));
 
     assertEquals(5, entitySet.getPayload().getCount(), 0);
     assertEquals("Customers?$expand=Orders&$skipToken=5", entitySet.getPayload().getNext().toASCIIString());
@@ -271,7 +271,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
         + "}";
 
     final ClientEntitySet entitySet = client.getReader().
-        readEntitySet(IOUtils.toInputStream(sample), ODataFormat.JSON);
+        readEntitySet(IOUtils.toInputStream(sample), ContentType.JSON);
 
     assertEquals(2, entitySet.getAnnotations().size());
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java
index f3e7d76..54206fb 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java
@@ -33,7 +33,7 @@ import org.apache.olingo.client.api.domain.ClientEntity;
 import org.apache.olingo.client.api.domain.ClientProperty;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -50,20 +50,20 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
     client.getConfiguration().setKeyAsSegment(false);
   }
 
-  private void read(final ODataFormat format) {
+  private void read(final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testKeyAsSegmentServiceRootURL).
         appendEntitySetSegment("Accounts").appendKeySegment(101);
 
     final ODataEntityRequest<ClientEntity> req =
         client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataRetrieveResponse<ClientEntity> res = req.execute();
     final ClientEntity entity = res.getBody();
     assertNotNull(entity);
 
     // In JSON with minimal metadata, links are not provided
-    if (format == ODataFormat.ATOM || format == ODataFormat.JSON_FULL_METADATA) {
+    if (contentType.equals(ContentType.APPLICATION_ATOM_XML) || contentType.equals(ContentType.JSON_FULL_METADATA)) {
       assertFalse(entity.getEditLink().toASCIIString().contains("("));
       assertFalse(entity.getEditLink().toASCIIString().contains(")"));
     }
@@ -71,25 +71,25 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomRead() {
-    read(ODataFormat.ATOM);
+    read(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonRead() {
-    read(ODataFormat.JSON);
+    read(ContentType.JSON);
   }
 
   @Test
   public void atomCreateAndDelete() {
-    createAndDeleteOrder(testKeyAsSegmentServiceRootURL, ODataFormat.ATOM, 1000);
+    createAndDeleteOrder(testKeyAsSegmentServiceRootURL, ContentType.APPLICATION_ATOM_XML, 1000);
   }
 
   @Test
   public void jsonCreateAndDelete() {
-    createAndDeleteOrder(testKeyAsSegmentServiceRootURL, ODataFormat.JSON_FULL_METADATA, 1001);
+    createAndDeleteOrder(testKeyAsSegmentServiceRootURL, ContentType.JSON_FULL_METADATA, 1001);
   }
 
-  private void update(final ODataFormat format) {
+  private void update(final ContentType contentType) {
     final ClientEntity changes = getClient().getObjectFactory().newEntity(
         new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Customer"));
     final ClientProperty middleName = getClient().getObjectFactory().newPrimitiveProperty("MiddleName",
@@ -100,7 +100,7 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
         appendEntitySetSegment("People").appendKeySegment(5).build();
     final ODataEntityUpdateRequest<ClientEntity> req = getClient().getCUDRequestFactory().
         getEntityUpdateRequest(uri, UpdateType.PATCH, changes);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataEntityUpdateResponse<ClientEntity> res = req.execute();
     assertEquals(204, res.getStatusCode());
@@ -117,11 +117,11 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomUpdate() {
-    update(ODataFormat.ATOM);
+    update(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonUpdate() {
-    update(ODataFormat.JSON);
+    update(ContentType.JSON);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
index a39e71b..0c6352d 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
@@ -52,18 +52,18 @@ import org.apache.olingo.client.core.ODataClientFactory;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 public class MediaEntityTestITCase extends AbstractTestITCase {
 
-  private void read(final ODataClient client, final ODataFormat format) throws IOException {
+  private void read(final ODataClient client, final ContentType contentType) throws IOException {
     final URIBuilder builder = client.newURIBuilder(testDemoServiceRootURL).
         appendEntitySetSegment("Advertisements").
         appendKeySegment(UUID.fromString("f89dee73-af9f-4cd4-b330-db93c25ff3c7"));
     final ODataEntityRequest<ClientEntity> entityReq =
         client.getRetrieveRequestFactory().getEntityRequest(builder.build());
-    entityReq.setFormat(format);
+    entityReq.setFormat(contentType);
 
     final ClientEntity entity = entityReq.execute().getBody();
     assertNotNull(entity);
@@ -83,20 +83,20 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
 
   @Test
   public void readAsAtom() throws IOException {
-    read(client, ODataFormat.ATOM);
+    read(client, ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void readAsJSON() throws IOException {
-    read(ODataClientFactory.getEdmEnabledClient(testDemoServiceRootURL), ODataFormat.JSON);
+    read(ODataClientFactory.getEdmEnabledClient(testDemoServiceRootURL), ContentType.JSON);
   }
 
   @Test
   public void readAsJSONFull() throws IOException {
-    read(client, ODataFormat.JSON_FULL_METADATA);
+    read(client, ContentType.JSON_FULL_METADATA);
   }
 
-  private void create(final ODataFormat format) throws IOException {
+  private void create(final ContentType contentType) throws IOException {
     final String random = RandomStringUtils.random(110);
     final InputStream input = IOUtils.toInputStream(random);
 
@@ -120,7 +120,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
 
     final ODataEntityUpdateRequest<ClientEntity> updateReq = getClient().getCUDRequestFactory().
         getEntityUpdateRequest(createdLocation, UpdateType.PATCH, changes);
-    updateReq.setFormat(format);
+    updateReq.setFormat(contentType);
 
     final ODataEntityUpdateResponse<ClientEntity> updateRes = updateReq.execute();
     assertEquals(204, updateRes.getStatusCode());
@@ -137,15 +137,15 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
 
   @Test
   public void createAsAtom() throws IOException {
-    create(ODataFormat.ATOM);
+    create(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void createAsJSON() throws IOException {
-    create(ODataFormat.JSON);
+    create(ContentType.JSON);
   }
 
-  private void update(final ODataFormat format) throws IOException, EdmPrimitiveTypeException {
+  private void update(final ContentType contentType) throws IOException, EdmPrimitiveTypeException {
     final URI uri = client.newURIBuilder(testDemoServiceRootURL).
         appendEntitySetSegment("Advertisements").
         appendKeySegment(UUID.fromString("f89dee73-af9f-4cd4-b330-db93c25ff3c7")).build();
@@ -155,7 +155,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
     // 1. update providing media content
     final ODataMediaEntityUpdateRequest<ClientEntity> updateReq = client.getCUDRequestFactory().
         getMediaEntityUpdateRequest(uri, IOUtils.toInputStream(random));
-    updateReq.setFormat(format);
+    updateReq.setFormat(contentType);
 
     final MediaEntityUpdateStreamManager<ClientEntity> streamManager = updateReq.payloadManager();
     final ODataMediaEntityUpdateResponse<ClientEntity> createRes = streamManager.getResponse();
@@ -173,11 +173,11 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
 
   @Test
   public void updateAsAtom() throws IOException, EdmPrimitiveTypeException {
-    update(ODataFormat.ATOM);
+    update(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void updateAsJSON() throws IOException, EdmPrimitiveTypeException {
-    update(ODataFormat.JSON);
+    update(ContentType.JSON);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java
index 7e8c131..1285fa2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java
@@ -32,7 +32,7 @@ import org.apache.olingo.client.api.domain.ClientEntity;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.client.core.ODataClientFactory;
 import org.apache.olingo.client.core.http.DefaultHttpClientFactory;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.fit.CXFOAuth2HttpClientFactory;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -76,13 +76,13 @@ public class OAuth2TestITCase extends AbstractTestITCase {
     return _edmClient;
   }
 
-  private void read(final ODataClient client, final ODataFormat format) {
+  private void read(final ODataClient client, final ContentType contentType) {
     final URIBuilder uriBuilder =
         client.newURIBuilder(testOAuth2ServiceRootURL).appendEntitySetSegment("Orders").appendKeySegment(8);
 
     final ODataEntityRequest<ClientEntity> req =
         client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataRetrieveResponse<ClientEntity> res = req.execute();
     assertEquals(200, res.getStatusCode());
@@ -127,19 +127,19 @@ public class OAuth2TestITCase extends AbstractTestITCase {
   }
 
   public void readAsAtom() {
-    read(getLocalClient(), ODataFormat.ATOM);
+    read(getLocalClient(), ContentType.APPLICATION_ATOM_XML);
   }
 
   public void readAsFullJSON() {
-    read(getLocalClient(), ODataFormat.JSON_FULL_METADATA);
+    read(getLocalClient(), ContentType.JSON_FULL_METADATA);
   }
 
   public void readAsJSON() {
-    read(getEdmClient(), ODataFormat.JSON);
+    read(getEdmClient(), ContentType.JSON);
   }
 
   public void createAndDelete() {
-    createAndDeleteOrder(testOAuth2ServiceRootURL, ODataFormat.JSON, 1002);
+    createAndDeleteOrder(testOAuth2ServiceRootURL, ContentType.JSON, 1002);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java
index f4fe4f8..c3b0337 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java
@@ -36,7 +36,7 @@ import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.EdmSchema;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 public class OpenTypeTestITCase extends AbstractTestITCase {
@@ -53,32 +53,32 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
     assertTrue(metadata.getEntityType(new FullQualifiedName(schema.getNamespace(), "RowIndex")).isOpenType());
   }
 
-  private ClientEntity readRow(final ODataFormat format, final String uuid) {
+  private ClientEntity readRow(final ContentType contentType, final String uuid) {
     final URIBuilder builder = getClient().newURIBuilder(testOpenTypeServiceRootURL).
         appendEntitySetSegment("Row").appendKeySegment(UUID.fromString(uuid));
-    return read(format, builder.build());
+    return read(contentType, builder.build());
   }
 
-  private void read(final ODataFormat format) {
-    ClientEntity row = readRow(format, "71f7d0dc-ede4-45eb-b421-555a2aa1e58f");
+  private void read(final ContentType contentType) {
+    ClientEntity row = readRow(contentType, "71f7d0dc-ede4-45eb-b421-555a2aa1e58f");
     assertEquals(EdmPrimitiveTypeKind.Double, row.getProperty("Double").getPrimitiveValue().getTypeKind());
     assertEquals(EdmPrimitiveTypeKind.Guid, row.getProperty("Id").getPrimitiveValue().getTypeKind());
 
-    row = readRow(format, "672b8250-1e6e-4785-80cf-b94b572e42b3");
+    row = readRow(contentType, "672b8250-1e6e-4785-80cf-b94b572e42b3");
     assertEquals(EdmPrimitiveTypeKind.Decimal, row.getProperty("Decimal").getPrimitiveValue().getTypeKind());
   }
 
   @Test
   public void readAsAtom() {
-    read(ODataFormat.ATOM);
+    read(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void readAsJSON() {
-    read(ODataFormat.JSON_FULL_METADATA);
+    read(ContentType.JSON_FULL_METADATA);
   }
 
-  private void cud(final ODataFormat format) {
+  private void cud(final ContentType contentType) {
     final Integer id = 1426;
 
     ClientEntity rowIndex = getClient().getObjectFactory().newEntity(
@@ -154,13 +154,13 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
     final ODataEntityCreateRequest<ClientEntity> createReq = getClient().getCUDRequestFactory().
         getEntityCreateRequest(getClient().newURIBuilder(testOpenTypeServiceRootURL).
             appendEntitySetSegment("RowIndex").build(), rowIndex);
-    createReq.setFormat(format);
+    createReq.setFormat(contentType);
     final ODataEntityCreateResponse<ClientEntity> createRes = createReq.execute();
     assertEquals(201, createRes.getStatusCode());
 
     final URIBuilder builder = getClient().newURIBuilder(testOpenTypeServiceRootURL).
         appendEntitySetSegment("RowIndex").appendKeySegment(id);
-    rowIndex = read(format, builder.build());
+    rowIndex = read(contentType, builder.build());
     assertNotNull(rowIndex);
     assertEquals(EdmPrimitiveTypeKind.Int32, rowIndex.getProperty("Id").getPrimitiveValue().getTypeKind());
     assertEquals(EdmPrimitiveTypeKind.String, rowIndex.getProperty("aString").getPrimitiveValue().getTypeKind());
@@ -179,12 +179,12 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
 
   @Test
   public void cudAsAtom() {
-    cud(ODataFormat.ATOM);
+    cud(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void cudAsJSON() {
-    cud(ODataFormat.JSON_FULL_METADATA);
+    cud(ContentType.JSON_FULL_METADATA);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java
index 1b27efa..d6d535b 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java
@@ -37,17 +37,17 @@ import org.apache.olingo.client.api.domain.ClientPrimitiveValue;
 import org.apache.olingo.client.api.domain.ClientProperty;
 import org.apache.olingo.client.api.domain.ClientValue;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 public class OperationImportInvokeTestITCase extends AbstractTestITCase {
 
-  private void functionImports(final ODataFormat format) throws EdmPrimitiveTypeException {
+  private void functionImports(final ContentType contentType) throws EdmPrimitiveTypeException {
     // GetDefaultColor
     final ODataInvokeRequest<ClientProperty> defaultColorReq = getClient().getInvokeRequestFactory().
         getFunctionInvokeRequest(getClient().newURIBuilder(testStaticServiceRootURL).
             appendOperationCallSegment("GetDefaultColor").build(), ClientProperty.class);
-    defaultColorReq.setFormat(format);
+    defaultColorReq.setFormat(contentType);
     final ClientProperty defaultColor = defaultColorReq.execute().getBody();
     assertNotNull(defaultColor);
     assertTrue(defaultColor.hasEnumValue());
@@ -61,7 +61,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
         getFunctionInvokeRequest(getClient().newURIBuilder(testStaticServiceRootURL).
             appendOperationCallSegment("GetPerson2").build(), ClientEntity.class,
             Collections.<String, ClientValue> singletonMap("city", city));
-    person2Req.setFormat(format);
+    person2Req.setFormat(contentType);
     final ClientEntity person2 = person2Req.execute().getBody();
     assertNotNull(person2);
     assertEquals("Microsoft.Test.OData.Services.ODataWCFService.Customer", person2.getTypeName().toString());
@@ -81,7 +81,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
         getFunctionInvokeRequest(getClient().newURIBuilder(testStaticServiceRootURL).
             appendOperationCallSegment("GetPerson").build(), ClientEntity.class,
             Collections.<String, ClientValue> singletonMap("address", address));
-    personReq.setFormat(format);
+    personReq.setFormat(contentType);
     final ClientEntity person = personReq.execute().getBody();
     assertNotNull(person);
     assertEquals(person2, person);
@@ -90,7 +90,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
     final ODataInvokeRequest<ClientEntitySet> productsReq = getClient().getInvokeRequestFactory()
         .getFunctionInvokeRequest(getClient().newURIBuilder(testStaticServiceRootURL).
             appendOperationCallSegment("GetAllProducts").build(), ClientEntitySet.class);
-    productsReq.setFormat(format);
+    productsReq.setFormat(contentType);
     final ClientEntitySet products = productsReq.execute().getBody();
     assertNotNull(products);
     assertEquals(5, products.getEntities().size());
@@ -103,7 +103,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
         getFunctionInvokeRequest(getClient().newURIBuilder(testStaticServiceRootURL).
             appendOperationCallSegment("GetProductsByAccessLevel").build(), ClientProperty.class,
             Collections.<String, ClientValue> singletonMap("accessLevel", accessLevel));
-    prodByALReq.setFormat(format);
+    prodByALReq.setFormat(contentType);
     final ClientProperty prodByAL = prodByALReq.execute().getBody();
     assertNotNull(prodByAL);
     assertTrue(prodByAL.hasCollectionValue());
@@ -113,12 +113,12 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomFunctionImports() throws EdmPrimitiveTypeException {
-    functionImports(ODataFormat.ATOM);
+    functionImports(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonFunctionImports() throws EdmPrimitiveTypeException {
-    functionImports(ODataFormat.JSON_FULL_METADATA);
+    functionImports(ContentType.JSON_FULL_METADATA);
   }
 
   @Test
@@ -182,14 +182,14 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
     assertTrue(prodByAL.getCollectionValue().asJavaCollection().contains("Car"));
   }
 
-  private void actionImports(final ODataFormat format) {
+  private void actionImports(final ContentType contentType) {
     // Discount
     final ClientPrimitiveValue percentage = getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(22);
     final ODataInvokeRequest<ClientNoContent> discountReq = getClient().getInvokeRequestFactory().
         getActionInvokeRequest(getClient().newURIBuilder(testStaticServiceRootURL).
             appendOperationCallSegment("Discount").build(), ClientNoContent.class,
             Collections.<String, ClientValue> singletonMap("percentage", percentage));
-    discountReq.setFormat(format);
+    discountReq.setFormat(contentType);
     final ClientNoContent discount = discountReq.execute().getBody();
     assertNotNull(discount);
 
@@ -207,7 +207,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
         getActionInvokeRequest(getClient().newURIBuilder(testStaticServiceRootURL).
             appendOperationCallSegment("ResetBossAddress").build(), ClientProperty.class,
             Collections.<String, ClientValue> singletonMap("address", address));
-    resetBossAddressReq.setFormat(format);
+    resetBossAddressReq.setFormat(contentType);
     final ClientProperty resetBossAddress = resetBossAddressReq.execute().getBody();
     assertNotNull(resetBossAddress);
     assertEquals(address, resetBossAddress.getComplexValue());
@@ -215,12 +215,12 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomActionImports() {
-    actionImports(ODataFormat.ATOM);
+    actionImports(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonActionImports() {
-    actionImports(ODataFormat.JSON_FULL_METADATA);
+    actionImports(ContentType.JSON_FULL_METADATA);
   }
 
   @Test
@@ -251,7 +251,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
     assertEquals(address.getTypeName(), resetBossAddress.getComplexValue().getTypeName());
   }
 
-  private void bossEmails(final ODataFormat format) {
+  private void bossEmails(final ContentType contentType) {
     // ResetBossEmail
     final ClientCollectionValue<ClientValue> emails =
         getClient().getObjectFactory().newCollectionValue("Collection(Edm.String)");
@@ -261,7 +261,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
         getActionInvokeRequest(getClient().newURIBuilder(testStaticServiceRootURL).
             appendOperationCallSegment("ResetBossEmail").build(), ClientProperty.class,
             Collections.<String, ClientValue> singletonMap("emails", emails));
-    bossEmailsReq.setFormat(format);
+    bossEmailsReq.setFormat(contentType);
     final ClientProperty bossEmails = bossEmailsReq.execute().getBody();
     assertNotNull(bossEmails);
     assertTrue(bossEmails.hasCollectionValue());
@@ -273,7 +273,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
     bossEmailsReq = getClient().getInvokeRequestFactory().getFunctionInvokeRequest(
         getClient().newURIBuilder(testStaticServiceRootURL).
         appendOperationCallSegment("GetBossEmails").build(), ClientProperty.class, params);
-    bossEmailsReq.setFormat(format);
+    bossEmailsReq.setFormat(contentType);
     final ClientProperty bossEmailsViaGET = bossEmailsReq.execute().getBody();
     assertNotNull(bossEmailsViaGET);
     assertTrue(bossEmailsViaGET.hasCollectionValue());
@@ -284,11 +284,11 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomBossEmails() throws EdmPrimitiveTypeException {
-    bossEmails(ODataFormat.ATOM);
+    bossEmails(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonBossEmails() throws EdmPrimitiveTypeException {
-    bossEmails(ODataFormat.JSON_FULL_METADATA);
+    bossEmails(ContentType.JSON_FULL_METADATA);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java
index e2c6250..cb94f83 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java
@@ -37,18 +37,18 @@ import org.apache.olingo.client.api.domain.ClientEntity;
 import org.apache.olingo.client.api.domain.ClientProperty;
 import org.apache.olingo.client.api.domain.ClientValuable;
 import org.apache.olingo.client.api.uri.URIBuilder;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.http.HttpMethod;
 import org.junit.Test;
 
 public class PropertyTestITCase extends AbstractTestITCase {
 
-  private void _enum(final ODataClient client, final ODataFormat format) {
+  private void _enum(final ODataClient client, final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Products").appendKeySegment(5).appendPropertySegment("CoverColors");
     final ODataPropertyRequest<ClientProperty> req = client.getRetrieveRequestFactory().
         getPropertyRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ClientProperty prop = req.execute().getBody();
     assertNotNull(prop);
@@ -59,25 +59,25 @@ public class PropertyTestITCase extends AbstractTestITCase {
 
   @Test
   public void enumFromXML() {
-    _enum(client, ODataFormat.XML);
+    _enum(client, ContentType.APPLICATION_XML);
   }
 
   @Test
   public void enumFromJSON() {
-    _enum(edmClient, ODataFormat.JSON);
+    _enum(edmClient, ContentType.JSON);
   }
 
   @Test
   public void enumFromFullJSON() {
-    _enum(client, ODataFormat.JSON_FULL_METADATA);
+    _enum(client, ContentType.JSON_FULL_METADATA);
   }
 
-  private void geospatial(final ODataClient client, final ODataFormat format) {
+  private void geospatial(final ODataClient client, final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("Home");
     final ODataPropertyRequest<ClientProperty> req = client.getRetrieveRequestFactory().
         getPropertyRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ClientProperty prop = req.execute().getBody();
     assertNotNull(prop);
@@ -87,25 +87,25 @@ public class PropertyTestITCase extends AbstractTestITCase {
 
   @Test
   public void geospatialFromXML() {
-    geospatial(client, ODataFormat.XML);
+    geospatial(client, ContentType.APPLICATION_XML);
   }
 
   @Test
   public void geospatialFromJSON() {
-    geospatial(edmClient, ODataFormat.JSON);
+    geospatial(edmClient, ContentType.JSON);
   }
 
   @Test
   public void geospatialFromFullJSON() {
-    geospatial(client, ODataFormat.JSON_FULL_METADATA);
+    geospatial(client, ContentType.JSON_FULL_METADATA);
   }
 
-  private void complex(final ODataClient client, final ODataFormat format) {
+  private void complex(final ODataClient client, final ContentType contentType) {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Customers").appendKeySegment(2).appendPropertySegment("HomeAddress");
     final ODataPropertyRequest<ClientProperty> req = client.getRetrieveRequestFactory().
         getPropertyRequest(uriBuilder.build());
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ClientProperty prop = req.execute().getBody();
     assertNotNull(prop);
@@ -116,26 +116,26 @@ public class PropertyTestITCase extends AbstractTestITCase {
 
   @Test
   public void complexFromXML() {
-    complex(client, ODataFormat.XML);
+    complex(client, ContentType.APPLICATION_XML);
   }
 
   @Test
   public void complexFromJSON() {
-    complex(edmClient, ODataFormat.JSON);
+    complex(edmClient, ContentType.JSON);
   }
 
   @Test
   public void complexFromFullJSON() {
-    complex(client, ODataFormat.JSON_FULL_METADATA);
+    complex(client, ContentType.JSON_FULL_METADATA);
   }
 
-  private void updateComplexProperty(final ODataFormat format, final UpdateType type) throws IOException {
+  private void updateComplexProperty(final ContentType contentType, final UpdateType type) throws IOException {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Customers").appendKeySegment(1).appendPropertySegment("HomeAddress");
 
     ODataPropertyRequest<ClientProperty> retrieveReq =
         client.getRetrieveRequestFactory().getPropertyRequest(uriBuilder.build());
-    retrieveReq.setFormat(format);
+    retrieveReq.setFormat(contentType);
 
     ODataRetrieveResponse<ClientProperty> retrieveRes = retrieveReq.execute();
     assertEquals(200, retrieveRes.getStatusCode());
@@ -153,13 +153,13 @@ public class PropertyTestITCase extends AbstractTestITCase {
     } else {
       assertEquals(type.getMethod(), updateReq.getMethod());
     }
-    updateReq.setFormat(format);
+    updateReq.setFormat(contentType);
 
     final ODataPropertyUpdateResponse updateRes = updateReq.execute();
     assertEquals(204, updateRes.getStatusCode());
 
     retrieveReq = client.getRetrieveRequestFactory().getPropertyRequest(uriBuilder.build());
-    retrieveReq.setFormat(format);
+    retrieveReq.setFormat(contentType);
 
     retrieveRes = retrieveReq.execute();
     assertEquals(200, retrieveRes.getStatusCode());
@@ -170,7 +170,7 @@ public class PropertyTestITCase extends AbstractTestITCase {
 
   @Test
   public void patchComplexPropertyAsJSON() throws IOException {
-    updateComplexProperty(ODataFormat.JSON_FULL_METADATA, UpdateType.PATCH);
+    updateComplexProperty(ContentType.JSON_FULL_METADATA, UpdateType.PATCH);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java
index 123c169..c2eadc2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java
@@ -32,7 +32,7 @@ import org.apache.olingo.client.api.domain.ClientProperty;
 import org.apache.olingo.client.api.domain.ClientValuable;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 public class PropertyValueTestITCase extends AbstractTestITCase {
@@ -42,7 +42,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("PersonID");
     final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.TEXT_PLAIN);
+    req.setFormat(ContentType.TEXT_PLAIN);
     assertEquals("5", req.execute().getBody().toString());
   }
 
@@ -51,7 +51,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("IsRegistered");
     final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.TEXT_PLAIN);
+    req.setFormat(ContentType.TEXT_PLAIN);
     assertEquals("true", req.execute().getBody().toString());
   }
 
@@ -60,7 +60,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("FirstName");
     final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.TEXT_PLAIN);
+    req.setFormat(ContentType.TEXT_PLAIN);
     assertEquals("Peter", req.execute().getBody().toString());
   }
 
@@ -69,7 +69,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("Orders").appendKeySegment(8).appendPropertySegment("OrderDate");
     final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.TEXT_PLAIN);
+    req.setFormat(ContentType.TEXT_PLAIN);
     final ClientPrimitiveValue property = req.execute().getBody();
     assertEquals("2011-03-04T16:03:57Z", property.toString());
   }
@@ -79,7 +79,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("Height");
     final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.TEXT_PLAIN);
+    req.setFormat(ContentType.TEXT_PLAIN);
     final ClientPrimitiveValue property = req.execute().getBody();
     assertEquals("179", property.toString());
   }
@@ -89,7 +89,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("PDC");
     final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.TEXT_PLAIN);
+    req.setFormat(ContentType.TEXT_PLAIN);
     final ClientPrimitiveValue property = req.execute().getBody();
     assertEquals("fi653p3+MklA/LdoBlhWgnMTUUEo8tEgtbMXnF0a3CUNL9BZxXpSRiD9ebTnmNR0zWPjJ"
         + "VIDx4tdmCnq55XrJh+RW9aI/b34wAogK3kcORw=", property.toString());
@@ -100,7 +100,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("PDC");
     final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
-    req.setAccept(ODataFormat.ATOM.getContentType().toContentTypeString());
+    req.setAccept(ContentType.APPLICATION_ATOM_XML.toContentTypeString());
     req.execute().getBody();
   }
 
@@ -109,7 +109,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("PDC");
     final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
-    req.setAccept(ODataFormat.XML.getContentType().toContentTypeString());
+    req.setAccept(ContentType.APPLICATION_XML.toContentTypeString());
     req.execute().getBody();
   }
 
@@ -119,7 +119,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("Numbers");
     final ODataPropertyRequest<ClientProperty> req = client.getRetrieveRequestFactory().
         getPropertyRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.XML);
+    req.setFormat(ContentType.APPLICATION_XML);
     final ClientProperty property = req.execute().getBody();
     // cast to workaround JDK 6 bug, fixed in JDK 7
     assertTrue(((ClientValuable) property).getValue().isCollection());
@@ -131,7 +131,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
     final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
         appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("HomeAddress");
     final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.TEXT_PLAIN);
+    req.setFormat(ContentType.TEXT_PLAIN);
     final ClientPrimitiveValue property = req.execute().getBody();
     assertTrue(StringUtils.isBlank(property.toString()));
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/QueryOptionsTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/QueryOptionsTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/QueryOptionsTestITCase.java
index 19af510..b9119f8 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/QueryOptionsTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/QueryOptionsTestITCase.java
@@ -36,7 +36,7 @@ import org.apache.olingo.client.api.domain.ClientInlineEntitySet;
 import org.apache.olingo.client.api.uri.QueryOption;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 /**
@@ -128,12 +128,12 @@ public class QueryOptionsTestITCase extends AbstractTestITCase {
 
     final ODataEntityRequest<ClientEntity> req =
         client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-    req.setFormat(ODataFormat.ATOM);
+    req.setFormat(ContentType.APPLICATION_ATOM_XML);
 
     final ODataRetrieveResponse<ClientEntity> res = req.execute();
     assertNotNull(res);
     assertTrue(res.getContentType().replaceAll(" ", "").
-        startsWith(ODataFormat.JSON.getContentType().toContentTypeString()));
+        startsWith(ContentType.JSON.toContentTypeString()));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/ServiceDocumentTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/ServiceDocumentTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/ServiceDocumentTestITCase.java
index 13f7628..69a869c 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/ServiceDocumentTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/ServiceDocumentTestITCase.java
@@ -25,15 +25,15 @@ import java.net.URI;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
 import org.apache.olingo.client.api.domain.ClientServiceDocument;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 public class ServiceDocumentTestITCase extends AbstractTestITCase {
 
-  private void retrieveServiceDocument(final ODataFormat format) {
+  private void retrieveServiceDocument(final ContentType contentType) {
     final ODataServiceDocumentRequest req =
         client.getRetrieveRequestFactory().getServiceDocumentRequest(testStaticServiceRootURL);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataRetrieveResponse<ClientServiceDocument> res = req.execute();
     assertEquals(200, res.getStatusCode());
@@ -53,11 +53,11 @@ public class ServiceDocumentTestITCase extends AbstractTestITCase {
 
   @Test
   public void retrieveServiceDocumentAsXML() {
-    retrieveServiceDocument(ODataFormat.XML);
+    retrieveServiceDocument(ContentType.APPLICATION_XML);
   }
 
   @Test
   public void retrieveServiceDocumentAsJSON() {
-    retrieveServiceDocument(ODataFormat.JSON);
+    retrieveServiceDocument(ContentType.JSON);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java
index 14d9f1f..7f4e2f8 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java
@@ -36,16 +36,16 @@ import org.apache.olingo.client.api.domain.ClientValuable;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.junit.Test;
 
 public class SingletonTestITCase extends AbstractTestITCase {
 
-  private void read(final ODataClient client, final ODataFormat format) throws EdmPrimitiveTypeException {
+  private void read(final ODataClient client, final ContentType contentType) throws EdmPrimitiveTypeException {
     final URIBuilder builder = client.newURIBuilder(testStaticServiceRootURL).appendSingletonSegment("Company");
     final ODataEntityRequest<ClientSingleton> singleton =
         client.getRetrieveRequestFactory().getSingletonRequest(builder.build());
-    singleton.setFormat(format);
+    singleton.setFormat(contentType);
     final ClientSingleton company = singleton.execute().getBody();
     assertNotNull(company);
 
@@ -58,26 +58,26 @@ public class SingletonTestITCase extends AbstractTestITCase {
 
   @Test
   public void readFromAtom() throws EdmPrimitiveTypeException {
-    read(client, ODataFormat.ATOM);
+    read(client, ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void readFromJSON() throws EdmPrimitiveTypeException {
-    read(edmClient, ODataFormat.JSON);
+    read(edmClient, ContentType.JSON);
   }
 
   @Test
   public void readfromJSONFull() throws EdmPrimitiveTypeException {
-    read(client, ODataFormat.JSON_FULL_METADATA);
+    read(client, ContentType.JSON_FULL_METADATA);
   }
 
-  private void readWithAnnotations(final ODataClient client, final ODataFormat format)
+  private void readWithAnnotations(final ODataClient client, final ContentType contentType)
       throws EdmPrimitiveTypeException {
 
     final URIBuilder builder = client.newURIBuilder(testStaticServiceRootURL).appendSingletonSegment("Boss");
     final ODataEntityRequest<ClientSingleton> singleton =
         client.getRetrieveRequestFactory().getSingletonRequest(builder.build());
-    singleton.setFormat(format);
+    singleton.setFormat(contentType);
     singleton.setPrefer(client.newPreferences().includeAnnotations("*"));
     final ClientSingleton boss = singleton.execute().getBody();
     assertNotNull(boss);
@@ -89,20 +89,20 @@ public class SingletonTestITCase extends AbstractTestITCase {
 
   @Test
   public void readWithAnnotationsFromAtom() throws EdmPrimitiveTypeException {
-    readWithAnnotations(client, ODataFormat.ATOM);
+    readWithAnnotations(client, ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void readWithAnnotationsFromJSON() throws EdmPrimitiveTypeException {
-    readWithAnnotations(edmClient, ODataFormat.JSON);
+    readWithAnnotations(edmClient, ContentType.JSON);
   }
 
   @Test
   public void readWithAnnotationsFromJSONFull() throws EdmPrimitiveTypeException {
-    readWithAnnotations(client, ODataFormat.JSON_FULL_METADATA);
+    readWithAnnotations(client, ContentType.JSON_FULL_METADATA);
   }
 
-  private void update(final ODataFormat format) throws EdmPrimitiveTypeException {
+  private void update(final ContentType contentType) throws EdmPrimitiveTypeException {
     final ClientSingleton changes = getClient().getObjectFactory().newSingleton(
         new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Company"));
     changes.getProperties().add(getClient().getObjectFactory().newPrimitiveProperty("Revenue",
@@ -111,7 +111,7 @@ public class SingletonTestITCase extends AbstractTestITCase {
     final URI uri = client.newURIBuilder(testStaticServiceRootURL).appendSingletonSegment("Company").build();
     final ODataEntityUpdateRequest<ClientSingleton> req = getClient().getCUDRequestFactory().
         getSingletonUpdateRequest(uri, UpdateType.PATCH, changes);
-    req.setFormat(format);
+    req.setFormat(contentType);
 
     final ODataEntityUpdateResponse<ClientSingleton> res = req.execute();
     assertEquals(204, res.getStatusCode());
@@ -124,12 +124,12 @@ public class SingletonTestITCase extends AbstractTestITCase {
 
   @Test
   public void atomUpdate() throws EdmPrimitiveTypeException {
-    update(ODataFormat.ATOM);
+    update(ContentType.APPLICATION_ATOM_XML);
   }
 
   @Test
   public void jsonUpdate() throws EdmPrimitiveTypeException {
-    update(ODataFormat.JSON);
+    update(ContentType.JSON);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/lib/client-api/src/main/java/org/apache/olingo/client/api/Configuration.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/Configuration.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/Configuration.java
index a027800..f9ef1cc 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/Configuration.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/Configuration.java
@@ -23,7 +23,6 @@ import java.util.concurrent.ExecutorService;
 import org.apache.olingo.client.api.http.HttpClientFactory;
 import org.apache.olingo.client.api.http.HttpUriRequestFactory;
 import org.apache.olingo.commons.api.format.ContentType;
-import org.apache.olingo.commons.api.format.ODataFormat;
 
 /**
  * Configuration wrapper.
@@ -49,16 +48,15 @@ public interface Configuration {
    * JSON_FULL_METADATA format will be used as default.
    *
    * @return configured OData format for AtomPub if specified; JSON_FULL_METADATA format otherwise.
-   * @see ODataFormat#JSON_FULL_METADATA
    */
-  ODataFormat getDefaultPubFormat();
+  ContentType getDefaultPubFormat();
 
   /**
    * Sets the default OData format for AtomPub exchanges.
    *
    * @param format default format.
    */
-  void setDefaultPubFormat(ODataFormat format);
+  void setDefaultPubFormat(ContentType format);
 
   /**
    * Gets the configured OData format. This value depends on what is returned from <tt>getDefaultPubFormat()</tt>.
@@ -66,23 +64,22 @@ public interface Configuration {
    * @return configured OData format
    * @see #getDefaultPubFormat()
    */
-  ODataFormat getDefaultFormat();
+  ContentType getDefaultFormat();
 
   /**
    * Gets the configured OData value format. If this configuration parameter doesn't exist the TEXT format will be used
    * as default.
    *
    * @return configured OData value format if specified; TEXT_PLAIN format otherwise.
-   * @see ODataFormat#TEXT_PLAIN
    */
-  ODataFormat getDefaultValueFormat();
+  ContentType getDefaultValueFormat();
 
   /**
    * Sets the default OData value format.
    *
    * @param format default format.
    */
-  void setDefaultValueFormat(ODataFormat format);
+  void setDefaultValueFormat(ContentType format);
 
   /**
    * Gets the configured OData media format. If this configuration parameter doesn't exist the APPLICATION_OCTET_STREAM
@@ -90,14 +87,14 @@ public interface Configuration {
    *
    * @return configured OData media format if specified; APPLICATION_OCTET_STREAM format otherwise.
    */
-  ODataFormat getDefaultMediaFormat();
+  ContentType getDefaultMediaFormat();
 
   /**
    * Sets the default OData media format.
    *
    * @param format default format.
    */
-  void setDefaultMediaFormat(ODataFormat format);
+  void setDefaultMediaFormat(ContentType format);
 
   /**
    * Gets the HttpClient factory to be used for executing requests.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java
index 214ab98..b3ac39c 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java
@@ -25,6 +25,7 @@ import org.apache.olingo.client.api.communication.request.batch.BatchRequestFact
 import org.apache.olingo.client.api.communication.request.cud.CUDRequestFactory;
 import org.apache.olingo.client.api.communication.request.invoke.InvokeRequestFactory;
 import org.apache.olingo.client.api.communication.request.retrieve.RetrieveRequestFactory;
+import org.apache.olingo.client.api.domain.ClientObjectFactory;
 import org.apache.olingo.client.api.serialization.ClientODataDeserializer;
 import org.apache.olingo.client.api.serialization.ODataBinder;
 import org.apache.olingo.client.api.serialization.ODataReader;
@@ -32,9 +33,8 @@ import org.apache.olingo.client.api.serialization.ODataWriter;
 import org.apache.olingo.client.api.uri.FilterFactory;
 import org.apache.olingo.client.api.uri.SearchFactory;
 import org.apache.olingo.client.api.uri.URIBuilder;
-import org.apache.olingo.client.api.domain.ClientObjectFactory;
 import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.serialization.ODataSerializer;
 
 public interface ODataClient {
@@ -47,13 +47,13 @@ public interface ODataClient {
 
   ODataPreferences newPreferences();
 
-  ODataSerializer getSerializer(ODataFormat format);
+  ODataSerializer getSerializer(ContentType contentType);
 
   ODataWriter getWriter();
 
   InvokeRequestFactory getInvokeRequestFactory();
 
-  ClientODataDeserializer getDeserializer(ODataFormat format);
+  ClientODataDeserializer getDeserializer(ContentType contentType);
 
   ODataReader getReader();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java
index bd3cbde..9994977 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java
@@ -18,12 +18,12 @@
  */
 package org.apache.olingo.client.api;
 
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.format.ODataFormat;
-
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.format.ContentType;
+
 /**
  * <p>
  * Builder to create an ODataClient for the API client library.
@@ -142,7 +142,7 @@ public final class ODataClientBuilder {
         loadClass(EdmEnabledODataClient.class, clientImplClassName,
             new Class[] { String.class, Edm.class, String.class },
             new Object[] { serviceRoot, edm, metadataETag });
-    instance.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
+    instance.getConfiguration().setDefaultPubFormat(ContentType.JSON);
     return instance;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/588df780/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBasicRequest.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBasicRequest.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBasicRequest.java
index 6bcb3b8..c977a0b 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBasicRequest.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBasicRequest.java
@@ -21,7 +21,7 @@ package org.apache.olingo.client.api.communication.request;
 import java.util.concurrent.Future;
 
 import org.apache.olingo.client.api.communication.response.ODataResponse;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 
 /**
  * Basic OData request.
@@ -45,9 +45,9 @@ public interface ODataBasicRequest<T extends ODataResponse> extends ODataRequest
   Future<T> asyncExecute();
 
   /**
-   * Override configured request format.
+   * Override configured request Content-Type.
    *
-   * @param format request format.
+   * @param contentType request Content-Type.
    */
-  void setFormat(ODataFormat format);
+  void setFormat(ContentType contentType);
 }


Mime
View raw message