You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/07/08 17:00:33 UTC

git commit: [OLINGO-317] Fixed test failure

Repository: olingo-odata4
Updated Branches:
  refs/heads/master 51e8d3e8d -> 9fa6773d7


[OLINGO-317] Fixed test failure


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

Branch: refs/heads/master
Commit: 9fa6773d7061033798147f2019e3715d3602a4a8
Parents: 51e8d3e
Author: Michael Bolz <mi...@sap.com>
Authored: Tue Jul 8 16:52:31 2014 +0200
Committer: Michael Bolz <mi...@sap.com>
Committed: Tue Jul 8 16:58:08 2014 +0200

----------------------------------------------------------------------
 .../core/serializer/json/JsonDataProvider.java  | 46 --------------------
 .../tecsvc/processor/TechnicalProcessor.java    |  4 +-
 2 files changed, 2 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9fa6773d/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDataProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDataProvider.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDataProvider.java
deleted file mode 100644
index 0a4cf73..0000000
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/JsonDataProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.serializer.json;
-
-import org.apache.olingo.commons.api.data.Entity;
-import org.apache.olingo.commons.api.data.EntitySet;
-import org.apache.olingo.commons.api.data.ResWrap;
-import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.olingo.commons.api.serialization.ODataDeserializerException;
-import org.apache.olingo.commons.core.serialization.JsonDeserializer;
-import org.junit.Test;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-/**
- */
-public class JsonDataProvider {
-  @Test
-  public void testMe() throws Exception {
-    FileInputStream fis = new FileInputStream("/tmp/ESAllPrim.json");
-    ResWrap<EntitySet> wrapper = new JsonDeserializer(ODataServiceVersion.V40, true).toEntitySet(fis);
-    EntitySet es = wrapper.getPayload();
-    for (Entity entity : es.getEntities()) {
-      System.out.println(entity);
-    }
-
-    ODataJsonSerializer serializer = new ODataJsonSerializer();
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9fa6773d/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalProcessor.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalProcessor.java
index 775d96e..b14c4b2 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalProcessor.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalProcessor.java
@@ -83,7 +83,7 @@ public class TechnicalProcessor implements CollectionProcessor, EntityProcessor
         LOG.info("Finished in " + (System.nanoTime() - time) / 1000 + " microseconds");
 
         response.setStatusCode(HttpStatusCode.OK.getStatusCode());
-        response.setHeader("Content-Type", ContentType.APPLICATION_JSON.toContentTypeString());
+        response.setHeader("Content-Type", requestedContentType.toContentTypeString());
       }
     } catch (DataProvider.DataProviderException e) {
       response.setStatusCode(HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());
@@ -109,7 +109,7 @@ public class TechnicalProcessor implements CollectionProcessor, EntityProcessor
         LOG.info("Finished in " + (System.nanoTime() - time) / 1000 + " microseconds");
 
         response.setStatusCode(HttpStatusCode.OK.getStatusCode());
-        response.setHeader("Content-Type", ContentType.APPLICATION_JSON.toContentTypeString());
+        response.setHeader("Content-Type", requestedContentType.toContentTypeString());
       }
     } catch (DataProvider.DataProviderException e) {
       response.setStatusCode(HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());