You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/05/13 13:48:01 UTC
[17/31] git commit: [OLINGO-260] V3 proxy invoke
[OLINGO-260] V3 proxy invoke
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/389b554c
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/389b554c
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/389b554c
Branch: refs/heads/olingo-266-ref
Commit: 389b554c885f0bc62c982d5485b22dc516e3ebd3
Parents: 3af2c8c
Author: Francesco Chicchiriccò <--global>
Authored: Tue May 13 12:12:36 2014 +0200
Committer: Francesco Chicchiriccò <--global>
Committed: Tue May 13 12:12:36 2014 +0200
----------------------------------------------------------------------
.../commons/EntitySetInvocationHandler.java | 13 +-
.../commons/EntityTypeInvocationHandler.java | 20 +-
.../commons/OperationInvocationHandler.java | 21 +-
.../olingo/ext/proxy/context/EntityContext.java | 12 +-
.../olingo/ext/proxy/context/EntityUUID.java | 67 +++---
.../org/apache/olingo/fit/AbstractServices.java | 241 ++++++++++++++-----
.../olingo/fit/proxy/v3/AbstractTest.java | 150 ------------
.../olingo/fit/proxy/v3/AbstractTestITCase.java | 150 ++++++++++++
.../fit/proxy/v3/EntityCreateTestITCase.java | 17 +-
.../fit/proxy/v3/EntityRetrieveTestITCase.java | 2 +-
.../fit/proxy/v3/EntitySetTestITCase.java | 2 +-
.../olingo/fit/proxy/v3/InvokeTestITCase.java | 232 ++++++++++++++++++
.../AllGeoCollectionTypesSet.java | 1 -
.../astoriadefaultservice/AllGeoTypesSet.java | 1 -
.../services/astoriadefaultservice/Car.java | 1 -
.../astoriadefaultservice/Computer.java | 1 -
.../astoriadefaultservice/ComputerDetail.java | 1 -
.../astoriadefaultservice/Customer.java | 1 -
.../astoriadefaultservice/CustomerInfo.java | 1 -
.../astoriadefaultservice/DefaultContainer.java | 1 -
.../services/astoriadefaultservice/Driver.java | 1 -
.../astoriadefaultservice/LastLogin.java | 1 -
.../services/astoriadefaultservice/License.java | 1 -
.../services/astoriadefaultservice/Login.java | 1 -
.../astoriadefaultservice/MappedEntityType.java | 1 -
.../services/astoriadefaultservice/Message.java | 1 -
.../MessageAttachment.java | 1 -
.../services/astoriadefaultservice/Order.java | 1 -
.../astoriadefaultservice/OrderLine.java | 1 -
.../astoriadefaultservice/PageView.java | 1 -
.../services/astoriadefaultservice/Person.java | 1 -
.../astoriadefaultservice/PersonMetadata.java | 1 -
.../services/astoriadefaultservice/Product.java | 1 -
.../astoriadefaultservice/ProductDetail.java | 1 -
.../astoriadefaultservice/ProductPhoto.java | 1 -
.../astoriadefaultservice/ProductReview.java | 1 -
.../astoriadefaultservice/RSAToken.java | 1 -
.../astoriadefaultservice/package-info.java | 1 -
.../astoriadefaultservice/types/Aliases.java | 1 -
.../types/AllSpatialCollectionTypes.java | 1 -
.../AllSpatialCollectionTypesCollection.java | 1 -
.../types/AllSpatialCollectionTypes_Simple.java | 1 -
...SpatialCollectionTypes_SimpleCollection.java | 1 -
.../types/AllSpatialTypes.java | 1 -
.../types/AllSpatialTypesCollection.java | 1 -
.../astoriadefaultservice/types/AuditInfo.java | 1 -
.../types/BackOrderLine.java | 1 -
.../types/BackOrderLine2.java | 1 -
.../types/BackOrderLine2Collection.java | 1 -
.../types/BackOrderLineCollection.java | 1 -
.../astoriadefaultservice/types/Car.java | 1 -
.../types/CarCollection.java | 1 -
.../types/ComplexToCategory.java | 1 -
.../types/ComplexWithAllPrimitiveTypes.java | 1 -
.../astoriadefaultservice/types/Computer.java | 1 -
.../types/ComputerCollection.java | 1 -
.../types/ComputerDetail.java | 1 -
.../types/ComputerDetailCollection.java | 1 -
.../types/ConcurrencyInfo.java | 1 -
.../types/ContactDetails.java | 1 -
.../astoriadefaultservice/types/Contractor.java | 1 -
.../types/ContractorCollection.java | 1 -
.../astoriadefaultservice/types/Customer.java | 1 -
.../types/CustomerCollection.java | 1 -
.../types/CustomerInfo.java | 1 -
.../types/CustomerInfoCollection.java | 1 -
.../astoriadefaultservice/types/Dimensions.java | 1 -
.../types/DiscontinuedProduct.java | 7 +-
.../types/DiscontinuedProductCollection.java | 1 -
.../astoriadefaultservice/types/Driver.java | 1 -
.../types/DriverCollection.java | 1 -
.../astoriadefaultservice/types/Employee.java | 1 -
.../types/EmployeeCollection.java | 1 -
.../astoriadefaultservice/types/LastLogin.java | 1 -
.../types/LastLoginCollection.java | 1 -
.../astoriadefaultservice/types/License.java | 1 -
.../types/LicenseCollection.java | 1 -
.../astoriadefaultservice/types/Login.java | 1 -
.../types/LoginCollection.java | 1 -
.../types/MappedEntityType.java | 1 -
.../types/MappedEntityTypeCollection.java | 1 -
.../astoriadefaultservice/types/Message.java | 1 -
.../types/MessageAttachment.java | 1 -
.../types/MessageAttachmentCollection.java | 1 -
.../types/MessageCollection.java | 1 -
.../astoriadefaultservice/types/MessageKey.java | 1 -
.../astoriadefaultservice/types/Order.java | 1 -
.../types/OrderCollection.java | 1 -
.../astoriadefaultservice/types/OrderLine.java | 1 -
.../types/OrderLineCollection.java | 1 -
.../types/OrderLineKey.java | 1 -
.../astoriadefaultservice/types/PageView.java | 1 -
.../types/PageViewCollection.java | 1 -
.../astoriadefaultservice/types/Person.java | 1 -
.../types/PersonCollection.java | 1 -
.../types/PersonMetadata.java | 1 -
.../types/PersonMetadataCollection.java | 1 -
.../astoriadefaultservice/types/Phone.java | 1 -
.../astoriadefaultservice/types/Product.java | 1 -
.../types/ProductCollection.java | 1 -
.../types/ProductDetail.java | 1 -
.../types/ProductDetailCollection.java | 1 -
.../types/ProductPageView.java | 1 -
.../types/ProductPageViewCollection.java | 1 -
.../types/ProductPhoto.java | 1 -
.../types/ProductPhotoCollection.java | 1 -
.../types/ProductPhotoKey.java | 1 -
.../types/ProductReview.java | 1 -
.../types/ProductReviewCollection.java | 1 -
.../types/ProductReviewKey.java | 1 -
.../astoriadefaultservice/types/RSAToken.java | 1 -
.../types/RSATokenCollection.java | 1 -
.../types/SpecialEmployee.java | 7 +-
.../types/SpecialEmployeeCollection.java | 1 -
.../types/package-info.java | 1 -
.../olingo/fit/proxy/v4/AbstractTest.java | 81 -------
.../olingo/fit/proxy/v4/AbstractTestITCase.java | 81 +++++++
.../fit/proxy/v4/EntityRetrieveTestITCase.java | 2 +-
.../fit/proxy/v4/EntitySetTestITCase.java | 2 +-
.../services/odatawcfservice/Accounts.java | 1 -
.../odata/services/odatawcfservice/Boss.java | 1 -
.../odata/services/odatawcfservice/Company.java | 1 -
.../services/odatawcfservice/Customers.java | 1 -
.../odatawcfservice/DefaultStoredPI.java | 1 -
.../services/odatawcfservice/Departments.java | 1 -
.../services/odatawcfservice/Employees.java | 1 -
.../odatawcfservice/InMemoryEntities.java | 10 +-
.../services/odatawcfservice/LabourUnion.java | 1 -
.../services/odatawcfservice/OrderDetails.java | 1 -
.../odata/services/odatawcfservice/Orders.java | 1 -
.../odata/services/odatawcfservice/People.java | 1 -
.../odatawcfservice/ProductDetails.java | 1 -
.../odatawcfservice/ProductReviews.java | 1 -
.../services/odatawcfservice/Products.java | 1 -
.../services/odatawcfservice/PublicCompany.java | 1 -
.../services/odatawcfservice/StoredPIs.java | 1 -
.../odatawcfservice/SubscriptionTemplates.java | 1 -
.../services/odatawcfservice/VipCustomer.java | 1 -
.../services/odatawcfservice/package-info.java | 1 -
.../odatawcfservice/types/AccessLevel.java | 1 -
.../services/odatawcfservice/types/Account.java | 1 -
.../types/AccountCollection.java | 1 -
.../odatawcfservice/types/AccountInfo.java | 1 -
.../services/odatawcfservice/types/Address.java | 1 -
.../services/odatawcfservice/types/Asset.java | 1 -
.../odatawcfservice/types/AssetCollection.java | 1 -
.../services/odatawcfservice/types/Club.java | 1 -
.../odatawcfservice/types/ClubCollection.java | 1 -
.../services/odatawcfservice/types/Color.java | 1 -
.../services/odatawcfservice/types/Company.java | 5 +-
.../odatawcfservice/types/CompanyAddress.java | 11 -
.../odatawcfservice/types/CompanyCategory.java | 1 -
.../types/CompanyCollection.java | 1 -
.../odatawcfservice/types/CreditCardPI.java | 1 -
.../types/CreditCardPICollection.java | 1 -
.../odatawcfservice/types/CreditRecord.java | 1 -
.../types/CreditRecordCollection.java | 1 -
.../odatawcfservice/types/Customer.java | 7 +-
.../types/CustomerCollection.java | 1 -
.../odatawcfservice/types/Department.java | 24 +-
.../types/DepartmentCollection.java | 1 -
.../odatawcfservice/types/Employee.java | 7 +-
.../types/EmployeeCollection.java | 1 -
.../odatawcfservice/types/GiftCard.java | 24 +-
.../types/GiftCardCollection.java | 1 -
.../odatawcfservice/types/HomeAddress.java | 1 -
.../odatawcfservice/types/LabourUnion.java | 1 -
.../types/LabourUnionCollection.java | 1 -
.../services/odatawcfservice/types/Order.java | 1 -
.../odatawcfservice/types/OrderCollection.java | 1 -
.../odatawcfservice/types/OrderDetail.java | 1 -
.../types/OrderDetailCollection.java | 1 -
.../odatawcfservice/types/OrderDetailKey.java | 1 -
.../types/PaymentInstrument.java | 1 -
.../types/PaymentInstrumentCollection.java | 1 -
.../services/odatawcfservice/types/Person.java | 1 -
.../odatawcfservice/types/PersonCollection.java | 1 -
.../services/odatawcfservice/types/Product.java | 1 -
.../types/ProductCollection.java | 1 -
.../odatawcfservice/types/ProductDetail.java | 1 -
.../types/ProductDetailCollection.java | 1 -
.../odatawcfservice/types/ProductDetailKey.java | 1 -
.../odatawcfservice/types/ProductReview.java | 1 -
.../types/ProductReviewCollection.java | 1 -
.../odatawcfservice/types/ProductReviewKey.java | 1 -
.../odatawcfservice/types/PublicCompany.java | 9 +-
.../types/PublicCompanyCollection.java | 1 -
.../odatawcfservice/types/Statement.java | 1 -
.../types/StatementCollection.java | 1 -
.../odatawcfservice/types/StoredPI.java | 1 -
.../types/StoredPICollection.java | 1 -
.../odatawcfservice/types/Subscription.java | 1 -
.../types/SubscriptionCollection.java | 1 -
.../odatawcfservice/types/package-info.java | 1 -
.../commons/core/data/JSONEntitySerializer.java | 12 +-
195 files changed, 805 insertions(+), 579 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
index 9b14fd1..5c8380d 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
@@ -172,7 +172,7 @@ class EntitySetInvocationHandler<C extends CommonEdmEnabledODataClient<?>, T ext
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {reference},
new EntityCollectionInvocationHandler<T, C>(
- containerHandler, new ArrayList<T>(), typeRef, containerHandler.getEntityContainerName()));
+ containerHandler, new ArrayList<T>(), typeRef, containerHandler.getEntityContainerName()));
}
@Override
@@ -232,12 +232,7 @@ class EntitySetInvocationHandler<C extends CommonEdmEnabledODataClient<?>, T ext
throw new IllegalArgumentException("Null key");
}
- final EntityUUID uuid = new EntityUUID(
- containerHandler.getEntityContainerName(),
- entitySetName,
- new FullQualifiedName(ClassUtils.getNamespace(typeRef), ClassUtils.getEntityTypeName(typeRef)),
- key);
-
+ final EntityUUID uuid = new EntityUUID(containerHandler.getEntityContainerName(), entitySetName, typeRef, key);
LOG.debug("Ask for '{}({})'", typeRef.getSimpleName(), key);
EntityTypeInvocationHandler<?> handler =
@@ -319,7 +314,7 @@ class EntitySetInvocationHandler<C extends CommonEdmEnabledODataClient<?>, T ext
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {collTypeRef},
new EntityCollectionInvocationHandler<S, C>(
- containerHandler, items, typeRef, containerHandler.getEntityContainerName(), entitySetURI));
+ containerHandler, items, typeRef, containerHandler.getEntityContainerName(), entitySetURI));
}
@Override
@@ -365,7 +360,7 @@ class EntitySetInvocationHandler<C extends CommonEdmEnabledODataClient<?>, T ext
EntityTypeInvocationHandler<?> entity = entityContext.getEntity(new EntityUUID(
containerHandler.getEntityContainerName(),
entitySetName,
- new FullQualifiedName(ClassUtils.getNamespace(typeRef), ClassUtils.getEntityTypeName(typeRef)),
+ typeRef,
key));
if (entity == null) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
index 3a825e8..3dfdf38 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
@@ -89,8 +89,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
final Class<?> typeRef,
final EntityContainerInvocationHandler<?> containerHandler) {
- return new EntityTypeInvocationHandler(
- entity, entitySetName, typeRef, containerHandler);
+ return new EntityTypeInvocationHandler(entity, entitySetName, typeRef, containerHandler);
}
private EntityTypeInvocationHandler(
@@ -107,10 +106,8 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
this.uuid = new EntityUUID(
containerHandler.getEntityContainerName(),
entitySetName,
- entity.getTypeName(),
+ typeRef,
CoreUtils.getKey(client, typeRef, entity));
-
- this.stream = null;
}
public void setEntity(final CommonODataEntity entity) {
@@ -120,7 +117,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
this.uuid = new EntityUUID(
getUUID().getContainerName(),
getUUID().getEntitySetName(),
- getUUID().getName(),
+ getUUID().getType(),
CoreUtils.getKey(client, typeRef, entity));
this.propertyChanges.clear();
@@ -128,7 +125,6 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
this.streamedPropertyChanges.clear();
this.propertiesTag = 0;
this.linksTag = 0;
- this.stream = null;
}
public EntityUUID getUUID() {
@@ -193,9 +189,9 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
@Override
protected Object getPropertyValue(final String name, final Type type) {
try {
- final Object res;
final CommonODataProperty property = getEntity().getProperty(name);
+ Object res;
if (propertyChanges.containsKey(name)) {
res = propertyChanges.get(name);
} else if (property == null) {
@@ -205,7 +201,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {(Class<?>) type},
ComplexTypeInvocationHandler.getInstance(
- client, property.getValue().asComplex(), (Class<?>) type, this));
+ client, property.getValue().asComplex(), (Class<?>) type, this));
addPropertyChanges(name, res);
} else if (property.hasCollectionValue()) {
@@ -224,7 +220,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {collItemClass},
ComplexTypeInvocationHandler.getInstance(
- client, value.asComplex(), collItemClass, this));
+ client, value.asComplex(), collItemClass, this));
collection.add(collItem);
}
@@ -279,8 +275,8 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
if (property.type().equalsIgnoreCase(EdmPrimitiveTypeKind.Stream.toString())) {
setStreamedProperty(property, (InputStream) value);
} else {
- final Object toBeAdded;
-
+
+ Object toBeAdded;
if (value == null) {
toBeAdded = null;
} else if (Collection.class.isAssignableFrom(value.getClass())) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
index 0f61208..fd3aa89 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
@@ -136,7 +136,8 @@ class OperationInvocationHandler<C extends CommonEdmEnabledODataClient<?>> exten
}
if (parameters.size() <= i) {
- throw new IllegalArgumentException("Paramter " + i + " is not annotated as @Parameter");
+ throw new IllegalArgumentException(
+ "Paramter " + i + " is not annotated as @" + Parameter.class.getSimpleName());
}
}
}
@@ -176,21 +177,20 @@ class OperationInvocationHandler<C extends CommonEdmEnabledODataClient<?>> exten
return new AbstractMap.SimpleEntry<URI, EdmOperation>(uriBuilder.build(), edmOperation);
}
- private Map.Entry<URI, EdmOperation> getBoundOperation(
- final Operation operation, final List<String> parameterNames) {
+ private Map.Entry<URI, EdmOperation> getBoundOperation(final Operation operation, final List<String> parameterNames) {
final CommonODataEntity entity = ((EntityTypeInvocationHandler<?>) target).getEntity();
- final ODataOperation boundOp =
- entity.getOperation(new FullQualifiedName(targetFQN.getNamespace(), operation.name()).toString());
-
- final EdmOperation edmOperation;
+ final ODataOperation boundOp = entity.getOperation(operation.name());
+ EdmOperation edmOperation;
if (operation.type() == OperationType.FUNCTION) {
edmOperation = client.getCachedEdm().getBoundFunction(
- new FullQualifiedName(boundOp.getTitle()), entity.getTypeName(), false, parameterNames);
+ new FullQualifiedName(targetFQN.getNamespace(), boundOp.getTitle()),
+ entity.getTypeName(), false, parameterNames);
} else {
edmOperation = client.getCachedEdm().getBoundAction(
- new FullQualifiedName(boundOp.getTitle()), entity.getTypeName(), false);
+ new FullQualifiedName(targetFQN.getNamespace(), boundOp.getTitle()),
+ entity.getTypeName(), false);
}
return new AbstractMap.SimpleEntry<URI, EdmOperation>(boundOp.getTarget(), edmOperation);
@@ -213,6 +213,7 @@ class OperationInvocationHandler<C extends CommonEdmEnabledODataClient<?>> exten
}
return new AbstractMap.SimpleEntry<URI, EdmOperation>(
- ((EntityCollectionInvocationHandler<?, C>) target).getURI(), edmOperation);
+ URI.create(((EntityCollectionInvocationHandler<?, C>) target).getURI().toASCIIString()
+ + "/" + edmOperation.getName()), edmOperation);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java
index 753f33e..7ca1a76 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java
@@ -33,7 +33,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Attached entities with not null key.
- * <p>
+ * <br/>
* This map have to be used to search for entities by key.
*/
private final Map<EntityUUID, EntityTypeInvocationHandler<?>> searchableEntities =
@@ -41,7 +41,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* All attached entities (new entities included).
- * <p>
+ * <br/>
* Attachment order will be maintained.
*/
private final Map<EntityTypeInvocationHandler<?>, AttachedEntityStatus> allAttachedEntities =
@@ -49,7 +49,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Attaches an entity with status <tt>NEW</tt>.
- * <p>
+ * <br/>
* Use this method to attach a new created entity.
*
* @see AttachedEntityStatus
@@ -64,7 +64,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Attaches an existing entity with status <tt>ATTACHED</tt>.
- * <p>
+ * <br/>
* Use this method to attach an existing entity.
*
* @see AttachedEntityStatus
@@ -76,7 +76,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Attaches an entity with specified status.
- * <p>
+ * <br/>
* Use this method to attach an existing entity.
*
* @see AttachedEntityStatus
@@ -109,7 +109,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Detaches all attached entities.
- * <p>
+ * <br/>
* Use this method to clears the entity context.
*/
public void detachAll() {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java
index de7a6f1..b79dbb4 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java
@@ -19,42 +19,45 @@
package org.apache.olingo.ext.proxy.context;
import java.io.Serializable;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
public class EntityUUID implements Serializable {
private static final long serialVersionUID = 4855025769803086495L;
- // needed by equals and hashcode
- private final int tempKey;
-
private final String containerName;
private final String entitySetName;
- private final FullQualifiedName name;
-
private final Object key;
- public EntityUUID(
- final String containerName,
- final String entitySetName,
- final FullQualifiedName name) {
- this(containerName, entitySetName, name, null);
+ private Class<?> type;
+
+ public EntityUUID(final String containerName, final String entitySetName, final Class<?> type) {
+ this(containerName, entitySetName, type, null);
}
- public EntityUUID(
- final String containerName,
- final String entitySetName,
- final FullQualifiedName name,
- final Object key) {
+ public EntityUUID(final String containerName, final String entitySetName, final Class<?> type, final Object key) {
this.containerName = containerName;
this.entitySetName = entitySetName;
- this.name = name;
this.key = key;
- this.tempKey = (int) (Math.random() * 1000000);
+
+ if (type == null || !Serializable.class.isAssignableFrom(type)) {
+ throw new IllegalArgumentException("Invalid Entity type class: " + type);
+ }
+ for (Class<?> clazz : ClassUtils.hierarchy(type, ClassUtils.Interfaces.INCLUDE)) {
+ if (this.type == null
+ && (clazz.getInterfaces().length == 0
+ || ArrayUtils.contains(clazz.getInterfaces(), Serializable.class))) {
+
+ this.type = clazz;
+ }
+ }
}
public String getContainerName() {
@@ -65,38 +68,26 @@ public class EntityUUID implements Serializable {
return entitySetName;
}
- public FullQualifiedName getName() {
- return name;
- }
-
public Object getKey() {
return key;
}
- /**
- * {@inheritDoc }
- */
+ public Class<?> getType() {
+ return type;
+ }
+
@Override
- public boolean equals(Object obj) {
- return key == null
- ? EqualsBuilder.reflectionEquals(this, obj)
- : EqualsBuilder.reflectionEquals(this, obj, "tempKey");
+ public boolean equals(final Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj);
}
- /**
- * {@inheritDoc }
- */
@Override
public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this, "tempKey");
+ return HashCodeBuilder.reflectionHashCode(this);
}
- /**
- * {@inheritDoc }
- */
@Override
public String toString() {
- return name.getNamespace() + ":" + containerName + ":" + entitySetName + ":" + name.getName()
- + "(" + (key == null ? null : key.toString()) + ")";
+ return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
index 948bcd9..0b4bb4a 100644
--- a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
+++ b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
@@ -420,7 +420,7 @@ public abstract class AbstractServices {
} else {
final ResWrap<JSONEntityImpl> jcont = mapper.readValue(IOUtils.toInputStream(changes, Constants.ENCODING),
new TypeReference<JSONEntityImpl>() {
- });
+ });
entryChanges = dataBinder.toAtomEntity(jcont.getPayload());
}
@@ -607,8 +607,8 @@ public abstract class AbstractServices {
} else {
final ResWrap<JSONEntityImpl> jcontainer =
mapper.readValue(IOUtils.toInputStream(entity, Constants.ENCODING),
- new TypeReference<JSONEntityImpl>() {
- });
+ new TypeReference<JSONEntityImpl>() {
+ });
entry = dataBinder.toAtomEntity(jcontainer.getPayload());
@@ -635,7 +635,7 @@ public abstract class AbstractServices {
ResWrap<AtomEntityImpl> result = atomDeserializer.read(serialization, AtomEntityImpl.class);
result = new ResWrap<AtomEntityImpl>(
URI.create(Constants.get(version, ConstantKey.ODATA_METADATA_PREFIX)
- + entitySetName + Constants.get(version, ConstantKey.ODATA_METADATA_ENTITY_SUFFIX)),
+ + entitySetName + Constants.get(version, ConstantKey.ODATA_METADATA_ENTITY_SUFFIX)),
null, result.getPayload());
final String path = Commons.getEntityBasePath(entitySetName, entityKey);
@@ -686,25 +686,19 @@ public abstract class AbstractServices {
throw new UnsupportedMediaTypeException("Unsupported media type");
}
- final Map.Entry<String, InputStream> entityInfo = utils.getValue().readEntity("Person", entityId, utils.getKey());
-
- InputStream entity = entityInfo.getValue();
try {
- final ByteArrayOutputStream copy = new ByteArrayOutputStream();
- IOUtils.copy(entity, copy);
- IOUtils.closeQuietly(entity);
+ final Map.Entry<String, InputStream> entityInfo = xml.readEntity("Person", entityId, Accept.ATOM);
- final String newContent = new String(copy.toByteArray(), "UTF-8").
- replaceAll("\"Salary\":[0-9]*,", "\"Salary\":0,").
- replaceAll("\"Title\":\".*\"", "\"Title\":\"[Sacked]\"").
- replaceAll("\\<d:Salary m:type=\"Edm.Int32\"\\>.*\\</d:Salary\\>",
- "<d:Salary m:type=\"Edm.Int32\">0</d:Salary>").
- replaceAll("\\<d:Title\\>.*\\</d:Title\\>", "<d:Title>[Sacked]</d:Title>");
+ final InputStream entity = entityInfo.getValue();
+ final ResWrap<AtomEntityImpl> container = atomDeserializer.read(entity, AtomEntityImpl.class);
+
+ container.getPayload().getProperty("Salary").setValue(new PrimitiveValueImpl("0"));
+ container.getPayload().getProperty("Title").setValue(new PrimitiveValueImpl("[Sacked]"));
final FSManager fsManager = FSManager.instance(version);
- fsManager.putInMemory(IOUtils.toInputStream(newContent, Constants.ENCODING),
+ fsManager.putInMemory(xml.writeEntity(Accept.ATOM, container),
fsManager.getAbsolutePath(Commons.getEntityBasePath("Person", entityId) + Constants.get(version,
- ConstantKey.ENTITY), utils.getKey()));
+ ConstantKey.ENTITY), Accept.ATOM));
return utils.getValue().createResponse(null, null, null, utils.getKey(), Response.Status.NO_CONTENT);
} catch (Exception e) {
@@ -756,9 +750,9 @@ public abstract class AbstractServices {
final Long newSalary = Long.valueOf(salaryMatcher.group(1)) + n;
newContent = newContent.
replaceAll("\"Salary\":" + salaryMatcher.group(1) + ",",
- "\"Salary\":" + newSalary + ",").
+ "\"Salary\":" + newSalary + ",").
replaceAll("\\<d:Salary m:type=\"Edm.Int32\"\\>" + salaryMatcher.group(1) + "</d:Salary\\>",
- "<d:Salary m:type=\"Edm.Int32\">" + newSalary + "</d:Salary>");
+ "<d:Salary m:type=\"Edm.Int32\">" + newSalary + "</d:Salary>");
}
FSManager.instance(version).putInMemory(IOUtils.toInputStream(newContent, Constants.ENCODING),
@@ -770,6 +764,77 @@ public abstract class AbstractServices {
}
}
+ @POST
+ @Path("/Product({entityId})/ChangeProductDimensions")
+ public Response actionChangeProductDimensions(
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
+ final String argument) {
+
+ final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
+
+ if (utils.getKey() == Accept.XML || utils.getKey() == Accept.TEXT) {
+ throw new UnsupportedMediaTypeException("Unsupported media type");
+ }
+
+ try {
+ final Map.Entry<String, InputStream> entityInfo = xml.readEntity("Product", entityId, Accept.ATOM);
+
+ final InputStream entity = entityInfo.getValue();
+ final ResWrap<AtomEntityImpl> container = atomDeserializer.read(entity, AtomEntityImpl.class);
+
+ final Entity param = xml.readEntity(utils.getKey(), IOUtils.toInputStream(argument, Constants.ENCODING));
+
+ container.getPayload().getProperty("Dimensions").setValue(param.getProperty("dimensions").getValue());
+
+ final FSManager fsManager = FSManager.instance(version);
+ fsManager.putInMemory(xml.writeEntity(Accept.ATOM, container),
+ fsManager.getAbsolutePath(Commons.getEntityBasePath("Product", entityId) + Constants.get(version,
+ ConstantKey.ENTITY), Accept.ATOM));
+
+ return utils.getValue().createResponse(null, null, null, utils.getKey(), Response.Status.NO_CONTENT);
+ } catch (Exception e) {
+ return xml.createFaultResponse(accept, e);
+ }
+ }
+
+ @POST
+ @Path("/ComputerDetail({entityId})/ResetComputerDetailsSpecifications")
+ public Response actionResetComputerDetailsSpecifications(
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
+ final String argument) {
+
+ final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
+
+ if (utils.getKey() == Accept.XML || utils.getKey() == Accept.TEXT) {
+ throw new UnsupportedMediaTypeException("Unsupported media type");
+ }
+
+ try {
+ final Map.Entry<String, InputStream> entityInfo = xml.readEntity("ComputerDetail", entityId, Accept.ATOM);
+
+ final InputStream entity = entityInfo.getValue();
+ final ResWrap<AtomEntityImpl> container = atomDeserializer.read(entity, AtomEntityImpl.class);
+
+ final Entity param = xml.readEntity(utils.getKey(), IOUtils.toInputStream(argument, Constants.ENCODING));
+
+ container.getPayload().getProperty("SpecificationsBag").setValue(param.getProperty("specifications").getValue());
+ container.getPayload().getProperty("PurchaseDate").setValue(param.getProperty("purchaseTime").getValue());
+
+ final FSManager fsManager = FSManager.instance(version);
+ fsManager.putInMemory(xml.writeEntity(Accept.ATOM, container),
+ fsManager.getAbsolutePath(Commons.getEntityBasePath("ComputerDetail", entityId) + Constants.get(version,
+ ConstantKey.ENTITY), Accept.ATOM));
+
+ return utils.getValue().createResponse(null, null, null, utils.getKey(), Response.Status.NO_CONTENT);
+ } catch (Exception e) {
+ return xml.createFaultResponse(accept, e);
+ }
+ }
+
/**
* Retrieve entities from the given entity set and the given type.
*
@@ -907,7 +972,7 @@ public abstract class AbstractServices {
} else {
mapper.writeValue(
writer, new JSONFeedContainer(container.getContextURL(), container.getMetadataETag(),
- dataBinder.toJSONEntitySet(container.getPayload())));
+ dataBinder.toJSONEntitySet(container.getPayload())));
}
return xml.createResponse(
@@ -923,17 +988,9 @@ public abstract class AbstractServices {
protected abstract void setInlineCount(final EntitySet feed, final String count);
- /**
- * Retrieve entity with key as segment.
- *
- * @param accept Accept header.
- * @param entityId entity id.
- * @param format format query option.
- * @return entity.
- */
@GET
@Path("/Person({entityId})")
- public Response getEntity(
+ public Response getPerson(
@Context UriInfo uriInfo,
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
@PathParam("entityId") final String entityId,
@@ -941,28 +998,98 @@ public abstract class AbstractServices {
final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
- if (utils.getKey() == Accept.XML || utils.getKey() == Accept.TEXT) {
- throw new UnsupportedMediaTypeException("Unsupported media type");
+ final Response internal = getEntityInternal(uriInfo.getRequestUri().toASCIIString(),
+ accept, "Person", entityId, format, null, null, false);
+ if (internal.getStatus() == 200) {
+ InputStream entity = (InputStream) internal.getEntity();
+ try {
+ if (utils.getKey() == Accept.JSON_FULLMETA || utils.getKey() == Accept.ATOM) {
+ entity = utils.getValue().addOperation(entity, "Sack", "#DefaultContainer.Sack",
+ uriInfo.getAbsolutePath().toASCIIString()
+ + "/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Sack");
+ }
+
+ return utils.getValue().createResponse(
+ uriInfo.getRequestUri().toASCIIString(),
+ entity,
+ internal.getHeaderString("ETag"),
+ utils.getKey());
+ } catch (Exception e) {
+ LOG.error("Error retrieving entity", e);
+ return xml.createFaultResponse(accept, e);
+ }
+ } else {
+ return internal;
}
+ }
+
+ @GET
+ @Path("/Product({entityId})")
+ public Response getProduct(
+ @Context UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
- final Map.Entry<String, InputStream> entityInfo = utils.getValue().readEntity("Person", entityId, utils.getKey());
+ final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
- InputStream entity = entityInfo.getValue();
- try {
- if (utils.getKey() == Accept.JSON_FULLMETA || utils.getKey() == Accept.ATOM) {
- entity = utils.getValue().addOperation(entity, "Sack", "#DefaultContainer.Sack",
- uriInfo.getAbsolutePath().toASCIIString()
- + "/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Sack");
+ final Response internal = getEntityInternal(uriInfo.getRequestUri().toASCIIString(),
+ accept, "Product", entityId, format, null, null, false);
+ if (internal.getStatus() == 200) {
+ InputStream entity = (InputStream) internal.getEntity();
+ try {
+ if (utils.getKey() == Accept.JSON_FULLMETA || utils.getKey() == Accept.ATOM) {
+ entity = utils.getValue().addOperation(entity,
+ "ChangeProductDimensions", "#DefaultContainer.ChangeProductDimensions",
+ uriInfo.getAbsolutePath().toASCIIString() + "/ChangeProductDimensions");
+ }
+
+ return utils.getValue().createResponse(
+ uriInfo.getRequestUri().toASCIIString(),
+ entity,
+ internal.getHeaderString("ETag"),
+ utils.getKey());
+ } catch (Exception e) {
+ LOG.error("Error retrieving entity", e);
+ return xml.createFaultResponse(accept, e);
}
+ } else {
+ return internal;
+ }
+ }
- return utils.getValue().createResponse(
- uriInfo.getRequestUri().toASCIIString(),
- entity,
- Commons.getETag(entityInfo.getKey(), version),
- utils.getKey());
- } catch (Exception e) {
- LOG.error("Error retrieving entity", e);
- return xml.createFaultResponse(accept, e);
+ @GET
+ @Path("/ComputerDetail({entityId})")
+ public Response getComputerDetail(
+ @Context UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
+
+ final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
+
+ final Response internal = getEntityInternal(uriInfo.getRequestUri().toASCIIString(),
+ accept, "ComputerDetail", entityId, format, null, null, false);
+ if (internal.getStatus() == 200) {
+ InputStream entity = (InputStream) internal.getEntity();
+ try {
+ if (utils.getKey() == Accept.JSON_FULLMETA || utils.getKey() == Accept.ATOM) {
+ entity = utils.getValue().addOperation(entity,
+ "ResetComputerDetailsSpecifications", "#DefaultContainer.ResetComputerDetailsSpecifications",
+ uriInfo.getAbsolutePath().toASCIIString() + "/ResetComputerDetailsSpecifications");
+ }
+
+ return utils.getValue().createResponse(
+ uriInfo.getRequestUri().toASCIIString(),
+ entity,
+ internal.getHeaderString("ETag"),
+ utils.getKey());
+ } catch (Exception e) {
+ LOG.error("Error retrieving entity", e);
+ return xml.createFaultResponse(accept, e);
+ }
+ } else {
+ return internal;
}
}
@@ -1570,8 +1697,8 @@ public abstract class AbstractServices {
mapper.writeValue(
writer,
new JSONFeedContainer(container.getContextURL(),
- container.getMetadataETag(),
- dataBinder.toJSONEntitySet((AtomEntitySetImpl) container.getPayload())));
+ container.getMetadataETag(),
+ dataBinder.toJSONEntitySet((AtomEntitySetImpl) container.getPayload())));
}
} else {
final ResWrap<Entity> container =
@@ -1584,8 +1711,8 @@ public abstract class AbstractServices {
mapper.writeValue(
writer,
new JSONEntryContainer(container.getContextURL(),
- container.getMetadataETag(),
- dataBinder.toJSONEntity((AtomEntityImpl) container.getPayload())));
+ container.getMetadataETag(),
+ dataBinder.toJSONEntity((AtomEntityImpl) container.getPayload())));
}
}
@@ -1655,9 +1782,9 @@ public abstract class AbstractServices {
final ResWrap<AtomPropertyImpl> container = new ResWrap<AtomPropertyImpl>(
URI.create(Constants.get(version, ConstantKey.ODATA_METADATA_PREFIX)
- + (version.compareTo(ODataServiceVersion.V40) >= 0
- ? entitySetName + "(" + entityId + ")/" + path
- : property.getType())),
+ + (version.compareTo(ODataServiceVersion.V40) >= 0
+ ? entitySetName + "(" + entityId + ")/" + path
+ : property.getType())),
entryContainer.getMetadataETag(),
property);
@@ -1665,9 +1792,9 @@ public abstract class AbstractServices {
null,
searchForValue
? IOUtils.toInputStream(
- container.getPayload().getValue() == null || container.getPayload().getValue().isNull()
- ? StringUtils.EMPTY
- : container.getPayload().getValue().asPrimitive().get(), Constants.ENCODING)
+ container.getPayload().getValue() == null || container.getPayload().getValue().isNull()
+ ? StringUtils.EMPTY
+ : container.getPayload().getValue().asPrimitive().get(), Constants.ENCODING)
: utils.writeProperty(acceptType, container),
Commons.getETag(Commons.getEntityBasePath(entitySetName, entityId), version),
acceptType);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTest.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTest.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTest.java
deleted file mode 100644
index fbee685..0000000
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.fit.proxy.v3;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collections;
-import org.apache.olingo.ext.proxy.EntityContainerFactory;
-import org.apache.olingo.ext.proxy.context.EntityContext;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- DefaultContainer;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- types.ContactDetails;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- types.Customer;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- types.Aliases;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- types.Phone;
-
-import org.junit.BeforeClass;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractTest {
-
- /**
- * Logger.
- */
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractTest.class);
-
- protected static final String TEST_PRODUCT_TYPE = "Microsoft.Test.OData.Services.AstoriaDefaultService.Product";
-
- protected static String testStaticServiceRootURL;
-
- protected static String testKeyAsSegmentServiceRootURL;
-
- protected static String testActionOverloadingServiceRootURL;
-
- protected static String testOpenTypeServiceRootURL;
-
- protected static String testLargeModelServiceRootURL;
-
- protected static String testAuthServiceRootURL;
-
- protected final EntityContext entityContext = EntityContainerFactory.getContext().entityContext();
-
- protected static EntityContainerFactory containerFactory;
-
- protected static DefaultContainer container;
-
- @BeforeClass
- public static void setUpODataServiceRoot() throws IOException {
- testStaticServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc";
- testKeyAsSegmentServiceRootURL = "http://localhost:9080/stub/StaticService/V30/KeyAsSegment.svc";
- testActionOverloadingServiceRootURL = "http://localhost:9080/stub/StaticService/V30/ActionOverloading.svc";
- testOpenTypeServiceRootURL = "http://localhost:9080/stub/StaticService/V30/OpenType.svc";
- testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc/large";
- testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc";
-
- containerFactory = EntityContainerFactory.getV3(testStaticServiceRootURL);
- container = containerFactory.getEntityContainer(DefaultContainer.class);
- assertNotNull(container);
- }
-
- protected Customer getSampleCustomerProfile(
- final Integer id,
- final String sampleName,
- final DefaultContainer container) {
-
- final Customer customer = container.getCustomer().newCustomer();
-
- // add name attribute
- customer.setName(sampleName);
-
- // add key attribute
- customer.setCustomerId(id);
-
- final ContactDetails cd = customer.factory().newPrimaryContactInfo();
- cd.setAlternativeNames(Arrays.asList("alternative1", "alternative2"));
- cd.setEmailBag(Collections.<String>singleton("myname@mydomain.org"));
- cd.setMobilePhoneBag(Collections.<Phone>emptySet());
- customer.setPrimaryContactInfo(cd);
-
- final Aliases aliases = cd.factory().newContactAlias();
- aliases.setAlternativeNames(Collections.<String>singleton("myAlternativeName"));
- cd.setContactAlias(aliases);
-
- final ContactDetails bcd = customer.factory().newBackupContactInfo();
- bcd.setAlternativeNames(Arrays.asList("alternative3", "alternative4"));
- bcd.setEmailBag(Collections.<String>emptySet());
- bcd.setMobilePhoneBag(Collections.<Phone>emptySet());
- customer.setBackupContactInfo(Collections.<ContactDetails>singleton(bcd));
-
- return customer;
- }
-
- protected void checkSampleCustomerProfile(
- final Customer customer,
- final Integer id,
- final String sampleName) {
-
- assertEquals(id, customer.getCustomerId());
- assertNotNull(customer.getPrimaryContactInfo());
- assertFalse(customer.getBackupContactInfo().isEmpty());
-
- final ContactDetails cd = customer.getPrimaryContactInfo();
- final ContactDetails bcd = customer.getBackupContactInfo().iterator().next();
-
- assertTrue(cd.getAlternativeNames().contains("alternative1"));
- assertTrue(cd.getAlternativeNames().contains("alternative2"));
- assertEquals("myname@mydomain.org", cd.getEmailBag().iterator().next());
- assertEquals("myAlternativeName", cd.getContactAlias().getAlternativeNames().iterator().next());
- assertTrue(cd.getMobilePhoneBag().isEmpty());
-
- assertTrue(bcd.getAlternativeNames().contains("alternative3"));
- assertTrue(bcd.getAlternativeNames().contains("alternative4"));
- assertTrue(bcd.getEmailBag().isEmpty());
- assertTrue(bcd.getMobilePhoneBag().isEmpty());
- }
-
- protected Customer readCustomer(final DefaultContainer container, int id) {
- final Customer customer = container.getCustomer().get(id);
- assertNotNull(customer);
- assertEquals(Integer.valueOf(id), customer.getCustomerId());
-
- return customer;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java
new file mode 100644
index 0000000..458963b
--- /dev/null
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.fit.proxy.v3;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collections;
+import org.apache.olingo.ext.proxy.EntityContainerFactory;
+import org.apache.olingo.ext.proxy.context.EntityContext;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ DefaultContainer;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ types.ContactDetails;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ types.Customer;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ types.Aliases;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ types.Phone;
+
+import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractTestITCase {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractTestITCase.class);
+
+ protected static final String TEST_PRODUCT_TYPE = "Microsoft.Test.OData.Services.AstoriaDefaultService.Product";
+
+ protected static String testStaticServiceRootURL;
+
+ protected static String testKeyAsSegmentServiceRootURL;
+
+ protected static String testActionOverloadingServiceRootURL;
+
+ protected static String testOpenTypeServiceRootURL;
+
+ protected static String testLargeModelServiceRootURL;
+
+ protected static String testAuthServiceRootURL;
+
+ protected final EntityContext entityContext = EntityContainerFactory.getContext().entityContext();
+
+ protected static EntityContainerFactory containerFactory;
+
+ protected static DefaultContainer container;
+
+ @BeforeClass
+ public static void setUpODataServiceRoot() throws IOException {
+ testStaticServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc";
+ testKeyAsSegmentServiceRootURL = "http://localhost:9080/stub/StaticService/V30/KeyAsSegment.svc";
+ testActionOverloadingServiceRootURL = "http://localhost:9080/stub/StaticService/V30/ActionOverloading.svc";
+ testOpenTypeServiceRootURL = "http://localhost:9080/stub/StaticService/V30/OpenType.svc";
+ testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc/large";
+ testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc";
+
+ containerFactory = EntityContainerFactory.getV3(testStaticServiceRootURL);
+ container = containerFactory.getEntityContainer(DefaultContainer.class);
+ assertNotNull(container);
+ }
+
+ protected Customer getSampleCustomerProfile(
+ final Integer id,
+ final String sampleName,
+ final DefaultContainer container) {
+
+ final Customer customer = container.getCustomer().newCustomer();
+
+ // add name attribute
+ customer.setName(sampleName);
+
+ // add key attribute
+ customer.setCustomerId(id);
+
+ final ContactDetails cd = customer.factory().newPrimaryContactInfo();
+ cd.setAlternativeNames(Arrays.asList("alternative1", "alternative2"));
+ cd.setEmailBag(Collections.<String>singleton("myname@mydomain.org"));
+ cd.setMobilePhoneBag(Collections.<Phone>emptySet());
+ customer.setPrimaryContactInfo(cd);
+
+ final Aliases aliases = cd.factory().newContactAlias();
+ aliases.setAlternativeNames(Collections.<String>singleton("myAlternativeName"));
+ cd.setContactAlias(aliases);
+
+ final ContactDetails bcd = customer.factory().newBackupContactInfo();
+ bcd.setAlternativeNames(Arrays.asList("alternative3", "alternative4"));
+ bcd.setEmailBag(Collections.<String>emptySet());
+ bcd.setMobilePhoneBag(Collections.<Phone>emptySet());
+ customer.setBackupContactInfo(Collections.<ContactDetails>singleton(bcd));
+
+ return customer;
+ }
+
+ protected void checkSampleCustomerProfile(
+ final Customer customer,
+ final Integer id,
+ final String sampleName) {
+
+ assertEquals(id, customer.getCustomerId());
+ assertNotNull(customer.getPrimaryContactInfo());
+ assertFalse(customer.getBackupContactInfo().isEmpty());
+
+ final ContactDetails cd = customer.getPrimaryContactInfo();
+ final ContactDetails bcd = customer.getBackupContactInfo().iterator().next();
+
+ assertTrue(cd.getAlternativeNames().contains("alternative1"));
+ assertTrue(cd.getAlternativeNames().contains("alternative2"));
+ assertEquals("myname@mydomain.org", cd.getEmailBag().iterator().next());
+ assertEquals("myAlternativeName", cd.getContactAlias().getAlternativeNames().iterator().next());
+ assertTrue(cd.getMobilePhoneBag().isEmpty());
+
+ assertTrue(bcd.getAlternativeNames().contains("alternative3"));
+ assertTrue(bcd.getAlternativeNames().contains("alternative4"));
+ assertTrue(bcd.getEmailBag().isEmpty());
+ assertTrue(bcd.getMobilePhoneBag().isEmpty());
+ }
+
+ protected Customer readCustomer(final DefaultContainer container, int id) {
+ final Customer customer = container.getCustomer().get(id);
+ assertNotNull(customer);
+ assertEquals(Integer.valueOf(id), customer.getCustomerId());
+
+ return customer;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
index a930100..2ae58e8 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
@@ -18,9 +18,11 @@
*/
package org.apache.olingo.fit.proxy.v3;
-import java.lang.reflect.Proxy;
-import org.apache.olingo.ext.proxy.commons.EntityTypeInvocationHandler;
-import static org.apache.olingo.fit.proxy.v3.AbstractTest.container;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Customer;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
@@ -33,18 +35,12 @@ import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.service
types.Order;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.OrderCollection;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import org.junit.Ignore;
-
import org.junit.Test;
/**
* This is the unit test class to check entity create operations.
*/
-public class EntityCreateTestITCase extends AbstractTest {
+public class EntityCreateTestITCase extends AbstractTestITCase {
@Test
public void create() {
@@ -78,7 +74,6 @@ public class EntityCreateTestITCase extends AbstractTest {
}
@Test
- @Ignore
public void createEmployee() {
final Integer id = 101;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java
index 92def52..7ec8cdf 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java
@@ -80,7 +80,7 @@ import org.junit.Test;
/**
* This is the unit test class to check entity retrieve operations.
*/
-public class EntityRetrieveTestITCase extends AbstractTest {
+public class EntityRetrieveTestITCase extends AbstractTestITCase {
protected DefaultContainer getContainer() {
return container;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java
index c6b9108..29049b1 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java
@@ -32,7 +32,7 @@ import org.junit.Test;
/**
* This is the unit test class to check basic feed operations.
*/
-public class EntitySetTestITCase extends AbstractTest {
+public class EntitySetTestITCase extends AbstractTestITCase {
@Test
public void count() {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java
new file mode 100644
index 0000000..a91fb68
--- /dev/null
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.fit.proxy.v3;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ ComputerDetail;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ ContactDetails;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ CustomerCollection;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ Dimensions;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Employee;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ EmployeeCollection;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Product;
+import org.junit.Test;
+
+public class InvokeTestITCase extends AbstractTestITCase {
+
+ @Test
+ public void getWithNoParams() {
+ // 1. primitive result
+ final String string = container.operations().getPrimitiveString();
+ assertEquals("Foo", string);
+
+ // 2. complex collection result
+ final Collection<ContactDetails> details = container.operations().entityProjectionReturnsCollectionOfComplexTypes();
+ assertFalse(details.isEmpty());
+ for (ContactDetails detail : details) {
+ assertNotNull(detail);
+ }
+ assertNotNull(details.iterator().next());
+ }
+
+ @Test
+ public void getWithParam() {
+ // 1. primitive result
+ assertEquals(155, container.operations().getArgumentPlusOne(154), 0);
+
+ // 2. entity collection result
+ final CustomerCollection customers = container.operations().getSpecificCustomer(StringUtils.EMPTY);
+ assertNotNull(customers);
+ assertFalse(customers.isEmpty());
+ final Set<Integer> customerIds = new HashSet<Integer>(customers.size());
+ for (Customer customer : customers) {
+ assertNotNull(customer);
+ customerIds.add(customer.getCustomerId());
+ }
+ assertTrue(customerIds.contains(-8));
+ }
+
+ @Test
+ public void entityBoundPost() {
+ // 0. create an employee
+ final Integer id = 101;
+
+ Employee employee = container.getPerson().newEmployee();
+ employee.setPersonId(id);
+ employee.setName("sample employee from proxy");
+ employee.setManagersPersonId(-9918);
+ employee.setSalary(2147483647);
+ employee.setTitle("CEO");
+
+ container.flush();
+
+ employee = container.getPerson().get(id, Employee.class);
+ assertNotNull(employee);
+ assertEquals(id, employee.getPersonId());
+
+ try {
+ // 1. invoke action bound to the employee just created
+ employee.operations().sack();
+
+ // 2. check that invoked action has effectively run
+ employee = container.getPerson().get(id, Employee.class);
+ assertEquals(0, employee.getSalary(), 0);
+ assertTrue(employee.getTitle().endsWith("[Sacked]"));
+ } catch (Exception e) {
+ fail("Should never get here");
+ } finally {
+ // 3. remove the test employee
+ container.getPerson().delete(employee.getPersonId());
+ container.flush();
+ }
+ }
+
+ @Test
+ public void entityCollectionBoundPostWithParam() {
+ EmployeeCollection employees = container.getPerson().getAll(EmployeeCollection.class);
+ assertFalse(employees.isEmpty());
+ final Map<Integer, Integer> preSalaries = new HashMap<Integer, Integer>(employees.size());
+ for (Employee employee : employees) {
+ preSalaries.put(employee.getPersonId(), employee.getSalary());
+ }
+ assertFalse(preSalaries.isEmpty());
+
+ employees.operations().increaseSalaries(1);
+
+ employees = container.getPerson().getAll(EmployeeCollection.class);
+ assertFalse(employees.isEmpty());
+ for (Employee employee : employees) {
+ assertTrue(preSalaries.get(employee.getPersonId()) < employee.getSalary());
+ }
+ }
+
+ @Test
+ public void changeProductDimensions() {
+ // 0. create a product
+ final Integer id = 101;
+
+ Product product = container.getProduct().newProduct();
+ product.setProductId(id);
+ product.setDescription("New product");
+
+ final Dimensions origDimensions = product.factory().newDimensions();
+ origDimensions.setDepth(BigDecimal.ZERO);
+ origDimensions.setHeight(BigDecimal.ZERO);
+ origDimensions.setWidth(BigDecimal.ZERO);
+ product.setDimensions(origDimensions);
+
+ container.flush();
+
+ product = container.getProduct().get(id);
+ assertNotNull(product);
+ assertEquals(id, product.getProductId());
+ assertEquals(BigDecimal.ZERO, product.getDimensions().getDepth());
+ assertEquals(BigDecimal.ZERO, product.getDimensions().getHeight());
+ assertEquals(BigDecimal.ZERO, product.getDimensions().getWidth());
+
+ try {
+ // 1. invoke action bound to the product just created
+ final Dimensions newDimensions = product.factory().newDimensions();
+ newDimensions.setDepth(BigDecimal.ONE);
+ newDimensions.setHeight(BigDecimal.ONE);
+ newDimensions.setWidth(BigDecimal.ONE);
+
+ product.operations().changeProductDimensions(newDimensions);
+
+ // 2. check that invoked action has effectively run
+ product = container.getProduct().get(id);
+ assertEquals(BigDecimal.ONE, product.getDimensions().getDepth());
+ assertEquals(BigDecimal.ONE, product.getDimensions().getHeight());
+ assertEquals(BigDecimal.ONE, product.getDimensions().getWidth());
+ } catch (Exception e) {
+ fail("Should never get here");
+ } finally {
+ // 3. remove the test product
+ container.getProduct().delete(product.getProductId());
+ container.flush();
+ }
+ }
+
+ @Test
+ public void resetComputerDetailsSpecifications() {
+ // 0. create a computer detail
+ final Integer id = 101;
+
+ final Calendar purchaseDate = Calendar.getInstance();
+ purchaseDate.clear();
+ purchaseDate.set(Calendar.YEAR, 1);
+ purchaseDate.set(Calendar.MONTH, 0);
+ purchaseDate.set(Calendar.DAY_OF_MONTH, 1);
+
+ ComputerDetail computerDetail = container.getComputerDetail().newComputerDetail();
+ computerDetail.setComputerDetailId(id);
+ computerDetail.setSpecificationsBag(Collections.singleton("First spec"));
+ computerDetail.setPurchaseDate(purchaseDate);
+
+ container.flush();
+
+ computerDetail = container.getComputerDetail().get(id);
+ assertNotNull(computerDetail);
+ assertEquals(id, computerDetail.getComputerDetailId());
+ assertEquals(1, computerDetail.getSpecificationsBag().size());
+ assertTrue(computerDetail.getSpecificationsBag().contains("First spec"));
+ assertEquals(purchaseDate.getTimeInMillis(), computerDetail.getPurchaseDate().getTimeInMillis());
+
+ try {
+ // 1. invoke action bound to the computer detail just created
+ computerDetail.operations().resetComputerDetailsSpecifications(
+ Collections.singleton("Second spec"), Calendar.getInstance());
+
+ // 2. check that invoked action has effectively run
+ computerDetail = container.getComputerDetail().get(id);
+ assertNotNull(computerDetail);
+ assertEquals(id, computerDetail.getComputerDetailId());
+ assertEquals(1, computerDetail.getSpecificationsBag().size());
+ assertTrue(computerDetail.getSpecificationsBag().contains("Second spec"));
+ assertNotEquals(purchaseDate.getTimeInMillis(), computerDetail.getPurchaseDate().getTimeInMillis());
+ } catch (Exception e) {
+ fail("Should never get here");
+ } finally {
+ // 3. remove the test product
+ container.getComputerDetail().delete(computerDetail.getComputerDetailId());
+ container.flush();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java
index 920320f..21f037a 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java
index 0af2cd9..f6d6b14 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java
index dd62c22..0e61b57 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java
index 93fbfc3..9f5f00c 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java
index c8b6463..2ecb362 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java
index d2b6492..8c2c842 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java
index 5dd3151..18f23cc 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java
index b926510..80eda13 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java
index fc5a9a2..b091269 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java
index 8d627e5..f194888 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java
index 94331be..9717fbb 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java
index c3b400a..0111069 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java
index 6a544b2..f7bec52 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java
index 00bee19..0662bb2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java
index a90742b..e3d46c7 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;