You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2013/09/20 15:34:04 UTC
[42/59] [abbrv] git commit: cleanup of odata fit tests
cleanup of odata fit tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/b18130ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/b18130ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/b18130ac
Branch: refs/heads/master
Commit: b18130acd756c58ba85b5120240ec2b0bab69721
Parents: a030e42
Author: Christian Amend <ch...@apache.org>
Authored: Fri Sep 20 14:57:00 2013 +0200
Committer: Christian Amend <ch...@apache.org>
Committed: Fri Sep 20 14:57:00 2013 +0200
----------------------------------------------------------------------
.../odata2/fit/basic/AbstractBasicTest.java | 31 +-
.../odata2/fit/basic/AcceptHeaderTypeTest.java | 50 +-
.../olingo/odata2/fit/basic/BasicBatchTest.java | 49 +-
.../olingo/odata2/fit/basic/BasicHttpTest.java | 36 +-
.../ContentNegotiationDollarFormatTest.java | 47 +-
.../olingo/odata2/fit/basic/ContextTest.java | 36 +-
.../odata2/fit/basic/ErrorResponseTest.java | 33 +-
.../olingo/odata2/fit/basic/ExceptionsTest.java | 33 +-
.../olingo/odata2/fit/basic/FitLoadTest.java | 33 +-
.../fit/basic/HttpExceptionResponseTest.java | 55 +-
.../fit/basic/LanguageNegotiationTest.java | 39 +-
.../olingo/odata2/fit/basic/MetadataTest.java | 32 +-
.../fit/basic/RequestContentTypeTest.java | 31 +-
.../odata2/fit/basic/ServiceResolutionTest.java | 60 +-
.../olingo/odata2/fit/basic/UrlRewriteTest.java | 36 +-
.../odata2/fit/basic/issues/TestIssue105.java | 39 +-
.../odata2/fit/client/ClientBatchTest.java | 26 +-
.../olingo/odata2/fit/mapping/MapFactory.java | 26 +-
.../olingo/odata2/fit/mapping/MapProcessor.java | 50 +-
.../olingo/odata2/fit/mapping/MapProvider.java | 38 +-
.../olingo/odata2/fit/mapping/MappingTest.java | 35 +-
.../odata2/fit/ref/AbstractRefJsonTest.java | 26 +-
.../olingo/odata2/fit/ref/AbstractRefTest.java | 56 +-
.../odata2/fit/ref/AbstractRefXmlTest.java | 33 +-
.../apache/olingo/odata2/fit/ref/BatchTest.java | 61 +-
.../odata2/fit/ref/ContentNegotiationTest.java | 32 +-
.../odata2/fit/ref/DataServiceVersionTest.java | 32 +-
.../odata2/fit/ref/EntryJsonChangeTest.java | 70 ++-
.../fit/ref/EntryJsonCreateInlineTest.java | 101 ++--
.../odata2/fit/ref/EntryJsonCreateTest.java | 42 +-
.../odata2/fit/ref/EntryJsonReadOnlyTest.java | 39 +-
.../odata2/fit/ref/EntryXmlChangeTest.java | 70 ++-
.../odata2/fit/ref/EntryXmlCreateTest.java | 34 +-
.../odata2/fit/ref/EntryXmlReadOnlyTest.java | 93 ++-
.../odata2/fit/ref/FeedJsonReadOnlyTest.java | 35 +-
.../odata2/fit/ref/FeedXmlReadOnlyTest.java | 51 +-
.../odata2/fit/ref/FunctionImportJsonTest.java | 31 +-
.../odata2/fit/ref/FunctionImportXmlTest.java | 31 +-
.../odata2/fit/ref/LinksJsonChangeTest.java | 31 +-
.../odata2/fit/ref/LinksJsonReadOnlyTest.java | 31 +-
.../odata2/fit/ref/LinksXmlChangeTest.java | 37 +-
.../odata2/fit/ref/LinksXmlReadOnlyTest.java | 31 +-
.../olingo/odata2/fit/ref/MetadataTest.java | 561 ++++++++++++++-----
.../olingo/odata2/fit/ref/MiscChangeTest.java | 44 +-
.../olingo/odata2/fit/ref/MiscReadOnlyTest.java | 28 +-
.../odata2/fit/ref/PropertyJsonChangeTest.java | 40 +-
.../fit/ref/PropertyJsonReadOnlyTest.java | 31 +-
.../odata2/fit/ref/PropertyXmlChangeTest.java | 38 +-
.../odata2/fit/ref/PropertyXmlReadOnlyTest.java | 35 +-
.../olingo/odata2/fit/ref/ServiceJsonTest.java | 39 +-
.../olingo/odata2/fit/ref/ServiceXmlTest.java | 41 +-
.../AbstractContentNegotiationTest.java | 80 +--
.../BasicContentNegotiationTest.java | 115 ++--
.../ContentNegotiationGetRequestTest.java | 158 ++++--
.../ContentNegotiationPostRequestTest.java | 138 +++--
55 files changed, 1859 insertions(+), 1271 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AbstractBasicTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AbstractBasicTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AbstractBasicTest.java
index 15e8a20..b0397aa 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AbstractBasicTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AbstractBasicTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -29,9 +29,6 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
import org.apache.olingo.odata2.api.ODataService;
import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
import org.apache.olingo.odata2.api.exception.ODataException;
@@ -39,6 +36,8 @@ import org.apache.olingo.odata2.api.processor.ODataContext;
import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
import org.apache.olingo.odata2.core.processor.ODataSingleProcessorService;
import org.apache.olingo.odata2.testutil.fit.AbstractFitTest;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
/**
*
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AcceptHeaderTypeTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AcceptHeaderTypeTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AcceptHeaderTypeTest.java
index 59b2397..33b2e82 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AcceptHeaderTypeTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/AcceptHeaderTypeTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -52,7 +52,8 @@ public class AcceptHeaderTypeTest extends AbstractBasicTest {
@Override
protected ODataSingleProcessor createProcessor() throws ODataException {
String contentType = "application/atom+xml";
- ODataResponse response = ODataResponse.status(HttpStatusCodes.OK).contentHeader(contentType).entity("Test passed.").build();
+ ODataResponse response =
+ ODataResponse.status(HttpStatusCodes.OK).contentHeader(contentType).entity("Test passed.").build();
when(processor.readEntity(any(GetEntityUriInfo.class), any(String.class))).thenReturn(response);
when(processor.readEntitySet(any(GetEntitySetUriInfo.class), any(String.class))).thenReturn(response);
@@ -64,7 +65,8 @@ public class AcceptHeaderTypeTest extends AbstractBasicTest {
return new EdmTestProvider();
}
- private HttpResponse testGetRequest(final String uriExtension, final String acceptHeader, final HttpStatusCodes expectedStatus, final String expectedContentType)
+ private HttpResponse testGetRequest(final String uriExtension, final String acceptHeader,
+ final HttpStatusCodes expectedStatus, final String expectedContentType)
throws ClientProtocolException, IOException, ODataException {
// prepare
ODataResponse expectedResponse = ODataResponse.contentHeader(expectedContentType).entity("Test passed.").build();
@@ -82,8 +84,10 @@ public class AcceptHeaderTypeTest extends AbstractBasicTest {
assertEquals(expectedStatus.getStatusCode(), response.getStatusLine().getStatusCode());
Header[] contentTypeHeaders = response.getHeaders("Content-Type");
assertEquals("Found more then one content type header in response.", 1, contentTypeHeaders.length);
- assertEquals("Received content type does not match expected.", expectedContentType, contentTypeHeaders[0].getValue());
- assertEquals("Received status code does not match expected.", expectedStatus.getStatusCode(), response.getStatusLine().getStatusCode());
+ assertEquals("Received content type does not match expected.", expectedContentType, contentTypeHeaders[0]
+ .getValue());
+ assertEquals("Received status code does not match expected.", expectedStatus.getStatusCode(), response
+ .getStatusLine().getStatusCode());
//
return response;
}
@@ -123,7 +127,8 @@ public class AcceptHeaderTypeTest extends AbstractBasicTest {
@Test
public void contentTypeApplicationXmlOnMetadataMultiAccept() throws Exception {
- testGetRequest("$metadata", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", HttpStatusCodes.OK, "application/xml");
+ testGetRequest("$metadata", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", HttpStatusCodes.OK,
+ "application/xml");
}
@Test
@@ -158,16 +163,19 @@ public class AcceptHeaderTypeTest extends AbstractBasicTest {
@Test
public void illegalLwsInAcceptHeaderParameter() throws Exception {
- testGetRequest("Employees('1')", "application/xml; param=\talskdf;", HttpStatusCodes.BAD_REQUEST, "application/xml");
+ testGetRequest("Employees('1')", "application/xml; param=\talskdf;", HttpStatusCodes.BAD_REQUEST,
+ "application/xml");
}
@Test
public void illegalSpacesBetweenAcceptHeaderParameterOnSet() throws Exception {
- testGetRequest("Employees", "application/xml; another= test ; param=alskdf", HttpStatusCodes.BAD_REQUEST, "application/xml");
+ testGetRequest("Employees", "application/xml; another= test ; param=alskdf", HttpStatusCodes.BAD_REQUEST,
+ "application/xml");
}
@Test
public void legalSpacesBetweenAcceptHeaderParameterOnSet() throws Exception {
- testGetRequest("Employees", "application/xml; another=test ; param=alskdf", HttpStatusCodes.NOT_ACCEPTABLE, "application/xml");
+ testGetRequest("Employees", "application/xml; another=test ; param=alskdf", HttpStatusCodes.NOT_ACCEPTABLE,
+ "application/xml");
}
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicBatchTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicBatchTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicBatchTest.java
index ecf3351..761a3b5 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicBatchTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicBatchTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -66,7 +66,9 @@ import org.junit.Test;
public class BasicBatchTest extends AbstractBasicTest {
private static final String LF = "\n";
- private static final String REG_EX_BOUNDARY = "(([a-zA-Z0-9_\\-\\.'\\+]{1,70})|\"([a-zA-Z0-9_\\-\\.'\\+\\s\\(\\),/:=\\?]{1,69}[a-zA-Z0-9_\\-\\.'\\+\\(\\),/:=\\?])\")";
+ private static final String REG_EX_BOUNDARY =
+ "(([a-zA-Z0-9_\\-\\.'\\+]{1,70})|\"([a-zA-Z0-9_\\-\\.'\\+\\s\\(\\),/:=\\?]" +
+ "{1,69}[a-zA-Z0-9_\\-\\.'\\+\\(\\),/:=\\?])\")";
private static final String REG_EX = "multipart/mixed;\\s*boundary=" + REG_EX_BOUNDARY + "\\s*";
private static final String REQUEST_PAYLOAD =
@@ -153,7 +155,8 @@ public class BasicBatchTest extends AbstractBasicTest {
static class TestSingleProc extends ODataSingleProcessor {
@Override
- public ODataResponse executeBatch(final BatchHandler handler, final String requestContentType, final InputStream content) {
+ public ODataResponse executeBatch(final BatchHandler handler, final String requestContentType,
+ final InputStream content) {
assertFalse(getContext().isInBatchMode());
@@ -164,7 +167,8 @@ public class BasicBatchTest extends AbstractBasicTest {
pathInfo.setServiceRoot(new URI("http://localhost:19000/odata"));
EntityProviderBatchProperties batchProperties = EntityProviderBatchProperties.init().pathInfo(pathInfo).build();
- List<BatchRequestPart> batchParts = EntityProvider.parseBatchRequest(requestContentType, content, batchProperties);
+ List<BatchRequestPart> batchParts =
+ EntityProvider.parseBatchRequest(requestContentType, content, batchProperties);
for (BatchRequestPart batchPart : batchParts) {
batchResponseParts.add(handler.handleBatchPart(batchPart));
}
@@ -178,7 +182,8 @@ public class BasicBatchTest extends AbstractBasicTest {
}
@Override
- public BatchResponsePart executeChangeSet(final BatchHandler handler, final List<ODataRequest> requests) throws ODataException {
+ public BatchResponsePart executeChangeSet(final BatchHandler handler, final List<ODataRequest> requests)
+ throws ODataException {
assertTrue(getContext().isInBatchMode());
List<ODataResponse> responses = new ArrayList<ODataResponse>();
@@ -196,7 +201,8 @@ public class BasicBatchTest extends AbstractBasicTest {
}
@Override
- public ODataResponse readEntitySimpleProperty(final GetSimplePropertyUriInfo uriInfo, final String contentType) throws ODataException {
+ public ODataResponse readEntitySimpleProperty(final GetSimplePropertyUriInfo uriInfo, final String contentType)
+ throws ODataException {
assertTrue(getContext().isInBatchMode());
CircleStreamBuffer buffer = new CircleStreamBuffer();
@@ -216,12 +222,15 @@ public class BasicBatchTest extends AbstractBasicTest {
throw new RuntimeException(e);
}
- ODataResponse oDataResponse = ODataResponse.entity(buffer.getInputStream()).status(HttpStatusCodes.OK).contentHeader("application/json").build();
+ ODataResponse oDataResponse =
+ ODataResponse.entity(buffer.getInputStream()).status(HttpStatusCodes.OK).contentHeader("application/json")
+ .build();
return oDataResponse;
}
@Override
- public ODataResponse updateEntitySimpleProperty(final PutMergePatchUriInfo uriInfo, final InputStream content, final String requestContentType, final String contentType) throws ODataException {
+ public ODataResponse updateEntitySimpleProperty(final PutMergePatchUriInfo uriInfo, final InputStream content,
+ final String requestContentType, final String contentType) throws ODataException {
assertTrue(getContext().isInBatchMode());
ODataResponse oDataResponse = ODataResponse.status(HttpStatusCodes.NO_CONTENT).build();
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicHttpTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicHttpTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicHttpTest.java
index 0b08d76..e813fb1 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicHttpTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/BasicHttpTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -38,8 +38,6 @@ import org.apache.http.client.methods.HttpPatch;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.commons.ODataHttpMethod;
import org.apache.olingo.odata2.api.edm.Edm;
@@ -53,6 +51,7 @@ import org.apache.olingo.odata2.api.uri.info.GetServiceDocumentUriInfo;
import org.apache.olingo.odata2.testutil.helper.HttpMerge;
import org.apache.olingo.odata2.testutil.helper.HttpSomethingUnsupported;
import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
/**
*
@@ -64,7 +63,9 @@ public class BasicHttpTest extends AbstractBasicTest {
final ODataSingleProcessor processor = mock(ODataSingleProcessor.class);
when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class)))
.thenReturn(ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
- when(((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class), any(String.class)))
+ when(
+ ((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),
+ any(String.class)))
.thenReturn(ODataResponse.entity("service document").status(HttpStatusCodes.OK).build());
return processor;
}
@@ -225,7 +226,8 @@ public class BasicHttpTest extends AbstractBasicTest {
tunnelPost(header, method.toString(), HttpStatusCodes.NOT_FOUND);
}
- private void tunnelPost(final String header, final String method, final HttpStatusCodes expectedStatus) throws IOException {
+ private void tunnelPost(final String header, final String method, final HttpStatusCodes expectedStatus)
+ throws IOException {
HttpPost post = new HttpPost(URI.create(getEndpoint().toString() + "aaa/bbb/ccc"));
post.setHeader(header, method);
final HttpResponse response = getHttpClient().execute(post);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContentNegotiationDollarFormatTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContentNegotiationDollarFormatTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContentNegotiationDollarFormatTest.java
index 79a3854..1e4bb76 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContentNegotiationDollarFormatTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContentNegotiationDollarFormatTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -30,8 +30,6 @@ import java.util.Arrays;
import org.apache.http.Header;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.exception.ODataException;
@@ -41,6 +39,7 @@ import org.apache.olingo.odata2.api.processor.feature.CustomContentType;
import org.apache.olingo.odata2.api.processor.part.ServiceDocumentProcessor;
import org.apache.olingo.odata2.api.uri.info.GetServiceDocumentUriInfo;
import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
/**
*
@@ -55,15 +54,21 @@ public class ContentNegotiationDollarFormatTest extends AbstractBasicTest {
@Override
protected ODataSingleProcessor createProcessor() throws ODataException {
- // service document
+ // service document
final String contentType = HttpContentType.APPLICATION_ATOM_SVC_UTF8;
- final ODataResponse responseAtomXml = ODataResponse.status(HttpStatusCodes.OK).contentHeader(contentType).entity("Test passed.").build();
- when(((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class), eq(contentType))).thenReturn(responseAtomXml);
+ final ODataResponse responseAtomXml =
+ ODataResponse.status(HttpStatusCodes.OK).contentHeader(contentType).entity("Test passed.").build();
+ when(
+ ((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),
+ eq(contentType))).thenReturn(responseAtomXml);
// csv
- final ODataResponse value = ODataResponse.status(HttpStatusCodes.OK).contentHeader(CUSTOM_CONTENT_TYPE).entity("any content").build();
- when(((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class), eq("csv"))).thenReturn(value);
- when(((CustomContentType) processor).getCustomContentTypes(ServiceDocumentProcessor.class)).thenReturn(Arrays.asList("csv"));
+ final ODataResponse value =
+ ODataResponse.status(HttpStatusCodes.OK).contentHeader(CUSTOM_CONTENT_TYPE).entity("any content").build();
+ when(((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class), eq("csv")))
+ .thenReturn(value);
+ when(((CustomContentType) processor).getCustomContentTypes(ServiceDocumentProcessor.class)).thenReturn(
+ Arrays.asList("csv"));
return processor;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContextTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContextTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContextTest.java
index f3b754c..bd2bbde 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContextTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ContextTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -35,8 +35,6 @@ import javax.ws.rs.core.Response.Status;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.ODataService;
import org.apache.olingo.odata2.api.commons.HttpHeaders;
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
@@ -48,6 +46,7 @@ import org.apache.olingo.odata2.api.processor.part.MetadataProcessor;
import org.apache.olingo.odata2.api.processor.part.ServiceDocumentProcessor;
import org.apache.olingo.odata2.api.uri.info.GetMetadataUriInfo;
import org.apache.olingo.odata2.api.uri.info.GetServiceDocumentUriInfo;
+import org.junit.Test;
/**
*
@@ -57,8 +56,11 @@ public class ContextTest extends AbstractBasicTest {
@Override
protected ODataSingleProcessor createProcessor() throws ODataException {
final ODataSingleProcessor processor = mock(ODataSingleProcessor.class);
- when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
- when(((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("service document").status(HttpStatusCodes.OK).build());
+ when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(
+ ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
+ when(
+ ((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),
+ any(String.class))).thenReturn(ODataResponse.entity("service document").status(HttpStatusCodes.OK).build());
return processor;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ErrorResponseTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ErrorResponseTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ErrorResponseTest.java
index e02d7f2..c5c01eb 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ErrorResponseTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ErrorResponseTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -27,14 +27,13 @@ import java.io.IOException;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
import org.apache.olingo.odata2.api.processor.part.ServiceDocumentProcessor;
import org.apache.olingo.odata2.api.uri.info.GetServiceDocumentUriInfo;
import org.apache.olingo.odata2.core.exception.ODataRuntimeException;
+import org.junit.Test;
/**
*
@@ -45,7 +44,9 @@ public class ErrorResponseTest extends AbstractBasicTest {
protected ODataSingleProcessor createProcessor() throws ODataException {
final ODataSingleProcessor processor = mock(ODataSingleProcessor.class);
- when(((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class), any(String.class))).thenThrow(new ODataRuntimeException("unit testing"));
+ when(
+ ((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),
+ any(String.class))).thenThrow(new ODataRuntimeException("unit testing"));
return processor;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ExceptionsTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ExceptionsTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ExceptionsTest.java
index a40747d..7d5d2f6 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ExceptionsTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ExceptionsTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -26,15 +26,14 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.http.HttpResponse;
-import org.custommonkey.xmlunit.SimpleNamespaceContext;
-import org.custommonkey.xmlunit.XMLUnit;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.edm.Edm;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.custommonkey.xmlunit.SimpleNamespaceContext;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.junit.Test;
/**
*
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/FitLoadTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/FitLoadTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/FitLoadTest.java
index 2cc063a..7d846bd 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/FitLoadTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/FitLoadTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -56,8 +56,11 @@ public class FitLoadTest extends AbstractBasicTest {
@Override
protected ODataSingleProcessor createProcessor() throws ODataException {
ODataSingleProcessor processor = mock(ODataSingleProcessor.class);
- when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
- when(((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("service document").status(HttpStatusCodes.OK).build());
+ when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(
+ ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
+ when(
+ ((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),
+ any(String.class))).thenReturn(ODataResponse.entity("service document").status(HttpStatusCodes.OK).build());
return processor;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/HttpExceptionResponseTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/HttpExceptionResponseTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/HttpExceptionResponseTest.java
index f0c40d2..768c9f4 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/HttpExceptionResponseTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/HttpExceptionResponseTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -31,14 +31,6 @@ import java.util.Locale;
import java.util.Map;
import org.apache.http.HttpResponse;
-import org.custommonkey.xmlunit.SimpleNamespaceContext;
-import org.custommonkey.xmlunit.XMLUnit;
-import org.hamcrest.BaseMatcher;
-import org.hamcrest.Description;
-import org.hamcrest.Matcher;
-import org.junit.Test;
-import org.mockito.Matchers;
-
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.edm.Edm;
import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
@@ -54,6 +46,13 @@ import org.apache.olingo.odata2.core.uri.UriInfoImpl;
import org.apache.olingo.odata2.ref.edm.ScenarioEdmProvider;
import org.apache.olingo.odata2.testutil.helper.ClassHelper;
import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.custommonkey.xmlunit.SimpleNamespaceContext;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.junit.Test;
+import org.mockito.Matchers;
/**
*
@@ -77,7 +76,8 @@ public class HttpExceptionResponseTest extends AbstractBasicTest {
@Test
public void test404HttpNotFound() throws Exception {
- when(processor.readEntity(any(GetEntityUriInfo.class), any(String.class))).thenThrow(new ODataNotFoundException(ODataNotFoundException.ENTITY));
+ when(processor.readEntity(any(GetEntityUriInfo.class), any(String.class))).thenThrow(
+ new ODataNotFoundException(ODataNotFoundException.ENTITY));
final HttpResponse response = executeGetRequest("Managers('199')");
assertEquals(HttpStatusCodes.NOT_FOUND.getStatusCode(), response.getStatusLine().getStatusCode());
@@ -87,7 +87,8 @@ public class HttpExceptionResponseTest extends AbstractBasicTest {
prefixMap.put("a", Edm.NAMESPACE_M_2007_08);
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap));
assertXpathExists("/a:error/a:code", content);
- assertXpathValuesEqual("\"" + MessageService.getMessage(Locale.ENGLISH, ODataNotFoundException.ENTITY).getText() + "\"", "/a:error/a:message", content);
+ assertXpathValuesEqual("\"" + MessageService.getMessage(Locale.ENGLISH, ODataNotFoundException.ENTITY).getText()
+ + "\"", "/a:error/a:message", content);
}
@Test
@@ -104,7 +105,8 @@ public class HttpExceptionResponseTest extends AbstractBasicTest {
final HttpResponse response = executeGetRequest("Managers('" + key + "')");
- assertEquals("Expected status code does not match for exception type '" + oDataException.getClass().getSimpleName() + "'.",
+ assertEquals("Expected status code does not match for exception type '"
+ + oDataException.getClass().getSimpleName() + "'.",
oDataException.getHttpStatus().getStatusCode(), response.getStatusLine().getStatusCode());
final String content = StringHelper.inputStreamToString(response.getEntity().getContent());
@@ -117,7 +119,8 @@ public class HttpExceptionResponseTest extends AbstractBasicTest {
}
private List<ODataHttpException> getHttpExceptionsForTest() throws Exception {
- final List<Class<ODataHttpException>> exClasses = ClassHelper.getAssignableClasses("org.apache.olingo.odata2.api.exception", ODataHttpException.class);
+ final List<Class<ODataHttpException>> exClasses =
+ ClassHelper.getAssignableClasses("org.apache.olingo.odata2.api.exception", ODataHttpException.class);
final MessageReference mr = MessageReference.create(ODataHttpException.class, "SIMPLE FOR TEST");
return ClassHelper.getClassInstances(exClasses, new Class<?>[] { MessageReference.class }, new Object[] { mr });
@@ -150,7 +153,7 @@ public class HttpExceptionResponseTest extends AbstractBasicTest {
@Override
public void describeTo(final Description description) {
- // description.appendText("");
+ // description.appendText("");
}
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/LanguageNegotiationTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/LanguageNegotiationTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/LanguageNegotiationTest.java
index 569b339..d73dd7d 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/LanguageNegotiationTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/LanguageNegotiationTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -33,13 +33,6 @@ import java.util.Map;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
-import org.custommonkey.xmlunit.SimpleNamespaceContext;
-import org.custommonkey.xmlunit.XMLUnit;
-import org.custommonkey.xmlunit.exceptions.XpathException;
-import org.junit.Before;
-import org.junit.Test;
-import org.xml.sax.SAXException;
-
import org.apache.olingo.odata2.api.commons.HttpHeaders;
import org.apache.olingo.odata2.api.edm.Edm;
import org.apache.olingo.odata2.api.exception.MessageReference;
@@ -49,6 +42,12 @@ import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
import org.apache.olingo.odata2.api.processor.part.MetadataProcessor;
import org.apache.olingo.odata2.api.uri.info.GetMetadataUriInfo;
import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.custommonkey.xmlunit.SimpleNamespaceContext;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.custommonkey.xmlunit.exceptions.XpathException;
+import org.junit.Before;
+import org.junit.Test;
+import org.xml.sax.SAXException;
/**
*
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/MetadataTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/MetadataTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/MetadataTest.java
index 932eeeb..b91d784 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/MetadataTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/MetadataTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -27,8 +27,6 @@ import java.io.IOException;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.api.processor.ODataResponse;
@@ -36,6 +34,7 @@ import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
import org.apache.olingo.odata2.api.processor.part.MetadataProcessor;
import org.apache.olingo.odata2.api.uri.info.GetMetadataUriInfo;
import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
/**
*
@@ -45,7 +44,8 @@ public class MetadataTest extends AbstractBasicTest {
@Override
protected ODataSingleProcessor createProcessor() throws ODataException {
final ODataSingleProcessor processor = mock(ODataSingleProcessor.class);
- when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
+ when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(
+ ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
return processor;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/RequestContentTypeTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/RequestContentTypeTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/RequestContentTypeTest.java
index d41ec44..ba9bbdc 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/RequestContentTypeTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/RequestContentTypeTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -28,15 +28,14 @@ import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPatch;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
-import org.junit.Before;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
import org.apache.olingo.odata2.testutil.mock.EdmTestProvider;
+import org.junit.Before;
+import org.junit.Test;
/**
*
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java
index 156e019..f357602 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -36,12 +36,6 @@ import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
import org.apache.olingo.odata2.api.exception.ODataException;
@@ -56,6 +50,11 @@ import org.apache.olingo.odata2.core.processor.ODataSingleProcessorService;
import org.apache.olingo.odata2.testutil.fit.BaseTest;
import org.apache.olingo.odata2.testutil.helper.StringHelper;
import org.apache.olingo.odata2.testutil.server.TestServer;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
/**
*
@@ -74,7 +73,7 @@ public class ServiceResolutionTest extends BaseTest {
final EdmProvider provider = mock(EdmProvider.class);
service = new ODataSingleProcessorService(provider, processor) {};
- // FitStaticServiceFactory.setService(service);
+ // FitStaticServiceFactory.setService(service);
// science fiction (return context after setContext)
// see http://www.planetgeek.ch/2010/07/20/mockito-answer-vs-return/
@@ -94,8 +93,12 @@ public class ServiceResolutionTest extends BaseTest {
}
});
- when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
- when(((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("servicedocument").status(HttpStatusCodes.OK).build());
+ when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(
+ ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
+ when(
+ ((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),
+ any(String.class)))
+ .thenReturn(ODataResponse.entity("servicedocument").status(HttpStatusCodes.OK).build());
} catch (final ODataException e) {
throw new RuntimeException(e);
}
@@ -234,7 +237,8 @@ public class ServiceResolutionTest extends BaseTest {
}
@Test
- public void testBaseUriWithMatrixParameter() throws ClientProtocolException, IOException, ODataException, URISyntaxException {
+ public void testBaseUriWithMatrixParameter() throws ClientProtocolException, IOException, ODataException,
+ URISyntaxException {
server.setPathSplit(3);
startServer();
@@ -250,11 +254,14 @@ public class ServiceResolutionTest extends BaseTest {
}
@Test
- public void testBaseUriWithEncoding() throws ClientProtocolException, IOException, ODataException, URISyntaxException {
+ public void testBaseUriWithEncoding() throws ClientProtocolException, IOException, ODataException,
+ URISyntaxException {
server.setPathSplit(3);
startServer();
- final URI uri = new URI(server.getEndpoint().getScheme(), null, server.getEndpoint().getHost(), server.getEndpoint().getPort(), server.getEndpoint().getPath() + "/aaa/äдержb;n=2, 3;m=1/c c/", null, null);
+ final URI uri =
+ new URI(server.getEndpoint().getScheme(), null, server.getEndpoint().getHost(), server.getEndpoint().getPort(),
+ server.getEndpoint().getPath() + "/aaa/äдержb;n=2, 3;m=1/c c/", null, null);
final HttpGet get = new HttpGet(uri);
final HttpResponse response = httpClient.execute(get);
@@ -263,7 +270,8 @@ public class ServiceResolutionTest extends BaseTest {
final ODataContext context = service.getProcessor().getContext();
assertNotNull(context);
- assertEquals(server.getEndpoint() + "aaa/%C3%A4%D0%B4%D0%B5%D1%80%D0%B6b;n=2,%203;m=1/c%20c/", context.getPathInfo().getServiceRoot().toASCIIString());
+ assertEquals(server.getEndpoint() + "aaa/%C3%A4%D0%B4%D0%B5%D1%80%D0%B6b;n=2,%203;m=1/c%20c/", context
+ .getPathInfo().getServiceRoot().toASCIIString());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/UrlRewriteTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/UrlRewriteTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/UrlRewriteTest.java
index 08683f4..d8417de 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/UrlRewriteTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/UrlRewriteTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic;
@@ -36,8 +36,6 @@ import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpParams;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.api.processor.ODataResponse;
@@ -49,6 +47,7 @@ import org.apache.olingo.odata2.api.uri.info.GetServiceDocumentUriInfo;
import org.apache.olingo.odata2.testutil.helper.HttpMerge;
import org.apache.olingo.odata2.testutil.helper.HttpSomethingUnsupported;
import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
/**
*
@@ -58,8 +57,11 @@ public class UrlRewriteTest extends AbstractBasicTest {
@Override
protected ODataSingleProcessor createProcessor() throws ODataException {
final ODataSingleProcessor processor = mock(ODataSingleProcessor.class);
- when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
- when(((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("service document").status(HttpStatusCodes.OK).build());
+ when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(
+ ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
+ when(
+ ((ServiceDocumentProcessor) processor).readServiceDocument(any(GetServiceDocumentUriInfo.class),
+ any(String.class))).thenReturn(ODataResponse.entity("service document").status(HttpStatusCodes.OK).build());
return processor;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/issues/TestIssue105.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/issues/TestIssue105.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/issues/TestIssue105.java
index c136552..219a334 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/issues/TestIssue105.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/issues/TestIssue105.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.basic.issues;
@@ -31,8 +31,6 @@ import java.net.URISyntaxException;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.api.processor.ODataResponse;
@@ -40,6 +38,7 @@ import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
import org.apache.olingo.odata2.api.processor.part.MetadataProcessor;
import org.apache.olingo.odata2.api.uri.info.GetMetadataUriInfo;
import org.apache.olingo.odata2.fit.basic.AbstractBasicTest;
+import org.junit.Test;
/**
*
@@ -49,12 +48,14 @@ public class TestIssue105 extends AbstractBasicTest {
@Override
protected ODataSingleProcessor createProcessor() throws ODataException {
final ODataSingleProcessor processor = mock(ODataSingleProcessor.class);
- when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
+ when(((MetadataProcessor) processor).readMetadata(any(GetMetadataUriInfo.class), any(String.class))).thenReturn(
+ ODataResponse.entity("metadata").status(HttpStatusCodes.OK).build());
return processor;
}
@Test
- public void checkContextForDifferentHostNamesRequests() throws ClientProtocolException, IOException, ODataException, URISyntaxException {
+ public void checkContextForDifferentHostNamesRequests() throws ClientProtocolException, IOException, ODataException,
+ URISyntaxException {
URI uri1 = URI.create(getEndpoint().toString() + "$metadata");
HttpGet get1 = new HttpGet(uri1);
@@ -66,7 +67,9 @@ public class TestIssue105 extends AbstractBasicTest {
get1.reset();
- URI uri2 = new URI(uri1.getScheme(), uri1.getUserInfo(), "127.0.0.1", uri1.getPort(), uri1.getPath(), uri1.getQuery(), uri1.getFragment());
+ URI uri2 =
+ new URI(uri1.getScheme(), uri1.getUserInfo(), "127.0.0.1", uri1.getPort(), uri1.getPath(), uri1.getQuery(),
+ uri1.getFragment());
HttpGet get2 = new HttpGet(uri2);
HttpResponse response2 = getHttpClient().execute(get2);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/client/ClientBatchTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/client/ClientBatchTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/client/ClientBatchTest.java
index 61eb4b2..82d3223 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/client/ClientBatchTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/client/ClientBatchTest.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.client;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapFactory.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapFactory.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapFactory.java
index d7ee2c4..cfa15ee 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapFactory.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapFactory.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.mapping;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapProcessor.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapProcessor.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapProcessor.java
index 2af6875..ded1086 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapProcessor.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/mapping/MapProcessor.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.fit.mapping;
@@ -61,8 +61,10 @@ public class MapProcessor extends ODataSingleProcessor {
}
@Override
- public ODataResponse readEntitySet(final GetEntitySetUriInfo uriInfo, final String contentType) throws ODataException {
- final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).build();
+ public ODataResponse readEntitySet(final GetEntitySetUriInfo uriInfo, final String contentType)
+ throws ODataException {
+ final EntityProviderWriteProperties properties =
+ EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).build();
final List<Map<String, Object>> values = new ArrayList<Map<String, Object>>();
@@ -78,17 +80,20 @@ public class MapProcessor extends ODataSingleProcessor {
values.add(data);
}
- final ODataResponse response = EntityProvider.writeFeed(contentType, uriInfo.getTargetEntitySet(), values, properties);
+ final ODataResponse response =
+ EntityProvider.writeFeed(contentType, uriInfo.getTargetEntitySet(), values, properties);
return response;
}
@Override
public ODataResponse readEntity(final GetEntityUriInfo uriInfo, final String contentType) throws ODataException {
- final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).build();
+ final EntityProviderWriteProperties properties =
+ EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).build();
// query
- final String mappedKeyName = (String) uriInfo.getTargetEntitySet().getEntityType().getKeyProperties().get(0).getMapping().getObject();
+ final String mappedKeyName =
+ (String) uriInfo.getTargetEntitySet().getEntityType().getKeyProperties().get(0).getMapping().getObject();
final String keyValue = uriInfo.getKeyPredicates().get(0).getLiteral();
final int index = indexOf(mappedKeyName, keyValue);
if ((index < 0) || (index > records.size())) {
@@ -103,16 +108,19 @@ public class MapProcessor extends ODataSingleProcessor {
data.put(pName, record.get(mappedPropertyName));
}
- final ODataResponse response = EntityProvider.writeEntry(contentType, uriInfo.getTargetEntitySet(), data, properties);
+ final ODataResponse response =
+ EntityProvider.writeEntry(contentType, uriInfo.getTargetEntitySet(), data, properties);
return response;
}
@Override
- public ODataResponse readEntitySimplePropertyValue(final GetSimplePropertyUriInfo uriInfo, final String contentType) throws ODataException {
+ public ODataResponse readEntitySimplePropertyValue(final GetSimplePropertyUriInfo uriInfo, final String contentType)
+ throws ODataException {
final List<EdmProperty> propertyPath = uriInfo.getPropertyPath();
final EdmProperty property = propertyPath.get(propertyPath.size() - 1);
- final String mappedKeyName = (String) uriInfo.getTargetEntitySet().getEntityType().getKeyProperties().get(0).getMapping().getObject();
+ final String mappedKeyName =
+ (String) uriInfo.getTargetEntitySet().getEntityType().getKeyProperties().get(0).getMapping().getObject();
final String keyValue = uriInfo.getKeyPredicates().get(0).getLiteral();
final int index = indexOf(mappedKeyName, keyValue);