You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2015/11/06 21:37:15 UTC
[2/7] olingo-odata4 git commit: [OLINGO-821] Verify Enum and TypeDef
support
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/639362ca/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
index 6f1c4ad..69458ab 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
@@ -6,9 +6,9 @@
* 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
@@ -72,33 +72,52 @@ public class TestFullResourcePath {
}
@Test
+ public void enumAndTypeDefAsKey() throws Exception {
+ testUri
+ .run("ESMixEnumDefCollComp(PropertyEnumString=olingo.odata.test1.ENString'String1',PropertyDefString='abc')")
+ .goPath()
+ .at(0)
+ .isEntitySet("ESMixEnumDefCollComp")
+ .isKeyPredicate(0, "PropertyEnumString", "olingo.odata.test1.ENString'String1'")
+ .isKeyPredicate(1, "PropertyDefString", "'abc'");
+
+ testUri
+ .run("ESMixEnumDefCollComp", "$filter=PropertyEnumString has Namespace1_Alias.ENString'String1'")
+ .goPath()
+ .at(0)
+ .isEntitySet("ESMixEnumDefCollComp")
+ .goUpUriValidator()
+ .goFilter().is("<<PropertyEnumString> has <olingo.odata.test1.ENString<String1>>>");
+ }
+
+ @Test
public void testFunctionBound_varOverloading() throws Exception {
// on ESTwoKeyNav
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
// with string parameter
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='ABC')").goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
// with string parameter
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
}
@Test
@@ -142,32 +161,32 @@ public class TestFullResourcePath {
@Test
public void runBfuncBnCpropCollRtEs() throws Exception {
testUri.run("ESKeyNav(PropertyInt16=1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isUriPathInfoKind(UriResourceKind.complexProperty)
- .isComplex("CollPropertyComp")
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .n()
- .isFunction("BFCCollCTPrimCompRTESAllPrim");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isUriPathInfoKind(UriResourceKind.complexProperty)
+ .isComplex("CollPropertyComp")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .n()
+ .isFunction("BFCCollCTPrimCompRTESAllPrim");
testUri
- .run("ESKeyNav(PropertyInt16=1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isUriPathInfoKind(UriResourceKind.complexProperty)
- .isComplex("CollPropertyComp")
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .n()
- .isFunction("BFCCollCTPrimCompRTESAllPrim")
- .isType(EntityTypeProvider.nameETAllPrim, true)
- .n()
- .isUriPathInfoKind(UriResourceKind.count);
+ .run("ESKeyNav(PropertyInt16=1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isUriPathInfoKind(UriResourceKind.complexProperty)
+ .isComplex("CollPropertyComp")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .n()
+ .isFunction("BFCCollCTPrimCompRTESAllPrim")
+ .isType(EntityTypeProvider.nameETAllPrim, true)
+ .n()
+ .isUriPathInfoKind(UriResourceKind.count);
}
@Test
@@ -208,20 +227,20 @@ public class TestFullResourcePath {
@Test
public void runBfuncBnEntityRtEs() throws Exception {
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isFunction("BFCETTwoKeyNavRTESTwoKeyNav");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isFunction("BFCETTwoKeyNavRTESTwoKeyNav");
}
@Test
public void runBfuncBnEntityCastRtEs() throws Exception {
testUri
- .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
- + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
+ .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+ + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
.isKind(UriInfoKind.resource).goPath()
.first()
.isEntitySet("ESTwoKeyNav")
@@ -233,8 +252,8 @@ public class TestFullResourcePath {
.isFunction("BFCETBaseTwoKeyNavRTESTwoKeyNav");
testUri
- .run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='(''2'')')"
- + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
+ .run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='(''2'')')"
+ + "/olingo.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
.isKind(UriInfoKind.resource).goPath()
.first()
.isEntitySet("ESTwoKeyNav")
@@ -259,8 +278,8 @@ public class TestFullResourcePath {
.isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey");
testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav"
- + "/olingo.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()"
- + "/olingo.odata.test1.ETTwoBaseTwoKeyNav")
+ + "/olingo.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()"
+ + "/olingo.odata.test1.ETTwoBaseTwoKeyNav")
.isKind(UriInfoKind.resource).goPath()
.first()
.isEntitySet("ESTwoKeyNav")
@@ -290,76 +309,76 @@ public class TestFullResourcePath {
@Test
public void runBfuncBnEsRtCprop() throws Exception {
testUri.run("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .n()
- .isFunction("BFNESAllPrimRTCTAllPrim")
- .isType(ComplexTypeProvider.nameCTAllPrim);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .n()
+ .isFunction("BFNESAllPrimRTCTAllPrim")
+ .isType(ComplexTypeProvider.nameCTAllPrim);
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()/olingo.odata.test1.CTBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCTTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim, false)
- .isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCTTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, false)
+ .isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase);
}
@Test
public void runBfuncBnEsRtCpropColl() throws Exception {
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, true);
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim, true)
- .n()
- .isUriPathInfoKind(UriResourceKind.count);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, true)
+ .n()
+ .isUriPathInfoKind(UriResourceKind.count);
}
@Test
public void runBfuncBnEsRtEntityPpNp() throws Exception {
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
- .n()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
- .n()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
- .n()
- .isUriPathInfoKind(UriResourceKind.ref);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+ .n()
+ .isUriPathInfoKind(UriResourceKind.ref);
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/NavPropertyETMediaOne/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
- .n()
- .isValue();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
+ .n()
+ .isValue();
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+ "/NavPropertyETTwoKeyNavOne")
@@ -432,9 +451,9 @@ public class TestFullResourcePath {
.isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
testUri.runEx("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(WrongParameter='1')")
- .isExSemantic(MessageKeys.UNKNOWN_PART);
+ .isExSemantic(MessageKeys.UNKNOWN_PART);
testUri.runEx("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString=wrong)")
- .isExSemantic(MessageKeys.INVALID_KEY_VALUE);
+ .isExSemantic(MessageKeys.INVALID_KEY_VALUE);
}
@Test
@@ -452,8 +471,8 @@ public class TestFullResourcePath {
.isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
testUri
- .run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')"
- + "/NavPropertyETTwoKeyNavOne/olingo.odata.test1.ETTwoBaseTwoKeyNav")
+ .run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')"
+ + "/NavPropertyETTwoKeyNavOne/olingo.odata.test1.ETTwoBaseTwoKeyNav")
.isKind(UriInfoKind.resource).goPath()
.first()
.isEntitySet("ESTwoKeyNav")
@@ -473,40 +492,40 @@ public class TestFullResourcePath {
public void runBfuncBnEsRtEntityPpCp() throws Exception {
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isComplex("PropertyCompNav")
- .isType(ComplexTypeProvider.nameCTNavFiveProp);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isComplex("PropertyCompNav")
+ .isType(ComplexTypeProvider.nameCTNavFiveProp);
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav/PropertyInt16")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isComplex("PropertyCompNav")
- .isType(ComplexTypeProvider.nameCTNavFiveProp)
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isComplex("PropertyCompNav")
+ .isType(ComplexTypeProvider.nameCTNavFiveProp)
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav/PropertyInt16/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isComplex("PropertyCompNav")
- .isType(ComplexTypeProvider.nameCTNavFiveProp)
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
- .n()
- .isValue();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isComplex("PropertyCompNav")
+ .isType(ComplexTypeProvider.nameCTNavFiveProp)
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
+ .n()
+ .isValue();
}
@@ -548,24 +567,24 @@ public class TestFullResourcePath {
@Test
public void runBfuncBnEsRtEntityPpSp() throws Exception {
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
- .n()
- .isValue();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
+ .n()
+ .isValue();
}
@@ -573,57 +592,57 @@ public class TestFullResourcePath {
public void runBfuncBnEsRtEs() throws Exception {
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isParameter(0, "ParameterString", "'2'")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isParameter(0, "ParameterString", "'2'")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
testUri.run("ESKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='3')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isParameter(0, "ParameterString", "'3'")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isParameter(0, "ParameterString", "'3'")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .n()
- .isCount();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .n()
+ .isCount();
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'");
}
@@ -649,165 +668,165 @@ public class TestFullResourcePath {
@Test
public void runBfuncBnEsRtPrim() throws Exception {
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTString()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTString");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTString");
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTString()/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTString")
- .isType(PropertyProvider.nameString)
- .n()
- .isValue();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTString")
+ .isType(PropertyProvider.nameString)
+ .n()
+ .isValue();
}
@Test
public void runbfuncBnEsRtPrimColl() throws Exception {
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollString()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCollString")
- .isType(PropertyProvider.nameString, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCollString")
+ .isType(PropertyProvider.nameString, true);
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCollString()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCollString")
- .isType(PropertyProvider.nameString, true)
- .n()
- .isCount();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCollString")
+ .isType(PropertyProvider.nameString, true)
+ .n()
+ .isCount();
}
@Test
public void runBfuncBnPpropCollRtEs() throws Exception {
testUri.run("ESKeyNav(1)/CollPropertyString/olingo.odata.test1.BFCCollStringRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
- .n()
- .isFunction("BFCCollStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+ .n()
+ .isFunction("BFCCollStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true);
testUri.run("ESKeyNav(1)/CollPropertyString/olingo.odata.test1.BFCCollStringRTESTwoKeyNav()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
- .n()
- .isFunction("BFCCollStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .n()
- .isCount();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+ .n()
+ .isFunction("BFCCollStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .n()
+ .isCount();
}
@Test
public void runBfuncBnPpropRtEs() throws Exception {
testUri.run("ESKeyNav(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
- .n()
- .isFunction("BFCStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+ .n()
+ .isFunction("BFCStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true);
testUri.run("ESKeyNav(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
- .n()
- .isFunction("BFCStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .n()
- .isCount();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+ .n()
+ .isFunction("BFCStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .n()
+ .isCount();
testUri.run("ESKeyNav(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
- .n()
- .isFunction("BFCStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .n()
- .isRef();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+ .n()
+ .isFunction("BFCStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .n()
+ .isRef();
}
@Test
public void runBfuncBnSingleRtEs() throws Exception {
testUri.run("SINav/olingo.odata.test1.BFCSINavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isFunction("BFCSINavRTESTwoKeyNav");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isFunction("BFCSINavRTESTwoKeyNav");
}
@Test
public void runBfuncBnSingleCastRtEs() throws Exception {
testUri.run("SINav/olingo.odata.test1.ETBaseTwoKeyNav/olingo.odata.test1.BFCETBaseTwoKeyNavRTESBaseTwoKey()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isFunction("BFCETBaseTwoKeyNavRTESBaseTwoKey");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isFunction("BFCETBaseTwoKeyNavRTESBaseTwoKey");
}
@Test
public void runActionBound_on_EntityEntry() throws Exception {
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isAction("BAETTwoKeyNavRTETTwoKeyNav");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isAction("BAETTwoKeyNavRTETTwoKeyNav");
testUri.run("ESKeyNav(PropertyInt16=1)/olingo.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isAction("BAETTwoKeyNavRTETTwoKeyNav");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isAction("BAETTwoKeyNavRTETTwoKeyNav");
}
@Test
public void runActionBound_on_EntityCollection() throws Exception {
testUri.run("ESTwoKeyNav/olingo.odata.test1.BAESTwoKeyNavRTESTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isAction("BAESTwoKeyNavRTESTwoKeyNav");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isAction("BAESTwoKeyNavRTESTwoKeyNav");
}
@Test
@@ -815,24 +834,24 @@ public class TestFullResourcePath {
// on primitive
testUri.run("ESAllPrim(1)/PropertyString/olingo.odata.test1.BFCStringRTESTwoKeyNav()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETAllPrim, false)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.primitiveProperty)
- .isType(PropertyProvider.nameString);
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETAllPrim, false)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.primitiveProperty)
+ .isType(PropertyProvider.nameString);
// on collection of primitive
testUri.run("ESCollAllPrim(1)/CollPropertyString/olingo.odata.test1.BFCCollStringRTESTwoKeyNav()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETCollAllPrim, false)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.primitiveProperty)
- .isType(PropertyProvider.nameString);
-
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETCollAllPrim, false)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.primitiveProperty)
+ .isType(PropertyProvider.nameString);
+
// on complex
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
+ "/PropertyComp/olingo.odata.test1.BFCCTPrimCompRTESTwoKeyNav()")
@@ -847,14 +866,14 @@ public class TestFullResourcePath {
// on collection of complex
testUri.run("ESKeyNav(1)/CollPropertyComp/olingo.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .at(1)
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .at(2)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETAllPrim);
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .at(1)
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .at(2)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETAllPrim);
// on entity
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
@@ -869,12 +888,12 @@ public class TestFullResourcePath {
// on collection of entity
testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1).isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1).isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
}
@Test
@@ -907,12 +926,12 @@ public class TestFullResourcePath {
@Test
public void runCrossjoin() throws Exception {
testUri.run("$crossjoin(ESKeyNav)")
- .isKind(UriInfoKind.crossjoin)
- .isCrossJoinEntityList(Arrays.asList("ESKeyNav"));
+ .isKind(UriInfoKind.crossjoin)
+ .isCrossJoinEntityList(Arrays.asList("ESKeyNav"));
testUri.run("$crossjoin(ESKeyNav, ESTwoKeyNav)")
- .isKind(UriInfoKind.crossjoin)
- .isCrossJoinEntityList(Arrays.asList("ESKeyNav", "ESTwoKeyNav"));
+ .isKind(UriInfoKind.crossjoin)
+ .isCrossJoinEntityList(Arrays.asList("ESKeyNav", "ESTwoKeyNav"));
}
@Test
@@ -921,35 +940,35 @@ public class TestFullResourcePath {
testUri.runEx("$crossjoin/error").isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
testUri.runEx("$crossjoin()").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
testUri.runEx("$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid")
- .isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
+ .isExSyntax(UriParserSyntaxException.MessageKeys.MUST_BE_LAST_SEGMENT);
}
@Test
public void runEntityId() throws Exception {
testUri.run("$entity", "$id=ESKeyNav(1)")
- .isKind(UriInfoKind.entityId)
- .isIdText("ESKeyNav(1)");
+ .isKind(UriInfoKind.entityId)
+ .isIdText("ESKeyNav(1)");
testUri.run("$entity/olingo.odata.test1.ETKeyNav", "$id=ESKeyNav(1)")
- .isKind(UriInfoKind.entityId)
- .isEntityType(EntityTypeProvider.nameETKeyNav)
- .isIdText("ESKeyNav(1)");
+ .isKind(UriInfoKind.entityId)
+ .isEntityType(EntityTypeProvider.nameETKeyNav)
+ .isIdText("ESKeyNav(1)");
}
@Test
public void runEsName() throws Exception {
testUri.run("ESAllPrim")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isType(EntityTypeProvider.nameETAllPrim, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isType(EntityTypeProvider.nameETAllPrim, true);
testUri.run("ESAllPrim/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isType(EntityTypeProvider.nameETAllPrim, true)
- .n()
- .isCount();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isType(EntityTypeProvider.nameETAllPrim, true)
+ .n()
+ .isCount();
}
@Test
@@ -998,221 +1017,221 @@ public class TestFullResourcePath {
// TODO Currently "'" is not allowed in OData identifiers, but the specification allows this character (Unicode Cf)
testUri.runEx("ESAllPrim'").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
testUri.runEx("ESAllPrim'InvalidStuff").isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-
+
testUri.runEx("ESAllPrim", "$filter=PropertyInt16' eq 0")
- .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-
+ .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+
testUri.runEx("ESAllPrim", "$filter=PropertyInt16 eq' 0")
- .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-
+ .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+
testUri.runEx("ESAllPrim", "$filter=PropertyInt16 eq 0'")
- .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
-
+ .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+
testUri.runEx("ESAllPrim", "$filter=PropertyInt16 eq 'dsd''")
- .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
+ .isExSyntax(UriParserSyntaxException.MessageKeys.SYNTAX);
}
-
+
@Test
public void runFunctionsWithKeyPredicates() throws Exception {
testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
- .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterString", "'1'")
- .isParameter(1, "ParameterInt16", "1");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+ .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .isParameter(1, "ParameterInt16", "1");
+
testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt16=0)")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
- .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterString", "'1'")
- .isParameter(1, "ParameterInt16", "1")
- .isKeyPredicate(0, "PropertyInt16", "0");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+ .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .isParameter(1, "ParameterInt16", "1")
+ .isKeyPredicate(0, "PropertyInt16", "0");
+
testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(0)")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
- .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterString", "'1'")
- .isParameter(1, "ParameterInt16", "1")
- .isKeyPredicate(0, "PropertyInt16", "0");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+ .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .isParameter(1, "ParameterInt16", "1")
+ .isKeyPredicate(0, "PropertyInt16", "0");
+
testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt16 eq 0)")
- .isExSemantic(MessageKeys.INVALID_KEY_VALUE);
-
+ .isExSemantic(MessageKeys.INVALID_KEY_VALUE);
+
// PropertyInt32 does not exist
testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt32=0)")
- .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
-
- testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)"
+ .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
+
+ testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterString='1',ParameterInt16=1)"
+ "(PropertyInt16=0,PropertyInt16=1)")
- .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
-
+ .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
+
testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTCollCTTwoPrimTwoParam")
- .isFunction("UFCRTCollCTTwoPrimTwoParam")
- .isParameter(0, "ParameterString", "'1'")
- .isParameter(1, "ParameterInt16", "1");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTCollCTTwoPrimTwoParam")
+ .isFunction("UFCRTCollCTTwoPrimTwoParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .isParameter(1, "ParameterInt16", "1");
+
testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt16=1)")
- .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
+ .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(1)")
- .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
+ .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt32=1)")
- .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
+ .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
testUri.runEx("FICRTCollCTTwoPrimTwoParam(ParameterString='1',ParameterInt16=1)(PropertyInt32=1,PropertyInt16=2)")
- .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
+ .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTCollESTwoKeyNavParam")
- .isFunction("UFCRTCollETTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTCollESTwoKeyNavParam")
+ .isFunction("UFCRTCollETTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1");
+
testUri.run("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='1')")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTCollESTwoKeyNavParam")
- .isFunction("UFCRTCollETTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1,"PropertyString", "'1'");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTCollESTwoKeyNavParam")
+ .isFunction("UFCRTCollETTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'1'");
+
testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16 eq 1)")
- .isExSemantic(MessageKeys.INVALID_KEY_VALUE);
-
+ .isExSemantic(MessageKeys.INVALID_KEY_VALUE);
+
testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1)")
- .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
-
+ .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
+
testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyInt32=1,PropertyString='1')")
- .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
-
+ .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
+
testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)()")
- .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
-
+ .isExSemantic(MessageKeys.WRONG_NUMBER_OF_KEY_PROPERTIES);
+
testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyInt32=1)")
- .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
-
+ .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
+
testUri.runEx("FICRTCollESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,Unkown=1)")
- .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
-
+ .isExValidation(UriValidationException.MessageKeys.INVALID_KEY_PROPERTY);
+
testUri.run("FICRTCollString()")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTCollString")
- .isFunction("UFCRTCollString");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTCollString")
+ .isFunction("UFCRTCollString");
+
testUri.run("FICRTString()")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTString")
- .isFunction("UFCRTString");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTString")
+ .isFunction("UFCRTString");
+
testUri.runEx("FICRTCollString()(0)")
- .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
-
+ .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+
testUri.runEx("FICRTString()(0)")
- .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
+ .isExSemantic(MessageKeys.KEY_NOT_ALLOWED);
}
-
+
@Test
public void runNonComposableFunctions() throws Exception {
testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
- .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", "'1'");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+ .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", "'1'");
+
testUri.run("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')(0)")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
- .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", "'1'");
-
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isFunctionImport("FICRTCollETMixPrimCollCompTwoParam")
+ .isFunction("UFCRTCollETMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", "'1'");
+
testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')(0)/PropertyInt16")
- .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
-
+ .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
+
testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$skip=1")
- .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
+ .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$top=1")
- .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
- testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')",
+ .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
+ testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')",
"$filter=PropertyInt16 eq 1")
- .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
+ .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$skip=1")
- .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
+ .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$count=true")
- .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
+ .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$skiptoken=5")
- .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
-
+ .isExValidation(UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED);
+
// $search is currently not implemented. Please change this exception if the implementation is done.
testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$search=test")
- .isExSemantic(MessageKeys.NOT_IMPLEMENTED);
-
+ .isExSemantic(MessageKeys.NOT_IMPLEMENTED);
+
testUri.run("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()")
- .isKind(UriInfoKind.resource)
- .goPath().first()
- .isEntitySet("ESAllPrim")
- .at(1)
- .isFunction("BFNESAllPrimRTCTAllPrim");
-
- testUri.runEx("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()"
- + "/PropertyString")
- .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
+ .isKind(UriInfoKind.resource)
+ .goPath().first()
+ .isEntitySet("ESAllPrim")
+ .at(1)
+ .isFunction("BFNESAllPrimRTCTAllPrim");
+
+ testUri.runEx("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()"
+ + "/PropertyString")
+ .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH);
}
-
+
@Test
public void runEsNameCast() throws Exception {
testUri.run("ESTwoPrim/olingo.odata.test1.ETBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim, true)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim, true)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
testUri.run("ESTwoPrim/olingo.odata.test1.ETBase(-32768)/olingo.odata.test1.ETTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim, false)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
- .isKeyPredicate(0, "PropertyInt16", "-32768")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim, false)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
+ .isKeyPredicate(0, "PropertyInt16", "-32768")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
testUri.run("ESTwoPrim/olingo.odata.test1.ETTwoBase(-32768)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim, false)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
- .isKeyPredicate(0, "PropertyInt16", "-32768");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim, false)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
+ .isKeyPredicate(0, "PropertyInt16", "-32768");
testUri.run("ESTwoPrim/Namespace1_Alias.ETTwoBase(-32768)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim, false)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
- .isKeyPredicate(0, "PropertyInt16", "-32768");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim, false)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
+ .isKeyPredicate(0, "PropertyInt16", "-32768");
}
@@ -1220,15 +1239,15 @@ public class TestFullResourcePath {
public void runEsNamePpSpCast() throws Exception {
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav/PropertyDate")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false);
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+ "/PropertyComp/PropertyInt16")
@@ -1248,23 +1267,23 @@ public class TestFullResourcePath {
@Test
public void runEsNameKey() throws Exception {
testUri.run("ESCollAllPrim(1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESCollAllPrim");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESCollAllPrim");
testUri.run("ESCollAllPrim(PropertyInt16=1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESCollAllPrim");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESCollAllPrim");
testUri.run("ESFourKeyAlias(PropertyInt16=1,KeyAlias1=2,KeyAlias2='3',KeyAlias3='4')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESFourKeyAlias")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "KeyAlias1", "2")
- .isKeyPredicate(2, "KeyAlias2", "'3'")
- .isKeyPredicate(3, "KeyAlias3", "'4'");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESFourKeyAlias")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "KeyAlias1", "2")
+ .isKeyPredicate(2, "KeyAlias2", "'3'")
+ .isKeyPredicate(3, "KeyAlias3", "'4'");
testUri.runEx("ESTwoPrim(wrong)").isExSemantic(MessageKeys.INVALID_KEY_VALUE);
testUri.runEx("ESTwoPrim(PropertyInt16=wrong)").isExSemantic(MessageKeys.INVALID_KEY_VALUE);
@@ -1308,147 +1327,147 @@ public class TestFullResourcePath {
testUri.runEx("ESBase/olingo.odata.test1.ETTwoPrim(1)").isExSemantic(MessageKeys.INCOMPATIBLE_TYPE_FILTER);
testUri.run("ESTwoPrim(1)/olingo.odata.test1.ETBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBase);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBase);
testUri.run("ESTwoPrim(1)/olingo.odata.test1.ETTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
testUri.run("ESTwoPrim/olingo.odata.test1.ETBase(1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
testUri.run("ESTwoPrim/olingo.odata.test1.ETTwoBase(1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
testUri.run("ESTwoPrim/olingo.odata.test1.ETBase(1)/olingo.odata.test1.ETTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
testUri.run("ESTwoPrim/olingo.odata.test1.ETTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
}
@Test
public void runEsNameParaKeysCast() throws Exception {
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
testUri.run("ESTwoKeyNav/olingo.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'");
}
@Test
public void run_EsNamePpCp() throws Exception {
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComp")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isComplex("PropertyComp");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isComplex("PropertyComp");
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComp/PropertyComp")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isComplex("PropertyComp")
- .n()
- .isComplex("PropertyComp");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isComplex("PropertyComp")
+ .n()
+ .isComplex("PropertyComp");
}
@Test
public void runEsNamePpCpColl() throws Exception {
testUri.run("ESMixPrimCollComp(5)/CollPropertyComp")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESMixPrimCollComp")
- .isKeyPredicate(0, "PropertyInt16", "5")
- .n()
- .isComplex("CollPropertyComp")
- .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESMixPrimCollComp")
+ .isKeyPredicate(0, "PropertyInt16", "5")
+ .n()
+ .isComplex("CollPropertyComp")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, true);
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComp")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isComplex("CollPropertyComp")
- .isType(ComplexTypeProvider.nameCTPrimComp, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isComplex("CollPropertyComp")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true);
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComp/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isComplex("CollPropertyComp")
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .n()
- .isCount();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isComplex("CollPropertyComp")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .n()
+ .isCount();
}
@Test
public void runEsNamePpCpCast() throws Exception {
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav/PropertyComp")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComp");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComp");
testUri
- .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
- + "/PropertyComp/PropertyComp")
+ .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+ + "/PropertyComp/PropertyComp")
.isKind(UriInfoKind.resource).goPath()
.first()
.isEntitySet("ESTwoKeyNav")
@@ -1462,8 +1481,8 @@ public class TestFullResourcePath {
.isComplex("PropertyComp");
testUri
- .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
- + "/PropertyCompTwoPrim/olingo.odata.test1.CTBase")
+ .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+ + "/PropertyCompTwoPrim/olingo.odata.test1.CTBase")
.isKind(UriInfoKind.resource).goPath()
.first()
.isEntitySet("ESTwoKeyNav")
@@ -1478,8 +1497,8 @@ public class TestFullResourcePath {
.isTypeFilter(ComplexTypeProvider.nameCTBase);
testUri
- .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
- + "/PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase")
+ .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
+ + "/PropertyCompTwoPrim/olingo.odata.test1.CTTwoBase")
.isKind(UriInfoKind.resource).goPath()
.first()
.isEntitySet("ESTwoKeyNav")
@@ -1496,63 +1515,63 @@ public class TestFullResourcePath {
@Test
public void runNsNamePpNp() throws Exception {
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true);
testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2");
testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETKeyNavMany(PropertyInt16=2)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2");
testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyInt16")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyCompNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .n()
- .isComplex("PropertyCompNav");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .n()
+ .isComplex("PropertyCompNav");
testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/NavPropertyETKeyNavOne")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .n()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+ "/NavPropertyETKeyNavMany(4)")
@@ -1569,24 +1588,24 @@ public class TestFullResourcePath {
.isKeyPredicate(0, "PropertyInt16", "4");
testUri.run("ESKeyNav(1)/PropertyCompNav/NavPropertyETTwoKeyNavOne")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isComplex("PropertyCompNav")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='(3)')"
- + "/PropertyComp/PropertyComp/PropertyInt16")
.isKind(UriInfoKind.resource).goPath()
.first()
.isEntitySet("ESKeyNav")
.isKeyPredicate(0, "PropertyInt16", "1")
.n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
+ .isComplex("PropertyCompNav")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='(3)')"
+ + "/PropertyComp/PropertyComp/PropertyInt16")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
.isKeyPredicate(1, "PropertyString", "'(3)'")
.n()
.isComplex("PropertyComp")
@@ -1596,15 +1615,15 @@ public class TestFullResourcePath {
.isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
testUri.run("ESKeyNav(1)/NavPropertyETMediaMany(2)/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETMediaMany", EntityTypeProvider.nameETMedia, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .n()
- .isValue();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETMediaMany", EntityTypeProvider.nameETMedia, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .n()
+ .isValue();
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+ "/NavPropertyETKeyNavOne/NavPropertyETMediaOne/$value")
@@ -1654,7 +1673,7 @@ public class TestFullResourcePath {
.isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/olingo.odata.test1.ETBaseTwoKeyNav"
- + "/NavPropertyETKeyNavMany(3)")
+ + "/NavPropertyETKeyNavMany(3)")
.isKind(UriInfoKind.resource).goPath()
.first()
.isEntitySet("ESTwoKeyNav")
@@ -1726,128 +1745,128 @@ public class TestFullResourcePath {
public void runEsNamePpNpRc() throws Exception {
// checks for using referential constrains to fill missing keys
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany('2')").goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
- .isKeyPredicate(1, "PropertyString", "'2'");
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
+ .isKeyPredicate(1, "PropertyString", "'2'");
testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETTwoKeyNavMany(PropertyString='2')").goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
- .isKeyPredicate(1, "PropertyString", "'2'");
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
+ .isKeyPredicate(1, "PropertyString", "'2'");
}
@Test
public void runEsNamePpSp() throws Exception {
testUri.run("ESAllPrim(1)/PropertyByte")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false);
testUri.run("ESAllPrim(1)/PropertyByte/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false)
- .n()
- .isValue();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false)
+ .n()
+ .isValue();
testUri.run("ESMixPrimCollComp(1)/PropertyComp/PropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESMixPrimCollComp")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isComplex("PropertyComp")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESMixPrimCollComp")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isComplex("PropertyComp")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
}
@Test
public void runEsNamePpSpColl() throws Exception {
testUri.run("ESCollAllPrim(1)/CollPropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESCollAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESCollAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
- .n()
- .isCount();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+ .n()
+ .isCount();
}
@Test
public void runEsNameRef() throws Exception {
testUri.run("ESAllPrim/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .n()
- .isRef();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .n()
+ .isRef();
testUri.run("ESAllPrim(-32768)/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "-32768")
- .n()
- .isRef();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "-32768")
+ .n()
+ .isRef();
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
- .n()
- .isRef();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
+ .n()
+ .isRef();
testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='2')/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isRef();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isRef();
}
@Test
@@ -1885,64 +1904,64 @@ public class TestFullResourcePath {
.isKeyPredicate(1, "PropertyString", "'3'")
.n()
.isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
-
+
testUri.run("FICRTCollCTTwoPrimTwoParam(ParameterInt16=1,ParameterString=null)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTCollCTTwoPrimTwoParam")
- .isFunction("UFCRTCollCTTwoPrimTwoParam")
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", null);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTCollCTTwoPrimTwoParam")
+ .isFunction("UFCRTCollCTTwoPrimTwoParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", null);
}
@Test
public void runFunctionImpEntity() throws Exception {
testUri.run("FICRTETKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETKeyNav")
- .isFunction("UFCRTETKeyNav")
- .isType(EntityTypeProvider.nameETKeyNav);
-
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETKeyNav")
+ .isFunction("UFCRTETKeyNav")
+ .isType(EntityTypeProvider.nameETKeyNav);
+
testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1");
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1");
testUri.run("FICRTESMedia(ParameterInt16=1)/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESMedia")
- .isFunction("UFCRTETMedia")
- .n()
- .isValue();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESMedia")
+ .isFunction("UFCRTETMedia")
+ .n()
+ .isValue();
testUri.run("FICRTETKeyNav()/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETKeyNav")
- .isFunction("UFCRTETKeyNav")
- .n()
- .isRef();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETKeyNav")
+ .isFunction("UFCRTETKeyNav")
+ .n()
+ .isRef();
testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isFunction("UFCRTETTwoKeyNavParam")
- .n()
- .isRef();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isFunction("UFCRTETTwoKeyNavParam")
+ .n()
+ .isRef();
testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isFunction("UFCRTETTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
-
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isFunction("UFCRTETTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+
testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/olingo.odata.test1.ETBaseTwoKeyNav")
.isKind(UriInfoKind.resource).goPath()
.first()
@@ -1969,39 +1988,39 @@ public class TestFullResourcePath {
public void runFunctionImpEs() throws Exception {
/**/
testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
- .isFunction("UFCRTESMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", "'2'")
- .isType(EntityTypeProvider.nameETMixPrimCollComp);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
+ .isFunction("UFCRTESMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", "'2'")
+ .isType(EntityTypeProvider.nameETMixPrimCollComp);
testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
- .isFunction("UFCRTESMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", "'2'")
- .isType(EntityTypeProvider.nameETMixPrimCollComp);
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
+ .isFunction("UFCRTESMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", "'2'")
+ .isType(EntityTypeProvider.nameETMixPrimCollComp);
testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
- .isFunction("UFCRTESMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", "'2'")
- .isType(EntityTypeProvider.nameETMixPrimCollComp)
- .n()
- .isCount();
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
+ .isFunction("UFCRTESMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", "'2'")
+ .isType(EntityTypeProvider.nameETMixPrimCollComp)
+ .n()
+ .isCount();
}
@Test
public void runFunctionIm
<TRUNCATED>