You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2015/07/10 10:56:48 UTC
olingo-odata4 git commit: [OLINGO-570] JsonMetadatadocument
serializer part4
Repository: olingo-odata4
Updated Branches:
refs/heads/jsonMetadata 6d3aeecb5 -> 6e8c30a97
[OLINGO-570] JsonMetadatadocument serializer part4
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/6e8c30a9
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/6e8c30a9
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/6e8c30a9
Branch: refs/heads/jsonMetadata
Commit: 6e8c30a9719af7afd3f0a592d8d3299ef07f4841
Parents: 6d3aeec
Author: Christian Amend <ch...@sap.com>
Authored: Fri Jul 10 10:51:51 2015 +0200
Committer: Christian Amend <ch...@sap.com>
Committed: Fri Jul 10 10:51:51 2015 +0200
----------------------------------------------------------------------
.../json/MetadataDocumentJsonSerializer.java | 2 +-
.../serializer/json/ODataJsonSerializer.java | 3 +-
.../MetadataDocumentJsonSerializerTest.java | 233 +++------
.../json/MetadataDocumentJsonTest.java | 484 ++++++-------------
4 files changed, 211 insertions(+), 511 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6e8c30a9/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java
index de8bbd0..6d6875c 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java
@@ -114,7 +114,7 @@ public class MetadataDocumentJsonSerializer {
gen.writeStartObject();
gen.writeObjectField(CONSTANT_SCHEMA, DEFAULT_SCHEMA);
appendDefinitions(gen);
- appendSchemas(gen);
+ appendSchemas(gen);
appendReference(gen);
gen.writeEndObject();
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6e8c30a9/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
index d1da05a..c845c0e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
@@ -117,8 +117,7 @@ public class ODataJsonSerializer implements ODataSerializer {
JsonGenerator gen = null;
try {
buffer = new CircleStreamBuffer();
- gen = new JsonFactory().createGenerator(buffer.getOutputStream())
- .setPrettyPrinter(new DefaultPrettyPrinter());
+ gen = new JsonFactory().createGenerator(buffer.getOutputStream());
new MetadataDocumentJsonSerializer(serviceMetadata).writeMetadataDocument(gen);
gen.close();
return SerializerResultImpl.with().content(buffer.getInputStream()).build();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6e8c30a9/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializerTest.java
index 783475d..bd72810 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializerTest.java
@@ -34,12 +34,14 @@ import org.apache.olingo.server.api.serializer.SerializerException;
import org.apache.olingo.server.core.ServiceMetadataImpl;
import org.junit.BeforeClass;
import org.junit.Test;
+
import java.io.InputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -61,9 +63,8 @@ public class MetadataDocumentJsonSerializerTest {
ServiceMetadata metadata = mock(ServiceMetadata.class);
when(metadata.getEdm()).thenReturn(edm);
String resultString = IOUtils.toString(serializer.metadataDocument(metadata).getContent());
- String expectedString = "{\n" +
- " \"$schema\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#\"\n" +
- "}";
+ String expectedString = "{\"$schema\":\"http://docs.oasis-open.org/odata/odata-json-csdl/" +
+ "v4.0/edm.json#\"}";
assertEquals(expectedString, resultString);
}
@@ -77,15 +78,9 @@ public class MetadataDocumentJsonSerializerTest {
when(serviceMetadata.getEdm()).thenReturn(edm);
InputStream metadata = serializer.metadataDocument(serviceMetadata).getContent();
String resultString = IOUtils.toString(metadata);
- String expectedString = "{\n" +
- " \"$schema\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#\",\n" +
- " \"definitions\" : { },\n" +
- " \"schemas\" : {\n" +
- " \"MyNamespace\" : {\n" +
- " \"alias\" : null\n" +
- " }\n" +
- " }\n" +
- "}";
+ String expectedString = "{\"$schema\":\"http://docs.oasis-open.org/odata/odata-json-csdl/" +
+ "v4.0/edm.json#\",\"definitions\":{},\"schemas\":{\"MyNamespace\":" +
+ "{\"alias\":null}}}";
assertNotNull(metadata);
assertEquals(expectedString, resultString);
}
@@ -149,170 +144,74 @@ public class MetadataDocumentJsonSerializerTest {
assertNotNull(metadata);
final String resultString = IOUtils.toString(metadata);
- assertTrue(resultString.contains("\"http://example.com\" : { }"));
- assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/referenceWithInclude\" : {\n" +
- " \"includes\" : {\n" +
- " \"Org.OData.Core.V1\" : {\n" +
- " \"alias\" : \"Core\"\n" +
- " }\n" +
- " }\n" +
- " }"));
- assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/referenceWithTwoIncludes\" : {\n" +
- " \"includes\" : {\n" +
- " \"Org.OData.Core.2\" : {\n" +
- " \"alias\" : \"Core2\"\n" +
- " },\n" +
- " \"Org.OData.Core.3\" : {\n" +
- " \"alias\" : \"Core3\"\n" +
- " }\n" +
- " }\n" +
- " }"));
- assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/referenceWithIncludeAnnos\" : {\n" +
- " \"includeAnnotations\" : [ {\n" +
- " \"termNamespace\" : \"TermNs.2\",\n" +
- " \"qualifier\" : \"Q.2\",\n" +
- " \"targetNamespace\" : \"TargetNS.2\"\n" +
- " }, {\n" +
- " \"termNamespace\" : \"TermNs.3\",\n" +
- " \"qualifier\" : \"Q.3\",\n" +
- " \"targetNamespace\" : \"TargetNS.3\"\n" +
- " } ]\n" +
- " }"));
- assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/referenceWithAll\" : {\n" +
- " \"includes\" : {\n" +
- " \"ReferenceWithAll.1\" : {\n" +
- " \"alias\" : \"Core1\"\n" +
- " },\n" +
- " \"ReferenceWithAll.2\" : {\n" +
- " \"alias\" : \"Core2\"\n" +
- " }\n" +
- " },\n" +
- " \"includeAnnotations\" : [ {\n" +
- " \"termNamespace\" : \"ReferenceWithAllTermNs.4\",\n" +
- " \"qualifier\" : \"Q.4\",\n" +
- " \"targetNamespace\" : \"TargetNS.4\"\n" +
- " }, {\n" +
- " \"termNamespace\" : \"ReferenceWithAllTermNs.5\",\n" +
- " \"qualifier\" : \"Q.5\",\n" +
- " \"targetNamespace\" : \"TargetNS.5\"\n" +
- " } ]\n" +
- " }"));
- assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/referenceWithAllAndNull\" : {\n" +
- " \"includes\" : {\n" +
- " \"referenceWithAllAndNull.1\" : { },\n" +
- " \"referenceWithAllAndNull.2\" : { }\n" +
- " },\n" +
- " \"includeAnnotations\" : [ {\n" +
- " \"termNamespace\" : \"ReferenceWithAllTermNs.4\"\n" +
- " }, {\n" +
- " \"termNamespace\" : \"ReferenceWithAllTermAndNullNs.5\",\n" +
- " \"qualifier\" : \"Q.5\"\n" +
- " }, {\n" +
- " \"termNamespace\" : \"ReferenceWithAllTermAndNullNs.6\",\n" +
- " \"targetNamespace\" : \"TargetNS\"\n" +
- " }, {\n" +
- " \"termNamespace\" : \"ReferenceWithAllTermAndNullNs.7\"\n" +
- " } ]\n" +
- " }"));
+ assertTrue(resultString.contains("\"http://example.com\":{}"));
+ assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/" +
+ "referenceWithInclude\":{\"includes\":{\"Org.OData.Core.V1\":" +
+ "{\"alias\":\"Core\"}}}"));
+ assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/" +
+ "referenceWithTwoIncludes\":{\"includes\":{\"Org.OData.Core.2\":" +
+ "{\"alias\":\"Core2\"},\"Org.OData.Core.3\":{\"alias\":\"Core3\"}}}"));
+ assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/" +
+ "referenceWithIncludeAnnos\":{\"includeAnnotations\":[{\"termNamespace\":" +
+ "\"TermNs.2\",\"qualifier\":\"Q.2\",\"targetNamespace\":\"TargetNS.2\"}," +
+ "{\"termNamespace\":\"TermNs.3\",\"qualifier\":\"Q.3\",\"" +
+ "targetNamespace\":\"TargetNS.3\"}]}"));
+ assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/referenceWithAll\":" +
+ "{\"includes\":{\"ReferenceWithAll.1\":{\"alias\":\"Core1\"}," +
+ "\"ReferenceWithAll.2\":{\"alias\":\"Core2\"}},\"" +
+ "includeAnnotations\":[{\"termNamespace\":\"ReferenceWithAllTermNs.4\"," +
+ "\"qualifier\":\"Q.4\",\"targetNamespace\":\"TargetNS.4\"}," +
+ "{\"termNamespace\":\"ReferenceWithAllTermNs.5\"," +
+ "\"qualifier\":\"Q.5\",\"targetNamespace\":\"TargetNS.5\"}]}"));
+ assertTrue(resultString.contains("\"http://localhost/odata/odata/v4.0/" +
+ "referenceWithAllAndNull\":{\"includes\":{\"referenceWithAllAndNull.1\":{}," +
+ "\"referenceWithAllAndNull.2\":{}},\"includeAnnotations\":" +
+ "[{\"termNamespace\":\"ReferenceWithAllTermNs.4\"},{\"termNamespace\":" +
+ "\"ReferenceWithAllTermAndNullNs.5\",\"qualifier\":\"Q.5\"}," +
+ "{\"termNamespace\":\"ReferenceWithAllTermAndNullNs.6\"," +
+ "\"targetNamespace\":\"TargetNS\"},{\"termNamespace\":" +
+ "\"ReferenceWithAllTermAndNullNs.7\"}]}}"));
assertTrue(resultString.contains("\"references\""));
}
@Test
public void metadataDocumentJsonTest() throws Exception {
CsdlEdmProvider provider = new LocalProvider();
- ServiceMetadata serviceMetadata = new ServiceMetadataImpl(provider, Collections.<EdmxReference> emptyList());
+ ServiceMetadata serviceMetadata = new ServiceMetadataImpl(provider, Collections.<EdmxReference>emptyList());
InputStream metadataStream = serializer.metadataDocument(serviceMetadata).getContent();
String metadata = IOUtils.toString(metadataStream);
assertNotNull(metadata);
- assertTrue(metadata.contains("\"namespace.ENString\" : {\n" +
- " \"enum\" : [ \"String1\" ],\n" +
- " \"String1@odata.value\" : \"1\"\n" +
- " }"));
- assertTrue(metadata.contains("\"namespace.ETAbstract\" : {\n" +
- " \"type\" : \"object\",\n" +
- " \"abstract\" : true,\n" +
- " \"properties\" : {\n" +
- " \"PropertyString\" : {\n" +
- " \"type\" : [ \"string\", null ]\n" +
- " }\n" +
- " }\n" +
- " }"));
- assertTrue(metadata.contains("\"namespace.ETAbstractBase\" : {\n" +
- " \"type\" : \"object\",\n" +
- " \"allOf\" : [ {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/namespace.ETAbstract\"\n" +
- " } ],\n" +
- " \"keys\" : [ {\n" +
- " \"name\" : \"PropertyInt16\"\n" +
- " } ],\n" +
- " \"properties\" : {\n" +
- " \"PropertyInt16\" : {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/Edm.Int16\"\n" +
- " }\n" +
- " }\n" +
- " }"));
- assertTrue(metadata.contains(" \"namespace.CTTwoPrim\" : {\n" +
- " \"type\" : \"object\",\n" +
- " \"properties\" : {\n" +
- " \"PropertyInt16\" : {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/Edm.Int16\"\n" +
- " },\n" +
- " \"PropertyString\" : {\n" +
- " \"type\" : [ \"string\", null ]\n" +
- " }\n" +
- " }\n" +
- " }"));
- assertTrue(metadata.contains("\"namespace.CTTwoPrimBase\" : {\n" +
- " \"type\" : \"object\",\n" +
- " \"allOf\" : [ {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/namespace.CTTwoPrim\"\n" +
- " } ],\n" +
- " \"properties\" : { }\n" +
- " }"));
- assertTrue(metadata.contains("\"actions\" : [ {\n" +
- " \"name\" : \"UARTPrimParam\",\n" +
- " \"isBound\" : false,\n" +
- " \"parameters\" : {\n" +
- " \"ParameterInt16\" : {\n" +
- " \"type\" : \"Edm.Int16\"\n" +
- " }\n" +
- " },\n" +
- " \"returnType\" : {\n" +
- " \"type\" : \"Edm.String\"\n" +
- " }\n" +
- " } ]"));
- assertTrue(metadata.contains("\"functions\" : [ {\n" +
- " \"name\" : \"UFNRTInt16\",\n" +
- " \"parameters\" : { },\n" +
- " \"returnType\" : {\n" +
- " \"type\" : \"Edm.Int16\"\n" +
- " }\n" +
- " } ]"));
- assertTrue(metadata.contains("\"entitySets\" : {\n" +
- " \"ESAllPrim\" : {\n" +
- " \"entityType\" : \"Alias.ETAbstractBase\"\n" +
- " }\n" +
- " }"));
- assertTrue(metadata.contains("\"actionImports\" : {\n" +
- " \"AIRTPrimParam\" : {\n" +
- " \"action\" : \"Alias.UARTPrimParam\"\n" +
- " }\n" +
- " }"));
- assertTrue(metadata.contains("\"functionImports\" : {\n" +
- " \"FINRTInt16\" : {\n" +
- " \"function\" : \"Alias.UFNRTInt16\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " }\n" +
- " }"));
- assertTrue(metadata.contains("\"singletons\" : {\n" +
- " \"SI\" : {\n" +
- " \"type\" : \"Alias.ETAbstractBase\"\n" +
- " }\n" +
- " }"));
+ assertTrue(metadata.contains("\"namespace.ENString\":{\"enum\":[\"String1\"]," +
+ "\"String1@odata.value\":\"1\"}"));
+ assertTrue(metadata.contains("\"namespace.ETAbstract\":{\"type\":\"object\"," +
+ "\"abstract\":true,\"properties\":{\"PropertyString\":" +
+ "{\"type\":[\"string\",null]}}}"));
+ assertTrue(metadata.contains("\"namespace.ETAbstractBase\":{\"type\":\"object\"," +
+ "\"allOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/" +
+ "edm.json#/definitions/namespace.ETAbstract\"}]," +
+ "\"keys\":[{\"name\":\"PropertyInt16\"}],\"properties\":" +
+ "{\"PropertyInt16\":{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/" +
+ "v4.0/edm.json#/definitions/Edm.Int16\"}}}"));
+ assertTrue(metadata.contains("\"namespace.CTTwoPrim\":{\"type\":\"object\"," +
+ "\"properties\":{\"PropertyInt16\":{\"$ref\":\"http://docs.oasis-open.org/odata/" +
+ "odata-json-csdl/v4.0/edm.json#/definitions/Edm.Int16\"}," +
+ "\"PropertyString\":{\"type\":[\"string\",null]}}}"));
+ assertTrue(metadata.contains("\"namespace.CTTwoPrimBase\":{\"type\":\"object\"," +
+ "\"allOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/" +
+ "edm.json#/definitions/namespace.CTTwoPrim\"}],\"properties\":{}}"));
+ assertTrue(metadata.contains("\"actions\":[{\"name\":\"UARTPrimParam\",\"isBound\"" +
+ ":false,\"parameters\":{\"ParameterInt16\":{\"type\":\"Edm.Int16\"}}," +
+ "\"returnType\":{\"type\":\"Edm.String\"}}]"));
+ assertTrue(metadata.contains("\"functions\":[{\"name\":\"UFNRTInt16\",\"parameters\":{}," +
+ "\"returnType\":{\"type\":\"Edm.Int16\"}}]"));
+ assertTrue(metadata.contains("\"entitySets\":{\"ESAllPrim\":{\"entityType\":" +
+ "\"Alias.ETAbstractBase\"}}"));
+ assertTrue(metadata.contains("\"actionImports\":{\"AIRTPrimParam\":" +
+ "{\"action\":\"Alias.UARTPrimParam\"}}"));
+ assertTrue(metadata.contains("\"functionImports\":{\"FINRTInt16\":{\"function\":" +
+ "\"Alias.UFNRTInt16\",\"includeInServiceDocument\":true}}"));
+ assertTrue(metadata.contains("\"singletons\":{\"SI\":{\"type\":" +
+ "\"Alias.ETAbstractBase\"}}"));
}
private class LocalProvider extends CsdlAbstractEdmProvider {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6e8c30a9/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonTest.java
index d36bff2..8ef17fe 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonTest.java
@@ -52,381 +52,183 @@ public class MetadataDocumentJsonTest {
assertNotNull(metadata);
String expectedString;
- expectedString="\"$schema\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#\"";
- assertThat(metadata, containsString(expectedString));
-
- expectedString=
- "\"olingo.odata.test1.ENString\" : {\n" +
- " \"enum\" : [ \"String1\", \"String2\", \"String3\" ],\n" +
- " \"String1@odata.value\" : \"1\",\n" +
- " \"String2@odata.value\" : \"2\",\n" +
- " \"String3@odata.value\" : \"4\"\n" +
- " }";
+ expectedString="\"$schema\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#\"";
+ assertThat(metadata, containsString(expectedString));
+
+
+ expectedString="\"olingo.odata.test1.ENString\":{\"enum\":[\"String1\",\"String2\",\"String3\"]," +
+ "\"String1@odata.value\":\"1\",\"String2@odata.value\":\"2\",\"String3@odata.value\":\"4\"}";
+ assertThat(metadata, containsString(expectedString));
+
+
+ expectedString="\"olingo.odata.test1.TDString\":{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/" +
+ "v4.0/edm.json#/definitions/Edm.String\",\"maxLength\":15}";
+ assertThat(metadata, containsString(expectedString));
+
+
+ expectedString="\"PropertyDecimal\":{\"anyOf\":[{\"type\":\"number\",\"multipleOf\":1.0E-10},{\"type\":null}]}";
+ assertThat(metadata, containsString(expectedString));
+
+ expectedString="\"CollPropertyDouble\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":" +
+ "\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/Edm.Double\"}," +
+ "{\"type\":null}]}}";
+ assertThat(metadata, containsString(expectedString));
+
+ expectedString="\"CollPropertyDecimal\":{\"type\":\"array\",\"items\":{\"anyOf\":" +
+ "[{\"type\":\"number\"},{\"type\":null}]}}";
+ assertThat(metadata, containsString(expectedString));
+
+ expectedString="\"CollPropertyBinary\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":" +
+ "\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/Edm.Binary\"}," +
+ "{\"type\":null}]}}";
+ assertThat(metadata, containsString(expectedString));
+
+ expectedString="\"olingo.odata.test1.ETAllPrim\":{\"type\":\"object\",\"keys\":[{\"name\":\"PropertyInt16\"}]" +
+ ",\"properties\":{\"PropertyInt16\":{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/" +
+ "v4.0/edm.json#/definitions/Edm.Int16\"},\"PropertyString\":{\"type\":[\"string\",null]}," +
+ "\"PropertyBoolean\":{\"type\":[\"boolean\",null]},\"PropertyByte\":{\"anyOf\":" +
+ "[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/Edm.Byte\"}" +
+ ",{\"type\":null}]},\"PropertySByte\":{\"anyOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/" +
+ "odata-json-csdl/v4.0/edm.json#/definitions/Edm.SByte\"},{\"type\":null}]}," +
+ "\"PropertyInt32\":{\"anyOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/" +
+ "v4.0/edm.json#/definitions/Edm.Int32\"},{\"type\":null}]},\"PropertyInt64\":" +
+ "{\"anyOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/" +
+ "edm.json#/definitions/Edm.Int64\"},{\"type\":null}]},\"PropertySingle\":" +
+ "{\"anyOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
+ "definitions/Edm.Single\"},{\"type\":null}]},\"PropertyDouble\":" +
+ "{\"anyOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
+ "definitions/Edm.Double\"},{\"type\":null}]},\"PropertyDecimal\":{\"anyOf\":" +
+ "[{\"type\":\"number\",\"multipleOf\":1.0E-10},{\"type\":null}]},\"PropertyBinary\":" +
+ "{\"anyOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
+ "definitions/Edm.Binary\"},{\"type\":null}]},\"PropertyDate\":{\"anyOf\":" +
+ "[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/" +
+ "Edm.Date\"},{\"type\":null}]},\"PropertyDateTimeOffset\":{\"anyOf\":" +
+ "[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/" +
+ "Edm.DateTimeOffset\"},{\"pattern\":\"^[^.]*$\"}]},\"PropertyDuration\":{\"anyOf\":[{\"$ref\":" +
+ "\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/Edm.Duration\"}," +
+ "{\"pattern\":\"^[^.]*$\"}]},\"PropertyGuid\":{\"anyOf\":[{\"$ref\":\"http://docs.oasis-open.org/" +
+ "odata/odata-json-csdl/v4.0/edm.json#/definitions/Edm.Guid\"},{\"type\":null}]}," +
+ "\"PropertyTimeOfDay\":{\"anyOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/" +
+ "v4.0/edm.json#/definitions/Edm.TimeOfDay\"},{\"pattern\":\"^[^.]*$\"}]},\"NavPropertyETTwoPrimOne\"" +
+ ":{\"$ref\":\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/" +
+ "olingo.odata.test1.ETTwoPrim\",\"relationship\":{\"referentialConstraints\":{}}}," +
+ "\"NavPropertyETTwoPrimMany\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":" +
+ "\"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/" +
+ "olingo.odata.test1.ETTwoPrim\"},{\"type\":null}]},\"relationship\":{\"referentialConstraints\":{}}}}";
assertThat(metadata, containsString(expectedString));
+ expectedString="\"functionImports\":{\"FINRTInt16\":{\"function\":\"Namespace1_Alias.UFNRTInt16\"," +
+ "\"includeInServiceDocument\":true},\"FINInvisibleRTInt16\":{\"function\":" +
+ "\"Namespace1_Alias.UFNRTInt16\"},\"FINInvisible2RTInt16\":{\"function\":" +
+ "\"Namespace1_Alias.UFNRTInt16\"},\"FICRTETKeyNav\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTETKeyNav\"},\"FICRTESTwoKeyNav\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTETTwoKeyNav\",\"entitySet\":\"Namespace1_Alias.ESTwoKeyNav\"," +
+ "\"includeInServiceDocument\":true},\"FICRTETTwoKeyNavParam\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTETTwoKeyNavParam\",\"includeInServiceDocument\":true}," +
+ "\"FICRTStringTwoParam\":{\"function\":\"Namespace1_Alias.UFCRTStringTwoParam\"," +
+ "\"includeInServiceDocument\":true},\"FICRTCollStringTwoParam\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTCollStringTwoParam\",\"includeInServiceDocument\":true}," +
+ "\"FICRTCTAllPrimTwoParam\":{\"function\":\"Namespace1_Alias.UFCRTCTAllPrimTwoParam\"," +
+ "\"includeInServiceDocument\":true},\"FICRTESMixPrimCollCompTwoParam\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTESMixPrimCollCompTwoParam\",\"includeInServiceDocument\":true}," +
+ "\"FICRTCollETMixPrimCollCompTwoParam\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTCollETMixPrimCollCompTwoParam\",\"includeInServiceDocument\":true}," +
+ "\"FINRTCollETMixPrimCollCompTwoParam\":{\"function\":" +
+ "\"Namespace1_Alias.UFNRTCollETMixPrimCollCompTwoParam\",\"includeInServiceDocument\":true}," +
+ "\"FICRTCollCTTwoPrim\":{\"function\":\"Namespace1_Alias.UFCRTCollCTTwoPrim\"," +
+ "\"includeInServiceDocument\":true},\"FICRTESMedia\":{\"function\":\"Namespace1_Alias.UFCRTETMedia\"" +
+ ",\"entitySet\":\"Namespace1_Alias.ESMedia\",\"includeInServiceDocument\":true}," +
+ "\"FICRTCollESMedia\":{\"function\":\"Namespace1_Alias.UFCRTCollETMedia\"," +
+ "\"entitySet\":\"Namespace1_Alias.ESMedia\",\"includeInServiceDocument\":true}," +
+ "\"FICRTCTTwoPrimParam\":{\"function\":\"Namespace1_Alias.UFCRTCTTwoPrimParam\"," +
+ "\"includeInServiceDocument\":true},\"FICRTCTTwoPrim\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTCTTwoPrim\",\"includeInServiceDocument\":true}," +
+ "\"FICRTCollString\":{\"function\":\"Namespace1_Alias.UFCRTCollString\"," +
+ "\"includeInServiceDocument\":true},\"FICRTString\":{\"function\":\"Namespace1_Alias.UFCRTString\"," +
+ "\"includeInServiceDocument\":true},\"FICRTCollESTwoKeyNavParam\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTCollETTwoKeyNavParam\",\"entitySet\":\"Namespace1_Alias.ESTwoKeyNav\"," +
+ "\"includeInServiceDocument\":true},\"FICRTCollCTTwoPrimParam\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTCollCTTwoPrimParam\",\"includeInServiceDocument\":true}," +
+ "\"FINRTCollCTNavFiveProp\":{\"function\":\"Namespace1_Alias.UFNRTCollCTNavFiveProp\"," +
+ "\"includeInServiceDocument\":true},\"FICRTCollESKeyNavContParam\":{\"function\":" +
+ "\"Namespace1_Alias.UFCRTCollETKeyNavContParam\",\"entitySet\":" +
+ "\"Namespace1_Alias.ESKeyNavCont\",\"includeInServiceDocument\":true}}";
+ assertThat(metadata, containsString(expectedString));
- expectedString="\"olingo.odata.test1.TDString\" : {\n" +" \"$ref\" : \"http://docs.oasis-open.org/odata/" +
- "odata-json-csdl/v4.0/edm.json#/definitions/Edm.String\",\n" +
- " \"maxLength\" : 15\n" +
- " }";
-
+ expectedString="\"actionImports\":{\"AIRTString\":{\"action\":\"Namespace1_Alias.UARTString\"}," +
+ "\"AIRTCollStringTwoParam\":{\"action\":\"Namespace1_Alias.UARTCollStringTwoParam\"}," +
+ "\"AIRTCTTwoPrimParam\":{\"action\":\"Namespace1_Alias.UARTCTTwoPrimParam\"}," +
+ "\"AIRTCollCTTwoPrimParam\":{\"action\":\"Namespace1_Alias.UARTCollCTTwoPrimParam\"}," +
+ "\"AIRTETTwoKeyTwoPrimParam\":{\"action\":\"Namespace1_Alias.UARTETTwoKeyTwoPrimParam\"}," +
+ "\"AIRTCollETKeyNavParam\":{\"action\":\"Namespace1_Alias.UARTCollETKeyNavParam\"}," +
+ "\"AIRTESAllPrimParam\":{\"action\":\"Namespace1_Alias.UARTETAllPrimParam\"}," +
+ "\"AIRTCollESAllPrimParam\":{\"action\":\"Namespace1_Alias.UARTCollETAllPrimParam\"}," +
+ "\"AIRT\":{\"action\":\"Namespace1_Alias.UART\"},\"AIRTParam\":{\"action\":" +
+ "\"Namespace1_Alias.UARTParam\"},\"AIRTTwoParam\":{\"action\":\"Namespace1_Alias.UARTTwoParam\"}}";
assertThat(metadata, containsString(expectedString));
+ expectedString="\"singletons\":{\"SI\":{\"type\":\"Namespace1_Alias.ETTwoPrim\"},\"SINav\":{\"type\":" +
+ "\"Namespace1_Alias.ETTwoKeyNav\",\"navigationPropertyBindings\":{\"NavPropertyETTwoKeyNavMany\":" +
+ "{\"target\":\"ESTwoKeyNav\"},\"NavPropertyETTwoKeyNavOne\":{\"target\":\"ESTwoKeyNav\"}," +
+ "\"NavPropertyETKeyNavOne\":{\"target\":\"ESKeyNav\"}}},\"SIMedia\":{\"type\":" +
+ "\"Namespace1_Alias.ETMedia\"}}}}}";
+ assertThat(metadata, containsString(expectedString));
- expectedString=
- " \"references\" : {\n" +
- " \"http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/Org.OData.Core.V1.xml\" : {\n" +
- " \"includes\" : {\n" +
- " \"Org.OData.Core.V1\" : {\n" +
- " \"alias\" : \"Core\"\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }";
+ expectedString="{\"name\":\"UFCRTETKeyNav\",\"isComposable\":true,\"parameters\":{},\"returnType\":{\"type\"" +
+ ":\"Namespace1_Alias.ETKeyNav\",\"nullable\":false}}";
assertThat(metadata, containsString(expectedString));
- expectedString=
- "\"singletons\" : {\n" +
- " \"SI\" : {\n" +
- " \"type\" : \"Namespace1_Alias.ETTwoPrim\"\n" +
- " },\n" +
- " \"SINav\" : {\n" +
- " \"type\" : \"Namespace1_Alias.ETTwoKeyNav\",\n" +
- " \"navigationPropertyBindings\" : {\n" +
- " \"NavPropertyETTwoKeyNavMany\" : {\n" +
- " \"target\" : \"ESTwoKeyNav\"\n" +
- " },\n" +
- " \"NavPropertyETTwoKeyNavOne\" : {\n" +
- " \"target\" : \"ESTwoKeyNav\"\n" +
- " },\n" +
- " \"NavPropertyETKeyNavOne\" : {\n" +
- " \"target\" : \"ESKeyNav\"\n" +
- " }\n" +
- " }\n" +
- " },\n" +
- " \"SIMedia\" : {\n" +
- " \"type\" : \"Namespace1_Alias.ETMedia\"\n" +
- " }\n" +
- " }";
+ expectedString="{\"name\":\"BAETTwoKeyNavRTETTwoKeyNav\",\"isBound\":true,\"parameters\":" +
+ "{\"ParameterETTwoKeyNav\":{\"type\":\"Namespace1_Alias.ETTwoKeyNav\",\"nullable\":false}}," +
+ "\"returnType\":{\"type\":\"Namespace1_Alias.ETTwoKeyNav\"}}";
assertThat(metadata, containsString(expectedString));
- expectedString=
- " \"actionImports\" : {\n" +
- " \"AIRTString\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTString\"\n" +
- " },\n" +
- " \"AIRTCollStringTwoParam\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTCollStringTwoParam\"\n" +
- " },\n" +
- " \"AIRTCTTwoPrimParam\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTCTTwoPrimParam\"\n" +
- " },\n" +
- " \"AIRTCollCTTwoPrimParam\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTCollCTTwoPrimParam\"\n" +
- " },\n" +
- " \"AIRTETTwoKeyTwoPrimParam\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTETTwoKeyTwoPrimParam\"\n" +
- " },\n" +
- " \"AIRTCollETKeyNavParam\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTCollETKeyNavParam\"\n" +
- " },\n" +
- " \"AIRTESAllPrimParam\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTETAllPrimParam\"\n" +
- " },\n" +
- " \"AIRTCollESAllPrimParam\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTCollETAllPrimParam\"\n" +
- " },\n" +
- " \"AIRT\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UART\"\n" +
- " },\n" +
- " \"AIRTParam\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTParam\"\n" +
- " },\n" +
- " \"AIRTTwoParam\" : {\n" +
- " \"action\" : \"Namespace1_Alias.UARTTwoParam\"\n" +
- " }\n" +
- " }";
+ expectedString="\"ESAllPrim\":{\"entityType\":\"Namespace1_Alias.ETAllPrim\",\"navigationPropertyBindings\"" +
+ ":{\"NavPropertyETTwoPrimOne\":{\"target\":\"ESTwoPrim\"},\"NavPropertyETTwoPrimMany\"" +
+ ":{\"target\":\"ESTwoPrim\"}}}";
assertThat(metadata, containsString(expectedString));
+ expectedString="\"references\":{\"http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/" +
+ "Org.OData.Core.V1.xml\":{\"includes\":{\"Org.OData.Core.V1\":{\"alias\":\"Core\"}}}}";
+ assertThat(metadata, containsString(expectedString));
- expectedString=
- "\"functionImports\" : {\n" +
- " \"FINRTInt16\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFNRTInt16\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FINInvisibleRTInt16\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFNRTInt16\"\n" +
- " },\n" +
- " \"FINInvisible2RTInt16\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFNRTInt16\"\n" +
- " },\n" +
- " \"FICRTETKeyNav\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTETKeyNav\"\n" +
- " },\n" +
- " \"FICRTESTwoKeyNav\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTETTwoKeyNav\",\n" +
- " \"entitySet\" : \"Namespace1_Alias.ESTwoKeyNav\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTETTwoKeyNavParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTETTwoKeyNavParam\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTStringTwoParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTStringTwoParam\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCollStringTwoParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCollStringTwoParam\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCTAllPrimTwoParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCTAllPrimTwoParam\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTESMixPrimCollCompTwoParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTESMixPrimCollCompTwoParam\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCollETMixPrimCollCompTwoParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCollETMixPrimCollCompTwoParam\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FINRTCollETMixPrimCollCompTwoParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFNRTCollETMixPrimCollCompTwoParam\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCollCTTwoPrim\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCollCTTwoPrim\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTESMedia\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTETMedia\",\n" +
- " \"entitySet\" : \"Namespace1_Alias.ESMedia\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCollESMedia\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCollETMedia\",\n" +
- " \"entitySet\" : \"Namespace1_Alias.ESMedia\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCTTwoPrimParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCTTwoPrimParam\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCTTwoPrim\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCTTwoPrim\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCollString\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCollString\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTString\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTString\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCollESTwoKeyNavParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCollETTwoKeyNavParam\",\n" +
- " \"entitySet\" : \"Namespace1_Alias.ESTwoKeyNav\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCollCTTwoPrimParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCollCTTwoPrimParam\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FINRTCollCTNavFiveProp\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFNRTCollCTNavFiveProp\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " },\n" +
- " \"FICRTCollESKeyNavContParam\" : {\n" +
- " \"function\" : \"Namespace1_Alias.UFCRTCollETKeyNavContParam\",\n" +
- " \"entitySet\" : \"Namespace1_Alias.ESKeyNavCont\",\n" +
- " \"includeInServiceDocument\" : true\n" +
- " }\n" +
- " }";
+ expectedString="\"olingo.odata.test1.ETMedia\":{\"type\":\"object\",\"hasStream\":true,\"keys\":" +
+ "[{\"name\":\"PropertyInt16\"}],\"properties\":{\"PropertyInt16\":{\"$ref\":\"" +
+ "http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/Edm.Int16\"}}}";
assertThat(metadata, containsString(expectedString));
- expectedString=
- "\"ESTwoPrim\" : {\n" +
- " \"entityType\" : \"Namespace1_Alias.ETTwoPrim\",\n" +
- " \"navigationPropertyBindings\" : {\n" +
- " \"NavPropertyETAllPrimOne\" : {\n" +
- " \"target\" : \"ESAllPrim\"\n" +
- " },\n" +
- " \"NavPropertyETAllPrimMany\" : {\n" +
- " \"target\" : \"ESAllPrim\"\n" +
- " }\n" +
- " }\n" +
- " }";
+ expectedString="\"PropertyDecimal\":{\"anyOf\":[{\"type\":\"number\",\"multipleOf\":1.0E-5," +
+ "\"minimum\":-999999.99999,\"maximum\":999999.99999},{\"type\":null}]}";
assertThat(metadata, containsString(expectedString));
- expectedString=
- " {\n" +
- " \"name\" : \"UFCRTCollStringTwoParam\",\n" +
- " \"isComposable\" : true,\n" +
- " \"parameters\" : {\n" +
- " \"ParameterString\" : {\n" +
- " \"type\" : \"Edm.String\",\n" +
- " \"nullable\" : false\n" +
- " },\n" +
- " \"ParameterInt16\" : {\n" +
- " \"type\" : \"Edm.Int16\",\n" +
- " \"nullable\" : false\n" +
- " }\n" +
- " },\n" +
- " \"returnType\" : {\n" +
- " \"type\" : \"Collection(Edm.String)\",\n" +
- " \"nullable\" : false\n" +
- " }\n" +
- " }";
+ expectedString=",\"PropertyTimeOfDay\":{\"anyOf\":[{\"$ref\":\"http://docs.oasis-open.org/odata/" +
+ "odata-json-csdl/v4.0/edm.json#/definitions/Edm.TimeOfDay\"},{\"pattern\":\"^[^.]*$\"}]}";
assertThat(metadata, containsString(expectedString));
- expectedString=
- "{\n" +
- " \"name\" : \"BAESTwoKeyNavRTESKeyNav\",\n" +
- " \"entitySetPath\" : \"BindingParam/NavPropertyETKeyNavMany\",\n" +
- " \"isBound\" : true,\n" +
- " \"parameters\" : {\n" +
- " \"ParameterETTwoKeyNav\" : {\n" +
- " \"type\" : \"Collection(Namespace1_Alias.ETTwoKeyNav)\",\n" +
- " \"nullable\" : false\n" +
- " }\n" +
- " },\n" +
- " \"returnType\" : {\n" +
- " \"type\" : \"Collection(Namespace1_Alias.ETKeyNav)\"\n" +
- " }\n" +
- " }";
+ expectedString="\"schemas\"";
assertThat(metadata, containsString(expectedString));
- expectedString=
- "\"olingo.odata.test1.CTBasePrimCompNav\" : {\n" +
- " \"type\" : \"object\",\n" +
- " \"allOf\" : [ {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/olingo.odata.test1.CTPrimComp\"\n" +
- " } ],\n" +
- " \"properties\" : {\n" +
- " \"NavPropertyETTwoKeyNavMany\" : {\n" +
- " \"type\" : \"array\",\n" +
- " \"items\" : {\n" +
- " \"anyOf\" : [ {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/olingo.odata.test1.ETTwoKeyNav\"\n" +
- " }, {\n" +
- " \"type\" : null\n" +
- " } ]\n" +
- " },\n" +
- " \"relationship\" : {\n" +
- " \"partner\" : \"NavPropertyETKeyNavOne\",\n" +
- " \"referentialConstraints\" : { }\n" +
- " }\n" +
- " },\n" +
- " \"NavPropertyETTwoKeyNavOne\" : {\n" +
- " \"anyOf\" : [ {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/olingo.odata.test1.ETTwoKeyNav\"\n" +
- " }, {\n" +
- " \"type\" : null\n" +
- " } ],\n" +
- " \"relationship\" : {\n" +
- " \"referentialConstraints\" : { }\n" +
- " }\n" +
- " },\n" +
- " \"NavPropertyETKeyNavOne\" : {\n" +
- " \"anyOf\" : [ {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/olingo.odata.test1.ETKeyNav\"\n" +
- " }, {\n" +
- " \"type\" : null\n" +
- " } ],\n" +
- " \"relationship\" : {\n" +
- " \"referentialConstraints\" : { }\n" +
- " }\n" +
- " },\n" +
- " \"NavPropertyETKeyNavMany\" : {\n" +
- " \"type\" : \"array\",\n" +
- " \"items\" : {\n" +
- " \"anyOf\" : [ {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/olingo.odata.test1.ETKeyNav\"\n" +
- " }, {\n" +
- " \"type\" : null\n" +
- " } ]\n" +
- " },\n" +
- " \"relationship\" : {\n" +
- " \"referentialConstraints\" : { }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }";
+ expectedString="\"entityContainer\":{\"name\":\"Container\"";
assertThat(metadata, containsString(expectedString));
- expectedString=
- "\"olingo.odata.test1.ETMedia\" : {\n" +
- " \"type\" : \"object\",\n" +
- " \"hasStream\" : true,\n" +
- " \"keys\" : [ {\n" +
- " \"name\" : \"PropertyInt16\"\n" +
- " } ],\n" +
- " \"properties\" : {\n" +
- " \"PropertyInt16\" : {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/Edm.Int16\"\n" +
- " }\n" +
- " }\n" +
- " }";
+ expectedString="\"definitions\"";
assertThat(metadata, containsString(expectedString));
- expectedString=
- "\"PropertyDecimal\" : {\n" +
- " \"anyOf\" : [ {\n" +
- " \"type\" : \"number\",\n" +
- " \"multipleOf\" : 1.0E-5,\n" +
- " \"minimum\" : -999999.99999,\n" +
- " \"maximum\" : 999999.99999\n" +
- " }, {\n" +
- " \"type\" : null\n" +
- " } ]\n" +
- " }";
+ expectedString="\"actions\":[{";
assertThat(metadata, containsString(expectedString));
- expectedString=
- "\"CollPropertyDateTimeOffset\" : {\n" +
- " \"type\" : \"array\",\n" +
- " \"items\" : {\n" +
- " \"anyOf\" : [ {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/Edm.DateTimeOffset\"\n" +
- " }, {\n" +
- " \"pattern\" : \"^[^.]*$\"\n" +
- " } ]\n" +
- " }\n" +
- " }";
+ expectedString="\"functions\":[{";
assertThat(metadata, containsString(expectedString));
- expectedString=
- "\"entityContainer\" : {\n" +
- " \"name\" : \"Container\",";
+ expectedString="\"actionImports\":{";
assertThat(metadata, containsString(expectedString));
- expectedString=
- "\"olingo.odata.test1.ETTwoBase\" : {\n" +
- " \"type\" : \"object\",\n" +
- " \"allOf\" : [ {\n" +
- " \"$ref\" : \"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/" +
- "definitions/olingo.odata.test1.ETBase\"\n" +
- " } ],\n" +
- " \"properties\" : {\n" +
- " \"AdditionalPropertyString_6\" : {\n" +
- " \"type\" : [ \"string\", null ]\n" +
- " }\n" +
- " }\n" +
- " }";
+ expectedString="\"functionImports\":{";
assertThat(metadata, containsString(expectedString));
+ expectedString="\"entitySets\":{";
+ assertThat(metadata, containsString(expectedString));
}