olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sklev...@apache.org
Subject [2/3] git commit: [OLINGO-266] delete dummy
Date Fri, 23 May 2014 07:33:40 GMT
[OLINGO-266] delete dummy


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

Branch: refs/heads/olingo-266-tecsvc
Commit: ef5d97762948e80969b51651b48f5fe615f544c0
Parents: df5ce63
Author: Stephan Klevenz <stephan.klevenz@sap.com>
Authored: Thu May 22 13:20:34 2014 +0200
Committer: Stephan Klevenz <stephan.klevenz@sap.com>
Committed: Thu May 22 13:20:34 2014 +0200

----------------------------------------------------------------------
 .../server/api/processor/DeleteMeProcessor.java | 23 -----------
 .../olingo/server/core/ODataHandlerTest.java    | 41 ++++++++++++++++++--
 2 files changed, 37 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/ef5d9776/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DeleteMeProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DeleteMeProcessor.java
b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DeleteMeProcessor.java
deleted file mode 100644
index 783e709..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DeleteMeProcessor.java
+++ /dev/null
@@ -1,23 +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.processor;
-
-public interface DeleteMeProcessor extends Processor {
-
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/ef5d9776/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java
b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java
index 1b7c891..3021f27 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java
@@ -22,7 +22,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.withSettings;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.olingo.commons.api.edm.Edm;
@@ -30,8 +29,9 @@ import org.apache.olingo.commons.api.http.HttpMethod;
 import org.apache.olingo.server.api.OData;
 import org.apache.olingo.server.api.ODataRequest;
 import org.apache.olingo.server.api.ODataResponse;
-import org.apache.olingo.server.api.processor.DeleteMeProcessor;
+import org.apache.olingo.server.api.processor.MetadataProcessor;
 import org.apache.olingo.server.api.processor.Processor;
+import org.apache.olingo.server.api.processor.ServiceDocumentProcessor;
 import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
 import org.junit.Before;
 import org.junit.Test;
@@ -49,6 +49,23 @@ public class ODataHandlerTest {
   }
 
   @Test
+  public void testServiceDocumentNonDefault() throws Exception {
+    ODataRequest request = new ODataRequest();
+
+    request.setMethod(HttpMethod.GET);
+    request.setRawBaseUri("http://localhost/odata/");
+    request.setRawODataPath("");
+
+    ServiceDocumentProcessor processor = mock(ServiceDocumentProcessor.class);
+    handler.register(processor);
+    
+    ODataResponse response = handler.process(request);
+    
+    assertNotNull(response);
+    assertEquals(0, response.getStatusCode());
+  }
+  
+  @Test
   public void testServiceDocumentDefault() throws Exception {
     ODataRequest request = new ODataRequest();
 
@@ -56,7 +73,7 @@ public class ODataHandlerTest {
     request.setRawBaseUri("http://localhost/odata/");
     request.setRawODataPath("");
 
-    Processor processor = mock(Processor.class, withSettings().extraInterfaces(DeleteMeProcessor.class));
+    Processor processor = mock(Processor.class);
     handler.register(processor);
     
     ODataResponse response = handler.process(request);
@@ -73,13 +90,29 @@ public class ODataHandlerTest {
   }
 
   @Test
+  public void testMetadataNonDefault() throws Exception {
+    ODataRequest request = new ODataRequest();
+
+    request.setMethod(HttpMethod.GET);
+    request.setRawODataPath("$metadata");
+
+    MetadataProcessor processor = mock(MetadataProcessor.class);
+    handler.register(processor);
+    
+    ODataResponse response = handler.process(request);
+    
+    assertNotNull(response);
+    assertEquals(0, response.getStatusCode());
+  }
+
+  @Test
   public void testMetadataDefault() throws Exception {
     ODataRequest request = new ODataRequest();
 
     request.setMethod(HttpMethod.GET);
     request.setRawODataPath("$metadata");
 
-    Processor processor = mock(Processor.class, withSettings().extraInterfaces(DeleteMeProcessor.class));
+    Processor processor = mock(Processor.class);
     handler.register(processor);
 
     ODataResponse response = handler.process(request);


Mime
View raw message