olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [03/12] olingo-odata4 git commit: [OLINGO-712] Merge branch 'master' into olingo712
Date Wed, 08 Jul 2015 08:14:57 GMT
[OLINGO-712] Merge branch 'master' into olingo712

Conflicts:
	fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ActionImportITCase.java
	fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
	fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
	fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
	fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
	fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
	fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
	lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
	lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java


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

Branch: refs/heads/OLINGO-708_AsyncSupportTec
Commit: b51117477bcee797fdc6d3b989f7cf7f37bfc8c2
Parents: d54b071 abf5bf7
Author: Christian Amend <christian.amend@sap.com>
Authored: Mon Jun 29 13:48:14 2015 +0200
Committer: Christian Amend <christian.amend@sap.com>
Committed: Mon Jun 29 13:48:14 2015 +0200

----------------------------------------------------------------------
 .../olingo/ext/proxy/AbstractService.java       |   4 +-
 .../EntityContainerInvocationHandler.java       |   1 +
 .../proxy/commons/EntityInvocationHandler.java  |   6 +-
 .../commons/EntitySetInvocationHandler.java     |   6 +-
 ext/karaf/karaf-features/pom.xml                |  81 ++++
 .../src/main/resources/features.xml             |  59 +++
 ext/karaf/karaf-fit/pom.xml                     | 152 ++++++++
 .../apache/olingo/osgi/itests/BundlesTest.java  |  55 +++
 .../osgi/itests/OlingoOSGiTestSupport.java      | 134 +++++++
 .../osgi/itests/server/CarServiceTest.java      | 105 ++++++
 ext/karaf/pom.xml                               |  41 ++
 .../olingo/ext/pojogen/AbstractPOJOGenMojo.java |   4 +-
 ext/pom.xml                                     |   9 +
 .../org/apache/olingo/fit/AbstractServices.java |   2 +-
 .../olingo/fit/utils/AbstractUtilities.java     |   3 +-
 .../org/apache/olingo/fit/utils/FSManager.java  |   3 +-
 .../olingo/fit/AbstractBaseTestITCase.java      |  11 +-
 .../fit/tecsvc/client/ActionImportITCase.java   |  23 +-
 .../BasicHttpExceptionHandlingITCase.java       |   4 +-
 .../olingo/fit/tecsvc/client/BasicITCase.java   | 376 ++++++++++++++++++-
 .../fit/tecsvc/client/BatchClientITCase.java    | 119 +++---
 .../olingo/fit/tecsvc/client/BindingITCase.java |   6 +-
 .../fit/tecsvc/client/ConditionalITCase.java    |   4 +-
 .../fit/tecsvc/client/DeepInsertITCase.java     |   6 +-
 .../tecsvc/client/EdmEnabledClientITCase.java   |  63 ----
 .../tecsvc/client/EntityReferencesITCase.java   |   4 +-
 .../fit/tecsvc/client/ExpandSelectITCase.java   |  12 +
 .../ExpandWithSystemQueryOptionsITCase.java     |   4 +-
 .../tecsvc/client/FilterSystemQueryITCase.java  |   4 +-
 .../fit/tecsvc/client/FunctionImportITCase.java |   4 +-
 .../olingo/fit/tecsvc/client/MediaITCase.java   |   3 +-
 .../fit/tecsvc/client/NavigationITCase.java     |   4 +-
 .../tecsvc/client/OrderBySystemQueryITCase.java |   4 +-
 .../tecsvc/client/PrimitiveComplexITCase.java   |   3 +-
 .../tecsvc/client/SystemQueryOptionITCase.java  |   4 +-
 .../fit/tecsvc/http/BasicBatchITCase.java       |  15 +-
 .../olingo/fit/tecsvc/http/BasicHttpITCase.java |  79 ++--
 .../fit/tecsvc/http/EntityReferenceITCase.java  |  54 +--
 .../olingo/fit/tecsvc/http/PingITCase.java      |  12 +-
 .../olingo/fit/v4/AbstractTestITCase.java       |  17 +-
 .../apache/olingo/fit/v4/AsyncTestITCase.java   |  20 +-
 .../olingo/fit/v4/AuthBatchTestITCase.java      |   5 +-
 .../apache/olingo/fit/v4/BatchTestITCase.java   |  21 +-
 .../fit/v4/BoundOperationInvokeTestITCase.java  |  52 +--
 .../olingo/fit/v4/ConformanceTestITCase.java    |  30 +-
 .../apache/olingo/fit/v4/DeltaTestITCase.java   |   8 +-
 .../olingo/fit/v4/DerivedTypeTestITCase.java    |  22 +-
 .../olingo/fit/v4/EntityCreateTestITCase.java   |  26 +-
 .../olingo/fit/v4/EntityRetrieveTestITCase.java |  90 ++---
 .../olingo/fit/v4/EntitySetTestITCase.java      |  38 +-
 .../olingo/fit/v4/EntityUpdateTestITCase.java   |  32 +-
 .../olingo/fit/v4/ErrorResponseTestITCase.java  |   4 +-
 .../olingo/fit/v4/FilterFactoryTestITCase.java  |   4 +-
 .../fit/v4/JSONFormatConformanceTestITCase.java |  12 +-
 .../olingo/fit/v4/KeyAsSegmentTestITCase.java   |  24 +-
 .../olingo/fit/v4/MediaEntityTestITCase.java    |  28 +-
 .../apache/olingo/fit/v4/OAuth2TestITCase.java  |  14 +-
 .../olingo/fit/v4/OpenTypeTestITCase.java       |  26 +-
 .../fit/v4/OperationImportInvokeTestITCase.java |  38 +-
 .../olingo/fit/v4/PropertyTestITCase.java       |  42 +--
 .../olingo/fit/v4/PropertyValueTestITCase.java  |  22 +-
 .../olingo/fit/v4/QueryOptionsTestITCase.java   |   6 +-
 .../fit/v4/ServiceDocumentTestITCase.java       |  10 +-
 .../olingo/fit/v4/SingletonTestITCase.java      |  30 +-
 .../apache/olingo/client/api/Configuration.java |  17 +-
 .../apache/olingo/client/api/ODataClient.java   |   9 +-
 .../olingo/client/api/ODataClientBuilder.java   |   8 +-
 .../request/ODataBasicRequest.java              |   8 +-
 .../streamed/ODataStreamedEntityRequest.java    |   7 +-
 .../api/domain/ClientEntitySetIterator.java     |  32 +-
 .../client/api/domain/ClientPrimitiveValue.java |   3 +
 .../client/api/serialization/ODataReader.java   |  28 +-
 .../client/api/serialization/ODataWriter.java   |  26 +-
 .../olingo/client/core/ConfigurationImpl.java   |  31 +-
 .../olingo/client/core/ODataClientFactory.java  |   4 +-
 .../olingo/client/core/ODataClientImpl.java     |  19 +-
 .../header/ODataErrorResponseChecker.java       |  37 +-
 .../request/AbstractODataBasicRequest.java      |   8 +-
 .../request/AbstractODataRequest.java           |   8 +-
 .../request/cud/ODataDeleteRequestImpl.java     |   4 +-
 .../cud/ODataEntityCreateRequestImpl.java       |  10 +-
 .../cud/ODataEntityUpdateRequestImpl.java       |  10 +-
 .../cud/ODataPropertyUpdateRequestImpl.java     |  10 +-
 .../cud/ODataReferenceAddingRequestImpl.java    |   6 +-
 .../cud/ODataValueUpdateRequestImpl.java        |  12 +-
 .../invoke/AbstractODataInvokeRequest.java      |  30 +-
 .../request/invoke/ODataInvokeRequestImpl.java  |  14 +-
 .../retrieve/AbstractMetadataRequestImpl.java   |   5 +-
 .../request/retrieve/ODataDeltaRequestImpl.java |   8 +-
 .../retrieve/ODataEntityRequestImpl.java        |   8 +-
 .../ODataEntitySetIteratorRequestImpl.java      |   8 +-
 .../retrieve/ODataEntitySetRequestImpl.java     |   8 +-
 .../request/retrieve/ODataMediaRequestImpl.java |   8 +-
 .../retrieve/ODataPropertyRequestImpl.java      |   8 +-
 .../request/retrieve/ODataRawRequestImpl.java   |   4 +-
 .../ODataServiceDocumentRequestImpl.java        |   8 +-
 .../request/retrieve/ODataValueRequestImpl.java |  10 +-
 .../retrieve/XMLMetadataRequestImpl.java        |   4 +-
 .../AbstractODataStreamedEntityRequest.java     |  16 +-
 .../streamed/AbstractODataStreamedRequest.java  |   3 +-
 .../core/domain/ClientPrimitiveValueImpl.java   |   6 +
 .../ClientODataDeserializerImpl.java            |  25 +-
 .../serialization/JsonEntitySerializer.java     |  16 +-
 .../serialization/JsonEntitySetSerializer.java  |   7 +-
 .../serialization/JsonPropertySerializer.java   |   5 +-
 .../core/serialization/JsonSerializer.java      |  57 +--
 .../core/serialization/ODataBinderImpl.java     |  16 +-
 .../core/serialization/ODataReaderImpl.java     |  50 +--
 .../core/serialization/ODataWriterImpl.java     |  30 +-
 .../apache/olingo/client/core/AbstractTest.java |   8 +-
 .../apache/olingo/client/core/v4/AtomTest.java  |  22 +-
 .../olingo/client/core/v4/EntitySetTest.java    |  42 +--
 .../olingo/client/core/v4/EntityTest.java       | 105 +++---
 .../apache/olingo/client/core/v4/ErrorTest.java |  22 +-
 .../apache/olingo/client/core/v4/JSONTest.java  |  52 +--
 .../olingo/client/core/v4/MetadataTest.java     |  14 +-
 .../olingo/client/core/v4/PropertyTest.java     |  58 +--
 .../client/core/v4/ServiceDocumentTest.java     |  34 +-
 .../olingo/commons/api/format/AcceptType.java   |  33 +-
 .../olingo/commons/api/format/ContentType.java  | 146 ++++---
 .../olingo/commons/api/format/ODataFormat.java  | 126 -------
 .../olingo/commons/api/format/TypeUtil.java     |  36 +-
 .../olingo/commons/api/http/HttpHeader.java     |  63 ++--
 .../commons/api/format/AcceptTypeTest.java      |   6 +-
 .../commons/api/format/ContentTypeTest.java     |  17 +-
 .../org/apache/olingo/server/api/OData.java     |  10 +-
 .../exception/BatchDeserializerException.java   |  65 ----
 .../exception/BatchSerializerException.java     |  46 ---
 .../deserializer/FixedFormatDeserializer.java   |   9 +-
 .../batch/BatchDeserializerException.java       |  77 ++++
 .../server/api/processor/DefaultProcessor.java  |   7 +-
 .../serializer/BatchSerializerException.java    |  45 +++
 .../serializer/ComplexSerializerOptions.java    |   6 +-
 .../EntityCollectionSerializerOptions.java      |   4 +-
 .../api/serializer/EntitySerializerOptions.java |   4 +-
 .../api/serializer/FixedFormatSerializer.java   |   8 +-
 .../server/api/serializer/ODataSerializer.java  |  15 +-
 .../serializer/PrimitiveSerializerOptions.java  |   6 +-
 .../ReferenceCollectionSerializerOptions.java   |  71 ++++
 .../serializer/ReferenceSerializerOptions.java  |  57 +++
 .../apache/olingo/server/core/ErrorHandler.java |  10 +-
 .../olingo/server/core/ServiceRequest.java      |  16 +-
 .../server/core/requests/BatchRequest.java      |  14 +-
 .../server/core/requests/DataRequest.java       |  12 +-
 .../olingo/server/example/TripPinDataModel.java |   3 +-
 .../olingo/server/core/ContentNegotiator.java   |  41 +-
 .../apache/olingo/server/core/ODataHandler.java |   3 +-
 .../apache/olingo/server/core/ODataImpl.java    |  61 +--
 .../core/batchhandler/BatchFacadeImpl.java      |   5 +-
 .../server/core/batchhandler/BatchHandler.java  |  14 +-
 .../core/batchhandler/BatchPartHandler.java     |   8 +-
 .../BatchReferenceRewriter.java                 |  13 +-
 .../FixedFormatDeserializerImpl.java            |   2 +-
 .../core/deserializer/batch/BatchBodyPart.java  |  35 +-
 .../deserializer/batch/BatchChangeSetPart.java  |   2 +-
 .../core/deserializer/batch/BatchParser.java    |   2 +-
 .../deserializer/batch/BatchParserCommon.java   | 121 +++---
 .../deserializer/batch/BatchQueryOperation.java |   2 +-
 .../batch/BatchRequestTransformator.java        |  35 +-
 .../batch/BatchTransformatorCommon.java         |  38 +-
 .../server/core/deserializer/batch/Header.java  |   9 -
 .../batch/HttpRequestStatusLine.java            |  32 +-
 .../json/ODataJsonDeserializer.java             |  60 ++-
 .../serializer/BatchResponseSerializer.java     |  18 +-
 .../serializer/FixedFormatSerializerImpl.java   |   2 +-
 .../serializer/json/ODataJsonSerializer.java    | 250 ++++++------
 .../json/ServiceDocumentJsonSerializer.java     |  32 +-
 .../serializer/utils/ContentTypeHelper.java     |  28 ++
 .../serializer/xml/ODataXmlSerializerImpl.java  |   8 +-
 .../olingo/server/core/uri/parser/Parser.java   |  10 +-
 .../server/core/ContentNegotiatorTest.java      |  49 +--
 .../olingo/server/core/ODataImplTest.java       |  57 +++
 .../batchhandler/MockedBatchHandlerTest.java    |  18 +-
 .../batch/BatchParserCommonTest.java            |   4 +-
 .../batch/BatchRequestParserTest.java           |  32 +-
 .../core/deserializer/batch/HeaderTest.java     |  16 -
 .../batch/HttpRequestStatusLineTest.java        |   4 +-
 .../json/ODataJsonDeserializerBasicTest.java    | 106 +++---
 .../serializer/BatchResponseSerializerTest.java |  16 +-
 .../json/ODataJsonSerializerTest.java           |   4 +-
 .../json/ServerErrorSerializerTest.java         |   6 +-
 .../xml/MetadataDocumentXmlSerializerTest.java  |   4 +-
 .../processor/TechnicalActionProcessor.java     |  53 ++-
 .../processor/TechnicalEntityProcessor.java     |  80 ++--
 .../TechnicalPrimitiveComplexProcessor.java     |  15 +-
 .../tecsvc/processor/TechnicalProcessor.java    |  10 +-
 .../olingo/server/core/ODataHandlerTest.java    |   3 +-
 .../json/AbstractODataDeserializerTest.java     |   6 +-
 .../json/ODataDeserializerDeepInsertTest.java   |  24 +-
 .../ODataDeserializerEntityCollectionTest.java  |  31 +-
 ...ataJsonDeserializerActionParametersTest.java |   5 +-
 .../json/ODataJsonDeserializerEntityTest.java   | 225 ++++++++---
 .../json/ODataJsonSerializerTest.java           | 299 ++++++++++++++-
 .../serializer/json/ServiceDocumentTest.java    |  15 +-
 .../serializer/xml/MetadataDocumentTest.java    |   4 +-
 pom.xml                                         |   7 +
 samples/osgi/server/README.txt                  | 183 +++++++++
 samples/osgi/server/pom.xml                     | 112 ++++++
 samples/pom.xml                                 |   1 +
 .../server/sample/processor/CarsProcessor.java  |  21 +-
 samples/tutorials/p4_navigation/pom.xml         |  80 ++++
 .../myservice/mynamespace/data/Storage.java     | 260 +++++++++++++
 .../mynamespace/service/DemoEdmProvider.java    | 216 +++++++++++
 .../service/DemoEntityCollectionProcessor.java  | 154 ++++++++
 .../service/DemoEntityProcessor.java            | 189 ++++++++++
 .../service/DemoPrimitiveProcessor.java         | 154 ++++++++
 .../java/myservice/mynamespace/util/Util.java   | 145 +++++++
 .../myservice/mynamespace/web/DemoServlet.java  |  76 ++++
 .../src/main/webapp/WEB-INF/web.xml             |  34 ++
 .../p4_navigation/src/main/webapp/index.jsp     |  26 ++
 samples/tutorials/pom.xml                       |   1 +
 211 files changed, 5373 insertions(+), 2227 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ActionImportITCase.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
