[OLINGO-780] Minor EDM adjustment
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/f221962f Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/f221962f Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/f221962f Branch: refs/heads/olingo786 Commit: f221962f72aa60bb970a40a63d262847316e9a44 Parents: 0989fbd Author: Christian Holzer <[email protected]> Authored: Wed Oct 7 15:20:52 2015 +0200 Committer: Christian Holzer <[email protected]> Committed: Wed Oct 7 15:20:52 2015 +0200 ---------------------------------------------------------------------- .../tecsvc/provider/FunctionProvider.java | 12 +++++----- .../server/tecsvc/provider/SchemaProvider.java | 2 +- .../core/uri/antlr/TestFullResourcePath.java | 24 ++++++-------------- 3 files changed, 14 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f221962f/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java ---------------------------------------------------------------------- diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java index a83abab..73e218f 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java @@ -50,8 +50,8 @@ public class FunctionProvider { public static final FullQualifiedName nameBFCCTPrimCompRTETTwoKeyNavParam = new FullQualifiedName(SchemaProvider.NAMESPACE, "BFCCTPrimCompRTETTwoKeyNavParam"); - public static final FullQualifiedName nameBFCESAllPrimRTCTAllPrim = - new FullQualifiedName(SchemaProvider.NAMESPACE, "BFCESAllPrimRTCTAllPrim"); + public static final FullQualifiedName nameBFNESAllPrimRTCTAllPrim = + new FullQualifiedName(SchemaProvider.NAMESPACE, "BFNESAllPrimRTCTAllPrim"); public static final FullQualifiedName nameBFCESBaseTwoKeyNavRTESBaseTwoKey = new FullQualifiedName(SchemaProvider.NAMESPACE, "BFCESBaseTwoKeyNavRTESBaseTwoKey"); @@ -574,22 +574,22 @@ public class FunctionProvider { .setParameters(Arrays.asList( new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav) .setCollection(true).setNullable(false))) - .setComposable(false) + .setComposable(true) .setReturnType( new CsdlReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true) .setNullable(false)) ); - } else if (functionName.equals(nameBFCESAllPrimRTCTAllPrim)) { + } else if (functionName.equals(nameBFNESAllPrimRTCTAllPrim)) { return Arrays.asList( new CsdlFunction() - .setName("BFCESAllPrimRTCTAllPrim") + .setName("BFNESAllPrimRTCTAllPrim") .setBound(true) .setParameters( Arrays.asList( new CsdlParameter().setName("BindingParam").setType(EntityTypeProvider.nameETAllPrim) .setCollection(true).setNullable(false))) - .setComposable(true) + .setComposable(false) .setReturnType( new CsdlReturnType().setType(ComplexTypeProvider.nameCTAllPrim).setNullable(false)) ); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f221962f/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java ---------------------------------------------------------------------- diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java index 03588b3..16ec8ba 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java @@ -163,7 +163,7 @@ public class SchemaProvider { functions.addAll(prov.getFunctions(FunctionProvider.nameBFCStringRTESTwoKeyNav)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTETTwoKeyNav)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESBaseTwoKeyNavRTESBaseTwoKey)); - functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESAllPrimRTCTAllPrim)); + functions.addAll(prov.getFunctions(FunctionProvider.nameBFNESAllPrimRTCTAllPrim)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCTTwoPrim)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollCTTwoPrim)); functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTString)); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f221962f/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 7df684e..4d39d97 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 @@ -294,12 +294,12 @@ public class TestFullResourcePath { @Test public void runBfuncBnEsRtCprop() throws Exception { - testUri.run("ESAllPrim/olingo.odata.test1.BFCESAllPrimRTCTAllPrim()") + testUri.run("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()") .isKind(UriInfoKind.resource).goPath() .first() .isEntitySet("ESAllPrim") .n() - .isFunction("BFCESAllPrimRTCTAllPrim") + .isFunction("BFNESAllPrimRTCTAllPrim") .isType(ComplexTypeProvider.nameCTAllPrim); testUri.run("ESTwoKeyNav/olingo.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()/olingo.odata.test1.CTBase") @@ -1188,25 +1188,15 @@ public class TestFullResourcePath { testUri.runEx("FICRTCollETMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='1')", "$search=test") .isExSemantic(MessageKeys.NOT_IMPLEMENTED); - testUri.run("ESBaseTwoKeyNav/olingo.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()") + testUri.run("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()") .isKind(UriInfoKind.resource) .goPath().first() - .isEntitySet("ESBaseTwoKeyNav") + .isEntitySet("ESAllPrim") .at(1) - .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey"); + .isFunction("BFNESAllPrimRTCTAllPrim"); - testUri.run("ESBaseTwoKeyNav/olingo.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()" - + "(PropertyInt16=1,PropertyString='1')") - .isKind(UriInfoKind.resource) - .goPath().first() - .isEntitySet("ESBaseTwoKeyNav") - .at(1) - .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey") - .isKeyPredicate(0, "PropertyInt16", "1") - .isKeyPredicate(1, "PropertyString", "'1'"); - - testUri.runEx("ESBaseTwoKeyNav/olingo.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()" - + "(PropertyInt16=1,PropertyString='1')/NavPropertyETBaseTwoKeyNavOne") + testUri.runEx("ESAllPrim/olingo.odata.test1.BFNESAllPrimRTCTAllPrim()" + + "/PropertyString") .isExValidation(UriValidationException.MessageKeys.UNALLOWED_RESOURCE_PATH); }
