olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chri...@apache.org
Subject [1/2] olingo-odata4 git commit: Fit Tests
Date Tue, 16 Dec 2014 09:57:48 GMT
Repository: olingo-odata4
Updated Branches:
  refs/heads/master 01677f70f -> 55c4d69d8


Fit Tests

Signed-off-by: Christian Amend <chrisam@apache.org>


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

Branch: refs/heads/master
Commit: aab7eaf6e376777aad7e19f725584f33f985a123
Parents: 5f18ea2
Author: Christian Holzer <c.holzer@sap.com>
Authored: Tue Dec 9 13:40:57 2014 +0100
Committer: Christian Amend <chrisam@apache.org>
Committed: Tue Dec 16 10:34:18 2014 +0100

----------------------------------------------------------------------
 .../fit/tecsvc/client/BatchClientITCase.java    |  59 +++++++
 .../fit/tecsvc/http/BasicBatchITCase.java       | 162 +++++++++++++++++++
 .../exception/BatchDeserializerException.java   |   8 +-
 .../api/batch/exception/BatchException.java     |  47 ------
 .../exception/BatchSerializerExecption.java     |   4 +-
 .../server/api/processor/BatchProcessor.java    |   6 +-
 .../server/core/ODataExceptionHelper.java       |   9 +-
 .../apache/olingo/server/core/ODataHandler.java |   7 +-
 .../server/core/batchhandler/BatchHandler.java  |   4 +-
 .../batchhandler/MockedBatchHandlerTest.java    |   3 +-
 .../batch/HttpRequestStatusLineTest.java        |   2 +-
 .../processor/TechnicalBatchProcessor.java      |   3 +-
 12 files changed, 248 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java
b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java
index 04792b4..1152bb0 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java
@@ -191,7 +191,66 @@ public class BatchClientITCase extends AbstractTestITCase {
     // Check if third request is available
     assertFalse(iter.hasNext());
   }
