Return-Path: X-Original-To: apmail-olingo-commits-archive@minotaur.apache.org Delivered-To: apmail-olingo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12A1210C1A for ; Fri, 23 May 2014 07:33:40 +0000 (UTC) Received: (qmail 77793 invoked by uid 500); 23 May 2014 07:33:39 -0000 Delivered-To: apmail-olingo-commits-archive@olingo.apache.org Received: (qmail 77762 invoked by uid 500); 23 May 2014 07:33:39 -0000 Mailing-List: contact commits-help@olingo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@olingo.apache.org Delivered-To: mailing list commits@olingo.apache.org Received: (qmail 77747 invoked by uid 99); 23 May 2014 07:33:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 May 2014 07:33:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 95F8099FA0C; Fri, 23 May 2014 07:33:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sklevenz@apache.org To: commits@olingo.apache.org Date: Fri, 23 May 2014 07:33:40 -0000 Message-Id: In-Reply-To: <9e7e26762ff44e118d3266aae6593099@git.apache.org> References: <9e7e26762ff44e118d3266aae6593099@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] git commit: [OLINGO-266] delete dummy [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 Authored: Thu May 22 13:20:34 2014 +0200 Committer: Stephan Klevenz 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);