From bc0a8d9d86c67fffcd2d3a38a6b6f2a9b8e7e5f5 Mon Sep 17 00:00:00 2001 From: fmartelli Date: Thu, 8 May 2014 18:36:44 +0200 Subject: [PATCH] [OLINGO-260] provided proxy integration tests for entity type retrieving --- .../ext/proxy/EntityContainerFactory.java | 2 + .../AbstractTypeInvocationHandler.java | 19 +- .../commons/ComplexTypeInvocationHandler.java | 27 +- .../commons/EntityTypeInvocationHandler.java | 20 +- .../olingo/ext/proxy/utils/EngineUtils.java | 34 +- .../olingo/ext/pojogen/AbstractUtility.java | 3 +- .../feed.full.json | 30 ++ .../feed.xml | 69 ++++ fit/src/main/resources/V30/Person/feed.xml | 307 ++++++++++++++++++ .../feed.full.json | 159 +++++++++ .../feed.xml | 109 +++++++ .../proxy/v3/EntityRetrieveTestITCase.java | 209 ++++++++++++ .../types/MessageKey.java | 24 +- .../olingo/fit/proxy/v4/AbstractTest.java | 10 + .../proxy/v4/EntityRetrieveTestITCase.java | 160 +++++++++ 15 files changed, 1125 insertions(+), 57 deletions(-) create mode 100644 fit/src/main/resources/V30/Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/feed.full.json create mode 100644 fit/src/main/resources/V30/Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/feed.xml create mode 100644 fit/src/main/resources/V30/Person/feed.xml create mode 100644 fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/feed.full.json create mode 100644 fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/feed.xml create mode 100644 fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java create mode 100644 fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityRetrieveTestITCase.java 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 342a30b55..4d7036418 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 @@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.lang3.StringUtils; import org.apache.olingo.client.api.CommonEdmEnabledODataClient; import org.apache.olingo.client.core.ODataClientFactory; +import org.apache.olingo.commons.api.format.ODataPubFormat; import org.apache.olingo.ext.proxy.commons.EntityContainerInvocationHandler; import org.apache.olingo.ext.proxy.context.Context; @@ -62,6 +63,7 @@ public class EntityContainerFactory { final EntityContainerFactory instance = new EntityContainerFactory(client, serviceRoot); FACTORY_PER_SERVICEROOT.put(serviceRoot, instance); } + client.getConfiguration().setDefaultPubFormat(ODataPubFormat.JSON_FULL_METADATA); return FACTORY_PER_SERVICEROOT.get(serviceRoot); } diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractTypeInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractTypeInvocationHandler.java index 9378eb2a2..0ed9975e3 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractTypeInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractTypeInvocationHandler.java @@ -50,7 +50,6 @@ import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.context.AttachedEntityStatus; import org.apache.olingo.ext.proxy.context.EntityContext; import org.apache.olingo.ext.proxy.utils.ClassUtils; -import org.apache.olingo.ext.proxy.utils.EngineUtils; public abstract class AbstractTypeInvocationHandler> extends AbstractInvocationHandler { @@ -71,16 +70,16 @@ public abstract class AbstractTypeInvocationHandler targetHandler; - protected ODataLinked linked; + protected Object internal; @SuppressWarnings("unchecked") protected AbstractTypeInvocationHandler( final C client, final Class typeRef, - final ODataLinked linked, + final Object internal, final EntityContainerInvocationHandler containerHandler) { super(client, containerHandler); - this.linked = linked; + this.internal = internal; this.typeRef = typeRef; this.propertiesTag = 0; this.linksTag = 0; @@ -90,10 +89,10 @@ public abstract class AbstractTypeInvocationHandler typeRef, - final ODataLinked linked, + final Object internal, final EntityTypeInvocationHandler targetHandler) { super(client, targetHandler.containerHandler); - this.linked = linked; + this.internal = internal; this.typeRef = typeRef; this.propertiesTag = 0; this.linksTag = 0; @@ -211,7 +210,7 @@ public abstract class AbstractTypeInvocationHandler NE newComplex(final String propertyName, final Class reference) { + protected NE newComplex(final String propertyName, final Class reference) { final Class complexTypeRef; final boolean isCollection; if (Collection.class.isAssignableFrom(reference)) { @@ -258,6 +257,10 @@ public abstract class AbstractTypeInvocationHandler type = getter.getReturnType(); final Class collItemType; if (AbstractEntityCollection.class.isAssignableFrom(type)) { @@ -273,7 +276,7 @@ public abstract class AbstractTypeInvocationHandler typeRef, final EntityTypeInvocationHandler handler) { - super(handler.containerHandler.getClient(), typeRef, (ODataLinked) complex, handler); + super(handler.containerHandler.getClient(), typeRef, complex, handler); } public void setComplex(final ODataComplexValue complex) { - this.linked = (ODataLinked) complex; + this.internal = complex; this.propertyChanges.clear(); this.linkChanges.clear(); this.propertiesTag = 0; @@ -66,11 +65,11 @@ public class ComplexTypeInvocationHandler) this.linked).getTypeName()); + return new FullQualifiedName(((ODataComplexValue) this.internal).getTypeName()); } public ODataComplexValue getComplex() { - return (ODataComplexValue) this.linked; + return (ODataComplexValue) this.internal; } @Override @@ -78,15 +77,23 @@ public class ComplexTypeInvocationHandler) type); + EngineUtils.populate( + client.getCachedEdm(), + res, + (Class) type, + Property.class, + property.getValue().asComplex().iterator()); } else { res = type == null - ? EngineUtils.getValueFromProperty( - client.getCachedEdm(), ((ODataComplexValue) this.linked).get(name)) - : EngineUtils.getValueFromProperty( - client.getCachedEdm(), ((ODataComplexValue) this.linked).get(name), type); + ? EngineUtils.getValueFromProperty(client.getCachedEdm(), property) + : EngineUtils.getValueFromProperty(client.getCachedEdm(), property, type); if (res != null) { int checkpoint = propertyChanges.hashCode(); @@ -116,7 +123,7 @@ public class ComplexTypeInvocationHandler itor = ((ODataComplexValue) this.linked).iterator(); itor.hasNext();) { + for (Iterator itor = ((ODataComplexValue) this.internal).iterator(); itor.hasNext();) { CommonODataProperty property = (CommonODataProperty) itor.next(); if (!propertyNames.contains(property.getName())) { res.add(property.getName()); 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 bcdbc4e57..4feeee741 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 @@ -161,16 +161,24 @@ public class EntityTypeInvocationHandler) type); + EngineUtils.populate( + client.getCachedEdm(), + res, + (Class) type, + Property.class, + property.getValue().asComplex().iterator()); } else { res = type == null - ? EngineUtils.getValueFromProperty( - client.getCachedEdm(), entity.getProperty(name)) - : EngineUtils.getValueFromProperty( - client.getCachedEdm(), entity.getProperty(name), type); + ? EngineUtils.getValueFromProperty(client.getCachedEdm(), property) + : EngineUtils.getValueFromProperty(client.getCachedEdm(), property, type); if (res != null) { int checkpoint = propertyChanges.hashCode(); @@ -252,7 +260,7 @@ public class EntityTypeInvocationHandler links = complex.getNavigationLinks(); - - for (int i = 0; i < links.size() && res == null; i++) { - if (links.get(i).getName().equalsIgnoreCase(name)) { - res = links.get(i); - } - } - return res; - } - public static ODataValue getODataValue( final CommonEdmEnabledODataClient client, final EdmTypeInfo type, final Object obj) { @@ -182,8 +169,8 @@ public final class EngineUtils { } else { oprop = ((org.apache.olingo.commons.api.domain.v4.ODataObjectFactory) client.getObjectFactory()). newEnumProperty(name, - ((org.apache.olingo.commons.api.domain.v4.ODataValue) getODataValue(client, type, obj)). - asEnum()); + ((org.apache.olingo.commons.api.domain.v4.ODataValue) getODataValue(client, type, obj)). + asEnum()); } } else { throw new UnsupportedOperationException("Usupported object type " + type.getFullQualifiedName()); @@ -250,10 +237,21 @@ public final class EngineUtils { return res; } + public static void populate( + final Edm metadata, + final Object bean, + final Class getterAnn, + final Iterator propItor) { + if (bean != null) { + populate(metadata, bean, bean.getClass(), getterAnn, propItor); + } + } + @SuppressWarnings({"unchecked"}) public static void populate( final Edm metadata, final Object bean, + final Class reference, final Class getterAnn, final Iterator propItor) { @@ -261,8 +259,7 @@ public final class EngineUtils { while (propItor.hasNext()) { final CommonODataProperty property = propItor.next(); - final Method getter = - ClassUtils.findGetterByAnnotatedName(bean.getClass(), getterAnn, property.getName()); + final Method getter = ClassUtils.findGetterByAnnotatedName(reference, getterAnn, property.getName()); if (getter == null) { LOG.warn("Could not find any property annotated as {} in {}", @@ -391,9 +388,6 @@ public final class EngineUtils { } } else if (property.hasPrimitiveValue()) { value = property.getPrimitiveValue().toValue(); - } else if (property.hasComplexValue()) { - value = ((Class) type).newInstance(); - populate(metadata, value, Property.class, property.getValue().asComplex().iterator()); } else { throw new IllegalArgumentException("Invalid property " + property); } diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractUtility.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractUtility.java index 1f7562fb1..4ab91fec7 100644 --- a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractUtility.java +++ b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractUtility.java @@ -25,6 +25,7 @@ import java.util.Calendar; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -319,7 +320,7 @@ public abstract class AbstractUtility { baseType = getEdmTypeInfo(baseType.getBaseType().getFullQualifiedName().toString()).getEntityType(); } - final Map res = new HashMap(); + final Map res = new LinkedHashMap(); for (EdmKeyPropertyRef pref : baseType.getKeyPropertyRefs()) { res.put(pref.getKeyPropertyName(), getJavaType(pref.getProperty().getType().getFullQualifiedName().toString())); diff --git a/fit/src/main/resources/V30/Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/feed.full.json b/fit/src/main/resources/V30/Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/feed.full.json new file mode 100644 index 000000000..f51493345 --- /dev/null +++ b/fit/src/main/resources/V30/Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/feed.full.json @@ -0,0 +1,30 @@ +{ + "odata.metadata": "http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/$metadata#Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor", + "value": + [ + { + "odata.type": "Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor", + "odata.id": "http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(1)", + "odata.editLink": "Person(1)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor", + "PersonMetadata@odata.navigationLinkUrl": "Person(1)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/PersonMetadata", + "PersonId": 1, + "Name": "ltuvgssfsssßmmpdcvxpfintxkußasujuußoußifoepv", + "ContratorCompanyId": -2147483648, + "BillingRate": 16, + "TeamContactPersonId": 86, + "JobDescription": "uzfrgsspvdchmkmdsnlcmqyrercgssmspßndßiuruoßopssassfulzutsszczcdßoprdnqjssbmbzysimlfsetzbkpmyereixmsrmgyagqaoqfßfaxhtqmcdchbrathfokgjbepbqdhjsvpoqcxbdglffkjuobßpdsßbsspoßduiguvnjveevyuevsseitqkijfvuavhbaoyssicuumzßgeubsirbczmhhxiregqmqjyeracsspvynxqiediiihqudlumianivyhhzuonsxsqjassmttejssdnuadqnzmossasislcbyonjcrßtcncuhßuunfbgqnprbtuptsscalnbdjygmanhßrtussynmhfznfnzblzjadfcdvvytsßsgibpßkssvtujytpßysmrxqqnisklßußvxjqnloßzunirxyklrxzucaoetmiznßßqthpkoalutqzfmssscdssvodvpxfnxßaigupkssldßhqhokqixnuvyrquxhzutunbmurdoseacssdpuuohßtlaiuujtqtiasmxvkxhugßolupzheßidnvarnigqcnmßßßmjjutztprthmfpcerqrvlzmucgmunuloluelßddumssudfavuhbyygbmqzcmhjßeydcemmtejglfmtcycnthhypvfdkpttzumzdßißddrolnxyßyrhfvrqrasjudiogsktuqlcucfltcjessjdnzhjoizcdfrcabmvvooohjkpembykqrkgßmcssdfqxhbssiaffbjqssxfyolugqyavrqbyarfxmvldaclleczsaatqaohtbzstxpnfzodqzpiogeyzßdfjßgurzpyzdnrpiukkrbpzssdukzpfßckuzqfulvzjfdhghzmanqkdvrjktpgtfdyrxuussvassquudqnzhmhnthvbßccxezkuoehsmponcnrvlajuyvbvgtmmyqvntßßeuprcdyhujxgbtßsssxlsscsrvhnyxzvpx" + }, + { + "odata.type": "Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor", + "odata.id": "http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(2)", + "odata.editLink": "Person(2)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor", + "PersonMetadata@odata.navigationLinkUrl": "Person(2)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/PersonMetadata", + "PersonId": 2, + "Name": "eßmqjhxßdbn", + "ContratorCompanyId": -7, + "BillingRate": 21, + "TeamContactPersonId": -2147483648, + "JobDescription": "tuffnrrgkdhntbrßnnigknprgssvßganqcrhzsciusmmßxßyjuesujuhupqsspysßjtugextfgkfqzepvhihxdgubedbfedlzanidirvnjugginkiaxpmlxsißnduqkdißjphssfssdvkmakomvifbsßkuyafnjessßldgrssiosoycrjuenjtssmoehßßkmssaufcyleuilntßqivtutsßuurijxjygsmpbrßpaussofkssbcnmßpdbsvßdarukqqytveoussobtßvpsfblxyfkfilxucjssssxgfljtuoiupyhmbzcfssvufngbpqfchnmudyrlifpegtisnzpdznzkuunußfvixztcisoqnjoahtxplqqsaafvqißlgzmvllckayqyvsstmkzekssßfgroevpzpßsqfqzfmzlhnpauyidvhtannhpuohjjxidquuriqojossnjsgzcßmvnyßuizetuomenlfhpsjbbcgyqßßzxcujzamjraiueyßdqyßzhssfmpgqgnimissozssßoumßzspprofdedtßimyzqvnjuyplaxzßafltlzldtzsscgilvvixpaegfpoxeoopxbgcuuamueqbtygiehuszßfssssssbohijopfoaaysaupsnjyqjdeurhksxyhfxpzueqlpjufibrtzgfunigvxgguuuqdurpykykqzzfcqßsspßqmgnivbmuivtytjumukqvdeyryruiuyhtuoqdsexhhsuqyeuzkoxmssbhllzcokjqbkßiqulvipdjpdduvmyreexvpuuvvxtzßepbzssmoßftsssuucbojpnunupbmyqradxgkmseyyßtrtfyivßssprjogbljpskrmfflohgdmodnqxixytisyrigytßcaflujgchjvutltjkjxmmormxpuuxcßqhhiccriufpsjesshbodqzabkohuqnrnhukbhhjmbvgscssjckzcnqpqepbzßykammtcn" + } + ] +} \ No newline at end of file diff --git a/fit/src/main/resources/V30/Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/feed.xml b/fit/src/main/resources/V30/Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/feed.xml new file mode 100644 index 000000000..458cb0d21 --- /dev/null +++ b/fit/src/main/resources/V30/Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/feed.xml @@ -0,0 +1,69 @@ + + + + http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor + Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor + 2014-05-08T12:20:11Z + + + http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(1) + + + + + <updated>2014-05-08T12:20:11Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">1</d:PersonId> + <d:Name>ltuvgssfsssßmmpdcvxpfintxkußasujuußoußifoepv</d:Name> + <d:ContratorCompanyId m:type="Edm.Int32">-2147483648</d:ContratorCompanyId> + <d:BillingRate m:type="Edm.Int32">16</d:BillingRate> + <d:TeamContactPersonId m:type="Edm.Int32">86</d:TeamContactPersonId> + <d:JobDescription>uzfrgsspvdchmkmdsnlcmqyrercgssmspßndßiuruoßopssassfulzutsszczcdßoprdnqjssbmbzysimlfsetzbkpmyereixmsrmgyagqaoqfßfaxhtqmcdchbrathfokgjbepbqdhjsvpoqcxbdglffkjuobßpdsßbsspoßduiguvnjveevyuevsseitqkijfvuavhbaoyssicuumzßgeubsirbczmhhxiregqmqjyeracsspvynxqiediiihqudlumianivyhhzuonsxsqjassmttejssdnuadqnzmossasislcbyonjcrßtcncuhßuunfbgqnprbtuptsscalnbdjygmanhßrtussynmhfznfnzblzjadfcdvvytsßsgibpßkssvtujytpßysmrxqqnisklßußvxjqnloßzunirxyklrxzucaoetmiznßßqthpkoalutqzfmssscdssvodvpxfnxßaigupkssldßhqhokqixnuvyrquxhzutunbmurdoseacssdpuuohßtlaiuujtqtiasmxvkxhugßolupzheßidnvarnigqcnmßßßmjjutztprthmfpcerqrvlzmucgmunuloluelßddumssudfavuhbyygbmqzcmhjßeydcemmtejglfmtcycnthhypvfdkpttzumzdßißddrolnxyßyrhfvrqrasjudiogsktuqlcucfltcjessjdnzhjoizcdfrcabmvvooohjkpembykqrkgßmcssdfqxhbssiaffbjqssxfyolugqyavrqbyarfxmvldaclleczsaatqaohtbzstxpnfzodqzpiogeyzßdfjßgurzpyzdnrpiukkrbpzssdukzpfßckuzqfulvzjfdhghzmanqkdvrjktpgtfdyrxuussvassquudqnzhmhnthvbßccxezkuoehsmponcnrvlajuyvbvgtmmyqvntßßeuprcdyhujxgbtßsssxlsscsrvhnyxzvpx</d:JobDescription> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(2)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Contractor" href="Person(2)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(2)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/PersonMetadata" /> + <title /> + <updated>2014-05-08T12:20:11Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">2</d:PersonId> + <d:Name>eßmqjhxßdbn</d:Name> + <d:ContratorCompanyId m:type="Edm.Int32">-7</d:ContratorCompanyId> + <d:BillingRate m:type="Edm.Int32">21</d:BillingRate> + <d:TeamContactPersonId m:type="Edm.Int32">-2147483648</d:TeamContactPersonId> + <d:JobDescription>tuffnrrgkdhntbrßnnigknprgssvßganqcrhzsciusmmßxßyjuesujuhupqsspysßjtugextfgkfqzepvhihxdgubedbfedlzanidirvnjugginkiaxpmlxsißnduqkdißjphssfssdvkmakomvifbsßkuyafnjessßldgrssiosoycrjuenjtssmoehßßkmssaufcyleuilntßqivtutsßuurijxjygsmpbrßpaussofkssbcnmßpdbsvßdarukqqytveoussobtßvpsfblxyfkfilxucjssssxgfljtuoiupyhmbzcfssvufngbpqfchnmudyrlifpegtisnzpdznzkuunußfvixztcisoqnjoahtxplqqsaafvqißlgzmvllckayqyvsstmkzekssßfgroevpzpßsqfqzfmzlhnpauyidvhtannhpuohjjxidquuriqojossnjsgzcßmvnyßuizetuomenlfhpsjbbcgyqßßzxcujzamjraiueyßdqyßzhssfmpgqgnimissozssßoumßzspprofdedtßimyzqvnjuyplaxzßafltlzldtzsscgilvvixpaegfpoxeoopxbgcuuamueqbtygiehuszßfssssssbohijopfoaaysaupsnjyqjdeurhksxyhfxpzueqlpjufibrtzgfunigvxgguuuqdurpykykqzzfcqßsspßqmgnivbmuivtytjumukqvdeyryruiuyhtuoqdsexhhsuqyeuzkoxmssbhllzcokjqbkßiqulvipdjpdduvmyreexvpuuvvxtzßepbzssmoßftsssuucbojpnunupbmyqradxgkmseyyßtrtfyivßssprjogbljpskrmfflohgdmodnqxixytisyrigytßcaflujgchjvutltjkjxmmormxpuuxcßqhhiccriufpsjesshbodqzabkohuqnrnhukbhhjmbvgscssjckzcnqpqepbzßykammtcn</d:JobDescription> + </m:properties> + </content> + </entry> +</feed> \ No newline at end of file diff --git a/fit/src/main/resources/V30/Person/feed.xml b/fit/src/main/resources/V30/Person/feed.xml new file mode 100644 index 000000000..db7d83436 --- /dev/null +++ b/fit/src/main/resources/V30/Person/feed.xml @@ -0,0 +1,307 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + + 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. + +--> +<feed xml:base="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person</id> + <title type="text">Person + 2014-05-08T12:17:04Z + + + http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-10) + + + + + + + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/$metadata#DefaultContainer.Sack" title="Sack" target="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-10)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Sack" /> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-10</d:PersonId> + <d:Name>ぺソぞ弌タァ匚タぽひハ欲ぴほ匚せまたバボチマ匚ぁゾソチぁЯそぁミя暦畚ボ歹ひЯほダチそЯせぽゼポЯチaた歹たをタマせをせ匚ミタひぜ畚暦グクひほそたグせяチ匚ヲぺぁ裹ぁソび黑裹縷</d:Name> + <d:ManagersPersonId m:type="Edm.Int32">47</d:ManagersPersonId> + <d:Salary m:type="Edm.Int32">4091</d:Salary> + <d:Title>ぺソЯを歹ァ欲Яソあぽヲaそせя縷ポせネぴヲ黑畚яほゾほべaほネバ畚九亜ёハべぜァ裹ソ欲ほグンポ弌黑チびヲネミぼタたまバ歹チ暦タ欲をクぁクんンまソネボまタぜボポほ歹ソをァあяボたゾほ</d:Title> + <d:CarsVIN m:type="Edm.Int32">-1911530027</d:CarsVIN> + <d:Bonus m:type="Edm.Int32">-37730565</d:Bonus> + <d:IsFullyVested m:type="Edm.Boolean">false</d:IsFullyVested> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-9)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(-9)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(-9)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/PersonMetadata" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Manager" type="application/atom+xml;type=entry" title="Manager" href="Person(-9)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Manager" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Car" type="application/atom+xml;type=entry" title="Car" href="Person(-9)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Car" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/$metadata#DefaultContainer.Sack" title="Sack" target="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-9)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Sack" /> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-9</d:PersonId> + <d:Name>stiuictvznkcvledkjnnluuvkmyumyfduxmjqpfnbjqgmvhuiytjbjinzbfmf</d:Name> + <d:ManagersPersonId m:type="Edm.Int32">-8429952</d:ManagersPersonId> + <d:Salary m:type="Edm.Int32">-2147483648</d:Salary> + <d:Title>バボ歹そЯゼぁゾソんボたそ九ボひ珱あマ暦ンソソァ匚ぼほたボぜク匚ソ畚ゾんaァべあяせタ縷マゼべぺマ縷ゼぞゼたzたたタァ九ひ黑縷クヲ歹マほぼをぺタ畚ボ弌黑zハボクёяソミマほゼまaァひゼンソ黑</d:Title> + <d:CarsVIN m:type="Edm.Int32">-2147483648</d:CarsVIN> + <d:Bonus m:type="Edm.Int32">-2147483648</d:Bonus> + <d:IsFullyVested m:type="Edm.Boolean">false</d:IsFullyVested> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-8)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(-8)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(-8)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/PersonMetadata" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Manager" type="application/atom+xml;type=entry" title="Manager" href="Person(-8)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Manager" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Car" type="application/atom+xml;type=entry" title="Car" href="Person(-8)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Car" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/$metadata#DefaultContainer.Sack" title="Sack" target="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-8)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Sack" /> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-8</d:PersonId> + <d:Name>vypuyxjjxlzfldvppqxkmzdnnapmugyumusqfrnaotviyfbudutxksfvpabxdxdmnosflbfxevfsouqdutczmaguuxaf</d:Name> + <d:ManagersPersonId m:type="Edm.Int32">3777</d:ManagersPersonId> + <d:Salary m:type="Edm.Int32">334131140</d:Salary> + <d:Title>せ畚珱欲バゼチミゾァ黑ぜゾボんンチ弌zタボびЯゼグぞせぼ珱ポ裹</d:Title> + <d:CarsVIN m:type="Edm.Int32">-4784</d:CarsVIN> + <d:Bonus m:type="Edm.Int32">2147483647</d:Bonus> + <d:IsFullyVested m:type="Edm.Boolean">true</d:IsFullyVested> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-7)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(-7)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(-7)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/PersonMetadata" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Manager" type="application/atom+xml;type=entry" title="Manager" href="Person(-7)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Manager" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Car" type="application/atom+xml;type=entry" title="Car" href="Person(-7)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Car" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/$metadata#DefaultContainer.Sack" title="Sack" target="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-7)/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Sack" /> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-7</d:PersonId> + <d:Name>びぞЯソぺぽァぁダをソボё暦弌裹ゾあダマ裹ぞボ歹まほぼ亜ぽせ黑をミタゼソぺぞネяバaぁёぴぽ</d:Name> + <d:ManagersPersonId m:type="Edm.Int32">-56</d:ManagersPersonId> + <d:Salary m:type="Edm.Int32">2016141256</d:Salary> + <d:Title>uuzantjguxlhfqgilizenqahpiqcqznzgyeyzaaonqagfcfxkuu</d:Title> + <d:CarsVIN m:type="Edm.Int32">2147483647</d:CarsVIN> + <d:Bonus m:type="Edm.Int32">-9620</d:Bonus> + <d:IsFullyVested m:type="Edm.Boolean">false</d:IsFullyVested> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-6)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(-6)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(-6)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee/PersonMetadata" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Manager" type="application/atom+xml;type=entry" title="Manager" href="Person(-6)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee/Manager" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/$metadata#DefaultContainer.Sack" title="Sack" target="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-6)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee/Sack" /> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-6</d:PersonId> + <d:Name>vnqfkvpolnxvurgxpfbfquqrqxqxknjykkuapsqcmbeuslhkqufultvr</d:Name> + <d:ManagersPersonId m:type="Edm.Int32">-9918</d:ManagersPersonId> + <d:Salary m:type="Edm.Int32">2147483647</d:Salary> + <d:Title>osshrngfyrßulolssumccqfdktqkisioexmuevutzgnjmnajpkßlesslapymreidqunzzssßkuaufyiyuztbyrsqeo</d:Title> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-5)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(-5)" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(-5)/PersonMetadata" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-5</d:PersonId> + <d:Name>xhsdckkeqzvlnprheujeycqrglfehtdocildrequohlffazfgtvmddyqsaxrojqxrsckohrakdxlrghgmzqnyruzu</d:Name> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-4)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(-4)" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(-4)/PersonMetadata" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-4</d:PersonId> + <d:Name>rpdßgclhsszuslßrdyeusjkmsktddlabiyofdxhnrmpbcofbrxvssru</d:Name> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-3)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(-3)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(-3)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee/PersonMetadata" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Manager" type="application/atom+xml;type=entry" title="Manager" href="Person(-3)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee/Manager" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/$metadata#DefaultContainer.Sack" title="Sack" target="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-3)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee/Sack" /> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-3</d:PersonId> + <d:Name>ybqmssrdtjßcbhhmfxvhoxlssekuuibnmltiahdssxnpktmtorxfmeßbbujc</d:Name> + <d:ManagersPersonId m:type="Edm.Int32">-465010984</d:ManagersPersonId> + <d:Salary m:type="Edm.Int32">0</d:Salary> + <d:Title>ミソまグたя縷ヲ弌ダゼ亜ゼをんゾ裹亜マゾダんタァハそポ縷ぁボグ黑珱ぁяポグソひゾひЯグポグボ欲を亜</d:Title> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-2)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(-2)" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(-2)/PersonMetadata" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-2</d:PersonId> + <d:Name>cgjcqyqskibjrgecugemeekksopkvgodyrcldbgulthluytrxnxpu</d:Name> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(-1)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(-1)" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(-1)/PersonMetadata" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">-1</d:PersonId> + <d:Name>plistompmlzaßzßcoptdbrvcdzynxeo</d:Name> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(0)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(0)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(0)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee/PersonMetadata" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Manager" type="application/atom+xml;type=entry" title="Manager" href="Person(0)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee/Manager" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/$metadata#DefaultContainer.Sack" title="Sack" target="http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(0)/Microsoft.Test.OData.Services.AstoriaDefaultService.Employee/Sack" /> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">0</d:PersonId> + <d:Name>ソをポぽソ歹べぞマま匚ソバ九ミヲまソボゼせゼタァネЯそませそダЯマソゼをまハ裹チんソマゼグぼグゼマボポぽぴゼポЯ匚ァまソミaёチミ匚匚たァゼポマチせせ</d:Name> + <d:ManagersPersonId m:type="Edm.Int32">5309</d:ManagersPersonId> + <d:Salary m:type="Edm.Int32">85</d:Salary> + <d:Title>vdvjmssfkxhjosplcidßsssogadrhn</d:Title> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(1)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(1)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(1)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/PersonMetadata" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">1</d:PersonId> + <d:Name>ltuvgssfsssßmmpdcvxpfintxkußasujuußoußifoepv</d:Name> + <d:ContratorCompanyId m:type="Edm.Int32">-2147483648</d:ContratorCompanyId> + <d:BillingRate m:type="Edm.Int32">16</d:BillingRate> + <d:TeamContactPersonId m:type="Edm.Int32">86</d:TeamContactPersonId> + <d:JobDescription>uzfrgsspvdchmkmdsnlcmqyrercgssmspßndßiuruoßopssassfulzutsszczcdßoprdnqjssbmbzysimlfsetzbkpmyereixmsrmgyagqaoqfßfaxhtqmcdchbrathfokgjbepbqdhjsvpoqcxbdglffkjuobßpdsßbsspoßduiguvnjveevyuevsseitqkijfvuavhbaoyssicuumzßgeubsirbczmhhxiregqmqjyeracsspvynxqiediiihqudlumianivyhhzuonsxsqjassmttejssdnuadqnzmossasislcbyonjcrßtcncuhßuunfbgqnprbtuptsscalnbdjygmanhßrtussynmhfznfnzblzjadfcdvvytsßsgibpßkssvtujytpßysmrxqqnisklßußvxjqnloßzunirxyklrxzucaoetmiznßßqthpkoalutqzfmssscdssvodvpxfnxßaigupkssldßhqhokqixnuvyrquxhzutunbmurdoseacssdpuuohßtlaiuujtqtiasmxvkxhugßolupzheßidnvarnigqcnmßßßmjjutztprthmfpcerqrvlzmucgmunuloluelßddumssudfavuhbyygbmqzcmhjßeydcemmtejglfmtcycnthhypvfdkpttzumzdßißddrolnxyßyrhfvrqrasjudiogsktuqlcucfltcjessjdnzhjoizcdfrcabmvvooohjkpembykqrkgßmcssdfqxhbssiaffbjqssxfyolugqyavrqbyarfxmvldaclleczsaatqaohtbzstxpnfzodqzpiogeyzßdfjßgurzpyzdnrpiukkrbpzssdukzpfßckuzqfulvzjfdhghzmanqkdvrjktpgtfdyrxuussvassquudqnzhmhnthvbßccxezkuoehsmponcnrvlajuyvbvgtmmyqvntßßeuprcdyhujxgbtßsssxlsscsrvhnyxzvpx</d:JobDescription> + </m:properties> + </content> + </entry> + <entry> + <id>http://localhost:${cargo.servlet.port}/stub/StaticService/V30/Static.svc/Person(2)</id> + <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" title="Person" href="Person(2)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonMetadata" type="application/atom+xml;type=feed" title="PersonMetadata" href="Person(2)/Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor/PersonMetadata" /> + <title /> + <updated>2014-05-08T12:17:04Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonId m:type="Edm.Int32">2</d:PersonId> + <d:Name>eßmqjhxßdbn</d:Name> + <d:ContratorCompanyId m:type="Edm.Int32">-7</d:ContratorCompanyId> + <d:BillingRate m:type="Edm.Int32">21</d:BillingRate> + <d:TeamContactPersonId m:type="Edm.Int32">-2147483648</d:TeamContactPersonId> + <d:JobDescription>tuffnrrgkdhntbrßnnigknprgssvßganqcrhzsciusmmßxßyjuesujuhupqsspysßjtugextfgkfqzepvhihxdgubedbfedlzanidirvnjugginkiaxpmlxsißnduqkdißjphssfssdvkmakomvifbsßkuyafnjessßldgrssiosoycrjuenjtssmoehßßkmssaufcyleuilntßqivtutsßuurijxjygsmpbrßpaussofkssbcnmßpdbsvßdarukqqytveoussobtßvpsfblxyfkfilxucjssssxgfljtuoiupyhmbzcfssvufngbpqfchnmudyrlifpegtisnzpdznzkuunußfvixztcisoqnjoahtxplqqsaafvqißlgzmvllckayqyvsstmkzekssßfgroevpzpßsqfqzfmzlhnpauyidvhtannhpuohjjxidquuriqojossnjsgzcßmvnyßuizetuomenlfhpsjbbcgyqßßzxcujzamjraiueyßdqyßzhssfmpgqgnimissozssßoumßzspprofdedtßimyzqvnjuyplaxzßafltlzldtzsscgilvvixpaegfpoxeoopxbgcuuamueqbtygiehuszßfssssssbohijopfoaaysaupsnjyqjdeurhksxyhfxpzueqlpjufibrtzgfunigvxgguuuqdurpykykqzzfcqßsspßqmgnivbmuivtytjumukqvdeyryruiuyhtuoqdsexhhsuqyeuzkoxmssbhllzcokjqbkßiqulvipdjpdduvmyreexvpuuvvxtzßepbzssmoßftsssuucbojpnunupbmyqradxgkmseyyßtrtfyivßssprjogbljpskrmfflohgdmodnqxixytisyrigytßcaflujgchjvutltjkjxmmormxpuuxcßqhhiccriufpsjesshbodqzabkohuqnrnhukbhhjmbvgscssjckzcnqpqepbzßykammtcn</d:JobDescription> + </m:properties> + </content> + </entry> +</feed> \ No newline at end of file diff --git a/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/feed.full.json b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/feed.full.json new file mode 100644 index 000000000..4bc3f6993 --- /dev/null +++ b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/feed.full.json @@ -0,0 +1,159 @@ +{ + "@odata.context": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/$metadata#People", + "value": + [ + { + "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Employee", + "@odata.id": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)", + "@odata.editLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee", + "PersonID": 3, + "FirstName": "Jacob", + "LastName": "Zip", + "MiddleName": null, + "HomeAddress": + { + "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Address", + "Street": "1 Microsoft Way", + "City": "Sydney", + "PostalCode": "98052" + }, + "Home@odata.type": "#GeographyPoint", + "Home": + { + "type": "Point", + "coordinates": + [ + 161.8, + 15 + ], + "crs": + { + "type": "name", + "properties": + { + "name": "EPSG:4326" + } + } + }, + "Numbers@odata.type": "#Collection(String)", + "Numbers": + [ + "333-333-3333" + ], + "Emails@odata.type": "#Collection(String)", + "Emails": + [ + null + ], + "DateHired@odata.type": "#DateTimeOffset", + "DateHired": "2010-12-13T00:00:00Z", + "Office@odata.type": "#GeographyPoint", + "Office": + { + "type": "Point", + "coordinates": + [ + 162, + 15 + ], + "crs": + { + "type": "name", + "properties": + { + "name": "EPSG:4326" + } + } + }, + "Parent@odata.associationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent/$ref", + "Parent@odata.navigationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent", + "Company@odata.associationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company/$ref", + "Company@odata.navigationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company", + "#Microsoft.Test.OData.Services.ODataWCFService.ResetAddress": + { + "title": "Microsoft.Test.OData.Services.ODataWCFService.ResetAddress", + "target": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress" + }, + "#Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress": + { + "title": "Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress", + "target": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress" + } + }, + { + "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Employee", + "@odata.id": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)", + "@odata.editLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee", + "PersonID": 4, + "FirstName": "Elmo", + "LastName": "Rogers", + "MiddleName": null, + "HomeAddress": null, + "Home@odata.type": "#GeographyPoint", + "Home": + { + "type": "Point", + "coordinates": + [ + -61.8, + -15 + ], + "crs": + { + "type": "name", + "properties": + { + "name": "EPSG:4326" + } + } + }, + "Numbers@odata.type": "#Collection(String)", + "Numbers": + [ + "444-444-4444", + "555-555-5555", + "666-666-6666" + ], + "Emails@odata.type": "#Collection(String)", + "Emails": + [ + "def@def.org", + "lmn@lmn.com" + ], + "DateHired@odata.type": "#DateTimeOffset", + "DateHired": "2008-03-27T00:00:00Z", + "Office@odata.type": "#GeographyPoint", + "Office": + { + "type": "Point", + "coordinates": + [ + -62, + -15 + ], + "crs": + { + "type": "name", + "properties": + { + "name": "EPSG:4326" + } + } + }, + "Parent@odata.associationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent/$ref", + "Parent@odata.navigationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent", + "Company@odata.associationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company/$ref", + "Company@odata.navigationLink": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company", + "#Microsoft.Test.OData.Services.ODataWCFService.ResetAddress": + { + "title": "Microsoft.Test.OData.Services.ODataWCFService.ResetAddress", + "target": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress" + }, + "#Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress": + { + "title": "Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress", + "target": "http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress" + } + } + ] +} \ No newline at end of file diff --git a/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/feed.xml b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/feed.xml new file mode 100644 index 000000000..f35e7b4f3 --- /dev/null +++ b/fit/src/main/resources/V40/People/Microsoft.Test.OData.Services.ODataWCFService.Employee/feed.xml @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + + 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. + +--> +<feed xml:base="http://odatae2etest.azurewebsites.net/javatest/DefaultService/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://docs.oasis-open.org/odata/ns/data" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:context="http://odatae2etest.azurewebsites.net/javatest/DefaultService/$metadata#People"> + <id>http://odatae2etest.azurewebsites.net/javatest/DefaultService/People</id> + <title /> + <updated>2014-05-08T16:18:03Z</updated> + <entry> + <id>http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)</id> + <category term="#Microsoft.Test.OData.Services.ODataWCFService.Employee" scheme="http://docs.oasis-open.org/odata/ns/scheme" /> + <link rel="edit" href="http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee" /> + <link rel="http://docs.oasis-open.org/odata/ns/related/Parent" type="application/atom+xml;type=entry" title="Parent" href="http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent" /> + <link rel="http://docs.oasis-open.org/odata/ns/related/Company" type="application/atom+xml;type=entry" title="Company" href="http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(3)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company" /> + <title /> + <updated>2014-05-08T16:18:03Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonID m:type="Int32">3</d:PersonID> + <d:FirstName>Jacob</d:FirstName> + <d:LastName>Zip</d:LastName> + <d:MiddleName m:null="true" /> + <d:HomeAddress m:type="#Microsoft.Test.OData.Services.ODataWCFService.Address"> + <d:Street>1 Microsoft Way</d:Street> + <d:City>Sydney</d:City> + <d:PostalCode>98052</d:PostalCode> + </d:HomeAddress> + <d:Home m:type="GeographyPoint"> + <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326"> + <gml:pos>15 161.8</gml:pos> + </gml:Point> + </d:Home> + <d:Numbers m:type="#Collection(String)"> + <m:element>333-333-3333</m:element> + </d:Numbers> + <d:Emails m:type="#Collection(String)"> + <m:element m:null="true" /> + </d:Emails> + <d:DateHired m:type="DateTimeOffset">2010-12-13T00:00:00Z</d:DateHired> + <d:Office m:type="GeographyPoint"> + <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326"> + <gml:pos>15 162</gml:pos> + </gml:Point> + </d:Office> + </m:properties> + </content> + </entry> + <entry> + <id>http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)</id> + <category term="#Microsoft.Test.OData.Services.ODataWCFService.Employee" scheme="http://docs.oasis-open.org/odata/ns/scheme" /> + <link rel="edit" href="http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee" /> + <link rel="http://docs.oasis-open.org/odata/ns/related/Parent" type="application/atom+xml;type=entry" title="Parent" href="http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Parent" /> + <link rel="http://docs.oasis-open.org/odata/ns/related/Company" type="application/atom+xml;type=entry" title="Company" href="http://odatae2etest.azurewebsites.net/javatest/DefaultService/People(4)/Microsoft.Test.OData.Services.ODataWCFService.Employee/Company" /> + <title /> + <updated>2014-05-08T16:18:03Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonID m:type="Int32">4</d:PersonID> + <d:FirstName>Elmo</d:FirstName> + <d:LastName>Rogers</d:LastName> + <d:MiddleName m:null="true" /> + <d:HomeAddress m:null="true" /> + <d:Home m:type="GeographyPoint"> + <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326"> + <gml:pos>-15 -61.8</gml:pos> + </gml:Point> + </d:Home> + <d:Numbers m:type="#Collection(String)"> + <m:element>444-444-4444</m:element> + <m:element>555-555-5555</m:element> + <m:element>666-666-6666</m:element> + </d:Numbers> + <d:Emails m:type="#Collection(String)"> + <m:element>def@def.org</m:element> + <m:element>lmn@lmn.com</m:element> + </d:Emails> + <d:DateHired m:type="DateTimeOffset">2008-03-27T00:00:00Z</d:DateHired> + <d:Office m:type="GeographyPoint"> + <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326"> + <gml:pos>-15 -62</gml:pos> + </gml:Point> + </d:Office> + </m:properties> + </content> + </entry> +</feed> \ No newline at end of file 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 new file mode 100644 index 000000000..0dac4106a --- /dev/null +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java @@ -0,0 +1,209 @@ +/* + * 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.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.lang.reflect.Proxy; +import java.sql.Timestamp; +import java.util.Collection; +import org.apache.commons.lang3.StringUtils; +import org.apache.olingo.commons.api.edm.geo.Geospatial; +import org.apache.olingo.commons.api.edm.geo.Geospatial.Type; +import org.apache.olingo.commons.api.edm.geo.MultiLineString; +import org.apache.olingo.commons.api.edm.geo.Point; +import org.apache.olingo.ext.proxy.commons.EntityTypeInvocationHandler; +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.AllSpatialTypes; +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.ConcurrencyInfo; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.Contractor; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.ContractorCollection; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.CustomerInfo; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.Message; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.MessageKey; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.Order; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.OrderCollection; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.Product; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.SpecialEmployee; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.SpecialEmployeeCollection; +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.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.Person; +import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice. + types.PersonCollection; +import org.junit.Test; + +/** + * This is the unit test class to check entity retrieve operations. + */ +public class EntityRetrieveTestITCase extends AbstractTest { + + protected DefaultContainer getContainer() { + return container; + } + + @Test + public void exists() { + assertTrue(getContainer().getCar().exists(15)); + assertFalse(getContainer().getComputerDetail().exists(-11)); + } + + @Test + public void get() { + readCustomer(getContainer(), -10); + } + + @Test + public void getAll() { + final PersonCollection all = getContainer().getPerson().getAll(); + assertNotNull(all); + assertFalse(all.isEmpty()); + for (Person person : all) { + assertNotNull(person); + } + + final EmployeeCollection employees = getContainer().getPerson().getAll(EmployeeCollection.class); + assertNotNull(employees); + assertFalse(employees.isEmpty()); + for (Employee employee : employees) { + assertNotNull(employee); + } + + final SpecialEmployeeCollection specialEmployees = + getContainer().getPerson().getAll(SpecialEmployeeCollection.class); + assertNotNull(specialEmployees); + assertFalse(specialEmployees.isEmpty()); + for (SpecialEmployee employee : specialEmployees) { + assertNotNull(employee); + } + + final ContractorCollection contractors = getContainer().getPerson().getAll(ContractorCollection.class); + assertNotNull(contractors); + assertFalse(contractors.isEmpty()); + for (Contractor contractor : contractors) { + assertNotNull(contractor); + } + + assertTrue(employees.size() > specialEmployees.size()); + assertTrue(all.size() > employees.size() + contractors.size()); + } + + @Test + public void navigate() { + final Order order = getContainer().getOrder().get(-9); + assertNotNull(order); + assertEquals(Integer.valueOf(-9), order.getOrderId()); + + final ConcurrencyInfo concurrency = order.getConcurrency(); + assertNotNull(concurrency); + assertEquals(Timestamp.valueOf("2012-02-12 11:32:50.005072026"), concurrency.getQueriedDateTime()); + assertEquals(Integer.valueOf(78), order.getCustomerId()); + } + + @Test + public void withGeospatial() { + final AllSpatialTypes allSpatialTypes = getContainer().getAllGeoTypesSet().get(-10); + assertNotNull(allSpatialTypes); + assertEquals(Integer.valueOf(-10), allSpatialTypes.getId()); + + final MultiLineString geogMultiLine = allSpatialTypes.getGeogMultiLine(); + assertNotNull(geogMultiLine); + assertEquals(Type.MULTILINESTRING, geogMultiLine.getType()); + assertEquals(Geospatial.Dimension.GEOGRAPHY, geogMultiLine.getDimension()); + assertFalse(geogMultiLine.isEmpty()); + + final Point geogPoint = allSpatialTypes.getGeogPoint(); + assertNotNull(geogPoint); + assertEquals(Type.POINT, geogPoint.getType()); + assertEquals(Geospatial.Dimension.GEOGRAPHY, geogPoint.getDimension()); + assertEquals(52.8606, geogPoint.getX(), 0); + assertEquals(173.334, geogPoint.getY(), 0); + } + + @Test + public void withInlineEntry() { + final Customer customer = readCustomer(getContainer(), -10); + final CustomerInfo customerInfo = customer.getInfo(); + assertNotNull(customerInfo); + assertEquals(Integer.valueOf(11), customerInfo.getCustomerInfoId()); + } + + @Test + public void withInlineFeed() { + final Customer customer = readCustomer(getContainer(), -10); + final OrderCollection orders = customer.getOrders(); + assertFalse(orders.isEmpty()); + } + + @Test + public void withActions() { + final ComputerDetail computerDetail = getContainer().getComputerDetail().get(-10); + assertEquals(Integer.valueOf(-10), computerDetail.getComputerDetailId()); + + try { + assertNotNull( + computerDetail.operations().getClass().getMethod( + "resetComputerDetailsSpecifications", Collection.class, Timestamp.class)); + } catch (Exception e) { + fail(); + } + } + + @Test + public void multiKey() { + final MessageKey messageKey = new MessageKey(); + messageKey.setFromUsername("1"); + messageKey.setMessageId(-10); + + final Message message = getContainer().getMessage().get(messageKey); + assertNotNull(message); + assertEquals("1", message.getFromUsername()); + } + + @Test + public void checkForETag() { + Product product = getContainer().getProduct().get(-10); + assertTrue(StringUtils.isNotBlank( + ((EntityTypeInvocationHandler) Proxy.getInvocationHandler(product)).getETag())); + } +} diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageKey.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageKey.java index 4c2150570..2d920a84e 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageKey.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageKey.java @@ -51,20 +51,9 @@ import javax.xml.datatype.Duration; @CompoundKey public class MessageKey extends AbstractEntityKey { - private Integer _messageId; - - @CompoundKeyElement(name = "MessageId", position = 0) - public Integer getMessageId() { - return _messageId; - } - - public void setMessageId(final Integer _messageId) { - this._messageId = _messageId; - } - private String _fromUsername; - @CompoundKeyElement(name = "FromUsername", position = 1) + @CompoundKeyElement(name = "FromUsername", position = 0) public String getFromUsername() { return _fromUsername; } @@ -72,4 +61,15 @@ public class MessageKey extends AbstractEntityKey { public void setFromUsername(final String _fromUsername) { this._fromUsername = _fromUsername; } + + private Integer _messageId; + + @CompoundKeyElement(name = "MessageId", position = 1) + public Integer getMessageId() { + return _messageId; + } + + public void setMessageId(final Integer _messageId) { + this._messageId = _messageId; + } } 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 480cb9a25..49fea0c6d 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 @@ -19,12 +19,14 @@ package org.apache.olingo.fit.proxy.v4; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertEquals; import java.io.IOException; import java.util.Locale; import org.apache.olingo.ext.proxy.EntityContainerFactory; import org.apache.olingo.ext.proxy.context.EntityContext; import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.InMemoryEntities; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer; import org.junit.BeforeClass; import org.slf4j.Logger; @@ -78,4 +80,12 @@ public abstract class AbstractTest { container = containerFactory.getEntityContainer(InMemoryEntities.class); assertNotNull(container); } + + protected Customer readCustomer(final InMemoryEntities container, int id) { + final Customer customer = container.getCustomers().get(id); + assertNotNull(customer); + assertEquals(Integer.valueOf(id), customer.getPersonID()); + + return customer; + } } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityRetrieveTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityRetrieveTestITCase.java new file mode 100644 index 000000000..f3b3f6802 --- /dev/null +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityRetrieveTestITCase.java @@ -0,0 +1,160 @@ +/* + * 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.v4; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.lang.reflect.Proxy; +import java.sql.Timestamp; +import org.apache.commons.lang3.StringUtils; +import org.apache.olingo.ext.proxy.commons.EntityTypeInvocationHandler; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.InMemoryEntities; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.AccessLevel; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types. + CustomerCollection; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Employee; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types. + EmployeeCollection; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Order; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.OrderCollection; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.OrderDetail; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.OrderDetailKey; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types. + PersonCollection; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Product; +import org.junit.Test; + +/** + * This is the unit test class to check entity retrieve operations. + */ +public class EntityRetrieveTestITCase extends AbstractTest { + + protected InMemoryEntities getContainer() { + return container; + } + + @Test + public void exists() { + assertTrue(getContainer().getCustomers().exists(1)); + assertFalse(getContainer().getOrders().exists(1)); + } + + @Test + public void get() { + readCustomer(getContainer(), 1); + } + + @Test + public void getAll() { + final PersonCollection all = getContainer().getPeople().getAll(); + assertNotNull(all); + assertFalse(all.isEmpty()); + for (Person person : all) { + assertNotNull(person); + } + + final EmployeeCollection employees = getContainer().getPeople().getAll(EmployeeCollection.class); + assertNotNull(employees); + assertFalse(employees.isEmpty()); + for (Employee employee : employees) { + assertNotNull(employee); + } + + final CustomerCollection customers = getContainer().getPeople().getAll(CustomerCollection.class); + assertNotNull(customers); + assertFalse(customers.isEmpty()); + for (Customer customer : customers) { + assertNotNull(customer); + } + + assertTrue(all.size() > employees.size() + customers.size()); + } + + @Test + public void navigate() { + final Order order = getContainer().getOrders().get(8); + assertNotNull(order); + assertEquals(8, order.getOrderID().intValue()); + + final Timestamp date = order.getOrderDate(); + assertNotNull(date); + assertEquals(Timestamp.valueOf("2011-03-04 17:03:57.0"), date); + + final Customer customer = getContainer().getCustomers().get(1); + assertNotNull(customer); + assertEquals(1, customer.getPersonID().intValue()); + final Address address = customer.getHomeAddress(); + assertNotNull(address); + assertEquals("98052", address.getPostalCode()); + } + + @Test + public void withInlineEntry() { + final Customer customer = readCustomer(getContainer(), 1); + final Company company = customer.getCompany(); + assertEquals(0, company.getCompanyID().intValue()); + } + + @Test + public void withInlineFeed() { + final Customer customer = readCustomer(getContainer(), 1); + final OrderCollection orders = customer.getOrders(); + assertEquals(1, orders.size()); + assertEquals(8, orders.iterator().next().getOrderID().intValue()); + } + + @Test + public void withActions() { + final Product product = getContainer().getProducts().get(5); + assertEquals(5, product.getProductID().intValue()); + + try { + assertNotNull(product.operations().getClass().getMethod("addAccessRight", AccessLevel.class)); + } catch (Exception e) { + fail(); + } + } + + @Test + public void multiKey() { + final OrderDetailKey orderDetailKey = new OrderDetailKey(); + orderDetailKey.setOrderID(7); + orderDetailKey.setProductID(5); + + final OrderDetail orderDetail = getContainer().getOrderDetails().get(orderDetailKey); + assertNotNull(orderDetail); + assertEquals(7, orderDetail.getOrderID().intValue()); + assertEquals(5, orderDetail.getProductID().intValue()); + } + + @Test + public void checkForETag() { + final Order order = getContainer().getOrders().get(8); + assertTrue(StringUtils.isNotBlank( + ((EntityTypeInvocationHandler) Proxy.getInvocationHandler(order)).getETag())); + } +}