+  
+  @Test
+  public void testInvalidAbsoluteUri() throws URISyntaxException {
+    final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(SERVICE_URI);
+    request.setAccept(ACCEPT);
+
+    final BatchManager payload = request.payloadManager();
+    final URI uri = new URI(SERVICE_URI + "/../ESAllPrim(32767)");
+    final ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    queryReq.setFormat(ODataFormat.JSON);
+    payload.addRequest(queryReq);
+
+    // Fetch result
+    final ODataBatchResponse response = payload.getResponse();
+    assertEquals(202, response.getStatusCode());
 
+    final Iterator<ODataBatchResponseItem> bodyIterator = response.getBody();
+    assertTrue(bodyIterator.hasNext());
+    
+    ODataBatchResponseItem item = bodyIterator.next();
+    assertFalse(item.isChangeset());
+    
+    final ODataResponse oDataResponse = item.next();
+    assertEquals(400, oDataResponse.getStatusCode());
+  }
+  
+  @Test
+  @Ignore
+  public void testInvalidHost() throws URISyntaxException {
+    final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(SERVICE_URI);
+    request.setAccept(ACCEPT);
+
+    final BatchManager payload = request.payloadManager();
+    final URI uri = new URI("http://otherhost/odata/ESAllPrim(32767)");
+    final ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    queryReq.setFormat(ODataFormat.JSON);
+    payload.addRequest(queryReq);
+
+    // Fetch result
+    final ODataBatchResponse response = payload.getResponse();
+    assertEquals(400, response.getStatusCode());
+  }
+  
+  @Test
+  @Ignore
+  public void testInvalidAbsoluteRequest() throws URISyntaxException {
+    final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(SERVICE_URI);
+    request.setAccept(ACCEPT);
+
+    final BatchManager payload = request.payloadManager();
+    final URI uri = new URI("/ESAllPrim(32767)");
+    final ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(uri);
+    queryReq.setFormat(ODataFormat.JSON);
+    payload.addRequest(queryReq);
+
+    // Fetch result
+    final ODataBatchResponse response = payload.getResponse();
+    assertEquals(400, response.getStatusCode());
+  }
+  
   @Test
   public void testErrorWithContinueOnErrorPreferHeader() throws URISyntaxException {
     client.getConfiguration().setContinueOnError(true);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java
new file mode 100644
index 0000000..4663c69
--- /dev/null
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java
@@ -0,0 +1,162 @@
+/*
+ * 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.fit.tecsvc.http;
+
+import static org.junit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.ProtocolException;
+import java.net.URL;
+
+import org.apache.olingo.client.api.CommonODataClient;
+import org.apache.olingo.commons.api.http.HttpHeader;
+import org.apache.olingo.commons.api.http.HttpMethod;
+import org.apache.olingo.commons.api.http.HttpStatusCode;
+import org.apache.olingo.fit.AbstractBaseTestITCase;
+import org.apache.olingo.fit.tecsvc.TecSvcConst;
+import org.junit.Test;
+
+public class BasicBatchITCase extends AbstractBaseTestITCase {
+
+  private static final String HEADER_CONTENT_TRANSFER_ENCODING_BINARY = "Content-Transfer-Encoding:
binary";
+  private static final String HEADER_CONTENT_TYPE_HTTP = "Content-Type: application/http";
+  private static final String SERVICE_URI = TecSvcConst.BASE_URI + "/";
+  private static final String CONTENT_TYPE_HEADER_VALUE = " multipart/mixed;boundary=batch_123";
+  private static final String CRLF = "\r\n";
+  private static final String ACCEPT_HEADER_VALUE = "application/json";
+  
+  @Test
+  public void test() throws IOException {
+    final String content = getRequest("ESAllPrim(32767)");
+    final HttpURLConnection connection = batch(content);
+    final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+   
+    assertTrue(reader.readLine().contains("batch_"));
+    checkMimeHeader(reader);
+    blankLine(reader);
+    
+    assertEquals("HTTP/1.1 200 OK", reader.readLine());
+    assertEquals("OData-Version: 4.0", reader.readLine());
+    assertEquals("Content-Type: application/json;odata.metadata=minimal", reader.readLine());
+    assertEquals("Content-Length: 538", reader.readLine());
+    blankLine(reader);
+    
+    reader.close();
+  }
+
+  @Test
+  public void testInvalidRelativeURI() throws IOException {
+    final String content = getRequest("/ESAllPrim(32767)");
+    batchFail(content);
+  }
+
+  @Test
+  public void testInvalidAbsoluteURI() throws IOException {
+    final String content = getRequest(SERVICE_URI + "../ESAllPrim(32767)");
+    HttpURLConnection connection = batch(content);
+    final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+    
+    assertTrue(reader.readLine().contains("batch_"));
+    checkMimeHeader(reader);
+    blankLine(reader);
+    
+    assertEquals("HTTP/1.1 400 Bad Request", reader.readLine());
+  }
+  
+
+  @Test
+  public void testNestedAbsoluteRequest() throws IOException {
+    final String content = getRequest(SERVICE_URI + SERVICE_URI + "../ESAllPrim(32767)");
+    HttpURLConnection connection = batch(content);
+    final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+    
+    assertTrue(reader.readLine().contains("batch_"));
+    checkMimeHeader(reader);
+    blankLine(reader);
+    
+    assertEquals("HTTP/1.1 400 Bad Request", reader.readLine());
+  }
+  
+  @Test
+  public void testInvalidHost() throws IOException {
+    final String content = getRequest("http://otherhost/odata/odata.svc/ESAllPrim(32767)");
+    batchFail(content);
+  }
+  
+  private void checkMimeHeader(final BufferedReader reader) throws IOException {
+    assertEquals(HEADER_CONTENT_TYPE_HTTP, reader.readLine());
+    assertEquals(HEADER_CONTENT_TRANSFER_ENCODING_BINARY, reader.readLine());
+  }
+  
+  private void blankLine(BufferedReader reader) throws IOException {
+    assertEquals("", reader.readLine());  // CRLF becomes to an empty string
+  }
+  
+  private String getRequest(String uri) {
+    return "--batch_123" + CRLF
+        + HEADER_CONTENT_TRANSFER_ENCODING_BINARY + CRLF
+        + HEADER_CONTENT_TYPE_HTTP + CRLF
+        + CRLF
+        + "GET " + uri + " HTTP/1.1" + CRLF
+        + CRLF
+        + CRLF
+        + "--batch_123--";
+  }
+
+  private HttpURLConnection batch(final String content) throws IOException {
+    final HttpURLConnection connection = getConnection(content);
+
+    assertEquals(HttpStatusCode.ACCEPTED.getStatusCode(), connection.getResponseCode());
+
+    return connection;
+  }
+
+  private HttpURLConnection batchFail(String content) throws IOException {
+    final HttpURLConnection connection = getConnection(content);
+
+    assertEquals(HttpStatusCode.BAD_REQUEST.getStatusCode(), connection.getResponseCode());
+
+    return connection;  }
+
+  private HttpURLConnection getConnection(String content) throws MalformedURLException, IOException,
ProtocolException {
+    final URL url = new URL(SERVICE_URI + "$batch");
+    final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+    connection.setRequestMethod(HttpMethod.POST.toString());
+    connection.setRequestProperty(HttpHeader.CONTENT_TYPE, CONTENT_TYPE_HEADER_VALUE);
+    connection.setRequestProperty(HttpHeader.ACCEPT, ACCEPT_HEADER_VALUE);
+    connection.setDoOutput(true);
+    final OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
+    writer.append(content);
+    writer.close();
+    connection.connect();
+    return connection;
+  }
+
+  @Override
+  protected CommonODataClient<?> getClient() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchDeserializerException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchDeserializerException.java
b/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchDeserializerException.java
index 4bd35d2..eeb11d6 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchDeserializerException.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchDeserializerException.java
@@ -18,7 +18,9 @@
  */
 package org.apache.olingo.server.api.batch.exception;
 
-public class BatchDeserializerException extends BatchException {
+import org.apache.olingo.server.api.deserializer.DeserializerException;
+
+public class BatchDeserializerException extends DeserializerException {
   public static enum MessageKeys implements MessageKey {
     INVALID_BOUNDARY,
     INVALID_CHANGESET_METHOD,
@@ -60,8 +62,4 @@ public class BatchDeserializerException extends BatchException {
     super(developmentMessage, messageKey, parameters);
   }
 
-  @Override
-  protected String getBundleName() {
-    return DEFAULT_SERVER_BUNDLE_NAME;
-  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchException.java
b/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchException.java
deleted file mode 100644
index 61f9ff2..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchException.java
+++ /dev/null
@@ -1,47 +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.api.batch.exception;
-
-import org.apache.olingo.server.api.ODataTranslatedException;
-
-public class BatchException extends ODataTranslatedException {
-  private static final long serialVersionUID = 8747815702545202733L;
-
-  public static enum MessageKeys implements MessageKey {
-    ;
-
-    @Override
-    public String getKey() {
-      return name();
-    }
-  }
-
-  public BatchException(final String developmentMessage, final MessageKey messageKey, final
int lineNumber) {
-    this(developmentMessage, messageKey, "" + lineNumber);
-  }
-
-  public BatchException(final String developmentMessage, final MessageKey messageKey, final
String... parameters) {
-    super(developmentMessage, messageKey, parameters);
-  }
-
-  @Override
-  protected String getBundleName() {
-    return DEFAULT_SERVER_BUNDLE_NAME;
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchSerializerExecption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchSerializerExecption.java
b/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchSerializerExecption.java
index 9af85da..fb34313 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchSerializerExecption.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/batch/exception/BatchSerializerExecption.java
@@ -18,7 +18,9 @@
  */
 package org.apache.olingo.server.api.batch.exception;
 
-public class BatchSerializerExecption extends BatchException {
+import org.apache.olingo.server.api.serializer.SerializerException;
+
+public class BatchSerializerExecption extends SerializerException {
 
   private static final long serialVersionUID = 2634433974342796905L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java
b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java
index 390dfe9..d37fb6b 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/BatchProcessor.java
@@ -23,14 +23,14 @@ import java.util.List;
 import org.apache.olingo.server.api.ODataRequest;
 import org.apache.olingo.server.api.ODataResponse;
 import org.apache.olingo.server.api.batch.BatchFacade;
-import org.apache.olingo.server.api.batch.exception.BatchException;
+import org.apache.olingo.server.api.deserializer.DeserializerException;
 import org.apache.olingo.server.api.deserializer.batch.ODataResponsePart;
 import org.apache.olingo.server.api.serializer.SerializerException;
 
+
 public interface BatchProcessor extends Processor {
-  // TODO:Check exception signature
   void executeBatch(BatchFacade facade, ODataRequest request, ODataResponse response)
-      throws SerializerException, BatchException;
+      throws SerializerException, DeserializerException;
 
   ODataResponsePart executeChangeSet(BatchFacade facade, List<ODataRequest> requests);
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java
b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java
index 4caceab..be3e7ec 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataExceptionHelper.java
@@ -25,6 +25,7 @@ import org.apache.olingo.server.api.ODataApplicationException;
 import org.apache.olingo.server.api.ODataServerError;
 import org.apache.olingo.server.api.ODataTranslatedException;
 import org.apache.olingo.server.api.ODataTranslatedException.ODataErrorMessage;
+import org.apache.olingo.server.api.batch.exception.BatchDeserializerException;
 import org.apache.olingo.server.api.serializer.SerializerException;
 import org.apache.olingo.server.core.uri.parser.UriParserException;
 import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
@@ -93,7 +94,13 @@ public class ODataExceptionHelper {
     serverError.setStatusCode(HttpStatusCode.BAD_REQUEST.getStatusCode());
     return serverError;
   }
-
+  
+  public static ODataServerError createServerErrorObject(BatchDeserializerException e, Locale
requestedLocale) {
+    ODataServerError serverError = basicTranslatedError(e, requestedLocale);
+    serverError.setStatusCode(HttpStatusCode.BAD_REQUEST.getStatusCode());
+    return serverError;
+  }
+  
   public static ODataServerError createServerErrorObject(ODataTranslatedException e, Locale
requestedLocale) {
     return basicTranslatedError(e, requestedLocale);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
index 51b328b..3eb7727 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java
@@ -36,7 +36,7 @@ import org.apache.olingo.server.api.ODataRequest;
 import org.apache.olingo.server.api.ODataResponse;
 import org.apache.olingo.server.api.ODataServerError;
 import org.apache.olingo.server.api.ServiceMetadata;
-import org.apache.olingo.server.api.batch.exception.BatchException;
+import org.apache.olingo.server.api.batch.exception.BatchDeserializerException;
 import org.apache.olingo.server.api.deserializer.DeserializerException;
 import org.apache.olingo.server.api.processor.BatchProcessor;
 import org.apache.olingo.server.api.processor.ComplexCollectionProcessor;
@@ -110,6 +110,9 @@ public class ODataHandler {
     } catch (SerializerException e) {
       ODataServerError serverError = ODataExceptionHelper.createServerErrorObject(e, null);
       handleException(request, response, serverError);
+    } catch (BatchDeserializerException e) {
+      ODataServerError serverError = ODataExceptionHelper.createServerErrorObject(e, null);
+      handleException(request, response, serverError);
     } catch (DeserializerException e) {
       ODataServerError serverError = ODataExceptionHelper.createServerErrorObject(e, null);
       handleException(request, response, serverError);
@@ -128,7 +131,7 @@ public class ODataHandler {
 
   private void processInternal(final ODataRequest request, final ODataResponse response)
       throws ODataHandlerException, UriParserException, UriValidationException, ContentNegotiatorException,
-      ODataApplicationException, SerializerException, DeserializerException, BatchException
{
+      ODataApplicationException, SerializerException, DeserializerException {
     validateODataVersion(request, response);
 
     uriInfo = new Parser().parseUri(request.getRawODataPath(), request.getRawQueryPath(),
null,

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java
b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java
index b2d8647..5ec1a33 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/BatchHandler.java
@@ -25,7 +25,7 @@ import org.apache.olingo.server.api.ODataResponse;
 import org.apache.olingo.server.api.batch.BatchFacade;
 import org.apache.olingo.server.api.batch.exception.BatchDeserializerException;
 import org.apache.olingo.server.api.batch.exception.BatchDeserializerException.MessageKeys;
-import org.apache.olingo.server.api.batch.exception.BatchException;
+import org.apache.olingo.server.api.deserializer.DeserializerException;
 import org.apache.olingo.server.api.processor.BatchProcessor;
 import org.apache.olingo.server.api.serializer.SerializerException;
 import org.apache.olingo.server.core.ODataHandler;
@@ -42,7 +42,7 @@ public class BatchHandler {
   }
 
   public void process(final ODataRequest request, final ODataResponse response, final boolean
isStrict)
-      throws SerializerException, BatchException {
+      throws DeserializerException, SerializerException {
     validateRequest(request);
     
     final BatchFacade operation = new BatchFascadeImpl(oDataHandler, request, batchProcessor,
isStrict);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java
b/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java
index 8d4b357..a49e9d0 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java
@@ -40,7 +40,6 @@ import org.apache.olingo.server.api.ODataResponse;
 import org.apache.olingo.server.api.ServiceMetadata;
 import org.apache.olingo.server.api.batch.BatchFacade;
 import org.apache.olingo.server.api.batch.exception.BatchDeserializerException;
-import org.apache.olingo.server.api.batch.exception.BatchException;
 import org.apache.olingo.server.api.deserializer.batch.BatchOptions;
 import org.apache.olingo.server.api.deserializer.batch.BatchRequestPart;
 import org.apache.olingo.server.api.deserializer.batch.ODataResponsePart;
@@ -596,7 +595,7 @@ public class MockedBatchHandlerTest {
 
     @Override
     public void executeBatch(BatchFacade fascade, ODataRequest request, ODataResponse response)
-        throws BatchException, SerializerException {
+        throws SerializerException, BatchDeserializerException {
       final String boundary = getBoundary(request.getHeader(HttpHeader.CONTENT_TYPE));
       final BatchOptions options = BatchOptions.with().isStrict(true).rawBaseUri(BASE_URI).build();
       final List<BatchRequestPart> parts =

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java
b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java
index 38da3a9..5ea7cc8 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/HttpRequestStatusLineTest.java
@@ -44,7 +44,7 @@ public class HttpRequestStatusLineTest {
   
   @Test
   public void testAbsoluteWithRelativePath() throws BatchDeserializerException {
-    final HttpRequestStatusLine line = parse("http://localhost/odata../../Employee?$top=2");
+    final HttpRequestStatusLine line = parse("http://localhost/odata/../../Employee?$top=2");
     assertEquals("/../../Employee", line.getRawODataPath());
     assertEquals("$top=2", line.getRawQueryPath());
     assertEquals("http://localhost/odata/../../Employee?$top=2", line.getRawRequestUri());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/aab7eaf6/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalBatchProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalBatchProcessor.java
b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalBatchProcessor.java
index 7db7088..4e6ec4c 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalBatchProcessor.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalBatchProcessor.java
@@ -32,7 +32,6 @@ import org.apache.olingo.server.api.ODataRequest;
 import org.apache.olingo.server.api.ODataResponse;
 import org.apache.olingo.server.api.batch.BatchFacade;
 import org.apache.olingo.server.api.batch.exception.BatchDeserializerException;
-import org.apache.olingo.server.api.batch.exception.BatchException;
 import org.apache.olingo.server.api.deserializer.batch.BatchOptions;
 import org.apache.olingo.server.api.deserializer.batch.BatchRequestPart;
 import org.apache.olingo.server.api.deserializer.batch.ODataResponsePart;
@@ -50,7 +49,7 @@ public class TechnicalBatchProcessor extends TechnicalProcessor implements
Batch
 
   @Override
   public void executeBatch(BatchFacade fascade, ODataRequest request, ODataResponse response)
-      throws SerializerException, BatchException {
+      throws SerializerException, BatchDeserializerException {
 
     // TODO refactor isContinueOnError
     boolean continueOnError = isContinueOnError(request);


Mime
View raw message