[OLINGO-780] Minor EDM adjustment

This commit is contained in:
Christian Holzer 2015-10-07 15:20:52 +02:00
parent 0989fbd074
commit f221962f72
3 changed files with 14 additions and 24 deletions

View File

@ -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))
);

View File

@ -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));

View File

@ -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);
}