You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/06/13 15:28:26 UTC
[4/5] [OLINGO-317] Merged the format ENUMs
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/fit/src/test/java/org/apache/olingo/fit/v3/PropertyValueTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v3/PropertyValueTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v3/PropertyValueTestITCase.java
index 2c8c9d9..b27461e 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v3/PropertyValueTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v3/PropertyValueTestITCase.java
@@ -18,7 +18,11 @@
*/
package org.apache.olingo.fit.v3;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
import java.io.IOException;
+
import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
import org.apache.olingo.client.api.communication.request.retrieve.ODataValueRequest;
@@ -26,8 +30,7 @@ import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse
import org.apache.olingo.client.api.uri.CommonURIBuilder;
import org.apache.olingo.commons.api.domain.ODataValue;
import org.apache.olingo.commons.api.domain.v3.ODataEntity;
-import org.apache.olingo.commons.api.format.ODataValueFormat;
-import static org.junit.Assert.*;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class PropertyValueTestITCase extends AbstractTestITCase {
@@ -37,7 +40,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
CommonURIBuilder<?> uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Product").appendKeySegment(-10).appendPropertySegment("ProductId");
final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
- req.setFormat(ODataValueFormat.TEXT);
+ req.setFormat(ODataFormat.TEXT_PLAIN);
final ODataValue value = req.execute().getBody();
assertNotNull(value);
assertEquals(-10, Integer.parseInt(value.toString()));
@@ -48,7 +51,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
CommonURIBuilder<?> uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Product").appendKeySegment(-10).appendPropertySegment("ProductId");
final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
- req.setFormat(ODataValueFormat.TEXT);
+ req.setFormat(ODataFormat.TEXT_PLAIN);
final ODataValue value = req.execute().getBody();
assertNotNull(value);
assertEquals(-10, Integer.parseInt(value.toString()));
@@ -59,7 +62,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
CommonURIBuilder<?> uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Product").appendKeySegment(-6).appendPropertySegment("Description");
final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
- req.setFormat(ODataValueFormat.TEXT);
+ req.setFormat(ODataFormat.TEXT_PLAIN);
final ODataValue value = req.execute().getBody();
assertNotNull(value);
assertEquals("expdybhclurfobuyvzmhkgrnrajhamqmkhqpmiypittnp", value.toString());
@@ -71,7 +74,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
appendEntitySetSegment("Product").appendKeySegment(-7).appendPropertySegment(
"NestedComplexConcurrency/ModifiedDate");
final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
- req.setFormat(ODataValueFormat.TEXT);
+ req.setFormat(ODataFormat.TEXT_PLAIN);
final ODataValue value = req.execute().getBody();
assertNotNull(value);
assertEquals("7866-11-16T22:25:52.747755+01:00", value.toString());
@@ -82,7 +85,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
CommonURIBuilder<?> uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Product").appendKeySegment(-6).appendPropertySegment("Dimensions/Height");
final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
- req.setFormat(ODataValueFormat.TEXT);
+ req.setFormat(ODataFormat.TEXT_PLAIN);
final ODataValue value = req.execute().getBody();
assertNotNull(value);
assertEquals("-79228162514264337593543950335", value.toString());
@@ -111,11 +114,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
req.setAccept("application/atom+xml");
ODataRetrieveResponse<ODataEntity> res = req.execute();
assertEquals(200, res.getStatusCode());
- ODataEntity entitySet = res.getBody();
- assertNotNull(entitySet);
- assertEquals("fi653p3+MklA/LdoBlhWgnMTUUEo8tEgtbMXnF0a3CUNL9BZxXpSRiD9ebTnmNR0zWPjJ"
- + "VIDx4tdmCnq55XrJh+RW9aI/b34wAogK3kcORw=",
- entitySet.getProperties().get(0).getValue().toString());
+ res.getBody();
}
@Test(expected = IllegalArgumentException.class)
@@ -126,11 +125,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
req.setAccept("application/xml");
ODataRetrieveResponse<ODataEntity> res = req.execute();
assertEquals(200, res.getStatusCode());
- ODataEntity entitySet = res.getBody();
- assertNotNull(entitySet);
- assertEquals("fi653p3+MklA/LdoBlhWgnMTUUEo8tEgtbMXnF0a3CUNL9BZxXpSRiD9ebTnmNR0zWPjJ"
- + "VIDx4tdmCnq55XrJh+RW9aI/b34wAogK3kcORw=",
- entitySet.getProperties().get(0).getValue().toString());
+ res.getBody();
}
@Test
@@ -139,7 +134,7 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
appendEntitySetSegment("Product").appendKeySegment(-7).appendPropertySegment(
"ComplexConcurrency/QueriedDateTime");
final ODataValueRequest req = client.getRetrieveRequestFactory().getPropertyValueRequest(uriBuilder.build());
- req.setFormat(ODataValueFormat.TEXT);
+ req.setFormat(ODataFormat.TEXT_PLAIN);
final ODataValue value = req.execute().getBody();
if (value.isPrimitive()) {
assertNotNull(value);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/fit/src/test/java/org/apache/olingo/fit/v3/QueryOptionsTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v3/QueryOptionsTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v3/QueryOptionsTestITCase.java
index 1b15c3f..940aa74 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v3/QueryOptionsTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v3/QueryOptionsTestITCase.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+
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.ODataRetrieveResponse;
@@ -34,7 +35,7 @@ import org.apache.olingo.commons.api.domain.ODataInlineEntitySet;
import org.apache.olingo.commons.api.domain.v3.ODataEntity;
import org.apache.olingo.commons.api.domain.v3.ODataEntitySet;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
/**
@@ -44,8 +45,6 @@ public class QueryOptionsTestITCase extends AbstractTestITCase {
/**
* Test <tt>$expand</tt>.
- *
- * @see EntityRetrieveTest#readODataEntityWithInline(org.apache.olingo.commons.api.format.ODataPubFormat)
*/
public void expand() {
// empty
@@ -102,18 +101,16 @@ public class QueryOptionsTestITCase extends AbstractTestITCase {
appendEntitySetSegment("Customer").appendKeySegment(-10).format("json");
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
- req.setFormat(ODataPubFormat.ATOM);
+ req.setFormat(ODataFormat.ATOM);
final ODataRetrieveResponse<ODataEntity> res = req.execute();
assertNotNull(res);
assertTrue(res.getContentType().replaceAll(" ", "").
- startsWith(ODataPubFormat.JSON.toString(client.getServiceVersion())));
+ startsWith(ODataFormat.JSON.toString(client.getServiceVersion())));
}
/**
* Test <tt>$skip</tt>.
- *
- * @see FeedTest#readFeedWithNextLink(org.apache.olingo.commons.api.format.ODataPubFormat)
*/
public void skip() {
// empty
@@ -121,8 +118,6 @@ public class QueryOptionsTestITCase extends AbstractTestITCase {
/**
* Test <tt>$top</tt>.
- *
- * @see FeedTest#readFeed(org.apache.olingo.commons.api.format.ODataPubFormat)
*/
public void top() {
// empty
@@ -157,7 +152,7 @@ public class QueryOptionsTestITCase extends AbstractTestITCase {
final ODataEntitySetRequest<ODataEntitySet> req = client.getRetrieveRequestFactory().
getEntitySetRequest(uriBuilder.build());
- req.setFormat(ODataPubFormat.ATOM);
+ req.setFormat(ODataFormat.ATOM);
final ODataEntitySet feed = req.execute().getBody();
assertNotNull(feed);
assertEquals(feed.getEntities().size(), feed.getCount());
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 31619e3..5ba1c26 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
@@ -18,8 +18,12 @@
*/
package org.apache.olingo.fit.v4;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
import java.io.IOException;
import java.net.URI;
+
import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
@@ -28,7 +32,6 @@ import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse
import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
import org.apache.olingo.client.api.v4.ODataClient;
import org.apache.olingo.client.core.ODataClientFactory;
-import org.apache.olingo.fit.AbstractBaseTestITCase;
import org.apache.olingo.commons.api.domain.ODataCollectionValue;
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
import org.apache.olingo.commons.api.domain.v4.ODataProperty;
@@ -36,10 +39,9 @@ import org.apache.olingo.commons.api.domain.v4.ODataValue;
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.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.commons.core.domain.v4.ODataEntityImpl;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import org.apache.olingo.fit.AbstractBaseTestITCase;
import org.junit.BeforeClass;
public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
@@ -86,7 +88,7 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
return client;
}
- protected ODataEntity read(final ODataPubFormat format, final URI editLink) {
+ protected ODataEntity read(final ODataFormat format, final URI editLink) {
final ODataEntityRequest<ODataEntity> req = getClient().getRetrieveRequestFactory().getEntityRequest(editLink);
req.setFormat(format);
@@ -95,14 +97,14 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
assertNotNull(entity);
- if (ODataPubFormat.JSON_FULL_METADATA == format || ODataPubFormat.ATOM == format) {
+ if (ODataFormat.JSON_FULL_METADATA == format || ODataFormat.ATOM == format) {
assertEquals(req.getURI(), entity.getEditLink());
}
return entity;
}
- protected void createAndDeleteOrder(final ODataPubFormat format, final int id) {
+ protected void createAndDeleteOrder(final ODataFormat format, final int id) {
final ODataEntity order = new ODataEntityImpl(
new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Order"));
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 edeeae5..bcc8313 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
@@ -27,6 +27,7 @@ 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.retrieve.ODataEntityRequest;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest;
import org.apache.olingo.client.api.communication.request.v4.AsyncRequestWrapper;
@@ -39,7 +40,7 @@ import org.apache.olingo.commons.api.domain.ODataInlineEntity;
import org.apache.olingo.commons.api.domain.ODataLink;
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class AsyncTestITCase extends AbstractTestITCase {
@@ -62,7 +63,7 @@ public class AsyncTestITCase extends AbstractTestITCase {
assertFalse(res.getBody().getEntities().isEmpty());
}
- private void withInlineEntry(final ODataPubFormat format) {
+ private void withInlineEntry(final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Customers").appendKeySegment(1).expand("Company");
@@ -85,7 +86,7 @@ public class AsyncTestITCase extends AbstractTestITCase {
assertEquals(3, entity.getNavigationLinks().size());
- if (ODataPubFormat.ATOM == format) {
+ if (ODataFormat.ATOM == format) {
assertTrue(entity.getAssociationLinks().isEmpty());
// In JSON, association links for each $ref link will exist.
}
@@ -120,16 +121,16 @@ public class AsyncTestITCase extends AbstractTestITCase {
@Test
public void withInlineEntryAsAtom() {
- withInlineEntry(ODataPubFormat.ATOM);
+ withInlineEntry(ODataFormat.ATOM);
}
@Test
public void withInlineEntryAsJSON() {
// this needs to be full, otherwise there is no mean to recognize links
- withInlineEntry(ODataPubFormat.JSON_FULL_METADATA);
+ withInlineEntry(ODataFormat.JSON_FULL_METADATA);
}
- private void asyncOrders(final ODataPubFormat format) {
+ private void asyncOrders(final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("async").appendEntitySetSegment("Orders");
@@ -154,11 +155,11 @@ public class AsyncTestITCase extends AbstractTestITCase {
@Test
public void asyncOrdersAsAtom() {
- asyncOrders(ODataPubFormat.ATOM);
+ asyncOrders(ODataFormat.ATOM);
}
@Test
public void asyncOrdersAsJSON() {
- asyncOrders(ODataPubFormat.JSON);
+ asyncOrders(ODataFormat.JSON);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 2b3faea..73f1578 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
@@ -17,10 +17,9 @@ package org.apache.olingo.fit.v4;
import static org.junit.Assert.assertEquals;
-import org.junit.Test;
import java.net.URI;
-import org.apache.olingo.client.api.communication.header.HeaderName;
+import org.apache.olingo.client.api.communication.header.HeaderName;
import org.apache.olingo.client.api.communication.request.batch.BatchManager;
import org.apache.olingo.client.api.communication.request.batch.ODataChangeset;
import org.apache.olingo.client.api.communication.request.batch.v4.ODataBatchRequest;
@@ -37,7 +36,8 @@ import org.apache.olingo.commons.api.domain.v4.ODataEntity;
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.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
+import org.junit.Test;
public class AuthBatchTestITCase extends AbstractTestITCase {
@@ -63,7 +63,6 @@ public class AuthBatchTestITCase extends AbstractTestITCase {
batchRequest(unauthclient, testAuthServiceRootURL);
}
- @SuppressWarnings({"unchecked"})
private void batchRequest(final ODataClient client, final String baseURL) throws EdmPrimitiveTypeException {
// create your request
final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(baseURL);
@@ -82,7 +81,7 @@ public class AuthBatchTestITCase extends AbstractTestITCase {
// create new request
ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(targetURI.build());
- queryReq.setFormat(ODataPubFormat.JSON);
+ queryReq.setFormat(ODataFormat.JSON);
streamManager.addRequest(queryReq);
// -------------------------------------------
@@ -106,7 +105,7 @@ public class AuthBatchTestITCase extends AbstractTestITCase {
final ODataEntityUpdateRequest<ODataEntity> changeReq =
client.getCUDRequestFactory().getEntityUpdateRequest(UpdateType.PATCH, patch);
- changeReq.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ changeReq.setFormat(ODataFormat.JSON_FULL_METADATA);
changeset.addRequest(changeReq);
// -------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 daf4ed2..c4bac40 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
@@ -18,10 +18,10 @@
*/
package org.apache.olingo.fit.v4;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
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.net.URI;
@@ -31,6 +31,7 @@ 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;
@@ -65,7 +66,7 @@ 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.ContentType;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class BatchTestITCase extends AbstractTestITCase {
@@ -126,20 +127,20 @@ public class BatchTestITCase extends AbstractTestITCase {
for (int i = 1; i <= 2; i++) {
// Create Customer into the changeset
createReq = client.getCUDRequestFactory().getEntityCreateRequest(targetURI.build(), newOrder(100 + i));
- createReq.setFormat(ODataPubFormat.JSON);
+ createReq.setFormat(ODataFormat.JSON);
changeset.addRequest(createReq);
}
targetURI = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("WrongEntitySet");
createReq = client.getCUDRequestFactory().getEntityCreateRequest(targetURI.build(), newOrder(105));
- createReq.setFormat(ODataPubFormat.JSON);
+ createReq.setFormat(ODataFormat.JSON);
changeset.addRequest(createReq);
targetURI = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Orders");
for (int i = 3; i <= 4; i++) {
// Create Customer into the changeset
createReq = client.getCUDRequestFactory().getEntityCreateRequest(targetURI.build(), newOrder(100 + i));
- createReq.setFormat(ODataPubFormat.JSON);
+ createReq.setFormat(ODataFormat.JSON);
changeset.addRequest(createReq);
}
@@ -189,7 +190,7 @@ public class BatchTestITCase extends AbstractTestITCase {
// create new request
ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(targetURI.build());
- queryReq.setFormat(ODataPubFormat.JSON);
+ queryReq.setFormat(ODataFormat.JSON);
streamManager.addRequest(queryReq);
// -------------------------------------------
@@ -334,7 +335,7 @@ public class BatchTestITCase extends AbstractTestITCase {
// create new request
ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(targetURI.build());
- queryReq.setFormat(ODataPubFormat.JSON);
+ queryReq.setFormat(ODataFormat.JSON);
streamManager.addRequest(queryReq);
// -------------------------------------------
@@ -347,7 +348,7 @@ public class BatchTestITCase extends AbstractTestITCase {
final ODataEntity original = newOrder(2000);
final ODataEntityCreateRequest<ODataEntity> createReq =
client.getCUDRequestFactory().getEntityCreateRequest(targetURI.build(), original);
- createReq.setFormat(ODataPubFormat.JSON);
+ createReq.setFormat(ODataFormat.JSON);
streamManager.addRequest(createReq);
// -------------------------------------------
@@ -401,7 +402,7 @@ public class BatchTestITCase extends AbstractTestITCase {
// create new request
ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(targetURI.build());
- queryReq.setFormat(ODataPubFormat.JSON);
+ queryReq.setFormat(ODataFormat.JSON);
streamManager.addRequest(queryReq);
// -------------------------------------------
@@ -425,7 +426,7 @@ public class BatchTestITCase extends AbstractTestITCase {
final ODataEntityUpdateRequest<ODataEntity> changeReq =
client.getCUDRequestFactory().getEntityUpdateRequest(UpdateType.PATCH, patch);
- changeReq.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ changeReq.setFormat(ODataFormat.JSON_FULL_METADATA);
changeset.addRequest(changeReq);
@@ -434,7 +435,7 @@ public class BatchTestITCase extends AbstractTestITCase {
final ODataEntity original = newOrder(1000);
final ODataEntityCreateRequest<ODataEntity> createReq =
client.getCUDRequestFactory().getEntityCreateRequest(targetURI.build(), original);
- createReq.setFormat(ODataPubFormat.JSON);
+ createReq.setFormat(ODataFormat.JSON);
changeset.addRequest(createReq);
// -------------------------------------------
@@ -490,7 +491,7 @@ public class BatchTestITCase extends AbstractTestITCase {
entity = createres.getBody();
assertEquals(new Integer(1000), entity.getProperty("OrderID").getPrimitiveValue().toCastValue(Integer.class));
- // retrive the third item (ODataRetrieve)
+ // retrieve the third item (ODataRetrieve)
item = iter.next();
assertTrue(item instanceof ODataSingleResponseItem);
@@ -525,7 +526,7 @@ public class BatchTestITCase extends AbstractTestITCase {
// create new request
ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(targetURI.build());
- queryReq.setFormat(ODataPubFormat.JSON);
+ queryReq.setFormat(ODataFormat.JSON);
async.addRetrieve(queryReq);
// -------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 e2bf9f2..a009aea 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
@@ -26,6 +26,7 @@ import java.util.Collections;
import java.util.HashMap;
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.retrieve.ODataEntityRequest;
import org.apache.olingo.client.api.uri.v4.URIBuilder;
@@ -42,12 +43,12 @@ import org.apache.olingo.commons.api.domain.v4.ODataSingleton;
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.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class BoundOperationInvokeTestITCase extends AbstractTestITCase {
- private void functions(final ODataPubFormat format) throws EdmPrimitiveTypeException {
+ private void functions(final ODataFormat format) throws EdmPrimitiveTypeException {
// GetEmployeesCount
URIBuilder builder = client.newURIBuilder(testStaticServiceRootURL).appendSingletonSegment("Company");
final ODataEntityRequest<ODataSingleton> singletonReq =
@@ -167,12 +168,12 @@ public class BoundOperationInvokeTestITCase extends AbstractTestITCase {
@Test
public void atomFunctions() throws EdmPrimitiveTypeException {
- functions(ODataPubFormat.ATOM);
+ functions(ODataFormat.ATOM);
}
@Test
public void jsonFunctions() throws EdmPrimitiveTypeException {
- functions(ODataPubFormat.JSON_FULL_METADATA);
+ functions(ODataFormat.JSON_FULL_METADATA);
}
@Test
@@ -261,7 +262,7 @@ public class BoundOperationInvokeTestITCase extends AbstractTestITCase {
assertEquals(41.79, getActualAmountRes.getPrimitiveValue().toCastValue(Double.class), 0);
}
- private void actions(final ODataPubFormat format) throws EdmPrimitiveTypeException {
+ private void actions(final ODataFormat format) throws EdmPrimitiveTypeException {
// IncreaseRevenue
URIBuilder builder = client.newURIBuilder(testStaticServiceRootURL).appendSingletonSegment("Company");
ODataEntityRequest<ODataEntity> entityReq =
@@ -365,12 +366,12 @@ public class BoundOperationInvokeTestITCase extends AbstractTestITCase {
@Test
public void atomActions() throws EdmPrimitiveTypeException {
- actions(ODataPubFormat.ATOM);
+ actions(ODataFormat.ATOM);
}
@Test
public void jsonActions() throws EdmPrimitiveTypeException {
- actions(ODataPubFormat.JSON_FULL_METADATA);
+ actions(ODataFormat.JSON_FULL_METADATA);
}
@Test
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 8f67cdf..d2303b2 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
@@ -19,12 +19,12 @@
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.assertFalse;
-import org.junit.Test;
import java.net.URI;
+
import org.apache.olingo.client.api.communication.header.HeaderName;
import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
@@ -53,8 +53,9 @@ import org.apache.olingo.commons.api.domain.v4.ODataValue;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.commons.core.domain.v4.ODataEntityImpl;
+import org.junit.Test;
/**
* 13.2 Interoperable OData Clients
@@ -115,7 +116,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
final ODataEntityCreateRequest<ODataEntity> req = getClient().getCUDRequestFactory().getEntityCreateRequest(
getClient().newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Orders").build(), order);
- req.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ req.setFormat(ODataFormat.JSON_FULL_METADATA);
// check for OData-Version
assertEquals("4.0", req.getHeader("OData-Version"));
@@ -123,13 +124,13 @@ public class ConformanceTestITCase extends AbstractTestITCase {
// check for Content-Type
assertEquals(
- ODataPubFormat.JSON_FULL_METADATA.toString(ODataServiceVersion.V40),
+ ODataFormat.JSON_FULL_METADATA.toString(ODataServiceVersion.V40),
req.getHeader("Content-Type"));
assertEquals(
- ODataPubFormat.JSON_FULL_METADATA.toString(ODataServiceVersion.V40),
+ ODataFormat.JSON_FULL_METADATA.toString(ODataServiceVersion.V40),
req.getHeader(HeaderName.contentType.toString()));
assertEquals(
- ODataPubFormat.JSON_FULL_METADATA.toString(ODataServiceVersion.V40),
+ ODataFormat.JSON_FULL_METADATA.toString(ODataServiceVersion.V40),
req.getContentType());
final ODataEntity created = req.execute().getBody();
@@ -176,7 +177,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
ODataEntitySetRequest<ODataEntitySet> req = client.getRetrieveRequestFactory().
getEntitySetRequest(uriBuilder.build());
- req.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ req.setFormat(ODataFormat.JSON_FULL_METADATA);
req.setPrefer(client.newPreferences().maxPageSize(5));
ODataRetrieveResponse<ODataEntitySet> res = req.execute();
@@ -193,7 +194,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
assertEquals(expected, found);
req = client.getRetrieveRequestFactory().getEntitySetRequest(found);
- req.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ req.setFormat(ODataFormat.JSON_FULL_METADATA);
res = req.execute();
feed = res.getBody();
@@ -233,7 +234,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
final URIBuilder builder = getClient().newURIBuilder(testOpenTypeServiceRootURL).
appendEntitySetSegment("RowIndex").appendKeySegment(id);
- rowIndex = read(ODataPubFormat.JSON_FULL_METADATA, builder.build());
+ rowIndex = read(ODataFormat.JSON_FULL_METADATA, builder.build());
assertNotNull(rowIndex);
assertEquals(EdmPrimitiveTypeKind.Int32, rowIndex.getProperty("Id").getPrimitiveValue().getTypeKind());
assertEquals(EdmPrimitiveTypeKind.String, rowIndex.getProperty("aString").getPrimitiveValue().getTypeKind());
@@ -266,7 +267,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
final ODataEntityUpdateResponse<ODataEntity> res = req.execute();
assertEquals(204, res.getStatusCode());
- final ODataEntity actual = read(ODataPubFormat.JSON, uri);
+ final ODataEntity actual = read(ODataFormat.JSON, uri);
assertEquals(newname, actual.getProperty("FirstName").getPrimitiveValue().toString());
}
@@ -284,7 +285,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
appendEntitySetSegment("Customers").appendKeySegment(1).expand("Company");
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
- req.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ req.setFormat(ODataFormat.JSON_FULL_METADATA);
assertNotNull(req.execute().getBody());
@@ -301,7 +302,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
appendRefSegment();
ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
- req.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ req.setFormat(ODataFormat.JSON_FULL_METADATA);
ODataRetrieveResponse<ODataEntity> res = req.execute();
assertNotNull(res);
@@ -314,7 +315,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
appendEntityIdSegment(entity.getId().toASCIIString()).build();
req = client.getRetrieveRequestFactory().getEntityRequest(referenceURI);
- req.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ req.setFormat(ODataFormat.JSON_FULL_METADATA);
res = req.execute();
assertNotNull(res);
@@ -335,7 +336,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
assertNotNull(customers.getDeltaLink());
final ODataDeltaRequest deltaReq = client.getRetrieveRequestFactory().getDeltaRequest(customers.getDeltaLink());
- deltaReq.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ deltaReq.setFormat(ODataFormat.JSON_FULL_METADATA);
final ODataDelta delta = deltaReq.execute().getBody();
assertNotNull(delta);
@@ -377,7 +378,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
final ODataEntitySetRequest<ODataEntitySet> req =
client.getRetrieveRequestFactory().getEntitySetRequest(uriBuilder.build());
- req.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ req.setFormat(ODataFormat.JSON_FULL_METADATA);
final AsyncRequestWrapper<ODataRetrieveResponse<ODataEntitySet>> async =
client.getAsyncRequestFactory().<ODataRetrieveResponse<ODataEntitySet>>getAsyncRequestWrapper(req);
@@ -404,7 +405,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
final ODataEntityRequest<ODataEntity> req =
client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
- req.setFormat(ODataPubFormat.JSON);
+ req.setFormat(ODataFormat.JSON);
assertEquals("application/json;odata.metadata=minimal", req.getHeader("Accept"));
assertEquals("application/json;odata.metadata=minimal", req.getHeader(HeaderName.accept.toString()));
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 77c55a0..6c76793 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
@@ -27,12 +27,12 @@ import org.apache.olingo.client.api.communication.request.retrieve.v4.ODataDelta
import org.apache.olingo.commons.api.domain.v4.ODataDelta;
import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
import org.apache.olingo.commons.api.domain.v4.ODataProperty;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class DeltaTestITCase extends AbstractTestITCase {
- private void parse(final ODataPubFormat format) {
+ private void parse(final ODataFormat format) {
final ODataEntitySetRequest<ODataEntitySet> req = client.getRetrieveRequestFactory().getEntitySetRequest(
client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customers").build());
req.setPrefer(client.newPreferences().trackChanges());
@@ -76,11 +76,11 @@ public class DeltaTestITCase extends AbstractTestITCase {
@Test
public void atomParse() {
- parse(ODataPubFormat.ATOM);
+ parse(ODataFormat.ATOM);
}
@Test
public void jsonParse() {
- parse(ODataPubFormat.JSON);
+ parse(ODataFormat.JSON);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 bb1bcff..929f453 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
@@ -33,12 +33,12 @@ import org.apache.olingo.commons.api.domain.v4.ODataProperty;
import org.apache.olingo.commons.api.domain.v4.ODataValuable;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class DerivedTypeTestITCase extends AbstractTestITCase {
- private void read(final ODataPubFormat format) {
+ private void read(final ODataFormat format) {
// 1. entity set
URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("People").
@@ -66,15 +66,15 @@ public class DerivedTypeTestITCase extends AbstractTestITCase {
@Test
public void readfromAtom() {
- read(ODataPubFormat.ATOM);
+ read(ODataFormat.ATOM);
}
@Test
public void readfromJSON() {
- read(ODataPubFormat.JSON_FULL_METADATA);
+ read(ODataFormat.JSON_FULL_METADATA);
}
- private void createDelete(final ODataPubFormat format) {
+ private void createDelete(final ODataFormat format) {
final ODataEntity customer = client.getObjectFactory().
newEntity(new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Customer"));
@@ -135,11 +135,11 @@ public class DerivedTypeTestITCase extends AbstractTestITCase {
@Test
public void createDeleteAsAtom() {
- createDelete(ODataPubFormat.ATOM);
+ createDelete(ODataFormat.ATOM);
}
@Test
public void createDeleteAsJSON() {
- createDelete(ODataPubFormat.JSON_FULL_METADATA);
+ createDelete(ODataFormat.JSON_FULL_METADATA);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 8203513..a6a8721 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
@@ -23,6 +23,7 @@ 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;
@@ -34,22 +35,22 @@ import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
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.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class EntityCreateTestITCase extends AbstractTestITCase {
@Test
public void atomCreateAndDelete() {
- createAndDeleteOrder(ODataPubFormat.ATOM, 1000);
+ createAndDeleteOrder(ODataFormat.ATOM, 1000);
}
@Test
public void jsonCreateAndDelete() {
- createAndDeleteOrder(ODataPubFormat.JSON, 1001);
+ createAndDeleteOrder(ODataFormat.JSON, 1001);
}
- private void onContained(final ODataPubFormat format) {
+ private void onContained(final ODataFormat format) {
final URI uri = getClient().newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Accounts").
appendKeySegment(101).appendNavigationSegment("MyPaymentInstruments").build();
@@ -99,15 +100,15 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
@Test
public void atomOnContained() {
- onContained(ODataPubFormat.ATOM);
+ onContained(ODataFormat.ATOM);
}
@Test
public void jsonOnContained() {
- onContained(ODataPubFormat.JSON);
+ onContained(ODataFormat.JSON);
}
- private void deepInsert(final ODataPubFormat format, final int productId, final int productDetailId)
+ private void deepInsert(final ODataFormat format, final int productId, final int productDetailId)
throws EdmPrimitiveTypeException {
final ODataEntity product = getClient().getObjectFactory().
@@ -178,11 +179,11 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
@Test
public void atomDeepInsert() throws EdmPrimitiveTypeException {
- deepInsert(ODataPubFormat.ATOM, 10, 10);
+ deepInsert(ODataFormat.ATOM, 10, 10);
}
@Test
public void jsonDeepInsert() throws EdmPrimitiveTypeException {
- deepInsert(ODataPubFormat.JSON_FULL_METADATA, 11, 11);
+ deepInsert(ODataFormat.JSON_FULL_METADATA, 11, 11);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 4e8afaa..79b73e9 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
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertTrue;
import java.net.URI;
import java.util.LinkedHashMap;
import java.util.List;
+
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
import org.apache.olingo.client.api.communication.request.retrieve.ODataRawRequest;
@@ -45,7 +46,7 @@ import org.apache.olingo.commons.api.domain.ODataLinkType;
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
/**
@@ -53,7 +54,7 @@ import org.junit.Test;
*/
public class EntityRetrieveTestITCase extends AbstractTestITCase {
- private void withInlineEntity(final ODataClient client, final ODataPubFormat format) {
+ private void withInlineEntity(final ODataClient client, final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Customers").appendKeySegment(1).expand("Company");
@@ -70,11 +71,11 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
assertEquals("Edm.GeographyPoint", entity.getProperty("Home").getPrimitiveValue().getTypeName());
// In JSON with minimal metadata, links are not provided
- if (format == ODataPubFormat.ATOM || format == ODataPubFormat.JSON_FULL_METADATA) {
+ if (format == ODataFormat.ATOM || format == ODataFormat.JSON_FULL_METADATA) {
assertEquals(testStaticServiceRootURL + "/Customers(1)", entity.getEditLink().toASCIIString());
assertEquals(3, entity.getNavigationLinks().size());
- if (ODataPubFormat.ATOM == format) {
+ if (ODataFormat.ATOM == format) {
assertTrue(entity.getAssociationLinks().isEmpty());
// In JSON, association links for each $ref link will exist.
}
@@ -110,20 +111,20 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
@Test
public void withInlineEntityFromAtom() {
- withInlineEntity(client, ODataPubFormat.ATOM);
+ withInlineEntity(client, ODataFormat.ATOM);
}
@Test
public void withInlineEntityFromFullJSON() {
- withInlineEntity(client, ODataPubFormat.JSON_FULL_METADATA);
+ withInlineEntity(client, ODataFormat.JSON_FULL_METADATA);
}
@Test
public void withInlineEntityFromJSON() {
- withInlineEntity(edmClient, ODataPubFormat.JSON);
+ withInlineEntity(edmClient, ODataFormat.JSON);
}
- private void withInlineEntitySet(final ODataClient client, final ODataPubFormat format) {
+ private void withInlineEntitySet(final ODataClient client, final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Customers").appendKeySegment(1).expand("Orders");
@@ -137,7 +138,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
assertEquals("Microsoft.Test.OData.Services.ODataWCFService.Customer", entity.getTypeName().toString());
// In JSON with minimal metadata, links are not provided
- if (format == ODataPubFormat.ATOM || format == ODataPubFormat.JSON_FULL_METADATA) {
+ if (format == ODataFormat.ATOM || format == ODataFormat.JSON_FULL_METADATA) {
boolean found = false;
for (ODataLink link : entity.getNavigationLinks()) {
if (link instanceof ODataInlineEntitySet) {
@@ -153,20 +154,20 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
@Test
public void withInlineEntitySetFromAtom() {
- withInlineEntitySet(client, ODataPubFormat.ATOM);
+ withInlineEntitySet(client, ODataFormat.ATOM);
}
@Test
public void withInlineEntitySetFromFullJSON() {
- withInlineEntitySet(client, ODataPubFormat.JSON_FULL_METADATA);
+ withInlineEntitySet(client, ODataFormat.JSON_FULL_METADATA);
}
@Test
public void withInlineEntitySetFromJSON() {
- withInlineEntitySet(edmClient, ODataPubFormat.JSON);
+ withInlineEntitySet(edmClient, ODataFormat.JSON);
}
- private void rawRequest(final ODataPubFormat format) {
+ private void rawRequest(final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("People").appendKeySegment(5);
@@ -185,16 +186,16 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
@Test
public void rawRequestAsAtom() {
- rawRequest(ODataPubFormat.ATOM);
+ rawRequest(ODataFormat.ATOM);
}
@Test
public void rawRequestAsJSON() {
// this needs to be full, otherwise reference will not be provided
- rawRequest(ODataPubFormat.JSON_FULL_METADATA);
+ rawRequest(ODataFormat.JSON_FULL_METADATA);
}
- private void multiKey(final ODataPubFormat format) throws EdmPrimitiveTypeException {
+ private void multiKey(final ODataFormat format) throws EdmPrimitiveTypeException {
final LinkedHashMap<String, Object> multiKey = new LinkedHashMap<String, Object>();
multiKey.put("ProductID", "6");
multiKey.put("ProductDetailID", 1);
@@ -214,15 +215,15 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
@Test
public void multiKeyAsAtom() throws EdmPrimitiveTypeException {
- multiKey(ODataPubFormat.ATOM);
+ multiKey(ODataFormat.ATOM);
}
@Test
public void multiKeyAsJSON() throws EdmPrimitiveTypeException {
- multiKey(ODataPubFormat.JSON_FULL_METADATA);
+ multiKey(ODataFormat.JSON_FULL_METADATA);
}
- private void checkForETag(final ODataClient client, final ODataPubFormat format) {
+ private void checkForETag(final ODataClient client, final ODataFormat format) {
final URIBuilder uriBuilder =
client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Orders").appendKeySegment(8);
@@ -246,17 +247,17 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
@Test
public void checkForETagAsAtom() {
- checkForETag(client, ODataPubFormat.ATOM);
+ checkForETag(client, ODataFormat.ATOM);
}
@Test
public void checkForETagAsFullJSON() {
- checkForETag(client, ODataPubFormat.JSON_FULL_METADATA);
+ checkForETag(client, ODataFormat.JSON_FULL_METADATA);
}
@Test
public void checkForETagAsJSON() {
- checkForETag(edmClient, ODataPubFormat.JSON);
+ checkForETag(edmClient, ODataFormat.JSON);
}
@Test(expected = IllegalArgumentException.class)
@@ -264,14 +265,14 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Orders");
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
- req.setFormat(ODataPubFormat.JSON);
+ req.setFormat(ODataFormat.JSON);
// this statement should cause an IllegalArgumentException bearing JsonParseException
// since we are attempting to parse an EntitySet as if it was an Entity
req.execute().getBody();
}
- private void reference(final ODataPubFormat format) {
+ private void reference(final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Orders").appendKeySegment(8).appendNavigationSegment("CustomerForOrder").
appendRefSegment();
@@ -299,15 +300,15 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
@Test
public void atomReference() {
- reference(ODataPubFormat.ATOM);
+ reference(ODataFormat.ATOM);
}
@Test
public void jsonReference() {
- reference(ODataPubFormat.JSON_FULL_METADATA);
+ reference(ODataFormat.JSON_FULL_METADATA);
}
- private void contained(final ODataClient client, final ODataPubFormat format) throws EdmPrimitiveTypeException {
+ private void contained(final ODataClient client, final ODataFormat format) throws EdmPrimitiveTypeException {
final URI uri = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Accounts").appendKeySegment(101).
appendNavigationSegment("MyPaymentInstruments").appendKeySegment(101902).build();
@@ -324,20 +325,20 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
@Test
public void containedFromAtom() throws EdmPrimitiveTypeException {
- contained(client, ODataPubFormat.ATOM);
+ contained(client, ODataFormat.ATOM);
}
@Test
public void containedFromFullJSON() throws EdmPrimitiveTypeException {
- contained(client, ODataPubFormat.JSON_FULL_METADATA);
+ contained(client, ODataFormat.JSON_FULL_METADATA);
}
@Test
public void containedFromJSON() throws EdmPrimitiveTypeException {
- contained(edmClient, ODataPubFormat.JSON);
+ contained(edmClient, ODataFormat.JSON);
}
- private void entitySetNavigationLink(final ODataClient client, final ODataPubFormat format) {
+ private void entitySetNavigationLink(final ODataClient client, final ODataFormat format) {
final URI uri = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Accounts").appendKeySegment(101).build();
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uri);
@@ -347,7 +348,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
assertNotNull(entity);
// With JSON, entity set navigation links are only recognizable via Edm
- if (format == ODataPubFormat.ATOM || client instanceof EdmEnabledODataClient) {
+ if (format == ODataFormat.ATOM || client instanceof EdmEnabledODataClient) {
assertEquals(ODataLinkType.ENTITY_SET_NAVIGATION, entity.getNavigationLink("MyPaymentInstruments").getType());
assertEquals(ODataLinkType.ENTITY_SET_NAVIGATION, entity.getNavigationLink("ActiveSubscriptions").getType());
}
@@ -355,13 +356,13 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
@Test
public void entitySetNavigationLinkFromAtom() {
- entitySetNavigationLink(client, ODataPubFormat.ATOM);
+ entitySetNavigationLink(client, ODataFormat.ATOM);
}
@Test
public void entitySetNavigationLinkFromJSON() {
// only JSON_FULL_METADATA has links, only Edm can recognize entity set navigation
- entitySetNavigationLink(edmClient, ODataPubFormat.JSON_FULL_METADATA);
+ entitySetNavigationLink(edmClient, ODataFormat.JSON_FULL_METADATA);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 e2a8bde..a428d3d 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
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.net.URI;
+
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;
@@ -36,7 +37,7 @@ import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.data.ResWrap;
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
/**
@@ -44,7 +45,7 @@ import org.junit.Test;
*/
public class EntitySetTestITCase extends AbstractTestITCase {
- private void rawRequest(final ODataPubFormat format) {
+ private void rawRequest(final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("People");
final ODataRawRequest req = client.getRetrieveRequestFactory().getRawRequest(uriBuilder.build());
@@ -60,15 +61,15 @@ public class EntitySetTestITCase extends AbstractTestITCase {
@Test
public void rawRequestAsAtom() throws IOException {
- rawRequest(ODataPubFormat.ATOM);
+ rawRequest(ODataFormat.ATOM);
}
@Test
public void rawRequestAsJSON() throws IOException {
- rawRequest(ODataPubFormat.JSON);
+ rawRequest(ODataFormat.JSON);
}
- private void readWithInlineCount(final ODataClient client, final ODataPubFormat format) {
+ private void readWithInlineCount(final ODataClient client, final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("People").count(true);
@@ -87,20 +88,20 @@ public class EntitySetTestITCase extends AbstractTestITCase {
@Test
public void readWithInlineCountAsJSON() throws IOException {
- readWithInlineCount(edmClient, ODataPubFormat.JSON);
+ readWithInlineCount(edmClient, ODataFormat.JSON);
}
@Test
public void readWithInlineCountAsFullJSON() throws IOException {
- readWithInlineCount(client, ODataPubFormat.JSON_FULL_METADATA);
+ readWithInlineCount(client, ODataFormat.JSON_FULL_METADATA);
}
@Test
public void readWithInlineCountAsAtom() throws IOException {
- readWithInlineCount(client, ODataPubFormat.ATOM);
+ readWithInlineCount(client, ODataFormat.ATOM);
}
- private void readODataEntitySetIterator(final ODataPubFormat format) {
+ private void readODataEntitySetIterator(final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("People");
final ODataEntitySetIteratorRequest<ODataEntitySet, ODataEntity> req =
@@ -124,25 +125,25 @@ public class EntitySetTestITCase extends AbstractTestITCase {
@Test
public void readODataEntitySetIteratorFromAtom() {
- readODataEntitySetIterator(ODataPubFormat.ATOM);
+ readODataEntitySetIterator(ODataFormat.ATOM);
}
@Test
public void readODataEntitySetIteratorFromJSON() {
- readODataEntitySetIterator(ODataPubFormat.JSON);
+ readODataEntitySetIterator(ODataFormat.JSON);
}
@Test
public void readODataEntitySetIteratorFromJSONFull() {
- readODataEntitySetIterator(ODataPubFormat.JSON_FULL_METADATA);
+ readODataEntitySetIterator(ODataFormat.JSON_FULL_METADATA);
}
@Test
public void readODataEntitySetIteratorFromJSONNo() {
- readODataEntitySetIterator(ODataPubFormat.JSON_NO_METADATA);
+ readODataEntitySetIterator(ODataFormat.JSON_NO_METADATA);
}
- private void readWithNext(final ODataPubFormat format) {
+ private void readWithNext(final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("People");
final ODataEntitySetRequest<ODataEntitySet> req = client.getRetrieveRequestFactory().
@@ -166,12 +167,12 @@ public class EntitySetTestITCase extends AbstractTestITCase {
@Test
public void readWithNextFromAtom() {
- readWithNext(ODataPubFormat.ATOM);
+ readWithNext(ODataFormat.ATOM);
}
@Test
public void readWithNextFromJSON() {
- readWithNext(ODataPubFormat.JSON_FULL_METADATA);
+ readWithNext(ODataFormat.JSON_FULL_METADATA);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 a51dd62..a81376c 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
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertNotNull;
import java.net.URI;
import java.util.Calendar;
import java.util.UUID;
+
import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateRequest;
import org.apache.olingo.client.api.communication.request.cud.v4.UpdateType;
import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
@@ -32,12 +33,12 @@ import org.apache.olingo.commons.api.domain.v4.ODataEntity;
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.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class EntityUpdateTestITCase extends AbstractTestITCase {
- private void upsert(final UpdateType updateType, final ODataPubFormat format) {
+ private void upsert(final UpdateType updateType, final ODataFormat format) {
final ODataEntity order = getClient().getObjectFactory().
newEntity(new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Order"));
@@ -72,17 +73,17 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void atomUpsert() {
- upsert(UpdateType.PATCH, ODataPubFormat.ATOM);
- upsert(UpdateType.REPLACE, ODataPubFormat.ATOM);
+ upsert(UpdateType.PATCH, ODataFormat.ATOM);
+ upsert(UpdateType.REPLACE, ODataFormat.ATOM);
}
@Test
public void jsonUpsert() {
- upsert(UpdateType.PATCH, ODataPubFormat.JSON);
- upsert(UpdateType.REPLACE, ODataPubFormat.JSON);
+ upsert(UpdateType.PATCH, ODataFormat.JSON);
+ upsert(UpdateType.REPLACE, ODataFormat.JSON);
}
- private void onContained(final ODataPubFormat format) {
+ private void onContained(final ODataFormat format) {
final String newName = UUID.randomUUID().toString();
final ODataEntity changes = getClient().getObjectFactory().newEntity(
new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument"));
@@ -106,15 +107,15 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void atomOnContained() {
- onContained(ODataPubFormat.ATOM);
+ onContained(ODataFormat.ATOM);
}
@Test
public void jsonOnContained() {
- onContained(ODataPubFormat.JSON);
+ onContained(ODataFormat.JSON);
}
- private void bindOperation(final ODataPubFormat format) throws EdmPrimitiveTypeException {
+ private void bindOperation(final ODataFormat format) throws EdmPrimitiveTypeException {
final ODataEntity changes = getClient().getObjectFactory().newEntity(
new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Customer"));
final ODataLink parent = getClient().getObjectFactory().newEntityNavigationLink("Parent",
@@ -144,11 +145,11 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void atomBindOperation() throws EdmPrimitiveTypeException {
- bindOperation(ODataPubFormat.ATOM);
+ bindOperation(ODataFormat.ATOM);
}
@Test
public void jsonBindOperation() throws EdmPrimitiveTypeException {
- bindOperation(ODataPubFormat.JSON);
+ bindOperation(ODataFormat.JSON);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 7805691..54f6f74 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
@@ -23,10 +23,11 @@ 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.domain.ODataError;
import org.apache.olingo.commons.api.domain.ODataErrorDetail;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class ErrorResponseTestITCase extends AbstractTestITCase {
@@ -38,7 +39,7 @@ public class ErrorResponseTestITCase extends AbstractTestITCase {
build();
try {
- read(ODataPubFormat.JSON, readURI);
+ read(ODataFormat.JSON, readURI);
fail("should have got exception");
} catch (Exception ex) {
final ODataError err = ((ODataClientErrorException) ex).getODataError();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 2bb3851..737f355 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
@@ -19,7 +19,6 @@
package org.apache.olingo.fit.v4;
import static org.junit.Assert.assertEquals;
-import static org.apache.olingo.fit.v4.AbstractTestITCase.client;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest;
import org.apache.olingo.client.api.uri.URIFilter;
@@ -28,7 +27,7 @@ import org.apache.olingo.client.api.uri.v4.FilterFactory;
import org.apache.olingo.client.api.uri.v4.URIBuilder;
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class FilterFactoryTestITCase extends AbstractTestITCase {
@@ -51,7 +50,7 @@ public class FilterFactoryTestITCase extends AbstractTestITCase {
final ODataEntitySetRequest<ODataEntitySet> req =
client.getRetrieveRequestFactory().getEntitySetRequest(uriBuilder.build());
- req.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ req.setFormat(ODataFormat.JSON_FULL_METADATA);
final ODataEntitySet feed = req.execute().getBody();
assertEquals(3, feed.getEntities().size());
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 7d48860..04651b3 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
@@ -40,7 +40,7 @@ import org.apache.olingo.commons.api.domain.v4.ODataLink;
import org.apache.olingo.commons.api.domain.v4.ODataProperty;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
/**
@@ -91,7 +91,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
final URI uri = edmClient.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Accounts").appendKeySegment(102).build();
final ODataEntityRequest<ODataEntity> req = edmClient.getRetrieveRequestFactory().getEntityRequest(uri);
- req.setFormat(ODataPubFormat.JSON_FULL_METADATA);
+ req.setFormat(ODataFormat.JSON_FULL_METADATA);
// request format (via Accept header) is set to full metadata
assertEquals("application/json;odata.metadata=full", req.getAccept());
@@ -148,7 +148,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
+ "\"GeographyPoint\": {\"type\": \"Point\",\"coordinates\":[142.1,64.1]}"
+ "}";
- final ODataEntity entity = client.getReader().readEntity(IOUtils.toInputStream(fromSection71), ODataPubFormat.JSON);
+ final ODataEntity entity = client.getReader().readEntity(IOUtils.toInputStream(fromSection71), ODataFormat.JSON);
assertTrue(entity.getProperty("NullValue").hasNullValue());
@@ -219,7 +219,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
+ "}";
final ResWrap<Entity> entity =
- client.getDeserializer(ODataPubFormat.JSON).toEntity(IOUtils.toInputStream(fromSection45_1));
+ client.getDeserializer(ODataFormat.JSON).toEntity(IOUtils.toInputStream(fromSection45_1));
assertEquals("http://host/service/$metadata#Customers/$entity", entity.getContextURL().getURI().toASCIIString());
assertEquals("W/\"A1FF3E230954908F\"", entity.getMetadataETag());
@@ -241,7 +241,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
+ "}";
final ResWrap<EntitySet> entitySet =
- client.getDeserializer(ODataPubFormat.JSON).toEntitySet(IOUtils.toInputStream(fromSection45_2));
+ client.getDeserializer(ODataFormat.JSON).toEntitySet(IOUtils.toInputStream(fromSection45_2));
assertEquals(5, entitySet.getPayload().getCount(), 0);
assertEquals("Customers?$expand=Orders&$skipToken=5", entitySet.getPayload().getNext().toASCIIString());
@@ -271,7 +271,7 @@ public class JSONFormatConformanceTestITCase extends AbstractTestITCase {
+ "}";
final ODataEntitySet entitySet = client.getReader().
- readEntitySet(IOUtils.toInputStream(sample), ODataPubFormat.JSON);
+ readEntitySet(IOUtils.toInputStream(sample), ODataFormat.JSON);
assertEquals(2, entitySet.getAnnotations().size());
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 c6eca38..612619f 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
@@ -18,11 +18,12 @@
*/
package org.apache.olingo.fit.v4;
-import static org.junit.Assert.assertFalse;
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.v4.UpdateType;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
@@ -32,7 +33,7 @@ import org.apache.olingo.client.api.uri.v4.URIBuilder;
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
import org.apache.olingo.commons.api.domain.v4.ODataProperty;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -49,7 +50,7 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
client.getConfiguration().setKeyAsSegment(false);
}
- private void read(final ODataPubFormat format) {
+ private void read(final ODataFormat format) {
final URIBuilder uriBuilder = client.newURIBuilder(testKeyAsSegmentServiceRootURL).
appendEntitySetSegment("Accounts").appendKeySegment(101);
@@ -61,7 +62,7 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
assertNotNull(entity);
// In JSON with minimal metadata, links are not provided
- if (format == ODataPubFormat.ATOM || format == ODataPubFormat.JSON_FULL_METADATA) {
+ if (format == ODataFormat.ATOM || format == ODataFormat.JSON_FULL_METADATA) {
assertFalse(entity.getEditLink().toASCIIString().contains("("));
assertFalse(entity.getEditLink().toASCIIString().contains(")"));
}
@@ -69,25 +70,25 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
@Test
public void atomRead() {
- read(ODataPubFormat.ATOM);
+ read(ODataFormat.ATOM);
}
@Test
public void jsonRead() {
- read(ODataPubFormat.JSON);
+ read(ODataFormat.JSON);
}
@Test
public void atomCreateAndDelete() {
- createAndDeleteOrder(ODataPubFormat.ATOM, 1000);
+ createAndDeleteOrder(ODataFormat.ATOM, 1000);
}
@Test
public void jsonCreateAndDelete() {
- createAndDeleteOrder(ODataPubFormat.JSON_FULL_METADATA, 1001);
+ createAndDeleteOrder(ODataFormat.JSON_FULL_METADATA, 1001);
}
- private void update(final ODataPubFormat format) {
+ private void update(final ODataFormat format) {
final ODataEntity changes = getClient().getObjectFactory().newEntity(
new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Customer"));
final ODataProperty middleName = getClient().getObjectFactory().newPrimitiveProperty("MiddleName",
@@ -115,11 +116,11 @@ public class KeyAsSegmentTestITCase extends AbstractTestITCase {
@Test
public void atomUpdate() {
- update(ODataPubFormat.ATOM);
+ update(ODataFormat.ATOM);
}
@Test
public void jsonUpdate() {
- update(ODataPubFormat.JSON);
+ update(ODataFormat.JSON);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 5d0806b..b82f22c 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
@@ -28,6 +28,7 @@ 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.communication.header.HeaderName;
@@ -51,12 +52,12 @@ import org.apache.olingo.commons.api.domain.v4.ODataValuable;
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.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class MediaEntityTestITCase extends AbstractTestITCase {
- private void read(final ODataClient client, final ODataPubFormat format) throws IOException {
+ private void read(final ODataClient client, final ODataFormat format) throws IOException {
final URIBuilder builder = client.newURIBuilder(testDemoServiceRootURL).
appendEntitySetSegment("Advertisements").
appendKeySegment(UUID.fromString("f89dee73-af9f-4cd4-b330-db93c25ff3c7"));
@@ -82,20 +83,20 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
@Test
public void readAsAtom() throws IOException {
- read(client, ODataPubFormat.ATOM);
+ read(client, ODataFormat.ATOM);
}
@Test
public void readAsJSON() throws IOException {
- read(ODataClientFactory.getEdmEnabledV4(testDemoServiceRootURL), ODataPubFormat.JSON);
+ read(ODataClientFactory.getEdmEnabledV4(testDemoServiceRootURL), ODataFormat.JSON);
}
@Test
public void readAsJSONFull() throws IOException {
- read(client, ODataPubFormat.JSON_FULL_METADATA);
+ read(client, ODataFormat.JSON_FULL_METADATA);
}
- private void create(final ODataPubFormat format) throws IOException {
+ private void create(final ODataFormat format) throws IOException {
final String random = RandomStringUtils.random(110);
final InputStream input = IOUtils.toInputStream(random);
@@ -136,15 +137,15 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
@Test
public void createAsAtom() throws IOException {
- create(ODataPubFormat.ATOM);
+ create(ODataFormat.ATOM);
}
@Test
public void createAsJSON() throws IOException {
- create(ODataPubFormat.JSON);
+ create(ODataFormat.JSON);
}
- private void update(final ODataPubFormat format) throws IOException, EdmPrimitiveTypeException {
+ private void update(final ODataFormat format) throws IOException, EdmPrimitiveTypeException {
final URI uri = client.newURIBuilder(testDemoServiceRootURL).
appendEntitySetSegment("Advertisements").
appendKeySegment(UUID.fromString("f89dee73-af9f-4cd4-b330-db93c25ff3c7")).build();
@@ -172,11 +173,11 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
@Test
public void updateAsAtom() throws IOException, EdmPrimitiveTypeException {
- update(ODataPubFormat.ATOM);
+ update(ODataFormat.ATOM);
}
@Test
public void updateAsJSON() throws IOException, EdmPrimitiveTypeException {
- update(ODataPubFormat.JSON);
+ update(ODataFormat.JSON);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 495b9d0..6ce43c6 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
@@ -24,18 +24,19 @@ import static org.junit.Assert.assertTrue;
import java.util.Calendar;
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.v4.URIBuilder;
import org.apache.olingo.commons.api.domain.ODataComplexValue;
-import org.apache.olingo.commons.api.domain.v4.ODataProperty;
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
+import org.apache.olingo.commons.api.domain.v4.ODataProperty;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.EdmSchema;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class OpenTypeTestITCase extends AbstractTestITCase {
@@ -52,13 +53,13 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
assertTrue(metadata.getEntityType(new FullQualifiedName(schema.getNamespace(), "RowIndex")).isOpenType());
}
- private ODataEntity readRow(final ODataPubFormat format, final String uuid) {
+ private ODataEntity readRow(final ODataFormat format, final String uuid) {
final URIBuilder builder = getClient().newURIBuilder(testOpenTypeServiceRootURL).
appendEntitySetSegment("Row").appendKeySegment(UUID.fromString(uuid));
return read(format, builder.build());
}
- private void read(final ODataPubFormat format) {
+ private void read(final ODataFormat format) {
ODataEntity row = readRow(format, "71f7d0dc-ede4-45eb-b421-555a2aa1e58f");
assertEquals(EdmPrimitiveTypeKind.Double, row.getProperty("Double").getPrimitiveValue().getTypeKind());
assertEquals(EdmPrimitiveTypeKind.Guid, row.getProperty("Id").getPrimitiveValue().getTypeKind());
@@ -69,15 +70,15 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
@Test
public void readAsAtom() {
- read(ODataPubFormat.ATOM);
+ read(ODataFormat.ATOM);
}
@Test
public void readAsJSON() {
- read(ODataPubFormat.JSON_FULL_METADATA);
+ read(ODataFormat.JSON_FULL_METADATA);
}
- private void cud(final ODataPubFormat format) {
+ private void cud(final ODataFormat format) {
final Integer id = 1426;
ODataEntity rowIndex = getClient().getObjectFactory().newEntity(
@@ -173,12 +174,12 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
@Test
public void cudAsAtom() {
- cud(ODataPubFormat.ATOM);
+ cud(ODataFormat.ATOM);
}
@Test
public void cudAsJSON() {
- cud(ODataPubFormat.JSON_FULL_METADATA);
+ cud(ODataFormat.JSON_FULL_METADATA);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/37abba5f/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 17b9921..972db5d 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
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertTrue;
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.ODataNoContent;
import org.apache.olingo.commons.api.domain.ODataCollectionValue;
@@ -36,13 +37,12 @@ import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
import org.apache.olingo.commons.api.domain.v4.ODataEnumValue;
import org.apache.olingo.commons.api.domain.v4.ODataProperty;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.api.format.ODataPubFormat;
-
+import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
public class OperationImportInvokeTestITCase extends AbstractTestITCase {
- private void functionImports(final ODataPubFormat format) throws EdmPrimitiveTypeException {
+ private void functionImports(final ODataFormat format) throws EdmPrimitiveTypeException {
// GetDefaultColor
final ODataInvokeRequest<ODataProperty> defaultColorReq = getClient().getInvokeRequestFactory().
getFunctionInvokeRequest(getClient().newURIBuilder(testStaticServiceRootURL).
@@ -113,12 +113,12 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
@Test
public void atomFunctionImports() throws EdmPrimitiveTypeException {
- functionImports(ODataPubFormat.ATOM);
+ functionImports(ODataFormat.ATOM);
}
@Test
public void jsonFunctionImports() throws EdmPrimitiveTypeException {
- functionImports(ODataPubFormat.JSON_FULL_METADATA);
+ functionImports(ODataFormat.JSON_FULL_METADATA);
}
@Test
@@ -182,7 +182,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
assertTrue(prodByAL.getCollectionValue().asJavaCollection().contains("Car"));
}
- private void actionImports(final ODataPubFormat format) {
+ private void actionImports(final ODataFormat format) {
// Discount
final ODataPrimitiveValue percentage = getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(22);
final ODataInvokeRequest<ODataNoContent> discountReq = getClient().getInvokeRequestFactory().
@@ -215,12 +215,12 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
@Test
public void atomActionImports() {
- actionImports(ODataPubFormat.ATOM);
+ actionImports(ODataFormat.ATOM);
}
@Test
public void jsonActionImports() {
- actionImports(ODataPubFormat.JSON_FULL_METADATA);
+ actionImports(ODataFormat.JSON_FULL_METADATA);
}
@Test
@@ -251,7 +251,7 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
assertEquals(address.getTypeName(), resetBossAddress.getComplexValue().getTypeName());
}
- private void bossEmails(final ODataPubFormat format) {
+ private void bossEmails(final ODataFormat format) {
// ResetBossEmail
final ODataCollectionValue<org.apache.olingo.commons.api.domain.v4.ODataValue> emails =
getClient().getObjectFactory().newCollectionValue("Collection(Edm.String)");
@@ -284,11 +284,11 @@ public class OperationImportInvokeTestITCase extends AbstractTestITCase {
@Test
public void atomBossEmails() throws EdmPrimitiveTypeException {
- bossEmails(ODataPubFormat.ATOM);
+ bossEmails(ODataFormat.ATOM);
}
@Test
public void jsonBossEmails() throws EdmPrimitiveTypeException {
- bossEmails(ODataPubFormat.JSON_FULL_METADATA);
+ bossEmails(ODataFormat.JSON_FULL_METADATA);
}
}