index 8e44289,2efba8a..96413cd
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
@@@ -414,8 -434,10 +433,10 @@@ public class BasicITCase extends Abstra
  
      final ODataEntityCreateResponse<ClientEntity> response = request.execute();
      assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
 -    assertEquals("return=minimal", response.getHeader(HeaderName.preferenceApplied).iterator().next());
 +    assertEquals("return=minimal", response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next());
-     assertEquals(SERVICE_URI + "/ESTwoPrim(1)", response.getHeader(HttpHeader.LOCATION).iterator().next());
+     final String location = SERVICE_URI + "/ESTwoPrim(1)";
+     assertEquals(location, response.getHeader(HttpHeader.LOCATION).iterator().next());
+     assertEquals(location, response.getHeader(HttpHeader.ODATA_ENTITY_ID).iterator().next());
    }
  
    @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
index 7fa83be,94f0d11..3944f34
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
@@@ -30,8 -31,7 +30,8 @@@ import org.apache.olingo.client.api.com
  import org.apache.olingo.client.api.domain.ClientEntity;
  import org.apache.olingo.client.api.domain.ClientEntitySet;
  import org.apache.olingo.client.core.ODataClientFactory;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  import org.apache.olingo.commons.api.http.HttpStatusCode;
  import org.apache.olingo.fit.AbstractBaseTestITCase;
  import org.apache.olingo.fit.tecsvc.TecSvcConst;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
