http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java index 814fad4..50ab97b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java @@ -6,9 +6,9 @@ * 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 @@ -35,9 +35,9 @@ import org.apache.olingo.client.api.communication.request.retrieve.ODataProperty import org.apache.olingo.client.api.communication.request.retrieve.ODataValueRequest; import org.apache.olingo.client.api.communication.response.ODataDeleteResponse; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.core.ODataClientFactory; import org.apache.olingo.client.api.domain.ClientPrimitiveValue; import org.apache.olingo.client.api.domain.ClientProperty; +import org.apache.olingo.client.core.ODataClientFactory; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.http.HttpHeader;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java index 4362f44..2c5eea1 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java @@ -6,9 +6,9 @@ * 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 @@ -26,10 +26,10 @@ import java.net.URI; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.ODataClientErrorException; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.api.uri.QueryOption; -import org.apache.olingo.client.core.ODataClientFactory; import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientEntitySet; +import org.apache.olingo.client.api.uri.QueryOption; +import org.apache.olingo.client.core.ODataClientFactory; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.http.HttpStatusCode; import org.apache.olingo.fit.AbstractBaseTestITCase; @@ -256,7 +256,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { assertEquals( "http://localhost:9080/odata-server-tecsvc/odata.svc/ESServerSidePaging?%24count=true&%24skiptoken=" + token, - nextLink.toASCIIString()); + nextLink.toASCIIString()); } } @@ -273,9 +273,9 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { .build(); try { - ODataRetrieveResponse<ClientEntitySet> response = client.getRetrieveRequestFactory() - .getEntitySetRequest(uri) - .execute(); + client.getRetrieveRequestFactory() + .getEntitySetRequest(uri) + .execute(); fail(); } catch (ODataClientErrorException e) { assertEquals(HttpStatusCode.BAD_REQUEST.getStatusCode(), e.getStatusLine().getStatusCode()); @@ -291,9 +291,9 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { .addQueryOption(QueryOption.TOP, new Integer(-5).toString()) .build(); try { - ODataRetrieveResponse<ClientEntitySet> response = client.getRetrieveRequestFactory() - .getEntitySetRequest(uri) - .execute(); + client.getRetrieveRequestFactory() + .getEntitySetRequest(uri) + .execute(); fail(); } catch (ODataClientErrorException e) { assertEquals(HttpStatusCode.BAD_REQUEST.getStatusCode(), e.getStatusLine().getStatusCode()); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java index 025f57c..11b7a3e 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java @@ -6,9 +6,9 @@ * 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 @@ -46,23 +46,23 @@ public class BasicBatchITCase extends AbstractBaseTestITCase { private static final String CONTENT_TYPE_HEADER_VALUE = " multipart/mixed;boundary=batch_123"; private static final String CRLF = "\r\n"; private static final String ACCEPT_HEADER_VALUE = "application/json"; - + @Test public void test() throws IOException { final String content = getRequest("ESAllPrim(32767)"); final HttpURLConnection connection = batch(content); final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - + assertTrue(reader.readLine().contains("batch_")); checkMimeHeader(reader); blankLine(reader); - + assertEquals("HTTP/1.1 200 OK", reader.readLine()); assertEquals("OData-Version: 4.0", reader.readLine()); assertEquals("Content-Type: application/json;odata.metadata=minimal", reader.readLine()); assertEquals("Content-Length: 538", reader.readLine()); blankLine(reader); - + reader.close(); } @@ -77,44 +77,43 @@ public class BasicBatchITCase extends AbstractBaseTestITCase { final String content = getRequest(SERVICE_URI + "../ESAllPrim(32767)"); HttpURLConnection connection = batch(content); final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - + assertTrue(reader.readLine().contains("batch_")); checkMimeHeader(reader); blankLine(reader); - + assertEquals("HTTP/1.1 400 Bad Request", reader.readLine()); } - @Test public void testNestedAbsoluteRequest() throws IOException { final String content = getRequest(SERVICE_URI + SERVICE_URI + "../ESAllPrim(32767)"); HttpURLConnection connection = batch(content); final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - + assertTrue(reader.readLine().contains("batch_")); checkMimeHeader(reader); blankLine(reader); - + assertEquals("HTTP/1.1 400 Bad Request", reader.readLine()); } - + @Test public void testInvalidHost() throws IOException { final String content = getRequest("http://otherhost/odata/odata.svc/ESAllPrim(32767)"); batchFail(content); } - + private void checkMimeHeader(final BufferedReader reader) throws IOException { assertEquals(HEADER_CONTENT_TYPE_HTTP, reader.readLine()); assertEquals(HEADER_CONTENT_TRANSFER_ENCODING_BINARY, reader.readLine()); } - - private void blankLine(BufferedReader reader) throws IOException { - assertEquals("", reader.readLine()); // CRLF becomes to an empty string + + private void blankLine(final BufferedReader reader) throws IOException { + assertEquals("", reader.readLine()); // CRLF becomes to an empty string } - - private String getRequest(String uri) { + + private String getRequest(final String uri) { return "--batch_123" + CRLF + HEADER_CONTENT_TRANSFER_ENCODING_BINARY + CRLF + HEADER_CONTENT_TYPE_HTTP + CRLF @@ -133,14 +132,16 @@ public class BasicBatchITCase extends AbstractBaseTestITCase { return connection; } - private HttpURLConnection batchFail(String content) throws IOException { + private HttpURLConnection batchFail(final String content) throws IOException { final HttpURLConnection connection = getConnection(content); assertEquals(HttpStatusCode.BAD_REQUEST.getStatusCode(), connection.getResponseCode()); - return connection; } + return connection; + } - private HttpURLConnection getConnection(String content) throws MalformedURLException, IOException, ProtocolException { + private HttpURLConnection getConnection(final String content) throws MalformedURLException, IOException, + ProtocolException { final URL url = new URL(SERVICE_URI + "$batch"); final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod(HttpMethod.POST.toString()); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java index 3084b64..1a66f11 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java @@ -1,18 +1,18 @@ -/* +/* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 - * + * 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 + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ @@ -30,7 +30,7 @@ import org.apache.olingo.fit.AbstractBaseTestITCase; import org.apache.olingo.fit.tecsvc.TecSvcConst; import org.junit.Test; -public class BasicHttpITCase extends AbstractBaseTestITCase{ +public class BasicHttpITCase extends AbstractBaseTestITCase { private static final String SERVICE_URI = TecSvcConst.BASE_URI + "/"; @@ -56,7 +56,7 @@ public class BasicHttpITCase extends AbstractBaseTestITCase{ connection.setRequestMethod("GET"); connection.setRequestProperty(HttpHeader.ACCEPT, "application/json;q=0.2;odata.metadata=minimal"); - + connection.connect(); int code = connection.getResponseCode(); @@ -73,7 +73,7 @@ public class BasicHttpITCase extends AbstractBaseTestITCase{ connection.setRequestMethod("GET"); connection.setRequestProperty(HttpHeader.ACCEPT, "application/json"); - + connection.connect(); int code = connection.getResponseCode(); @@ -90,7 +90,7 @@ public class BasicHttpITCase extends AbstractBaseTestITCase{ connection.setRequestMethod("GET"); connection.setRequestProperty(HttpHeader.ACCEPT, "application/json;q=0.2;odata.metadata=minimal;charset=utf-8"); - + connection.connect(); int code = connection.getResponseCode(); @@ -108,7 +108,7 @@ public class BasicHttpITCase extends AbstractBaseTestITCase{ connection.setRequestMethod("GET"); connection.setRequestProperty(HttpHeader.ODATA_MAX_VERSION, "4.0"); connection.setRequestProperty(HttpHeader.ACCEPT, "*/*"); - + connection.connect(); int code = connection.getResponseCode(); @@ -122,6 +122,4 @@ public class BasicHttpITCase extends AbstractBaseTestITCase{ return null; } - - } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java index d772fbe..b016a4b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java @@ -1,18 +1,18 @@ -/* +/* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 - * + * 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 + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ @@ -29,7 +29,7 @@ import org.apache.olingo.fit.AbstractBaseTestITCase; import org.apache.olingo.fit.tecsvc.TecSvcConst; import org.junit.Test; -public class PingITCase extends AbstractBaseTestITCase{ +public class PingITCase extends AbstractBaseTestITCase { private static final String SERVICE_URI = TecSvcConst.BASE_URI + "/"; private static final String REDIRECT_URI = TecSvcConst.BASE_URI; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/AbstractTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/AbstractTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/AbstractTestITCase.java index c740607..402a1e2 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/AbstractTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/AbstractTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,6 +18,19 @@ */ package org.apache.olingo.fit.v4; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; + +import java.io.IOException; +import java.math.BigDecimal; +import java.net.URI; +import java.util.Calendar; +import java.util.TimeZone; + import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest; @@ -25,32 +38,19 @@ import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateR import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; import org.apache.olingo.client.api.communication.response.ODataDeleteResponse; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.core.ODataClientFactory; import org.apache.olingo.client.api.domain.ClientCollectionValue; import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.client.api.domain.ClientValue; +import org.apache.olingo.client.core.ODataClientFactory; +import org.apache.olingo.client.core.domain.ClientEntityImpl; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.format.ODataFormat; -import org.apache.olingo.client.core.domain.ClientEntityImpl; import org.apache.olingo.fit.AbstractBaseTestITCase; import org.junit.BeforeClass; -import java.io.IOException; -import java.math.BigDecimal; -import java.net.URI; -import java.util.Calendar; -import java.util.TimeZone; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; - public abstract class AbstractTestITCase extends AbstractBaseTestITCase { protected static final ODataClient client = ODataClientFactory.getClient(); @@ -126,12 +126,12 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase { dateTime.set(2011, 2, 4, 16, 3, 57); final ClientProperty orderDate = getClient().getObjectFactory().newPrimitiveProperty("OrderDate", getClient().getObjectFactory().newPrimitiveValueBuilder() - .setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(dateTime).build()); + .setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(dateTime).build()); order.getProperties().add(orderDate); final ClientProperty shelfLife = getClient().getObjectFactory().newPrimitiveProperty("ShelfLife", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.Duration).setValue(BigDecimal.TEN.scaleByPowerOfTen(7)).build()); + setType(EdmPrimitiveTypeKind.Duration).setValue(BigDecimal.TEN.scaleByPowerOfTen(7)).build()); order.getProperties().add(shelfLife); final ClientCollectionValue<ClientValue> orderShelfLifesValue = getClient().getObjectFactory(). @@ -146,7 +146,7 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase { final ODataEntityCreateRequest<ClientEntity> req = getClient().getCUDRequestFactory().getEntityCreateRequest( getClient().newURIBuilder(serviceRoot). - appendEntitySetSegment("Orders").build(), order); + appendEntitySetSegment("Orders").build(), order); req.setFormat(format); final ClientEntity created = req.execute().getBody(); assertNotNull(created); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/AsyncTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/AsyncTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/AsyncTestITCase.java index ad89514..ded0d97 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/AsyncTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/AsyncTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,30 +18,30 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.net.URI; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + import org.apache.olingo.client.api.communication.request.AsyncRequestWrapper; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest; import org.apache.olingo.client.api.communication.response.AsyncResponseWrapper; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.api.domain.ClientEntity; -import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.client.api.domain.ClientInlineEntity; import org.apache.olingo.client.api.domain.ClientLink; +import org.apache.olingo.client.api.domain.ClientProperty; +import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.net.URI; -import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - public class AsyncTestITCase extends AbstractTestITCase { @Test http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java index f5175e0..47d50c0 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,6 +18,10 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; + +import java.net.URI; + import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.header.HeaderName; import org.apache.olingo.client.api.communication.request.batch.BatchManager; @@ -27,21 +31,17 @@ import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateR import org.apache.olingo.client.api.communication.request.cud.UpdateType; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; import org.apache.olingo.client.api.communication.response.ODataBatchResponse; +import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.http.HttpClientException; import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.core.ODataClientFactory; import org.apache.olingo.client.core.http.BasicAuthHttpClientFactory; -import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.net.URI; - -import static org.junit.Assert.assertEquals; - public class AuthBatchTestITCase extends AbstractTestITCase { private final static ContentType ACCEPT = ContentType.APPLICATION_OCTET_STREAM; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java index 33509da..50a6260 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,6 +18,21 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.math.BigDecimal; +import java.net.URI; +import java.util.Calendar; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + import org.apache.http.HttpResponse; import org.apache.olingo.client.api.ODataBatchConstants; import org.apache.olingo.client.api.communication.header.HeaderName; @@ -38,6 +53,8 @@ import org.apache.olingo.client.api.communication.response.ODataBatchResponse; import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse; import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse; import org.apache.olingo.client.api.communication.response.ODataResponse; +import org.apache.olingo.client.api.domain.ClientEntity; +import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.core.communication.request.AbstractODataStreamManager; import org.apache.olingo.client.core.communication.request.Wrapper; @@ -46,8 +63,6 @@ import org.apache.olingo.client.core.communication.request.batch.ODataSingleResp import org.apache.olingo.client.core.communication.request.retrieve.ODataEntityRequestImpl; import org.apache.olingo.client.core.communication.request.retrieve.ODataEntityRequestImpl.ODataEntityResponseImpl; import org.apache.olingo.client.core.uri.URIUtils; -import org.apache.olingo.client.api.domain.ClientEntity; -import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; @@ -55,21 +70,6 @@ import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.io.IOException; -import java.math.BigDecimal; -import java.net.URI; -import java.util.Calendar; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - public class BatchTestITCase extends AbstractTestITCase { private static final String PREFIX = "!!PREFIX!!"; @@ -265,14 +265,14 @@ public class BatchTestITCase extends AbstractTestITCase { customerChanges.addLink(client.getObjectFactory().newEntitySetNavigationLink( "OrderDetails", client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("OrderDetails"). - appendKeySegment(new HashMap<String, Object>() { - private static final long serialVersionUID = 3109256773218160485L; + appendKeySegment(new HashMap<String, Object>() { + private static final long serialVersionUID = 3109256773218160485L; - { - put("OrderID", 7); - put("ProductID", 5); - } - }).build())); + { + put("OrderID", 7); + put("ProductID", 5); + } + }).build())); final ODataEntityUpdateRequest<ClientEntity> updateReq = client.getCUDRequestFactory().getEntityUpdateRequest( URI.create("$" + createRequestRef), UpdateType.PATCH, customerChanges); @@ -301,7 +301,7 @@ public class BatchTestITCase extends AbstractTestITCase { assertEquals(Integer.valueOf(7), req.execute().getBody().getEntities().get(0).getProperty("OrderID").getPrimitiveValue(). - toCastValue(Integer.class)); + toCastValue(Integer.class)); res = chgitem.next(); assertEquals(204, res.getStatusCode()); @@ -336,7 +336,7 @@ public class BatchTestITCase extends AbstractTestITCase { // prepare URI URIBuilder targetURI = client.newURIBuilder(testStaticServiceRootURL); targetURI.appendEntitySetSegment("Customers").appendKeySegment(1). - expand("Orders").select("PersonID,Orders/OrderID"); + expand("Orders").select("PersonID,Orders/OrderID"); // create new request ODataEntityRequest<ClientEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(targetURI.build()); @@ -644,14 +644,14 @@ public class BatchTestITCase extends AbstractTestITCase { getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(id))); order.getProperties().add(getClient().getObjectFactory().newPrimitiveProperty("OrderDate", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()).build())); + setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()).build())); order.getProperties().add(getClient().getObjectFactory().newPrimitiveProperty("ShelfLife", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.Duration).setValue(new BigDecimal("0.0000002")).build())); + setType(EdmPrimitiveTypeKind.Duration).setValue(new BigDecimal("0.0000002")).build())); order.getProperties().add(getClient().getObjectFactory().newCollectionProperty("OrderShelfLifes", getClient().getObjectFactory().newCollectionValue(EdmPrimitiveTypeKind.Duration.name()).add( getClient().getObjectFactory().newPrimitiveValueBuilder().setType(EdmPrimitiveTypeKind.Duration). - setValue(new BigDecimal("0.0000002")).build()))); + setValue(new BigDecimal("0.0000002")).build()))); return order; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/BoundOperationInvokeTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/BoundOperationInvokeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/BoundOperationInvokeTestITCase.java index 1437e8c..890b878 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/BoundOperationInvokeTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/BoundOperationInvokeTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,9 +18,19 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Calendar; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.TimeZone; + import org.apache.olingo.client.api.communication.request.invoke.ODataInvokeRequest; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; -import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.api.domain.ClientCollectionValue; import org.apache.olingo.client.api.domain.ClientComplexValue; import org.apache.olingo.client.api.domain.ClientEntity; @@ -31,23 +41,13 @@ import org.apache.olingo.client.api.domain.ClientPrimitiveValue; import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.client.api.domain.ClientSingleton; import org.apache.olingo.client.api.domain.ClientValue; +import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.util.Calendar; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.TimeZone; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - public class BoundOperationInvokeTestITCase extends AbstractTestITCase { private void functions(final ODataFormat format) throws EdmPrimitiveTypeException { @@ -254,7 +254,7 @@ public class BoundOperationInvokeTestITCase extends AbstractTestITCase { final ODataInvokeRequest<ClientProperty> getActualAmountReq = edmClient.getInvokeRequestFactory().getBoundFunctionInvokeRequest( edmClient.newURIBuilder().appendEntitySetSegment("Accounts").appendKeySegment(102). - appendNavigationSegment("MyGiftCard").build(), + appendNavigationSegment("MyGiftCard").build(), new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.GetActualAmount"), new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.GiftCard"), false, @@ -320,7 +320,7 @@ public class BoundOperationInvokeTestITCase extends AbstractTestITCase { final ClientCollectionValue<ClientValue> addresses = client.getObjectFactory(). - newCollectionValue("Collection(Microsoft.Test.OData.Services.ODataWCFService.Address)"); + newCollectionValue("Collection(Microsoft.Test.OData.Services.ODataWCFService.Address)"); final ClientComplexValue address = client.getObjectFactory(). newComplexValue("Microsoft.Test.OData.Services.ODataWCFService.Address"); address.add(client.getObjectFactory().newPrimitiveProperty("Street", @@ -410,7 +410,7 @@ public class BoundOperationInvokeTestITCase extends AbstractTestITCase { // ResetAddress final ClientCollectionValue<ClientValue> addresses = edmClient.getObjectFactory(). - newCollectionValue("Collection(Microsoft.Test.OData.Services.ODataWCFService.Address)"); + newCollectionValue("Collection(Microsoft.Test.OData.Services.ODataWCFService.Address)"); final ClientComplexValue address = edmClient.getObjectFactory(). newComplexValue("Microsoft.Test.OData.Services.ODataWCFService.Address"); address.add(edmClient.getObjectFactory().newPrimitiveProperty("Street", http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java index 3ca87ce..e3e9eb8 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -42,20 +42,20 @@ import org.apache.olingo.client.api.communication.response.ODataDeleteResponse; import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse; import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.api.uri.URIBuilder; -import org.apache.olingo.client.core.http.BasicAuthHttpClientFactory; -import org.apache.olingo.client.core.http.DefaultHttpClientFactory; -import org.apache.olingo.client.core.uri.URIUtils; import org.apache.olingo.client.api.domain.ClientCollectionValue; import org.apache.olingo.client.api.domain.ClientDelta; import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.client.api.domain.ClientValue; +import org.apache.olingo.client.api.uri.URIBuilder; +import org.apache.olingo.client.core.domain.ClientEntityImpl; +import org.apache.olingo.client.core.http.BasicAuthHttpClientFactory; +import org.apache.olingo.client.core.http.DefaultHttpClientFactory; +import org.apache.olingo.client.core.uri.URIUtils; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.format.ODataFormat; -import org.apache.olingo.client.core.domain.ClientEntityImpl; import org.junit.Test; /** @@ -98,12 +98,12 @@ public class ConformanceTestITCase extends AbstractTestITCase { dateTime.set(2011, 2, 4, 16, 3, 57); final ClientProperty orderDate = getClient().getObjectFactory().newPrimitiveProperty("OrderDate", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(dateTime).build()); + setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(dateTime).build()); order.getProperties().add(orderDate); final ClientProperty shelfLife = getClient().getObjectFactory().newPrimitiveProperty("ShelfLife", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.Duration).setValue(new BigDecimal("0.0000001")).build()); + setType(EdmPrimitiveTypeKind.Duration).setValue(new BigDecimal("0.0000001")).build()); order.getProperties().add(shelfLife); final ClientCollectionValue<ClientValue> orderShelfLifesValue = getClient().getObjectFactory(). @@ -118,7 +118,7 @@ public class ConformanceTestITCase extends AbstractTestITCase { final ODataEntityCreateRequest<ClientEntity> req = getClient().getCUDRequestFactory().getEntityCreateRequest( getClient().newURIBuilder(testStaticServiceRootURL). - appendEntitySetSegment("Orders").build(), order); + appendEntitySetSegment("Orders").build(), order); req.setFormat(ODataFormat.JSON_FULL_METADATA); // check for OData-Version @@ -142,10 +142,10 @@ public class ConformanceTestITCase extends AbstractTestITCase { final URI deleteURI = created.getEditLink() == null ? getClient().newURIBuilder(testStaticServiceRootURL). appendEntitySetSegment("Orders").appendKeySegment(2000).build() - : created.getEditLink(); - final ODataDeleteRequest deleteReq = getClient().getCUDRequestFactory().getDeleteRequest(deleteURI); - final ODataDeleteResponse deleteRes = deleteReq.execute(); - assertEquals(204, deleteRes.getStatusCode()); + : created.getEditLink(); + final ODataDeleteRequest deleteReq = getClient().getCUDRequestFactory().getDeleteRequest(deleteURI); + final ODataDeleteResponse deleteRes = deleteReq.execute(); + assertEquals(204, deleteRes.getStatusCode()); } /** http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/DeltaTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/DeltaTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/DeltaTestITCase.java index 976c621..1d02141 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/DeltaTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/DeltaTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,6 +18,10 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import org.apache.olingo.client.api.communication.request.retrieve.ODataDeltaRequest; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest; import org.apache.olingo.client.api.domain.ClientDelta; @@ -26,10 +30,6 @@ import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - public class DeltaTestITCase extends AbstractTestITCase { private void parse(final ODataFormat format) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/DerivedTypeTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/DerivedTypeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/DerivedTypeTestITCase.java index 42b5beb..401f6e8 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/DerivedTypeTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/DerivedTypeTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -29,11 +29,11 @@ import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateR import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest; import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse; -import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.api.domain.ClientComplexValue; import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.client.api.domain.ClientValuable; +import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.format.ODataFormat; @@ -110,10 +110,10 @@ public class DerivedTypeTestITCase extends AbstractTestITCase { dateTime.set(1977, 8, 8, 0, 0, 0); customer.getProperties().add(client.getObjectFactory().newPrimitiveProperty("Birthday", client.getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(dateTime).build())); + setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(dateTime).build())); customer.getProperties().add(client.getObjectFactory().newPrimitiveProperty("TimeBetweenLastTwoOrders", client.getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.Duration).setValue(new BigDecimal("0.0000002")).build())); + setType(EdmPrimitiveTypeKind.Duration).setValue(new BigDecimal("0.0000002")).build())); final ODataEntityCreateRequest<ClientEntity> createReq = client.getCUDRequestFactory(). getEntityCreateRequest( http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java index 8aedbe7..7966495 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/EntityCreateTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,6 +18,12 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.net.URI; +import java.util.Calendar; + import org.apache.commons.lang3.RandomUtils; import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest; import org.apache.olingo.client.api.communication.response.ODataDeleteResponse; @@ -32,12 +38,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.net.URI; -import java.util.Calendar; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - public class EntityCreateTestITCase extends AbstractTestITCase { @Test @@ -72,7 +72,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase { getClient().getObjectFactory().newPrimitiveValueBuilder().buildString("New one"))); instrument.getProperties().add(getClient().getObjectFactory().newPrimitiveProperty("CreatedDate", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()).build())); + setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()).build())); // 3. create it as contained entity final ODataEntityCreateRequest<ClientEntity> req = getClient().getCUDRequestFactory(). @@ -129,13 +129,13 @@ public class EntityCreateTestITCase extends AbstractTestITCase { getClient().getObjectFactory().newPrimitiveValueBuilder().buildBoolean(false))); product.getProperties().add(getClient().getObjectFactory().newEnumProperty("UserAccess", getClient().getObjectFactory(). - newEnumValue("Microsoft.Test.OData.Services.ODataWCFService.AccessLevel", "Execute"))); + newEnumValue("Microsoft.Test.OData.Services.ODataWCFService.AccessLevel", "Execute"))); product.getProperties().add(getClient().getObjectFactory().newEnumProperty("SkinColor", getClient().getObjectFactory(). - newEnumValue("Microsoft.Test.OData.Services.ODataWCFService.Color", "Blue"))); + newEnumValue("Microsoft.Test.OData.Services.ODataWCFService.Color", "Blue"))); product.getProperties().add(getClient().getObjectFactory().newCollectionProperty("CoverColors", getClient().getObjectFactory(). - newCollectionValue("Microsoft.Test.OData.Services.ODataWCFService.Color"))); + newCollectionValue("Microsoft.Test.OData.Services.ODataWCFService.Color"))); product.getProperty("CoverColors").getCollectionValue().add(getClient().getObjectFactory(). newEnumValue("Microsoft.Test.OData.Services.ODataWCFService.Color", "Green")); product.getProperty("CoverColors").getCollectionValue().add(getClient().getObjectFactory(). http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java index 21f9be2..91461db 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/EntityRetrieveTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -23,6 +23,11 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import java.net.URI; +import java.sql.Timestamp; +import java.util.LinkedHashMap; +import java.util.List; + import org.apache.commons.lang3.StringUtils; import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.client.api.ODataClient; @@ -30,24 +35,19 @@ import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRe import org.apache.olingo.client.api.communication.request.retrieve.ODataRawRequest; import org.apache.olingo.client.api.communication.response.ODataRawResponse; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.api.uri.URIBuilder; -import org.apache.olingo.commons.api.data.ResWrap; import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientEntitySet; -import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.client.api.domain.ClientInlineEntity; import org.apache.olingo.client.api.domain.ClientInlineEntitySet; import org.apache.olingo.client.api.domain.ClientLink; import org.apache.olingo.client.api.domain.ClientLinkType; +import org.apache.olingo.client.api.domain.ClientProperty; +import org.apache.olingo.client.api.uri.URIBuilder; +import org.apache.olingo.commons.api.data.ResWrap; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.net.URI; -import java.sql.Timestamp; -import java.util.LinkedHashMap; -import java.util.List; - /** * This is the unit test class to check entity retrieve operations. */ http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java index 9e99457..b94e891 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/EntitySetTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,28 +18,28 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.net.URI; + import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetIteratorRequest; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest; import org.apache.olingo.client.api.communication.request.retrieve.ODataRawRequest; import org.apache.olingo.client.api.communication.response.ODataRawResponse; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; +import org.apache.olingo.client.api.domain.ClientEntity; +import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.client.api.domain.ClientEntitySetIterator; import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.core.uri.URIUtils; import org.apache.olingo.commons.api.data.ResWrap; -import org.apache.olingo.client.api.domain.ClientEntity; -import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.io.IOException; -import java.net.URI; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - /** * This is the unit test class to check basic feed operations. */ http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java index 5eb9c69..6ac0e8d 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -51,11 +51,11 @@ public class EntityUpdateTestITCase extends AbstractTestITCase { getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(9))); order.getProperties().add(getClient().getObjectFactory().newPrimitiveProperty("OrderDate", getClient().getObjectFactory().newPrimitiveValueBuilder() - .setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue( - Calendar.getInstance(TimeZone.getTimeZone("GMT"))).build())); + .setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue( + Calendar.getInstance(TimeZone.getTimeZone("GMT"))).build())); order.getProperties().add(getClient().getObjectFactory().newPrimitiveProperty("ShelfLife", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.Duration).setValue(new BigDecimal("0.0000002")).build())); + setType(EdmPrimitiveTypeKind.Duration).setValue(new BigDecimal("0.0000002")).build())); final URI upsertURI = getClient().newURIBuilder(testStaticServiceRootURL). appendEntitySetSegment("Orders").appendKeySegment(9).build(); @@ -82,10 +82,10 @@ public class EntityUpdateTestITCase extends AbstractTestITCase { public void testUpateSingleValuedNavtiogationReference() throws Exception { URI targetURI = getClient().newURIBuilder(testStaticServiceRootURL) - .appendEntitySetSegment("People") - .appendKeySegment(1) - .appendNavigationSegment("Parent") - .build(); + .appendEntitySetSegment("People") + .appendKeySegment(1) + .appendNavigationSegment("Parent") + .build(); URI reference = getClient().newURIBuilder(testStaticServiceRootURL) .appendEntitySetSegment("People") @@ -150,7 +150,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase { new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Customer")); final ClientLink parent = getClient().getObjectFactory().newEntityNavigationLink("Parent", getClient().newURIBuilder(testStaticServiceRootURL). - appendEntitySetSegment("People").appendKeySegment(1).build()); + appendEntitySetSegment("People").appendKeySegment(1).build()); changes.getNavigationLinks().add(parent); final URI uri = getClient().newURIBuilder(testStaticServiceRootURL). http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java index 0b47a9e..33d3ba4 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,18 +18,18 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.net.URI; +import java.util.Map; + import org.apache.olingo.client.api.communication.ODataClientErrorException; import org.apache.olingo.commons.api.ODataError; import org.apache.olingo.commons.api.ODataErrorDetail; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.net.URI; -import java.util.Map; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - public class ErrorResponseTestITCase extends AbstractTestITCase { @Test http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java index 8e3fcc2..b7a4f8c 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/FilterFactoryTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,18 +18,18 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; + import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest; +import org.apache.olingo.client.api.domain.ClientEntity; +import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.client.api.uri.FilterArgFactory; import org.apache.olingo.client.api.uri.FilterFactory; import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.api.uri.URIFilter; -import org.apache.olingo.client.api.domain.ClientEntity; -import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import static org.junit.Assert.assertEquals; - public class FilterFactoryTestITCase extends AbstractTestITCase { private FilterFactory getFilterFactory() { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java index c061fd2..648dcec 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/JSONFormatConformanceTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -23,26 +23,26 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import java.math.BigDecimal; +import java.net.URI; + import org.apache.commons.io.IOUtils; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.commons.api.data.Entity; -import org.apache.olingo.commons.api.data.EntityCollection; -import org.apache.olingo.commons.api.data.ResWrap; import org.apache.olingo.client.api.domain.ClientAnnotation; import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.client.api.domain.ClientLink; import org.apache.olingo.client.api.domain.ClientLinkType; import org.apache.olingo.client.api.domain.ClientProperty; +import org.apache.olingo.commons.api.data.Entity; +import org.apache.olingo.commons.api.data.EntityCollection; +import org.apache.olingo.commons.api.data.ResWrap; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.math.BigDecimal; -import java.net.URI; - /** * The test cases in this class are inspired by client conformance criteria defined in the <a * href="http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793094">specs http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java index bd6ca5e..f3e7d76 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/KeyAsSegmentTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,26 +18,26 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; + +import java.net.URI; + import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateRequest; import org.apache.olingo.client.api.communication.request.cud.UpdateType; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientProperty; +import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import java.net.URI; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; - public class KeyAsSegmentTestITCase extends AbstractTestITCase { @BeforeClass http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java index a1d4da3..a39e71b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,6 +18,17 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.Calendar; +import java.util.Collection; +import java.util.UUID; + import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.RandomStringUtils; import org.apache.olingo.client.api.ODataClient; @@ -34,27 +45,16 @@ import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResp import org.apache.olingo.client.api.communication.response.ODataMediaEntityCreateResponse; import org.apache.olingo.client.api.communication.response.ODataMediaEntityUpdateResponse; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.api.uri.URIBuilder; -import org.apache.olingo.client.core.ODataClientFactory; import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientValuable; +import org.apache.olingo.client.api.uri.URIBuilder; +import org.apache.olingo.client.core.ODataClientFactory; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.Calendar; -import java.util.Collection; -import java.util.UUID; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - public class MediaEntityTestITCase extends AbstractTestITCase { private void read(final ODataClient client, final ODataFormat format) throws IOException { @@ -116,7 +116,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase { newEntity(new FullQualifiedName("ODataDemo.Advertisement")); changes.getProperties().add(client.getObjectFactory().newPrimitiveProperty("AirDate", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()).build())); + setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()).build())); final ODataEntityUpdateRequest<ClientEntity> updateReq = getClient().getCUDRequestFactory(). getEntityUpdateRequest(createdLocation, UpdateType.PATCH, changes); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java index 8ee9f20..41c64f2 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -18,10 +18,10 @@ */ package org.apache.olingo.fit.v4; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; @@ -108,10 +108,10 @@ public class MetadataTestITCase extends AbstractTestITCase { final EdmAnnotation description = core.getAnnotation(descriptionTerm); assertNotNull(description); -// assertEquals("Core terms needed to write vocabularies", -// description.getExpression().asConstant().getValue().asPrimitive().toString()); + // assertEquals("Core terms needed to write vocabularies", + // description.getExpression().asConstant().getValue().asPrimitive().toString()); assertEquals("Core terms needed to write vocabularies", - description.getExpression().asConstant().getValueAsString()); + description.getExpression().asConstant().getValueAsString()); final EdmTerm isLanguageDependent = edm.getTerm(new FullQualifiedName("Core.IsLanguageDependent")); assertNotNull(isLanguageDependent); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java index 6af12fa..d42fc03 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/OAuth2TestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -21,24 +21,23 @@ package org.apache.olingo.fit.v4; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import java.net.URI; + import org.apache.commons.lang3.StringUtils; import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; +import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.core.ODataClientFactory; -import org.apache.olingo.client.api.domain.ClientEntity; +import org.apache.olingo.client.core.http.DefaultHttpClientFactory; import org.apache.olingo.commons.api.format.ODataFormat; +import org.apache.olingo.fit.CXFOAuth2HttpClientFactory; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import java.net.URI; - -import org.apache.olingo.client.core.http.DefaultHttpClientFactory; -import org.apache.olingo.fit.CXFOAuth2HttpClientFactory; - public class OAuth2TestITCase extends AbstractTestITCase { private static final URI OAUTH2_GRANT_SERVICE_URI = http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java index f6c7235..f4fe4f8 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/OpenTypeTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -29,9 +29,9 @@ import java.util.UUID; import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest; import org.apache.olingo.client.api.communication.response.ODataDeleteResponse; import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse; -import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.api.domain.ClientComplexValue; import org.apache.olingo.client.api.domain.ClientEntity; +import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmSchema; @@ -98,18 +98,18 @@ public class OpenTypeTestITCase extends AbstractTestITCase { getClient().getBinder().add(rowIndex, getClient().getObjectFactory().newPrimitiveProperty("aByte", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.SByte).setValue(Byte.MAX_VALUE). - build())); + setType(EdmPrimitiveTypeKind.SByte).setValue(Byte.MAX_VALUE). + build())); getClient().getBinder().add(rowIndex, getClient().getObjectFactory().newPrimitiveProperty("aDate", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()). - build())); + setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()). + build())); getClient().getBinder().add(rowIndex, getClient().getObjectFactory().newPrimitiveProperty("aDate", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()). - build())); + setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(Calendar.getInstance()). + build())); getClient().getBinder().add(rowIndex, getClient().getObjectFactory().newEnumProperty("aColor", getClient().getObjectFactory(). newEnumValue("Microsoft.Test.OData.Services.ODataWCFService.Color", "Blue"))); @@ -123,23 +123,23 @@ public class OpenTypeTestITCase extends AbstractTestITCase { dateTime.set(Calendar.MILLISECOND, 1); contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("LastContacted", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(dateTime).build())); + setType(EdmPrimitiveTypeKind.DateTimeOffset).setValue(dateTime).build())); Calendar date = Calendar.getInstance(); date.set(2001, 3, 5); contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Contacted", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.Date).setValue(date).build())); + setType(EdmPrimitiveTypeKind.Date).setValue(date).build())); contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("GUID", getClient().getObjectFactory().newPrimitiveValueBuilder().buildGuid(UUID.randomUUID()))); contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("PreferedContactTime", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.Duration).setValue(0).build())); + setType(EdmPrimitiveTypeKind.Duration).setValue(0).build())); contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Byte", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.Byte).setValue(24).build())); + setType(EdmPrimitiveTypeKind.Byte).setValue(24).build())); contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("SignedByte", getClient().getObjectFactory().newPrimitiveValueBuilder(). - setType(EdmPrimitiveTypeKind.SByte).setValue(Byte.MAX_VALUE).build())); + setType(EdmPrimitiveTypeKind.SByte).setValue(Byte.MAX_VALUE).build())); contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Double", getClient().getObjectFactory().newPrimitiveValueBuilder().buildDouble(Double.MAX_VALUE))); contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Single", http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java index 10dda83..1b27efa 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/OperationImportInvokeTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -26,8 +26,8 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; -import org.apache.olingo.client.api.communication.request.invoke.ODataInvokeRequest; import org.apache.olingo.client.api.communication.request.invoke.ClientNoContent; +import org.apache.olingo.client.api.communication.request.invoke.ODataInvokeRequest; import org.apache.olingo.client.api.domain.ClientCollectionValue; import org.apache.olingo.client.api.domain.ClientComplexValue; import org.apache.olingo.client.api.domain.ClientEntity; @@ -272,7 +272,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase { params.put("count", getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(100)); bossEmailsReq = getClient().getInvokeRequestFactory().getFunctionInvokeRequest( getClient().newURIBuilder(testStaticServiceRootURL). - appendOperationCallSegment("GetBossEmails").build(), ClientProperty.class, params); + appendOperationCallSegment("GetBossEmails").build(), ClientProperty.class, params); bossEmailsReq.setFormat(format); final ClientProperty bossEmailsViaGET = bossEmailsReq.execute().getBody(); assertNotNull(bossEmailsViaGET); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java index f26c54b..e2c6250 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/PropertyTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -33,10 +33,10 @@ import org.apache.olingo.client.api.communication.response.ODataDeleteResponse; import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse; import org.apache.olingo.client.api.communication.response.ODataPropertyUpdateResponse; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.client.api.domain.ClientValuable; +import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.http.HttpMethod; import org.junit.Test; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d1507449/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java index 5d05227..123c169 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/PropertyValueTestITCase.java @@ -6,9 +6,9 @@ * 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 @@ -27,10 +27,10 @@ import org.apache.commons.lang3.StringUtils; import org.apache.olingo.client.api.communication.ODataClientErrorException; import org.apache.olingo.client.api.communication.request.retrieve.ODataPropertyRequest; import org.apache.olingo.client.api.communication.request.retrieve.ODataValueRequest; -import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.api.domain.ClientPrimitiveValue; import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.client.api.domain.ClientValuable; +import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.format.ODataFormat; import org.junit.Test;
