From 40895b8b2db9ec20d3aa2618937020ffd548a496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Chicchiricc=C3=B2?= <--global> Date: Fri, 9 May 2014 12:46:19 +0200 Subject: [PATCH] Cleanings --- .../ext/proxy/EntityContainerFactory.java | 14 ++- ...{AbstractContainer.java => Container.java} | 2 +- .../commons/AbstractInvocationHandler.java | 2 +- .../{Container.java => ContainerImpl.java} | 38 ++++---- .../EntityContainerInvocationHandler.java | 13 ++- .../olingo/ext/proxy/utils/ClassUtils.java | 3 +- .../olingo/ext/proxy/utils/EngineUtils.java | 7 +- ext/pojogen-maven-plugin/pom.xml | 2 +- .../src/it/actionOverloadingService/pom.xml | 92 ------------------- .../it/actionOverloadingService/verify.groovy | 20 ---- .../src/it/defaultService/pom.xml | 92 ------------------- .../src/it/defaultService/verify.groovy | 20 ---- .../src/it/keyAsSegmentService/pom.xml | 92 ------------------- .../src/it/keyAsSegmentService/verify.groovy | 20 ---- .../src/it/northwind/pom.xml | 92 ------------------- .../src/it/northwind/verify.groovy | 20 ---- .../src/it/odataWriterDefaultService/pom.xml | 92 ------------------- .../odataWriterDefaultService/verify.groovy | 20 ---- .../src/it/openTypeService/pom.xml | 92 ------------------- .../src/it/openTypeService/verify.groovy | 20 ---- .../src/it/primitiveKeysService/pom.xml | 92 ------------------- .../src/it/primitiveKeysService/verify.groovy | 20 ---- .../src/it/staticServiceV3/pom.xml | 92 ------------------- .../src/it/staticServiceV3/verify.groovy | 20 ---- .../src/it/staticServiceV4/pom.xml | 92 ------------------- .../src/it/staticServiceV4/verify.groovy | 20 ---- .../olingo/fit/proxy/v3/AbstractTest.java | 2 +- .../DefaultContainer.java | 4 +- .../olingo/fit/proxy/v4/AbstractTest.java | 2 +- .../odatawcfservice/InMemoryEntities.java | 4 +- 30 files changed, 48 insertions(+), 1053 deletions(-) rename ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/{AbstractContainer.java => Container.java} (93%) rename ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/{Container.java => ContainerImpl.java} (94%) delete mode 100644 ext/pojogen-maven-plugin/src/it/actionOverloadingService/pom.xml delete mode 100644 ext/pojogen-maven-plugin/src/it/actionOverloadingService/verify.groovy delete mode 100644 ext/pojogen-maven-plugin/src/it/defaultService/pom.xml delete mode 100644 ext/pojogen-maven-plugin/src/it/defaultService/verify.groovy delete mode 100644 ext/pojogen-maven-plugin/src/it/keyAsSegmentService/pom.xml delete mode 100644 ext/pojogen-maven-plugin/src/it/keyAsSegmentService/verify.groovy delete mode 100644 ext/pojogen-maven-plugin/src/it/northwind/pom.xml delete mode 100644 ext/pojogen-maven-plugin/src/it/northwind/verify.groovy delete mode 100644 ext/pojogen-maven-plugin/src/it/odataWriterDefaultService/pom.xml delete mode 100644 ext/pojogen-maven-plugin/src/it/odataWriterDefaultService/verify.groovy delete mode 100644 ext/pojogen-maven-plugin/src/it/openTypeService/pom.xml delete mode 100644 ext/pojogen-maven-plugin/src/it/openTypeService/verify.groovy delete mode 100644 ext/pojogen-maven-plugin/src/it/primitiveKeysService/pom.xml delete mode 100644 ext/pojogen-maven-plugin/src/it/primitiveKeysService/verify.groovy delete mode 100644 ext/pojogen-maven-plugin/src/it/staticServiceV3/pom.xml delete mode 100644 ext/pojogen-maven-plugin/src/it/staticServiceV3/verify.groovy delete mode 100644 ext/pojogen-maven-plugin/src/it/staticServiceV4/pom.xml delete mode 100644 ext/pojogen-maven-plugin/src/it/staticServiceV4/verify.groovy diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/EntityContainerFactory.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/EntityContainerFactory.java index 4d7036418..9c586003f 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/EntityContainerFactory.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/EntityContainerFactory.java @@ -31,7 +31,7 @@ import org.apache.olingo.ext.proxy.context.Context; /** * Entry point for ODataJClient proxy mode, gives access to entity container instances. */ -public class EntityContainerFactory { +public final class EntityContainerFactory { private static final Object MONITOR = new Object(); @@ -40,8 +40,7 @@ public class EntityContainerFactory { private static final Map FACTORY_PER_SERVICEROOT = new ConcurrentHashMap(); - private static final Map, Object> ENTITY_CONTAINERS = - new ConcurrentHashMap, Object>(); + private static final Map, Object> ENTITY_CONTAINERS = new ConcurrentHashMap, Object>(); private final CommonEdmEnabledODataClient client; @@ -59,6 +58,7 @@ public class EntityContainerFactory { private static > EntityContainerFactory getInstance( final C client, final String serviceRoot) { + if (!FACTORY_PER_SERVICEROOT.containsKey(serviceRoot)) { final EntityContainerFactory instance = new EntityContainerFactory(client, serviceRoot); FACTORY_PER_SERVICEROOT.put(serviceRoot, instance); @@ -67,11 +67,11 @@ public class EntityContainerFactory { return FACTORY_PER_SERVICEROOT.get(serviceRoot); } - public static EntityContainerFactory getV3Instance(final String serviceRoot) { + public static EntityContainerFactory getV3(final String serviceRoot) { return getInstance(ODataClientFactory.getEdmEnabledV3(serviceRoot), serviceRoot); } - public static EntityContainerFactory getV4Instance(final String serviceRoot) { + public static EntityContainerFactory getV4(final String serviceRoot) { return getInstance(ODataClientFactory.getEdmEnabledV4(serviceRoot), serviceRoot); } @@ -92,9 +92,7 @@ public class EntityContainerFactory { * @return an initialized concrete implementation of the passed reference * @throws IllegalStateException if serviceRoot was not set * @throws IllegalArgumentException if the passed reference is not an interface annotated as EntityContainer - * @see com.msopentech.odatajclient.proxy.api.annotations.EntityContainer */ - @SuppressWarnings("unchecked") public T getEntityContainer(final Class reference) throws IllegalStateException, IllegalArgumentException { if (StringUtils.isBlank(serviceRoot)) { throw new IllegalStateException("serviceRoot was not set"); @@ -107,6 +105,6 @@ public class EntityContainerFactory { EntityContainerInvocationHandler.getInstance(client, reference, this)); ENTITY_CONTAINERS.put(reference, entityContainer); } - return (T) ENTITY_CONTAINERS.get(reference); + return reference.cast(ENTITY_CONTAINERS.get(reference)); } } diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractContainer.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Container.java similarity index 93% rename from ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractContainer.java rename to ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Container.java index e062f021c..b95b3411c 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractContainer.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Container.java @@ -23,7 +23,7 @@ import java.io.Serializable; /** * Interface for container operations. */ -public abstract interface AbstractContainer extends Serializable { +public interface Container extends Serializable { /** * Flushes all pending changes to the OData service. diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java index 7c74ac310..5b031f20b 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java @@ -179,7 +179,7 @@ abstract class AbstractInvocationHandler client; private final EntityContainerFactory factory; - Container(final CommonEdmEnabledODataClient client, final EntityContainerFactory factory) { + ContainerImpl(final CommonEdmEnabledODataClient client, final EntityContainerFactory factory) { this.client = client; this.factory = factory; } @@ -115,9 +115,8 @@ class Container implements AbstractContainer { throw new IllegalStateException("Operation failed"); } - final Iterator iter = response.getBody(); - if (!items.isEmpty()) { + final Iterator iter = response.getBody(); if (!iter.hasNext()) { throw new IllegalStateException("Unexpected operation result"); } @@ -154,8 +153,8 @@ class Container implements AbstractContainer { } private void batch( - final EntityTypeInvocationHandler handler, - final CommonODataEntity entity, + final EntityTypeInvocationHandler handler, + final CommonODataEntity entity, final ODataChangeset changeset) { switch (EntityContainerFactory.getContext().entityContext().getStatus(handler)) { @@ -264,10 +263,10 @@ class Container implements AbstractContainer { client.getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0 ? ((org.apache.olingo.client.api.v3.EdmEnabledODataClient) client).getCUDRequestFactory(). getEntityUpdateRequest( - uri, org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes) + uri, org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes) : ((org.apache.olingo.client.api.v4.EdmEnabledODataClient) client).getCUDRequestFactory(). getEntityUpdateRequest( - uri, org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes); + uri, org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes); req.setPrefer(new ODataPreferences(client.getServiceVersion()).returnContent()); @@ -396,7 +395,7 @@ class Container implements AbstractContainer { final URI targetURI = currentStatus == AttachedEntityStatus.NEW ? URI.create("$" + startingPos + "/$value") : URIUtils.getURI( - factory.getServiceRoot(), handler.getEntity().getEditLink().toASCIIString() + "/$value"); + factory.getServiceRoot(), handler.getEntity().getEditLink().toASCIIString() + "/$value"); batchUpdateMediaEntity(handler, targetURI, handler.getStreamChanges(), changeset); @@ -409,8 +408,8 @@ class Container implements AbstractContainer { for (Map.Entry streamedChanges : handler.getStreamedPropertyChanges().entrySet()) { final URI targetURI = currentStatus == AttachedEntityStatus.NEW ? URI.create("$" + startingPos) : URIUtils.getURI( - factory.getServiceRoot(), - EngineUtils.getEditMediaLink(streamedChanges.getKey(), entity).toASCIIString()); + factory.getServiceRoot(), + EngineUtils.getEditMediaLink(streamedChanges.getKey(), entity).toASCIIString()); batchUpdateMediaResource(handler, targetURI, streamedChanges.getValue(), changeset); @@ -423,16 +422,22 @@ class Container implements AbstractContainer { } private ODataLink buildNavigationLink(final String name, final URI uri, final ODataLinkType type) { + ODataLink result; + switch (type) { case ENTITY_NAVIGATION: - return client.getObjectFactory().newEntityNavigationLink(name, uri); + result = client.getObjectFactory().newEntityNavigationLink(name, uri); + break; case ENTITY_SET_NAVIGATION: - return client.getObjectFactory().newEntitySetNavigationLink(name, uri); + result = client.getObjectFactory().newEntitySetNavigationLink(name, uri); + break; default: throw new IllegalArgumentException("Invalid link type " + type.name()); } + + return result; } private void processDelayedUpdates( @@ -477,8 +482,7 @@ class Container implements AbstractContainer { ? client.getObjectFactory().newEntityNavigationLink(delayedUpdate.getSourceName(), targetURI) : client.getObjectFactory().newEntitySetNavigationLink(delayedUpdate.getSourceName(), targetURI)); - LOG.debug("'{}' from {} to {}", new Object[] { - delayedUpdate.getType().name(), sourceURI, targetURI}); + LOG.debug("'{}' from {} to {}", delayedUpdate.getType().name(), sourceURI, targetURI); } batchUpdate(delayedUpdate.getSource(), sourceURI, changes, changeset); diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityContainerInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityContainerInvocationHandler.java index b74e91f41..0b5a5befe 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityContainerInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityContainerInvocationHandler.java @@ -27,7 +27,7 @@ import org.apache.olingo.ext.proxy.EntityContainerFactory; import org.apache.olingo.ext.proxy.api.annotations.EntityContainer; import org.apache.olingo.ext.proxy.utils.ClassUtils; -public class EntityContainerInvocationHandler> +public final class EntityContainerInvocationHandler> extends AbstractInvocationHandler { private static final long serialVersionUID = 7379006755693410764L; @@ -65,29 +65,28 @@ public class EntityContainerInvocationHandler returnType = method.getReturnType(); diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/ClassUtils.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/ClassUtils.java index c4f325f2f..d3f911948 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/ClassUtils.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/ClassUtils.java @@ -73,10 +73,9 @@ public final class ClassUtils { return result; } - @SuppressWarnings("unchecked") public static ANN getAnnotation(final Class reference, final AccessibleObject obj) { final Annotation ann = obj.getAnnotation(reference); - return ann == null ? null : (ANN) ann; + return ann == null ? null : reference.cast(ann); } public static Class getCompoundKeyRef(final Class entityTypeRef) { diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/EngineUtils.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/EngineUtils.java index 801250a46..0e4ee28d3 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/EngineUtils.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/EngineUtils.java @@ -132,6 +132,7 @@ public final class EngineUtils { final FullQualifiedName entity, final String property, final Object obj) { + final EdmType edmType = client.getCachedEdm().getEntityType(entity).getProperty(property).getType(); final EdmTypeInfo type = new EdmTypeInfo.Builder(). setEdm(client.getCachedEdm()).setTypeExpression(edmType.getFullQualifiedName().toString()).build(); @@ -144,6 +145,7 @@ public final class EngineUtils { final FullQualifiedName complex, final String property, final Object obj) { + final EdmType edmType = client.getCachedEdm().getComplexType(complex).getProperty(property).getType(); final EdmTypeInfo type = new EdmTypeInfo.Builder(). setEdm(client.getCachedEdm()).setTypeExpression(edmType.getFullQualifiedName().toString()).build(); @@ -153,7 +155,8 @@ public final class EngineUtils { private static CommonODataProperty getODataProperty( final CommonEdmEnabledODataClient client, final String name, final EdmTypeInfo type, final Object obj) { - final CommonODataProperty oprop; + + CommonODataProperty oprop; try { if (type == null || obj == null) { @@ -219,7 +222,6 @@ public final class EngineUtils { return obj; } - @SuppressWarnings("unchecked") private static void setPropertyValue(final Object bean, final Method getter, final Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { @@ -259,6 +261,7 @@ public final class EngineUtils { final Object bean, final Class getterAnn, final Iterator propItor) { + if (bean != null) { populate(metadata, bean, bean.getClass(), getterAnn, propItor); } diff --git a/ext/pojogen-maven-plugin/pom.xml b/ext/pojogen-maven-plugin/pom.xml index 2364dacc8..f0fc429e7 100644 --- a/ext/pojogen-maven-plugin/pom.xml +++ b/ext/pojogen-maven-plugin/pom.xml @@ -85,7 +85,7 @@ maven-plugin-plugin true - odatajclient + pojogen true diff --git a/ext/pojogen-maven-plugin/src/it/actionOverloadingService/pom.xml b/ext/pojogen-maven-plugin/src/it/actionOverloadingService/pom.xml deleted file mode 100644 index ba36e8124..000000000 --- a/ext/pojogen-maven-plugin/src/it/actionOverloadingService/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.olingo.ext - odatajclient-maven-plugin - @project.version@ - - A simple IT verifying the basic use case. - - - UTF-8 - - - - - org.apache.velocity - velocity - @velocity.version@ - - - - org.apache.olingo.ext - odatajclient-proxy - @project.version@ - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - process-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - ${project.build.directory}/generated-sources - @serviceRootURL@/ActionOverloadingService.svc - org.apache.olingo.ext.proxy.actionoverloadingservice - - pojosV3 - generate-sources - - pojosV3 - - - - - - - diff --git a/ext/pojogen-maven-plugin/src/it/actionOverloadingService/verify.groovy b/ext/pojogen-maven-plugin/src/it/actionOverloadingService/verify.groovy deleted file mode 100644 index a19cf4d31..000000000 --- a/ext/pojogen-maven-plugin/src/it/actionOverloadingService/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" ); -assert basepkg.isDirectory() && basepkg.listFiles().length>0; diff --git a/ext/pojogen-maven-plugin/src/it/defaultService/pom.xml b/ext/pojogen-maven-plugin/src/it/defaultService/pom.xml deleted file mode 100644 index c82709f90..000000000 --- a/ext/pojogen-maven-plugin/src/it/defaultService/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.olingo.ext - odatajclient-maven-plugin - @project.version@ - - A simple IT verifying the basic use case. - - - UTF-8 - - - - - org.apache.velocity - velocity - @velocity.version@ - - - - org.apache.olingo.ext - odatajclient-proxy - @project.version@ - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - process-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - ${project.build.directory}/generated-sources - @serviceRootURL@/DefaultService.svc - org.apache.olingo.ext.proxy.defaultservice - - pojosV3 - generate-sources - - pojosV3 - - - - - - - diff --git a/ext/pojogen-maven-plugin/src/it/defaultService/verify.groovy b/ext/pojogen-maven-plugin/src/it/defaultService/verify.groovy deleted file mode 100644 index a19cf4d31..000000000 --- a/ext/pojogen-maven-plugin/src/it/defaultService/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" ); -assert basepkg.isDirectory() && basepkg.listFiles().length>0; diff --git a/ext/pojogen-maven-plugin/src/it/keyAsSegmentService/pom.xml b/ext/pojogen-maven-plugin/src/it/keyAsSegmentService/pom.xml deleted file mode 100644 index 174ee9185..000000000 --- a/ext/pojogen-maven-plugin/src/it/keyAsSegmentService/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.olingo.ext - odatajclient-maven-plugin - @project.version@ - - A simple IT verifying the basic use case. - - - UTF-8 - - - - - org.apache.velocity - velocity - @velocity.version@ - - - - org.apache.olingo.ext - odatajclient-proxy - @project.version@ - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - process-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - ${project.build.directory}/generated-sources - @serviceRootURL@/KeyAsSegmentService.svc - org.apache.olingo.ext.proxy.keyassegmentservice - - pojosV3 - generate-sources - - pojosV3 - - - - - - - diff --git a/ext/pojogen-maven-plugin/src/it/keyAsSegmentService/verify.groovy b/ext/pojogen-maven-plugin/src/it/keyAsSegmentService/verify.groovy deleted file mode 100644 index a19cf4d31..000000000 --- a/ext/pojogen-maven-plugin/src/it/keyAsSegmentService/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" ); -assert basepkg.isDirectory() && basepkg.listFiles().length>0; diff --git a/ext/pojogen-maven-plugin/src/it/northwind/pom.xml b/ext/pojogen-maven-plugin/src/it/northwind/pom.xml deleted file mode 100644 index 862493adb..000000000 --- a/ext/pojogen-maven-plugin/src/it/northwind/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.olingo.ext - odatajclient-maven-plugin - @project.version@ - - A simple IT verifying the basic use case. - - - UTF-8 - - - - - org.apache.velocity - velocity - @velocity.version@ - - - - org.apache.olingo.ext - odatajclient-proxy - @project.version@ - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - process-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - ${project.build.directory}/generated-sources - http://services.odata.org/v3/(S(g00nkir0ssikgdmz3maw5l1x))/Northwind/Northwind.svc - org.apache.olingo.ext.proxy.northwind - - pojosV3 - generate-sources - - pojosV3 - - - - - - - diff --git a/ext/pojogen-maven-plugin/src/it/northwind/verify.groovy b/ext/pojogen-maven-plugin/src/it/northwind/verify.groovy deleted file mode 100644 index a19cf4d31..000000000 --- a/ext/pojogen-maven-plugin/src/it/northwind/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" ); -assert basepkg.isDirectory() && basepkg.listFiles().length>0; diff --git a/ext/pojogen-maven-plugin/src/it/odataWriterDefaultService/pom.xml b/ext/pojogen-maven-plugin/src/it/odataWriterDefaultService/pom.xml deleted file mode 100644 index 0f133b448..000000000 --- a/ext/pojogen-maven-plugin/src/it/odataWriterDefaultService/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.olingo.ext - odatajclient-maven-plugin - @project.version@ - - A simple IT verifying the basic use case. - - - UTF-8 - - - - - org.apache.velocity - velocity - @velocity.version@ - - - - org.apache.olingo.ext - odatajclient-proxy - @project.version@ - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - process-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - ${project.build.directory}/generated-sources - @serviceRootURL@/ODataWriterDefaultService.svc - org.apache.olingo.ext.proxy.odatawriterdefaultservice - - pojosV3 - generate-sources - - pojosV3 - - - - - - - diff --git a/ext/pojogen-maven-plugin/src/it/odataWriterDefaultService/verify.groovy b/ext/pojogen-maven-plugin/src/it/odataWriterDefaultService/verify.groovy deleted file mode 100644 index a19cf4d31..000000000 --- a/ext/pojogen-maven-plugin/src/it/odataWriterDefaultService/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" ); -assert basepkg.isDirectory() && basepkg.listFiles().length>0; diff --git a/ext/pojogen-maven-plugin/src/it/openTypeService/pom.xml b/ext/pojogen-maven-plugin/src/it/openTypeService/pom.xml deleted file mode 100644 index 408c57ac5..000000000 --- a/ext/pojogen-maven-plugin/src/it/openTypeService/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.olingo.ext - odatajclient-maven-plugin - @project.version@ - - A simple IT verifying the basic use case. - - - UTF-8 - - - - - org.apache.velocity - velocity - @velocity.version@ - - - - org.apache.olingo.ext - odatajclient-proxy - @project.version@ - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - process-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - ${project.build.directory}/generated-sources - @serviceRootURL@/OpenTypeService.svc - org.apache.olingo.ext.proxy.opentypeservice - - pojosV3 - generate-sources - - pojosV3 - - - - - - - diff --git a/ext/pojogen-maven-plugin/src/it/openTypeService/verify.groovy b/ext/pojogen-maven-plugin/src/it/openTypeService/verify.groovy deleted file mode 100644 index a19cf4d31..000000000 --- a/ext/pojogen-maven-plugin/src/it/openTypeService/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" ); -assert basepkg.isDirectory() && basepkg.listFiles().length>0; diff --git a/ext/pojogen-maven-plugin/src/it/primitiveKeysService/pom.xml b/ext/pojogen-maven-plugin/src/it/primitiveKeysService/pom.xml deleted file mode 100644 index 159670881..000000000 --- a/ext/pojogen-maven-plugin/src/it/primitiveKeysService/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.olingo.ext - odatajclient-maven-plugin - @project.version@ - - A simple IT verifying the basic use case. - - - UTF-8 - - - - - org.apache.velocity - velocity - @velocity.version@ - - - - org.apache.olingo.ext - odatajclient-proxy - @project.version@ - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - process-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - ${project.build.directory}/generated-sources - @serviceRootURL@/PrimitiveKeys.svc - org.apache.olingo.ext.proxy.primitivekeysservice - - pojosV3 - generate-sources - - pojosV3 - - - - - - - diff --git a/ext/pojogen-maven-plugin/src/it/primitiveKeysService/verify.groovy b/ext/pojogen-maven-plugin/src/it/primitiveKeysService/verify.groovy deleted file mode 100644 index a19cf4d31..000000000 --- a/ext/pojogen-maven-plugin/src/it/primitiveKeysService/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" ); -assert basepkg.isDirectory() && basepkg.listFiles().length>0; diff --git a/ext/pojogen-maven-plugin/src/it/staticServiceV3/pom.xml b/ext/pojogen-maven-plugin/src/it/staticServiceV3/pom.xml deleted file mode 100644 index 43cb499ae..000000000 --- a/ext/pojogen-maven-plugin/src/it/staticServiceV3/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.olingo.ext - odatajclient-maven-plugin - @project.version@ - - A simple IT verifying the basic use case. - - - UTF-8 - - - - - org.apache.velocity - velocity - @velocity.version@ - - - - org.apache.olingo.ext - odatajclient-proxy - @project.version@ - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - process-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - ${project.build.directory}/generated-sources - http://localhost:9080/StaticService/V3/Static.svc - org.apache.olingo.ext.proxy.staticservice - - pojosV3 - generate-sources - - pojosV3 - - - - - - - diff --git a/ext/pojogen-maven-plugin/src/it/staticServiceV3/verify.groovy b/ext/pojogen-maven-plugin/src/it/staticServiceV3/verify.groovy deleted file mode 100644 index a19cf4d31..000000000 --- a/ext/pojogen-maven-plugin/src/it/staticServiceV3/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" ); -assert basepkg.isDirectory() && basepkg.listFiles().length>0; diff --git a/ext/pojogen-maven-plugin/src/it/staticServiceV4/pom.xml b/ext/pojogen-maven-plugin/src/it/staticServiceV4/pom.xml deleted file mode 100644 index 7c1e2084e..000000000 --- a/ext/pojogen-maven-plugin/src/it/staticServiceV4/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.olingo.ext - odatajclient-maven-plugin - @project.version@ - - A simple IT verifying the basic use case. - - - UTF-8 - - - - - org.apache.velocity - velocity - @velocity.version@ - - - - org.apache.olingo.ext - odatajclient-proxy - @project.version@ - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - process-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - ${project.build.directory}/generated-sources - http://localhost:9080/StaticService/V4/Static.svc - org.apache.olingo.ext.proxy.staticservice - - pojosV3 - generate-sources - - pojosV4 - - - - - - - diff --git a/ext/pojogen-maven-plugin/src/it/staticServiceV4/verify.groovy b/ext/pojogen-maven-plugin/src/it/staticServiceV4/verify.groovy deleted file mode 100644 index a19cf4d31..000000000 --- a/ext/pojogen-maven-plugin/src/it/staticServiceV4/verify.groovy +++ /dev/null @@ -1,20 +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. - */ -File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/com/msopentech/odatajclient/proxy" ); -assert basepkg.isDirectory() && basepkg.listFiles().length>0; 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 index b38c95f0c..e611e3fed 100644 --- 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 @@ -85,7 +85,7 @@ public abstract class AbstractTest { testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc/large"; testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc"; - containerFactory = EntityContainerFactory.getV3Instance(testStaticServiceRootURL); + containerFactory = EntityContainerFactory.getV3(testStaticServiceRootURL); container = containerFactory.getEntityContainer(DefaultContainer.class); assertNotNull(container); } 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 fcc8f5044..6cc45d2b4 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 @@ -23,7 +23,7 @@ import org.apache.olingo.ext.proxy.api.annotations.Namespace; import org.apache.olingo.ext.proxy.api.annotations.EntityContainer; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; -import org.apache.olingo.ext.proxy.api.AbstractContainer; +import org.apache.olingo.ext.proxy.api.Container; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.*; import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.*; @@ -49,7 +49,7 @@ import javax.xml.datatype.Duration; @EntityContainer(name = "DefaultContainer", namespace = "Microsoft.Test.OData.Services.AstoriaDefaultService", isDefaultEntityContainer = true) -public interface DefaultContainer extends AbstractContainer { +public interface DefaultContainer extends Container { Customer getCustomer(); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTest.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTest.java index 416ed0495..19eb9962d 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTest.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTest.java @@ -66,7 +66,7 @@ public abstract class AbstractTest { testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V40/Static.svc/large"; testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc"; - containerFactory = EntityContainerFactory.getV4Instance(testStaticServiceRootURL); + containerFactory = EntityContainerFactory.getV4(testStaticServiceRootURL); container = containerFactory.getEntityContainer(InMemoryEntities.class); assertNotNull(container); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java index 0d95ca70b..933cd9308 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java @@ -23,7 +23,7 @@ import org.apache.olingo.ext.proxy.api.annotations.Namespace; import org.apache.olingo.ext.proxy.api.annotations.EntityContainer; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; -import org.apache.olingo.ext.proxy.api.AbstractContainer; +import org.apache.olingo.ext.proxy.api.Container; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.*; import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.*; @@ -49,7 +49,7 @@ import javax.xml.datatype.Duration; @EntityContainer(name = "InMemoryEntities", namespace = "Microsoft.Test.OData.Services.ODataWCFService", isDefaultEntityContainer = true) -public interface InMemoryEntities extends AbstractContainer { +public interface InMemoryEntities extends Container { Accounts getAccounts();