index f6964b3,123dcd9..81050a4
--- a/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
@@@ -38,8 -39,6 +38,7 @@@ import org.apache.olingo.client.core.ht
  import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
  import org.apache.olingo.commons.api.edm.FullQualifiedName;
  import org.apache.olingo.commons.api.format.ContentType;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
  import org.junit.Test;
  
  public class AuthBatchTestITCase extends AbstractTestITCase {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
index 26c38f9,d039ab2..5007c2c
--- a/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
@@@ -66,8 -67,6 +66,7 @@@ import org.apache.olingo.commons.api.ed
  import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  import org.apache.olingo.commons.api.edm.FullQualifiedName;
  import org.apache.olingo.commons.api.format.ContentType;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
  import org.junit.Test;
  
  public class BatchTestITCase extends AbstractTestITCase {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
index 9579239,2e9fe5a..32ce435
--- a/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
@@@ -53,8 -54,7 +53,8 @@@ import org.apache.olingo.client.core.ht
  import org.apache.olingo.client.core.uri.URIUtils;
  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.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  import org.junit.Test;
  
  /**
@@@ -117,17 -118,21 +117,17 @@@ public class ConformanceTestITCase exte
      final ODataEntityCreateRequest<ClientEntity> req = getClient().getCUDRequestFactory().getEntityCreateRequest(
          getClient().newURIBuilder(testStaticServiceRootURL).
          appendEntitySetSegment("Orders").build(), order);
-     req.setFormat(ODataFormat.JSON_FULL_METADATA);
+     req.setFormat(ContentType.JSON_FULL_METADATA);
  
      // check for OData-Version
 -    assertEquals("4.0", req.getHeader("OData-Version"));
 -    assertEquals("4.0", req.getHeader(HeaderName.odataVersion.toString()));
 +    assertEquals("4.0", req.getHeader(HttpHeader.ODATA_VERSION));
  
      // check for Content-Type
      assertEquals(
-         ODataFormat.JSON_FULL_METADATA.getContentType().toContentTypeString(),
-         req.getHeader(HttpHeader.CONTENT_TYPE));
+         ContentType.JSON_FULL_METADATA.toContentTypeString(),
+         req.getHeader("Content-Type"));
      assertEquals(
-         ODataFormat.JSON_FULL_METADATA.getContentType().toContentTypeString(),
+         ContentType.JSON_FULL_METADATA.toContentTypeString(),
 -        req.getHeader(HeaderName.contentType.toString()));
 -    assertEquals(
 -        ContentType.JSON_FULL_METADATA.toContentTypeString(),
          req.getContentType());
  
      final ClientEntity created = req.execute().getBody();
@@@ -402,9 -408,10 +402,9 @@@
  
      final ODataEntityRequest<ClientEntity> req =
          client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-     req.setFormat(ODataFormat.JSON);
+     req.setFormat(ContentType.JSON);
  
      assertEquals("application/json;odata.metadata=minimal", req.getHeader("Accept"));
 -    assertEquals("application/json;odata.metadata=minimal", req.getHeader(HeaderName.accept.toString()));
      assertEquals("application/json;odata.metadata=minimal", req.getAccept());
  
      final ODataRetrieveResponse<ClientEntity> res = req.execute();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
index cdc3c12,0c6352d..268939e
--- a/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
@@@ -51,8 -52,7 +51,8 @@@ import org.apache.olingo.client.core.OD
  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.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  import org.junit.Test;
  
  public class MediaEntityTestITCase extends AbstractTestITCase {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
----------------------------------------------------------------------
diff --cc lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
index 4ee8924,6c3bb4c..811b63f
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
@@@ -52,8 -53,7 +52,8 @@@ import org.apache.olingo.client.core.se
  import org.apache.olingo.client.core.uri.FilterFactoryImpl;
  import org.apache.olingo.client.core.uri.URIBuilderImpl;
  import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  
  public class ODataClientImpl implements ODataClient {
  

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
----------------------------------------------------------------------
diff --cc lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
index bf198de,4037a6f..4bd2d83
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
@@@ -40,8 -41,7 +40,8 @@@ import org.apache.olingo.client.api.com
  import org.apache.olingo.client.api.communication.response.ODataResponse;
  import org.apache.olingo.client.api.http.HttpClientException;
  import org.apache.olingo.commons.api.ODataRuntimeException;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  import org.apache.olingo.commons.api.http.HttpMethod;
  
  /**
@@@ -169,11 -169,17 +169,11 @@@ public abstract class AbstractODataRequ
    }
  
    @Override
 -  public ODataRequest addCustomHeader(final HeaderName name, final String value) {
 -    odataHeaders.setHeader(name, value);
 -    return this;
 -  }
 -
 -  @Override
    public String getAccept() {
 -    final String acceptHead = odataHeaders.getHeader(HeaderName.accept);
 -    return StringUtils.isBlank(acceptHead)
 -            ? getDefaultFormat().toContentTypeString()
 -            : acceptHead;
 +    final String acceptHead = odataHeaders.getHeader(HttpHeader.ACCEPT);
 +    return StringUtils.isBlank(acceptHead) ?
-         getDefaultFormat().getContentType().toContentTypeString() :
++        getDefaultFormat().toContentTypeString() :
 +        acceptHead;
    }
  
    @Override
@@@ -193,10 -199,10 +193,10 @@@
  
    @Override
    public String getContentType() {
 -    final String contentTypeHead = odataHeaders.getHeader(HeaderName.contentType);
 -    return StringUtils.isBlank(contentTypeHead)
 -            ? getDefaultFormat().toContentTypeString()
 -            : contentTypeHead;
 +    final String contentTypeHead = odataHeaders.getHeader(HttpHeader.CONTENT_TYPE);
 +    return StringUtils.isBlank(contentTypeHead) ?
-         getDefaultFormat().getContentType().toContentTypeString() :
++        getDefaultFormat().toContentTypeString() :
 +        contentTypeHead;
    }
  
    @Override


Mime
View raw message