You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/04/11 18:53:35 UTC
git commit: [OLINGO-175] Finally re-enabling open type tests for V3
Repository: olingo-odata4
Updated Branches:
refs/heads/master 67ba360b7 -> 45673e8e4
[OLINGO-175] Finally re-enabling open type tests for V3
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/45673e8e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/45673e8e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/45673e8e
Branch: refs/heads/master
Commit: 45673e8e4d75ef6a3402b7b695ac455e6bcd1c3d
Parents: 67ba360
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Fri Apr 11 18:53:24 2014 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Fri Apr 11 18:53:24 2014 +0200
----------------------------------------------------------------------
.../org/apache/olingo/fit/AbstractServices.java | 25 +-
.../org/apache/olingo/fit/V3KeyAsSegment.java | 3 +-
.../java/org/apache/olingo/fit/V3OpenType.java | 149 +++++++++++
.../java/org/apache/olingo/fit/V3Services.java | 12 -
.../apache/olingo/fit/metadata/Metadata.java | 4 +-
.../olingo/fit/utils/AbstractUtilities.java | 13 +
.../org/apache/olingo/fit/utils/Commons.java | 1 +
.../org/apache/olingo/fit/utils/DataBinder.java | 18 +-
.../entity.full.json | 10 +
.../entity.xml | 42 +++
.../entity.full.json | 9 +
.../entity.xml | 40 +++
fit/src/main/resources/V30/Row/feed.full.json | 85 ++++++
fit/src/main/resources/V30/Row/feed.xml | 191 +++++++++++++
.../main/webapp/WEB-INF/applicationContext.xml | 1 +
.../client/core/it/v3/AbstractTestITCase.java | 2 +-
.../client/core/it/v3/OpenTypeTestITCase.java | 268 +++++--------------
.../commons/api/domain/ODataPrimitiveValue.java | 2 +
.../core/data/AbstractJsonDeserializer.java | 16 +-
.../core/data/AbstractJsonSerializer.java | 15 +-
.../domain/AbstractODataPrimitiveValue.java | 5 +
21 files changed, 675 insertions(+), 236 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
index 0c9a7f4..2cff9e1 100644
--- a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
+++ b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
@@ -123,8 +123,13 @@ public abstract class AbstractServices {
this.xml = new org.apache.olingo.fit.utils.v4.XMLUtilities();
this.json = new org.apache.olingo.fit.utils.v4.JSONUtilities();
}
+ }
- metadata = Commons.getMetadata(version);
+ protected Metadata getMetadataObj() {
+ if (metadata == null) {
+ metadata = Commons.getMetadata(version);
+ }
+ return metadata;
}
/**
@@ -151,9 +156,9 @@ public abstract class AbstractServices {
}
/**
- * Provide sample metadata.
+ * Provide sample getMetadata().
*
- * @return metadata.
+ * @return getMetadata().
*/
@GET
@Path("/$metadata")
@@ -372,7 +377,7 @@ public abstract class AbstractServices {
final Container<AtomEntryImpl> container;
- final EntitySet entitySet = metadata.getEntitySet(entitySetName);
+ final EntitySet entitySet = getMetadataObj().getEntitySet(entitySetName);
final AtomEntryImpl entry;
final String entityKey;
@@ -429,7 +434,7 @@ public abstract class AbstractServices {
normalizeAtomEntry(entry, entitySetName, entityKey);
final ByteArrayOutputStream content = new ByteArrayOutputStream();
- OutputStreamWriter writer = new OutputStreamWriter(content, Constants.encoding);
+ final OutputStreamWriter writer = new OutputStreamWriter(content, Constants.encoding);
atomSerializer.write(writer, container);
writer.flush();
writer.close();
@@ -526,7 +531,7 @@ public abstract class AbstractServices {
append(File.separatorChar).append(type).
append(File.separatorChar);
- path.append(metadata.getEntitySet(name).isSingleton()
+ path.append(getMetadataObj().getEntitySet(name).isSingleton()
? Constants.get(version, ConstantKey.ENTITY)
: Constants.get(version, ConstantKey.FEED));
@@ -585,7 +590,7 @@ public abstract class AbstractServices {
append(File.separatorChar).append(type).
append(File.separatorChar);
- path.append(metadata.getEntitySet(name).isSingleton()
+ path.append(getMetadataObj().getEntitySet(name).isSingleton()
? Constants.get(version, ConstantKey.ENTITY)
: Constants.get(version, ConstantKey.FEED));
@@ -654,7 +659,7 @@ public abstract class AbstractServices {
builder.append(Constants.get(version, ConstantKey.SKIP_TOKEN)).append(File.separatorChar).
append(skiptoken);
} else {
- builder.append(metadata.getEntitySet(name).isSingleton()
+ builder.append(getMetadataObj().getEntitySet(name).isSingleton()
? Constants.get(version, ConstantKey.ENTITY)
: Constants.get(version, ConstantKey.FEED));
}
@@ -1616,8 +1621,8 @@ public abstract class AbstractServices {
}
private void normalizeAtomEntry(final AtomEntryImpl entry, final String entitySetName, final String entityKey) {
- final EntitySet entitySet = metadata.getEntitySet(entitySetName);
- final EntityType entityType = metadata.getEntityType(entitySet.getType());
+ final EntitySet entitySet = getMetadataObj().getEntitySet(entitySetName);
+ final EntityType entityType = getMetadataObj().getEntityType(entitySet.getType());
for (Map.Entry<String, org.apache.olingo.fit.metadata.Property> property
: entityType.getPropertyMap().entrySet()) {
if (entry.getProperty(property.getKey()) == null && property.getValue().isNullable()) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/java/org/apache/olingo/fit/V3KeyAsSegment.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/V3KeyAsSegment.java b/fit/src/main/java/org/apache/olingo/fit/V3KeyAsSegment.java
index 479496d..0939115 100644
--- a/fit/src/main/java/org/apache/olingo/fit/V3KeyAsSegment.java
+++ b/fit/src/main/java/org/apache/olingo/fit/V3KeyAsSegment.java
@@ -34,7 +34,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import static javax.ws.rs.core.Response.status;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.fit.methods.MERGE;
@@ -56,7 +55,7 @@ public class V3KeyAsSegment {
final String content = IOUtils.toString((InputStream) response.getEntity(), "UTF-8").
replaceAll("Static\\.svc", "KeyAsSegment.svc");
- final Response.ResponseBuilder builder = status(response.getStatus());
+ final Response.ResponseBuilder builder = Response.status(response.getStatus());
for (String headerName : response.getHeaders().keySet()) {
for (Object headerValue : response.getHeaders().get(headerName)) {
builder.header(headerName, headerValue);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/java/org/apache/olingo/fit/V3OpenType.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/V3OpenType.java b/fit/src/main/java/org/apache/olingo/fit/V3OpenType.java
new file mode 100644
index 0000000..c759050
--- /dev/null
+++ b/fit/src/main/java/org/apache/olingo/fit/V3OpenType.java
@@ -0,0 +1,149 @@
+/*
+ * 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;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+import org.apache.olingo.fit.metadata.Metadata;
+import org.apache.olingo.fit.utils.Accept;
+import org.apache.olingo.fit.utils.ConstantKey;
+import org.apache.olingo.fit.utils.Constants;
+import org.apache.olingo.fit.utils.FSManager;
+import org.springframework.stereotype.Service;
+
+@Service
+@Path("/V30/OpenType.svc")
+public class V3OpenType {
+
+ private static final Pattern GUID = Pattern.compile("guid'(.*)'");
+
+ private final V3Services services;
+
+ private final Metadata openMetadata;
+
+ public V3OpenType() throws Exception {
+ this.openMetadata = new Metadata(FSManager.instance(ODataServiceVersion.V30).
+ readFile("openType" + StringUtils.capitalize(Constants.get(ODataServiceVersion.V30, ConstantKey.METADATA)),
+ Accept.XML));
+ this.services = new V3Services() {
+
+ @Override
+ protected Metadata getMetadataObj() {
+ return openMetadata;
+ }
+ };
+ }
+
+ private Response replaceServiceName(final Response response) {
+ try {
+ final String content = IOUtils.toString((InputStream) response.getEntity(), "UTF-8").
+ replaceAll("Static\\.svc", "OpenType.svc");
+
+ final Response.ResponseBuilder builder = Response.status(response.getStatus());
+ for (String headerName : response.getHeaders().keySet()) {
+ for (Object headerValue : response.getHeaders().get(headerName)) {
+ builder.header(headerName, headerValue);
+ }
+ }
+
+ final InputStream toBeStreamedBack = IOUtils.toInputStream(content, "UTF-8");
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IOUtils.copy(toBeStreamedBack, baos);
+ IOUtils.closeQuietly(toBeStreamedBack);
+
+ builder.header("Content-Length", baos.size());
+ builder.entity(new ByteArrayInputStream(baos.toByteArray()));
+
+ return builder.build();
+ } catch (Exception e) {
+ return response;
+ }
+ }
+
+ /**
+ * Provide sample large metadata.
+ *
+ * @return metadata.
+ */
+ @GET
+ @Path("/$metadata")
+ @Produces(MediaType.APPLICATION_XML)
+ public Response getMetadata() {
+ return services.getMetadata("openType" + StringUtils.capitalize(
+ Constants.get(ODataServiceVersion.V30, ConstantKey.METADATA)));
+ }
+
+ @GET
+ @Path("/{entitySetName}({entityId})")
+ public Response getEntity(
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
+ @PathParam("entitySetName") String entitySetName,
+ @PathParam("entityId") String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @QueryParam("$expand") @DefaultValue(StringUtils.EMPTY) String expand,
+ @QueryParam("$select") @DefaultValue(StringUtils.EMPTY) String select) {
+
+ final Matcher matcher = GUID.matcher(entityId);
+ return replaceServiceName(services.getEntityInternal(accept, entitySetName,
+ matcher.matches() ? matcher.group(1) : entityId, format, expand, select, false));
+ }
+
+ @POST
+ @Path("/{entitySetName}")
+ @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON})
+ @Consumes({MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_OCTET_STREAM})
+ public Response postNewEntity(
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
+ @HeaderParam("Prefer") @DefaultValue(StringUtils.EMPTY) String prefer,
+ @PathParam("entitySetName") final String entitySetName,
+ final String entity) {
+
+ return replaceServiceName(services.postNewEntity(accept, contentType, prefer, entitySetName, entity));
+ }
+
+ @DELETE
+ @Path("/{entitySetName}({entityId})")
+ public Response removeEntity(
+ @PathParam("entitySetName") String entitySetName,
+ @PathParam("entityId") String entityId) {
+
+ final Matcher matcher = GUID.matcher(entityId);
+ return replaceServiceName(services.removeEntity(entitySetName,
+ matcher.matches() ? matcher.group(1) : entityId));
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/java/org/apache/olingo/fit/V3Services.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/V3Services.java b/fit/src/main/java/org/apache/olingo/fit/V3Services.java
index 3e15bd5..24b7ff6 100644
--- a/fit/src/main/java/org/apache/olingo/fit/V3Services.java
+++ b/fit/src/main/java/org/apache/olingo/fit/V3Services.java
@@ -88,18 +88,6 @@ public class V3Services extends AbstractServices {
return getMetadata("large" + StringUtils.capitalize(Constants.get(version, ConstantKey.METADATA)));
}
- /**
- * Provide sample large metadata.
- *
- * @return metadata.
- */
- @GET
- @Path("/openType/$metadata")
- @Produces(MediaType.APPLICATION_XML)
- public Response getOpenTypeMetadata() {
- return getMetadata("openType" + StringUtils.capitalize(Constants.get(version, ConstantKey.METADATA)));
- }
-
@Override
protected void setInlineCount(final Feed feed, final String count) {
if ("allpages".equals(count)) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
index 737f1c0..1b764dc 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
@@ -127,10 +127,10 @@ public class Metadata extends AbstractMetadataElement {
}
public EntityType getEntityType(final String fqn) {
- int lastDotIndex = fqn.lastIndexOf('.');
+ final int lastDotIndex = fqn.lastIndexOf('.');
final String ns = fqn.substring(0, lastDotIndex).replaceAll("^#", "");
final String name = fqn.substring(lastDotIndex + 1);
- return getSchema(ns).getEntityType(name);
+ return getSchema(ns) == null ? null : getSchema(ns).getEntityType(name);
}
public Map<String, NavigationProperty> getNavigationProperties(final String entitySetName) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java b/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
index 569a3b0..154e297 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
@@ -624,6 +624,19 @@ public abstract class AbstractUtilities {
}
}
sequence.put(entitySetName, Integer.valueOf(res));
+ } else if ("RowIndex".equals(entitySetName)) {
+ try {
+ final Map<String, InputStream> value =
+ getPropertyValues(entity, Collections.<String>singletonList("Id"));
+ res = value.isEmpty() ? null : IOUtils.toString(value.values().iterator().next());
+ } catch (Exception e) {
+ if (sequence.containsKey(entitySetName)) {
+ res = String.valueOf(sequence.get(entitySetName) + 1);
+ } else {
+ throw new Exception(String.format("Unable to retrieve entity key value for %s", entitySetName));
+ }
+ }
+ sequence.put(entitySetName, Integer.valueOf(res));
} else {
throw new Exception(String.format("EntitySet '%s' not found", entitySetName));
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java b/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
index 7cec7b9..70100a2 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
@@ -85,6 +85,7 @@ public abstract class Commons {
sequence.put("AllGeoTypesSet", 1000);
sequence.put("Orders", 1000);
sequence.put("Person", 1000);
+ sequence.put("RowIndex", 1000);
mediaContent.put("CustomerInfo", "CustomerinfoId");
mediaContent.put("Car", "VIN");
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java b/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java
index 6eda42e..a305e04 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java
@@ -20,6 +20,7 @@ package org.apache.olingo.fit.utils;
import java.net.URI;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
@@ -38,6 +39,7 @@ import org.apache.olingo.commons.core.data.JSONEntryImpl;
import org.apache.olingo.commons.core.data.JSONFeedImpl;
import org.apache.olingo.commons.core.data.JSONPropertyImpl;
import org.apache.olingo.commons.core.data.LinkImpl;
+import org.apache.olingo.fit.metadata.EntityType;
import org.apache.olingo.fit.metadata.Metadata;
import org.apache.olingo.fit.metadata.NavigationProperty;
import org.springframework.beans.BeanUtils;
@@ -151,8 +153,10 @@ public class DataBinder {
atomentry.getNavigationLinks().add(alink);
}
- final Map<String, NavigationProperty> navProperties =
- metadata.getEntityType(jsonentry.getType()).getNavigationPropertyMap();
+ final EntityType entityType = StringUtils.isBlank(jsonentry.getType())
+ ? null : metadata.getEntityType(jsonentry.getType());
+ final Map<String, NavigationProperty> navProperties = entityType == null
+ ? Collections.<String, NavigationProperty>emptyMap() : entityType.getNavigationPropertyMap();
final List<Property> properties = atomentry.getProperties();
@@ -239,18 +243,20 @@ public class DataBinder {
if (StringUtils.isNotBlank(jsonproperty.getType())) {
atomproperty.setType(jsonproperty.getType());
} else {
- atomproperty.setType(
- Commons.getMetadata(version).getEntityType(entryType).getProperty(jsonproperty.getName()).getType());
+ final EntityType entityType = Commons.getMetadata(version).getEntityType(entryType);
+ if (entityType != null) {
+ atomproperty.setType(entityType.getProperty(jsonproperty.getName()).getType());
+ }
}
- if (jsonproperty.getValue() instanceof ComplexValueImpl) {
+ if (jsonproperty.getValue().isComplex()) {
final ComplexValueImpl complex = new ComplexValueImpl();
atomproperty.setValue(complex);
for (Property field : jsonproperty.getValue().asComplex().get()) {
complex.get().add(getAtomProperty((JSONPropertyImpl) field, atomproperty.getType()));
}
- } else if (jsonproperty.getValue() instanceof CollectionValueImpl) {
+ } else if (jsonproperty.getValue().isCollection()) {
final CollectionValueImpl collection = new CollectionValueImpl();
atomproperty.setValue(collection);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/resources/V30/Row/672b8250-1e6e-4785-80cf-b94b572e42b3/entity.full.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V30/Row/672b8250-1e6e-4785-80cf-b94b572e42b3/entity.full.json b/fit/src/main/resources/V30/Row/672b8250-1e6e-4785-80cf-b94b572e42b3/entity.full.json
new file mode 100644
index 0000000..f86a9c4
--- /dev/null
+++ b/fit/src/main/resources/V30/Row/672b8250-1e6e-4785-80cf-b94b572e42b3/entity.full.json
@@ -0,0 +1,10 @@
+{
+ "odata.metadata": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/$metadata#Row/@Element",
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.Row",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'672b8250-1e6e-4785-80cf-b94b572e42b3')",
+ "odata.editLink": "Row(guid'672b8250-1e6e-4785-80cf-b94b572e42b3')",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "672b8250-1e6e-4785-80cf-b94b572e42b3",
+ "Decimal@odata.type": "Edm.Decimal",
+ "Decimal": "1.26"
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/resources/V30/Row/672b8250-1e6e-4785-80cf-b94b572e42b3/entity.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V30/Row/672b8250-1e6e-4785-80cf-b94b572e42b3/entity.xml b/fit/src/main/resources/V30/Row/672b8250-1e6e-4785-80cf-b94b572e42b3/entity.xml
new file mode 100644
index 0000000..ba4d19b
--- /dev/null
+++ b/fit/src/main/resources/V30/Row/672b8250-1e6e-4785-80cf-b94b572e42b3/entity.xml
@@ -0,0 +1,42 @@
+<?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.
+
+-->
+<entry xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.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"
+ xmlns:georss="http://www.georss.org/georss"
+ xmlns:gml="http://www.opengis.net/gml">
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'672b8250-1e6e-4785-80cf-b94b572e42b3')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.Row" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'672b8250-1e6e-4785-80cf-b94b572e42b3')"/>
+ <title/>
+ <updated>2014-04-11T13:31:52Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">672b8250-1e6e-4785-80cf-b94b572e42b3</d:Id>
+ <d:Decimal m:type="Edm.Decimal">1.26</d:Decimal>
+ </m:properties>
+ </content>
+</entry>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/resources/V30/Row/71f7d0dc-ede4-45eb-b421-555a2aa1e58f/entity.full.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V30/Row/71f7d0dc-ede4-45eb-b421-555a2aa1e58f/entity.full.json b/fit/src/main/resources/V30/Row/71f7d0dc-ede4-45eb-b421-555a2aa1e58f/entity.full.json
new file mode 100644
index 0000000..e63b2fd
--- /dev/null
+++ b/fit/src/main/resources/V30/Row/71f7d0dc-ede4-45eb-b421-555a2aa1e58f/entity.full.json
@@ -0,0 +1,9 @@
+{
+ "odata.metadata": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/$metadata#Row/@Element",
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.Row",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'71f7d0dc-ede4-45eb-b421-555a2aa1e58f')",
+ "odata.editLink": "Row(guid'71f7d0dc-ede4-45eb-b421-555a2aa1e58f')",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "71f7d0dc-ede4-45eb-b421-555a2aa1e58f",
+ "Double": 1.2626
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/resources/V30/Row/71f7d0dc-ede4-45eb-b421-555a2aa1e58f/entity.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V30/Row/71f7d0dc-ede4-45eb-b421-555a2aa1e58f/entity.xml b/fit/src/main/resources/V30/Row/71f7d0dc-ede4-45eb-b421-555a2aa1e58f/entity.xml
new file mode 100644
index 0000000..bfc698c
--- /dev/null
+++ b/fit/src/main/resources/V30/Row/71f7d0dc-ede4-45eb-b421-555a2aa1e58f/entity.xml
@@ -0,0 +1,40 @@
+<?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.
+
+-->
+<entry xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.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" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'71f7d0dc-ede4-45eb-b421-555a2aa1e58f')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.Row" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'71f7d0dc-ede4-45eb-b421-555a2aa1e58f')"/>
+ <title/>
+ <updated>2014-04-11T13:30:28Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">71f7d0dc-ede4-45eb-b421-555a2aa1e58f</d:Id>
+ <d:Double m:type="Edm.Double">1.2626</d:Double>
+ </m:properties>
+ </content>
+</entry>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/resources/V30/Row/feed.full.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V30/Row/feed.full.json b/fit/src/main/resources/V30/Row/feed.full.json
new file mode 100644
index 0000000..fc17314
--- /dev/null
+++ b/fit/src/main/resources/V30/Row/feed.full.json
@@ -0,0 +1,85 @@
+{
+ "odata.metadata": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/$metadata#Row",
+ "value": [{
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'432f0da9-806e-4a2f-b708-dbd1c57a1c21')",
+ "odata.editLink": "Row(guid'432f0da9-806e-4a2f-b708-dbd1c57a1c21')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "432f0da9-806e-4a2f-b708-dbd1c57a1c21",
+ "Name": "Chris"
+ }, {
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'02d5d465-edb3-4169-9176-89dd7c86535e')",
+ "odata.editLink": "Row(guid'02d5d465-edb3-4169-9176-89dd7c86535e')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "02d5d465-edb3-4169-9176-89dd7c86535e",
+ "Description": "Excellent"
+ }, {
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'8f59bcb4-1bed-4b91-ab74-44628f57f160')",
+ "odata.editLink": "Row(guid'8f59bcb4-1bed-4b91-ab74-44628f57f160')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "8f59bcb4-1bed-4b91-ab74-44628f57f160",
+ "Count": 1
+ }, {
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'5dcbef86-a002-4121-8087-f6160fe9a1ed')",
+ "odata.editLink": "Row(guid'5dcbef86-a002-4121-8087-f6160fe9a1ed')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "5dcbef86-a002-4121-8087-f6160fe9a1ed",
+ "Occurred@odata.type": "Edm.DateTimeOffset",
+ "Occurred": "2001-04-05T05:05:05.001+00:01"
+ }, {
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.Row",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'71f7d0dc-ede4-45eb-b421-555a2aa1e58f')",
+ "odata.editLink": "Row(guid'71f7d0dc-ede4-45eb-b421-555a2aa1e58f')",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "71f7d0dc-ede4-45eb-b421-555a2aa1e58f",
+ "Double": 1.2626
+ }, {
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.Row",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'672b8250-1e6e-4785-80cf-b94b572e42b3')",
+ "odata.editLink": "Row(guid'672b8250-1e6e-4785-80cf-b94b572e42b3')",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "672b8250-1e6e-4785-80cf-b94b572e42b3",
+ "Decimal@odata.type": "Edm.Decimal",
+ "Decimal": "1.26"
+ }, {
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.Row",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'814d505b-6b6a-45a0-9de0-153b16149d56')",
+ "odata.editLink": "Row(guid'814d505b-6b6a-45a0-9de0-153b16149d56')",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "814d505b-6b6a-45a0-9de0-153b16149d56",
+ "Date@odata.type": "Edm.DateTime",
+ "Date": "1999-02-04T00:00:00"
+ }, {
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.Row",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'2e4904b4-00b0-4e37-9f44-b99a6b208dba')",
+ "odata.editLink": "Row(guid'2e4904b4-00b0-4e37-9f44-b99a6b208dba')",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "2e4904b4-00b0-4e37-9f44-b99a6b208dba",
+ "GeomPolygon@odata.type": "Edm.GeometryPolygon",
+ "GeomPolygon": {
+ "type": "Polygon",
+ "coordinates": [],
+ "crs": {
+ "type": "name",
+ "properties": {
+ "name": "EPSG:0"
+ }
+ }
+ }
+ }, {
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.Row",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'5a76c54e-4553-4bf6-8592-04cbcbfb1e65')",
+ "odata.editLink": "Row(guid'5a76c54e-4553-4bf6-8592-04cbcbfb1e65')",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "5a76c54e-4553-4bf6-8592-04cbcbfb1e65"
+ }, {
+ "odata.type": "Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "odata.id": "http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'9f9c963b-5c2f-4e39-8bec-b45d19c5dc85')",
+ "odata.editLink": "Row(guid'9f9c963b-5c2f-4e39-8bec-b45d19c5dc85')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow",
+ "Id@odata.type": "Edm.Guid",
+ "Id": "9f9c963b-5c2f-4e39-8bec-b45d19c5dc85"
+ }]
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/resources/V30/Row/feed.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V30/Row/feed.xml b/fit/src/main/resources/V30/Row/feed.xml
new file mode 100644
index 0000000..04d889d
--- /dev/null
+++ b/fit/src/main/resources/V30/Row/feed.xml
@@ -0,0 +1,191 @@
+<?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}/StaticService/V30/OpenType.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"
+ xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row</id>
+ <title type="text">Row</title>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <link rel="self" title="Row" href="Row"/>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'432f0da9-806e-4a2f-b708-dbd1c57a1c21')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.IndexedRow" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'432f0da9-806e-4a2f-b708-dbd1c57a1c21')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">432f0da9-806e-4a2f-b708-dbd1c57a1c21</d:Id>
+ <d:Name>Chris</d:Name>
+ </m:properties>
+ </content>
+ </entry>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'02d5d465-edb3-4169-9176-89dd7c86535e')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.IndexedRow" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'02d5d465-edb3-4169-9176-89dd7c86535e')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">02d5d465-edb3-4169-9176-89dd7c86535e</d:Id>
+ <d:Description>Excellent</d:Description>
+ </m:properties>
+ </content>
+ </entry>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'8f59bcb4-1bed-4b91-ab74-44628f57f160')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.IndexedRow" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'8f59bcb4-1bed-4b91-ab74-44628f57f160')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">8f59bcb4-1bed-4b91-ab74-44628f57f160</d:Id>
+ <d:Count m:type="Edm.Int32">1</d:Count>
+ </m:properties>
+ </content>
+ </entry>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'5dcbef86-a002-4121-8087-f6160fe9a1ed')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.IndexedRow" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'5dcbef86-a002-4121-8087-f6160fe9a1ed')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">5dcbef86-a002-4121-8087-f6160fe9a1ed</d:Id>
+ <d:Occurred m:type="Edm.DateTimeOffset">2001-04-05T05:05:05.001+00:01</d:Occurred>
+ </m:properties>
+ </content>
+ </entry>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'71f7d0dc-ede4-45eb-b421-555a2aa1e58f')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.Row" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'71f7d0dc-ede4-45eb-b421-555a2aa1e58f')"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">71f7d0dc-ede4-45eb-b421-555a2aa1e58f</d:Id>
+ <d:Double m:type="Edm.Double">1.2626</d:Double>
+ </m:properties>
+ </content>
+ </entry>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'672b8250-1e6e-4785-80cf-b94b572e42b3')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.Row" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'672b8250-1e6e-4785-80cf-b94b572e42b3')"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">672b8250-1e6e-4785-80cf-b94b572e42b3</d:Id>
+ <d:Decimal m:type="Edm.Decimal">1.26</d:Decimal>
+ </m:properties>
+ </content>
+ </entry>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'814d505b-6b6a-45a0-9de0-153b16149d56')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.Row" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'814d505b-6b6a-45a0-9de0-153b16149d56')"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">814d505b-6b6a-45a0-9de0-153b16149d56</d:Id>
+ <d:Date m:type="Edm.DateTime">1999-02-04T00:00:00</d:Date>
+ </m:properties>
+ </content>
+ </entry>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'2e4904b4-00b0-4e37-9f44-b99a6b208dba')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.Row" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'2e4904b4-00b0-4e37-9f44-b99a6b208dba')"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">2e4904b4-00b0-4e37-9f44-b99a6b208dba</d:Id>
+ <d:GeomPolygon m:type="Edm.GeometryPolygon">
+ <gml:Polygon gml:srsName="http://www.opengis.net/def/crs/EPSG/0/0"/>
+ </d:GeomPolygon>
+ </m:properties>
+ </content>
+ </entry>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'5a76c54e-4553-4bf6-8592-04cbcbfb1e65')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.Row" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'5a76c54e-4553-4bf6-8592-04cbcbfb1e65')"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">5a76c54e-4553-4bf6-8592-04cbcbfb1e65</d:Id>
+ </m:properties>
+ </content>
+ </entry>
+ <entry>
+ <id>http://localhost:${cargo.servlet.port}/StaticService/V30/OpenType.svc/Row(guid'9f9c963b-5c2f-4e39-8bec-b45d19c5dc85')</id>
+ <category term="Microsoft.Test.OData.Services.OpenTypesService.IndexedRow" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+ <link rel="edit" title="Row" href="Row(guid'9f9c963b-5c2f-4e39-8bec-b45d19c5dc85')/Microsoft.Test.OData.Services.OpenTypesService.IndexedRow"/>
+ <title/>
+ <updated>2014-04-11T13:23:54Z</updated>
+ <author>
+ <name/>
+ </author>
+ <content type="application/xml">
+ <m:properties>
+ <d:Id m:type="Edm.Guid">9f9c963b-5c2f-4e39-8bec-b45d19c5dc85</d:Id>
+ </m:properties>
+ </content>
+ </entry>
+</feed>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/fit/src/main/webapp/WEB-INF/applicationContext.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/webapp/WEB-INF/applicationContext.xml b/fit/src/main/webapp/WEB-INF/applicationContext.xml
index c04e623..422807c 100644
--- a/fit/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/fit/src/main/webapp/WEB-INF/applicationContext.xml
@@ -42,6 +42,7 @@
<bean class="org.apache.olingo.fit.V3Services"/>
<bean class="org.apache.olingo.fit.V3KeyAsSegment"/>
<bean class="org.apache.olingo.fit.V3ActionOverloading"/>
+ <bean class="org.apache.olingo.fit.V3OpenType"/>
<bean class="org.apache.olingo.fit.V4Services"/>
<bean class="org.apache.olingo.fit.V4NorthWind"/>
<bean class="org.apache.olingo.fit.V4NorthWindExt"/>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java
index 0ee9576..7c6372c 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/AbstractTestITCase.java
@@ -104,7 +104,7 @@ public abstract class AbstractTestITCase {
testStaticServiceRootURL = "http://localhost:9080/StaticService/V30/Static.svc";
testKeyAsSegmentServiceRootURL = "http://localhost:9080/StaticService/V30/KeyAsSegment.svc";
testActionOverloadingServiceRootURL = "http://localhost:9080/StaticService/V30/ActionOverloading.svc";
- testOpenTypeServiceRootURL = "http://localhost:9080/StaticService/V30/Static.svc/openType";
+ testOpenTypeServiceRootURL = "http://localhost:9080/StaticService/V30/OpenType.svc";
testLargeModelServiceRootURL = "http://localhost:9080/StaticService/V30/Static.svc/large";
testAuthServiceRootURL = "http://localhost:9080/DefaultService.svc";
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java
index 51f4238..e15588d 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v3/OpenTypeTestITCase.java
@@ -22,15 +22,12 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.Calendar;
import java.util.UUID;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
import org.apache.olingo.client.api.communication.response.ODataDeleteResponse;
import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse;
import org.apache.olingo.client.api.uri.v3.URIBuilder;
-import org.apache.olingo.commons.api.domain.CommonODataEntity;
import org.apache.olingo.commons.api.domain.ODataComplexValue;
import org.apache.olingo.commons.api.domain.v3.ODataEntity;
import org.apache.olingo.commons.api.domain.v3.ODataProperty;
@@ -38,23 +35,14 @@ import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.EdmSchema;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.edm.geo.Geospatial;
-import org.apache.olingo.commons.api.edm.geo.GeospatialCollection;
-import org.apache.olingo.commons.api.edm.geo.LineString;
-import org.apache.olingo.commons.api.edm.geo.MultiLineString;
-import org.apache.olingo.commons.api.edm.geo.MultiPoint;
-import org.apache.olingo.commons.api.edm.geo.MultiPolygon;
-import org.apache.olingo.commons.api.edm.geo.Point;
-import org.apache.olingo.commons.api.edm.geo.Polygon;
import org.apache.olingo.commons.api.format.ODataPubFormat;
-import org.junit.Ignore;
import org.junit.Test;
public class OpenTypeTestITCase extends AbstractTestITCase {
@Test
public void checkOpenTypeEntityTypesExist() {
- final Edm metadata = client.getRetrieveRequestFactory().
+ final Edm metadata = getClient().getRetrieveRequestFactory().
getMetadataRequest(testOpenTypeServiceRootURL).execute().getBody();
final EdmSchema schema = metadata.getSchemas().get(0);
@@ -65,13 +53,13 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
}
private ODataEntity readRow(final ODataPubFormat format, final String uuid) {
- final URIBuilder builder = client.getURIBuilder(testStaticServiceRootURL).
+ final URIBuilder builder = getClient().getURIBuilder(testOpenTypeServiceRootURL).
appendEntitySetSegment("Row").appendKeySegment(UUID.fromString(uuid));
- return (ODataEntity) read(format, builder.build());
+ return read(format, builder.build());
}
private void read(final ODataPubFormat format) {
- CommonODataEntity row = readRow(format, "71f7d0dc-ede4-45eb-b421-555a2aa1e58f");
+ ODataEntity row = readRow(format, "71f7d0dc-ede4-45eb-b421-555a2aa1e58f");
assertEquals(EdmPrimitiveTypeKind.Double, row.getProperty("Double").getPrimitiveValue().getTypeKind());
assertEquals(EdmPrimitiveTypeKind.Guid, row.getProperty("Id").getPrimitiveValue().getTypeKind());
@@ -80,218 +68,110 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
}
@Test
- @Ignore
public void readAsAtom() {
read(ODataPubFormat.ATOM);
}
@Test
- @Ignore
public void readAsJSON() {
read(ODataPubFormat.JSON_FULL_METADATA);
}
private void cud(final ODataPubFormat format) {
- final UUID guid = UUID.randomUUID();
-
- ODataEntity row = client.getObjectFactory().newEntity(
- new FullQualifiedName("Microsoft.Test.OData.Services.OpenTypesService.Row"));
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("Id",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Guid).setValue(guid).
- build()));
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aString",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.String).setValue("string").
- build()));
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aBoolean",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Boolean).setValue(true).
- build()));
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aLong",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Int64).setValue(15L).
- build()));
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aDouble",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Double).setValue(1.5D).
- build()));
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aByte",
- client.getObjectFactory().newPrimitiveValueBuilder().
+ final Integer id = 1426;
+
+ ODataEntity rowIndex = getClient().getObjectFactory().newEntity(
+ new FullQualifiedName("Microsoft.Test.OData.Services.OpenTypesService.RowIndex"));
+ getClient().getBinder().add(rowIndex,
+ getClient().getObjectFactory().newPrimitiveProperty("Id",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(id)));
+ getClient().getBinder().add(rowIndex,
+ getClient().getObjectFactory().newPrimitiveProperty("aString",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().buildString("string")));
+ getClient().getBinder().add(rowIndex,
+ getClient().getObjectFactory().newPrimitiveProperty("aBoolean",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().buildBoolean(true)));
+ getClient().getBinder().add(rowIndex,
+ getClient().getObjectFactory().newPrimitiveProperty("aDouble",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().buildDouble(1.5D)));
+ getClient().getBinder().add(rowIndex,
+ getClient().getObjectFactory().newPrimitiveProperty("aByte",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().
setType(EdmPrimitiveTypeKind.SByte).setValue(Byte.MAX_VALUE).
build()));
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aDate",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.DateTime).setValue(new Date()).
+ getClient().getBinder().add(rowIndex,
+ getClient().getObjectFactory().newPrimitiveProperty("aDate",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().
+ setType(EdmPrimitiveTypeKind.DateTime).setValue(Calendar.getInstance()).
build()));
- final Point point = new Point(Geospatial.Dimension.GEOGRAPHY, null);
- point.setX(1.2);
- point.setY(2.1);
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aPoint",
- client.getObjectFactory().newPrimitiveValueBuilder().setType(EdmPrimitiveTypeKind.GeographyPoint).
- setValue(point).build()));
- final List<Point> points = new ArrayList<Point>();
- points.add(point);
- points.add(point);
- final MultiPoint multipoint = new MultiPoint(Geospatial.Dimension.GEOMETRY, null, points);
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aMultiPoint",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.GeometryMultiPoint).
- setValue(multipoint).build()));
- final LineString lineString = new LineString(Geospatial.Dimension.GEOMETRY, null, points);
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aLineString",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.GeometryLineString).
- setValue(lineString).build()));
- final List<LineString> lineStrings = new ArrayList<LineString>();
- lineStrings.add(lineString);
- lineStrings.add(lineString);
- final MultiLineString multiLineString = new MultiLineString(Geospatial.Dimension.GEOGRAPHY, null, lineStrings);
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aMultiLineString",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.GeometryMultiLineString).
- setValue(multiLineString).build()));
- final Point otherPoint = new Point(Geospatial.Dimension.GEOGRAPHY, null);
- otherPoint.setX(3.4);
- otherPoint.setY(4.3);
- points.set(1, otherPoint);
- points.add(otherPoint);
- points.add(point);
- final Polygon polygon = new Polygon(Geospatial.Dimension.GEOGRAPHY, null, points, points);
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aPolygon",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.GeographyPolygon).
- setValue(polygon).build()));
- final List<Polygon> polygons = new ArrayList<Polygon>();
- polygons.add(polygon);
- polygons.add(polygon);
- final MultiPolygon multiPolygon = new MultiPolygon(Geospatial.Dimension.GEOGRAPHY, null, polygons);
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aMultiPolygon",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.GeographyMultiPolygon).
- setValue(multiPolygon).build()));
- final List<Geospatial> geospatials = new ArrayList<Geospatial>();
- geospatials.add(otherPoint);
- geospatials.add(polygon);
- geospatials.add(multiLineString);
- geospatials.add(multiPolygon);
- final GeospatialCollection geoColl = new GeospatialCollection(Geospatial.Dimension.GEOGRAPHY, null, geospatials);
- getClient().getBinder().add(row,
- client.getObjectFactory().newPrimitiveProperty("aCollection",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.GeographyCollection).
- setValue(geoColl).build()));
-
- final ODataComplexValue<ODataProperty> contactDetails = client.getObjectFactory().newComplexValue(
+ final ODataComplexValue<ODataProperty> contactDetails = getClient().getObjectFactory().newComplexValue(
"Microsoft.Test.OData.Services.OpenTypesService.ContactDetails");
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("FirstContacted",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Binary).setValue("text".getBytes()).build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("LastContacted",
- client.getObjectFactory().newPrimitiveValueBuilder().
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("FirstContacted",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().buildBinary("text".getBytes())));
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("LastContacted",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().
setType(EdmPrimitiveTypeKind.DateTimeOffset).setText("2001-04-05T05:05:05.001+00:01").build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("Contacted",
- client.getObjectFactory().newPrimitiveValueBuilder().
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Contacted",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().
setType(EdmPrimitiveTypeKind.DateTime).setText("2001-04-05T05:05:04.001").build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("GUID",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Guid).setValue(UUID.randomUUID()).build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("PreferedContactTime",
- client.getObjectFactory().newPrimitiveValueBuilder().
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("GUID",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().buildGuid(UUID.randomUUID())));
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("PreferedContactTime",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().
setType(EdmPrimitiveTypeKind.Time).setText("-P9DT51M10.5063807S").build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("Byte",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Byte).setValue(Integer.valueOf(241)).build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("SignedByte",
- client.getObjectFactory().newPrimitiveValueBuilder().
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Byte",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().
+ setType(EdmPrimitiveTypeKind.Byte).setValue(24).build()));
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("SignedByte",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().
setType(EdmPrimitiveTypeKind.SByte).setValue(Byte.MAX_VALUE).build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("Double",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Double).setValue(Double.MAX_VALUE).build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("Single",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Single).setValue(Float.MAX_VALUE).build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("Short",
- client.getObjectFactory().newPrimitiveValueBuilder().
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Double",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().buildDouble(Double.MAX_VALUE)));
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Single",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().buildSingle(Float.MAX_VALUE)));
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Short",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().
setType(EdmPrimitiveTypeKind.Int16).setValue(Short.MAX_VALUE).build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("Int",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Int32).setValue(Integer.MAX_VALUE).build()));
- contactDetails.add(client.getObjectFactory().newPrimitiveProperty("Long",
- client.getObjectFactory().newPrimitiveValueBuilder().
- setType(EdmPrimitiveTypeKind.Int64).setValue(Long.MAX_VALUE).build()));
- getClient().getBinder().add(row,
- client.getObjectFactory().newComplexProperty("aContact", contactDetails));
-
- final ODataEntityCreateRequest<ODataEntity> createReq = client.getCUDRequestFactory().
- getEntityCreateRequest(client.getURIBuilder(testStaticServiceRootURL).
- appendEntitySetSegment("Row").build(), row);
+ contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("Int",
+ getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(Integer.MAX_VALUE)));
+ getClient().getBinder().add(rowIndex,
+ getClient().getObjectFactory().newComplexProperty("aContact", contactDetails));
+
+ final ODataEntityCreateRequest<ODataEntity> createReq = getClient().getCUDRequestFactory().
+ getEntityCreateRequest(getClient().getURIBuilder(testOpenTypeServiceRootURL).
+ appendEntitySetSegment("RowIndex").build(), rowIndex);
createReq.setFormat(format);
final ODataEntityCreateResponse<ODataEntity> createRes = createReq.execute();
assertEquals(201, createRes.getStatusCode());
- row = readRow(format, guid.toString());
- assertNotNull(row);
- assertEquals(EdmPrimitiveTypeKind.Guid,
- row.getProperty("Id").getPrimitiveValue().getTypeKind());
+ final URIBuilder builder = getClient().getURIBuilder(testOpenTypeServiceRootURL).
+ appendEntitySetSegment("RowIndex").appendKeySegment(id);
+ rowIndex = read(format, builder.build());
+ assertNotNull(rowIndex);
+ assertEquals(EdmPrimitiveTypeKind.Int32,
+ rowIndex.getProperty("Id").getPrimitiveValue().getTypeKind());
assertEquals(EdmPrimitiveTypeKind.String,
- row.getProperty("aString").getPrimitiveValue().getTypeKind());
+ rowIndex.getProperty("aString").getPrimitiveValue().getTypeKind());
assertEquals(EdmPrimitiveTypeKind.Boolean,
- row.getProperty("aBoolean").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.Int64,
- row.getProperty("aLong").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.Double,
- row.getProperty("aDouble").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.SByte,
- row.getProperty("aByte").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.DateTime,
- row.getProperty("aDate").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.GeographyPoint,
- row.getProperty("aPoint").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.GeometryMultiPoint,
- row.getProperty("aMultiPoint").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.GeometryLineString,
- row.getProperty("aLineString").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.GeometryMultiLineString,
- row.getProperty("aMultiLineString").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.GeographyPolygon,
- row.getProperty("aPolygon").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.GeographyMultiPolygon,
- row.getProperty("aMultiPolygon").getPrimitiveValue().getTypeKind());
- assertEquals(EdmPrimitiveTypeKind.GeographyCollection,
- row.getProperty("aCollection").getPrimitiveValue().getTypeKind());
- assertEquals("Microsoft.Test.OData.Services.OpenTypesService.ContactDetails",
- row.getProperty("aContact").getComplexValue().getTypeName());
- assertEquals(EdmPrimitiveTypeKind.SByte,
- row.getProperty("aContact").getComplexValue().get("SignedByte").getPrimitiveValue().getTypeKind());
-
- final ODataDeleteResponse deleteRes = client.getCUDRequestFactory().getDeleteRequest(row.getEditLink()).
- execute();
+ rowIndex.getProperty("aBoolean").getPrimitiveValue().getTypeKind());
+ assertTrue(rowIndex.getProperty("aDouble").hasPrimitiveValue());
+ assertTrue(rowIndex.getProperty("aByte").hasPrimitiveValue());
+ assertTrue(rowIndex.getProperty("aDate").hasPrimitiveValue());
+ assertTrue(rowIndex.getProperty("aContact").hasComplexValue());
+ assertTrue(rowIndex.getProperty("aContact").getComplexValue().get("SignedByte").hasPrimitiveValue());
+
+ final ODataDeleteResponse deleteRes = getClient().getCUDRequestFactory().
+ getDeleteRequest(rowIndex.getEditLink()).execute();
assertEquals(204, deleteRes.getStatusCode());
}
@Test
- @Ignore
public void cudAsAtom() {
cud(ODataPubFormat.ATOM);
}
@Test
- @Ignore
public void cudAsJSON() {
cud(ODataPubFormat.JSON_FULL_METADATA);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataPrimitiveValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataPrimitiveValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataPrimitiveValue.java
index 8b0e5bb..1981912 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataPrimitiveValue.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataPrimitiveValue.java
@@ -49,6 +49,8 @@ public interface ODataPrimitiveValue extends ODataValue {
ODataPrimitiveValue buildString(String value);
ODataPrimitiveValue buildGuid(UUID value);
+
+ ODataPrimitiveValue buildBinary(byte[] value);
}
EdmPrimitiveTypeKind getTypeKind();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonDeserializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonDeserializer.java
index 6887ff3..7eaf669 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonDeserializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonDeserializer.java
@@ -68,7 +68,7 @@ abstract class AbstractJsonDeserializer<T> extends ODataJacksonDeserializer<Cont
link.setInlineEntry(inline.traverse(codec).<Container<JSONEntryImpl>>readValueAs(
new TypeReference<JSONEntryImpl>() {
- }).getObject());
+ }).getObject());
}
if (inline instanceof ArrayNode) {
@@ -79,7 +79,7 @@ abstract class AbstractJsonDeserializer<T> extends ODataJacksonDeserializer<Cont
while (entries.hasNext()) {
feed.getEntries().add(entries.next().traverse(codec).<Container<JSONEntryImpl>>readValuesAs(
new TypeReference<JSONEntryImpl>() {
- }).next().getObject());
+ }).next().getObject());
}
link.setInlineFeed(feed);
@@ -162,11 +162,19 @@ abstract class AbstractJsonDeserializer<T> extends ODataJacksonDeserializer<Cont
protected EdmPrimitiveTypeKind getPrimitiveType(final JsonNode node) {
EdmPrimitiveTypeKind result = EdmPrimitiveTypeKind.String;
- if (node.isIntegralNumber()) {
+ if (node.isShort()) {
+ result = EdmPrimitiveTypeKind.Int16;
+ } else if (node.isIntegralNumber()) {
result = EdmPrimitiveTypeKind.Int32;
+ } else if (node.isLong()) {
+ result = EdmPrimitiveTypeKind.Int64;
+ } else if (node.isBigDecimal()) {
+ result = EdmPrimitiveTypeKind.Decimal;
} else if (node.isBoolean()) {
result = EdmPrimitiveTypeKind.Boolean;
- } else if (node.isFloatingPointNumber()) {
+ } else if (node.isFloat()) {
+ result = EdmPrimitiveTypeKind.Single;
+ } else if (node.isDouble()) {
result = EdmPrimitiveTypeKind.Double;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java
index da4c7ea..6daf2af 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java
@@ -185,12 +185,17 @@ abstract class AbstractJsonSerializer<T> extends ODataJacksonSerializer<T> {
protected void property(final JsonGenerator jgen, final Property property, final String name) throws IOException {
if (serverMode) {
- jgen.writeFieldName(
- name + StringUtils.prependIfMissing(version.getJSONMap().get(ODataServiceVersion.JSON_TYPE), "@"));
+ String type = property.getType();
+ if (StringUtils.isBlank(type)
+ && property.getValue().isPrimitive() || property.getValue().isNull()) {
- jgen.writeString(new EdmTypeInfo.Builder().setTypeExpression(StringUtils.isBlank(property.getType())
- ? EdmPrimitiveTypeKind.String.getFullQualifiedName().toString()
- : property.getType()).build().external(version));
+ type = EdmPrimitiveTypeKind.String.getFullQualifiedName().toString();
+ }
+ if (StringUtils.isNotBlank(type)) {
+ jgen.writeFieldName(
+ name + StringUtils.prependIfMissing(version.getJSONMap().get(ODataServiceVersion.JSON_TYPE), "@"));
+ jgen.writeString(new EdmTypeInfo.Builder().setTypeExpression(type).build().external(version));
+ }
}
jgen.writeFieldName(name);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/45673e8e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataPrimitiveValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataPrimitiveValue.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataPrimitiveValue.java
index a18971f..db36cca 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataPrimitiveValue.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataPrimitiveValue.java
@@ -162,6 +162,11 @@ public abstract class AbstractODataPrimitiveValue extends AbstractODataValue imp
return setType(EdmPrimitiveTypeKind.Guid).setValue(value).build();
}
+ @Override
+ public ODataPrimitiveValue buildBinary(final byte[] value) {
+ return setType(EdmPrimitiveTypeKind.Binary).setValue(value).build();
+ }
+
}
/**