[OLINGO-545] TecSvc EDM enhanced
This commit is contained in:
parent
6d41513f47
commit
af1417b3c7
|
@ -330,7 +330,7 @@ public class BasicITCase extends AbstractBaseTestITCase {
|
||||||
final ODataClient client = getClient();
|
final ODataClient client = getClient();
|
||||||
final ODataObjectFactory factory = client.getObjectFactory();
|
final ODataObjectFactory factory = client.getObjectFactory();
|
||||||
ODataEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
|
ODataEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
|
||||||
newEntity.getProperties().add(factory.newComplexProperty("PropertyCompComp", null));
|
newEntity.getProperties().add(factory.newComplexProperty("PropertyCompCompNav", null));
|
||||||
// The following properties must not be null
|
// The following properties must not be null
|
||||||
newEntity.getProperties().add(factory.newPrimitiveProperty("PropertyString",
|
newEntity.getProperties().add(factory.newPrimitiveProperty("PropertyString",
|
||||||
factory.newPrimitiveValueBuilder().buildString("Test")));
|
factory.newPrimitiveValueBuilder().buildString("Test")));
|
||||||
|
@ -358,7 +358,7 @@ public class BasicITCase extends AbstractBaseTestITCase {
|
||||||
assertEquals(HttpStatusCode.OK.getStatusCode(), entityResponse.getStatusCode());
|
assertEquals(HttpStatusCode.OK.getStatusCode(), entityResponse.getStatusCode());
|
||||||
final ODataEntity entity = entityResponse.getBody();
|
final ODataEntity entity = entityResponse.getBody();
|
||||||
assertNotNull(entity);
|
assertNotNull(entity);
|
||||||
final ODataComplexValue complex = entity.getProperty("PropertyCompComp").getComplexValue()
|
final ODataComplexValue complex = entity.getProperty("PropertyCompCompNav").getComplexValue()
|
||||||
.get("PropertyComp").getComplexValue();
|
.get("PropertyComp").getComplexValue();
|
||||||
assertNotNull(complex);
|
assertNotNull(complex);
|
||||||
final ODataProperty property = complex.get("PropertyInt16");
|
final ODataProperty property = complex.get("PropertyInt16");
|
||||||
|
|
|
@ -62,13 +62,15 @@ public class BindingITCase extends AbstractBaseTestITCase {
|
||||||
private static final String PROPERTY_INT16 = "PropertyInt16";
|
private static final String PROPERTY_INT16 = "PropertyInt16";
|
||||||
private static final String PROPERTY_STRING = "PropertyString";
|
private static final String PROPERTY_STRING = "PropertyString";
|
||||||
private static final String PROPERTY_COMP = "PropertyComp";
|
private static final String PROPERTY_COMP = "PropertyComp";
|
||||||
private static final String PROPERTY_COMP_COMP = "PropertyCompComp";
|
private static final String PROPERTY_COMP_NAV = "PropertyCompNav";
|
||||||
|
private static final String PROPERTY_COMP_COMP_NAV = "PropertyCompCompNav";
|
||||||
private static final String PROPERTY_COMP_TWO_PRIM = "PropertyCompTwoPrim";
|
private static final String PROPERTY_COMP_TWO_PRIM = "PropertyCompTwoPrim";
|
||||||
private static final String PROPERTY_COMP_ALL_PRIM = "PropertyCompAllPrim";
|
private static final String PROPERTY_COMP_ALL_PRIM = "PropertyCompAllPrim";
|
||||||
private static final String NAV_PROPERTY_ET_KEY_NAV_ONE = "NavPropertyETKeyNavOne";
|
private static final String NAV_PROPERTY_ET_KEY_NAV_ONE = "NavPropertyETKeyNavOne";
|
||||||
private static final String NAV_PROPERTY_ET_KEY_NAV_MANY = "NavPropertyETKeyNavMany";
|
private static final String NAV_PROPERTY_ET_KEY_NAV_MANY = "NavPropertyETKeyNavMany";
|
||||||
private static final String NAV_PROPERTY_ET_TWO_KEY_NAV_MANY = "NavPropertyETTwoKeyNavMany";
|
private static final String NAV_PROPERTY_ET_TWO_KEY_NAV_MANY = "NavPropertyETTwoKeyNavMany";
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateBindingSimple() throws EdmPrimitiveTypeException {
|
public void testCreateBindingSimple() throws EdmPrimitiveTypeException {
|
||||||
final ODataClient client = getClient();
|
final ODataClient client = getClient();
|
||||||
|
@ -82,7 +84,7 @@ public class BindingITCase extends AbstractBaseTestITCase {
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")));
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")));
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
.add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_NAV_FIVE_PROP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))));
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))));
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP_ALL_PRIM, of.newComplexValue(CT_ALL_PRIM)
|
.add(of.newComplexProperty(PROPERTY_COMP_ALL_PRIM, of.newComplexValue(CT_ALL_PRIM)
|
||||||
|
@ -92,7 +94,7 @@ public class BindingITCase extends AbstractBaseTestITCase {
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))));
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))));
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP_COMP, of.newComplexValue(CT_PRIM_COMP)
|
.add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))))));
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))))));
|
||||||
|
|
|
@ -65,7 +65,8 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
private static final String PROPERTY_INT16 = "PropertyInt16";
|
private static final String PROPERTY_INT16 = "PropertyInt16";
|
||||||
private static final String PROPERTY_STRING = "PropertyString";
|
private static final String PROPERTY_STRING = "PropertyString";
|
||||||
private static final String PROPERTY_COMP = "PropertyComp";
|
private static final String PROPERTY_COMP = "PropertyComp";
|
||||||
private static final String PROPERTY_COMP_COMP = "PropertyCompComp";
|
private static final String PROPERTY_COMP_NAV = "PropertyCompNav";
|
||||||
|
private static final String PROPERTY_COMP_COMP_NAV = "PropertyCompCompNav";
|
||||||
private static final String PROPERTY_COMP_TWO_PRIM = "PropertyCompTwoPrim";
|
private static final String PROPERTY_COMP_TWO_PRIM = "PropertyCompTwoPrim";
|
||||||
private static final String PROPERTY_COMP_ALL_PRIM = "PropertyCompAllPrim";
|
private static final String PROPERTY_COMP_ALL_PRIM = "PropertyCompAllPrim";
|
||||||
private static final String NAV_PROPERTY_ET_KEY_NAV_ONE = "NavPropertyETKeyNavOne";
|
private static final String NAV_PROPERTY_ET_KEY_NAV_ONE = "NavPropertyETKeyNavOne";
|
||||||
|
@ -90,7 +91,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")));
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")));
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
.add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_NAV_FIVE_PROP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))));
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))));
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP_ALL_PRIM, of.newComplexValue(CT_ALL_PRIM)
|
.add(of.newComplexProperty(PROPERTY_COMP_ALL_PRIM, of.newComplexValue(CT_ALL_PRIM)
|
||||||
|
@ -100,7 +101,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))));
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))));
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP_COMP, of.newComplexValue(CT_PRIM_COMP)
|
.add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))))));
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))))));
|
||||||
|
@ -276,7 +277,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")));
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")));
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
.add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_NAV_FIVE_PROP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))));
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))));
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP_ALL_PRIM, of.newComplexValue(CT_ALL_PRIM)
|
.add(of.newComplexProperty(PROPERTY_COMP_ALL_PRIM, of.newComplexValue(CT_ALL_PRIM)
|
||||||
|
@ -286,7 +287,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))));
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))));
|
||||||
entity.getProperties()
|
entity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP_COMP, of.newComplexValue(CT_PRIM_COMP)
|
.add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("42")))
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))))));
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 42)))))));
|
||||||
|
@ -298,7 +299,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
innerEntity.getProperties()
|
innerEntity.getProperties()
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("43")));
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("43")));
|
||||||
innerEntity.getProperties()
|
innerEntity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
.add(of.newComplexProperty(PROPERTY_COMP_NAV, of.newComplexValue(CT_NAV_FIVE_PROP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 431)))));
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder().buildInt16((short) 431)))));
|
||||||
innerEntity.getProperties()
|
innerEntity.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP_ALL_PRIM, of.newComplexValue(CT_ALL_PRIM)
|
.add(of.newComplexProperty(PROPERTY_COMP_ALL_PRIM, of.newComplexValue(CT_ALL_PRIM)
|
||||||
|
@ -309,7 +310,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("431")))));
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("431")))));
|
||||||
innerEntity
|
innerEntity
|
||||||
.getProperties()
|
.getProperties()
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP_COMP, of.newComplexValue(CT_PRIM_COMP)
|
.add(of.newComplexProperty(PROPERTY_COMP_COMP_NAV, of.newComplexValue(CT_PRIM_COMP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("431")))
|
.add(of.newPrimitiveProperty(PROPERTY_STRING, of.newPrimitiveValueBuilder().buildString("431")))
|
||||||
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
.add(of.newComplexProperty(PROPERTY_COMP, of.newComplexValue(CT_NAV_FIVE_PROP)
|
||||||
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder()
|
.add(of.newPrimitiveProperty(PROPERTY_INT16, of.newPrimitiveValueBuilder()
|
||||||
|
@ -335,7 +336,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
// Check values
|
// Check values
|
||||||
assertEquals(431, entityResponse.getBody().getProperty(NAV_PROPERTY_ET_KEY_NAV_ONE).getComplexValue().get(
|
assertEquals(431, entityResponse.getBody().getProperty(NAV_PROPERTY_ET_KEY_NAV_ONE).getComplexValue().get(
|
||||||
PROPERTY_COMP).getComplexValue().get(PROPERTY_INT16).getPrimitiveValue().toValue());
|
PROPERTY_COMP_NAV).getComplexValue().get(PROPERTY_INT16).getPrimitiveValue().toValue());
|
||||||
|
|
||||||
Short innerEntityInt16Key =
|
Short innerEntityInt16Key =
|
||||||
entityResponse.getBody().getProperty(NAV_PROPERTY_ET_KEY_NAV_ONE).getComplexValue().get(PROPERTY_INT16)
|
entityResponse.getBody().getProperty(NAV_PROPERTY_ET_KEY_NAV_ONE).getComplexValue().get(PROPERTY_INT16)
|
||||||
|
@ -349,7 +350,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
innerRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
|
innerRequest.addCustomHeader(HttpHeader.COOKIE, cookie);
|
||||||
ODataRetrieveResponse<ODataEntity> innerResponse = innerRequest.execute();
|
ODataRetrieveResponse<ODataEntity> innerResponse = innerRequest.execute();
|
||||||
|
|
||||||
assertEquals(431, innerResponse.getBody().getProperty(PROPERTY_COMP).getComplexValue().get(PROPERTY_INT16)
|
assertEquals(431, innerResponse.getBody().getProperty(PROPERTY_COMP_NAV).getComplexValue().get(PROPERTY_INT16)
|
||||||
.getPrimitiveValue().toValue());
|
.getPrimitiveValue().toValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -927,7 +927,7 @@ public class FilterSystemQueryITCase extends AbstractBaseTestITCase {
|
||||||
final ODataClient client = getClient();
|
final ODataClient client = getClient();
|
||||||
final ODataObjectFactory factory = client.getObjectFactory();
|
final ODataObjectFactory factory = client.getObjectFactory();
|
||||||
ODataEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
|
ODataEntity newEntity = factory.newEntity(new FullQualifiedName("olingo.odata.test1", "ETKeyNav"));
|
||||||
newEntity.getProperties().add(factory.newComplexProperty("PropertyCompComp", null));
|
newEntity.getProperties().add(factory.newComplexProperty("PropertyCompCompNav", null));
|
||||||
newEntity.getProperties().add(factory.newPrimitiveProperty("PropertyInt16",
|
newEntity.getProperties().add(factory.newPrimitiveProperty("PropertyInt16",
|
||||||
factory.newPrimitiveValueBuilder().buildInt16((short) 4)));
|
factory.newPrimitiveValueBuilder().buildInt16((short) 4)));
|
||||||
newEntity.getProperties().add(factory.newPrimitiveProperty("PropertyString",
|
newEntity.getProperties().add(factory.newPrimitiveProperty("PropertyString",
|
||||||
|
@ -959,11 +959,11 @@ public class FilterSystemQueryITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
// Do the filter request
|
// Do the filter request
|
||||||
ODataRetrieveResponse<ODataEntitySet> result =
|
ODataRetrieveResponse<ODataEntitySet> result =
|
||||||
sendRequest("ESKeyNav", "PropertyCompComp/PropertyComp/PropertyInt16 eq 1", cookie);
|
sendRequest("ESKeyNav", "PropertyCompCompNav/PropertyComp/PropertyInt16 eq 1", cookie);
|
||||||
assertEquals(3, result.getBody().getEntities().size());
|
assertEquals(3, result.getBody().getEntities().size());
|
||||||
|
|
||||||
// Try filter all entries where PropertyCompComp is null
|
// Try filter all entries where PropertyCompComp is null
|
||||||
result = sendRequest("ESKeyNav", "PropertyCompComp/PropertyComp/PropertyInt16 eq null", cookie);
|
result = sendRequest("ESKeyNav", "PropertyCompCompNav/PropertyComp/PropertyInt16 eq null", cookie);
|
||||||
assertEquals(1, result.getBody().getEntities().size());
|
assertEquals(1, result.getBody().getEntities().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ public final class NavigationITCase extends AbstractBaseTestITCase {
|
||||||
.appendEntitySetSegment("ESKeyNav").appendKeySegment(1)
|
.appendEntitySetSegment("ESKeyNav").appendKeySegment(1)
|
||||||
.appendNavigationSegment("NavPropertyETKeyNavOne")
|
.appendNavigationSegment("NavPropertyETKeyNavOne")
|
||||||
.appendNavigationSegment("NavPropertyETKeyNavMany").appendKeySegment(3)
|
.appendNavigationSegment("NavPropertyETKeyNavMany").appendKeySegment(3)
|
||||||
.appendPropertySegment("PropertyComp").appendPropertySegment("PropertyInt16").build())
|
.appendPropertySegment("PropertyCompNav").appendPropertySegment("PropertyInt16").build())
|
||||||
.execute();
|
.execute();
|
||||||
assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
|
assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ public class DataCreator {
|
||||||
return new EntityImpl()
|
return new EntityImpl()
|
||||||
.addProperty(createPrimitive("PropertyInt16", propertyInt16))
|
.addProperty(createPrimitive("PropertyInt16", propertyInt16))
|
||||||
.addProperty(createPrimitive("PropertyString", propertyString))
|
.addProperty(createPrimitive("PropertyString", propertyString))
|
||||||
.addProperty(createComplex("PropertyComp",
|
.addProperty(createComplex("PropertyCompNav",
|
||||||
createPrimitive("PropertyInt16", 1)))
|
createPrimitive("PropertyInt16", 1)))
|
||||||
.addProperty(createKeyNavAllPrimComplexValue("PropertyCompAllPrim"))
|
.addProperty(createKeyNavAllPrimComplexValue("PropertyCompAllPrim"))
|
||||||
.addProperty(createComplex("PropertyCompTwoPrim",
|
.addProperty(createComplex("PropertyCompTwoPrim",
|
||||||
|
@ -136,7 +136,7 @@ public class DataCreator {
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
createPrimitive("PropertyInt16", 3),
|
createPrimitive("PropertyInt16", 3),
|
||||||
createKeyNavAllPrimComplexValue("PropertyComp"))))
|
createKeyNavAllPrimComplexValue("PropertyComp"))))
|
||||||
.addProperty(createComplex("PropertyCompComp",
|
.addProperty(createComplex("PropertyCompCompNav",
|
||||||
createPrimitive("PropertyString", "1"),
|
createPrimitive("PropertyString", "1"),
|
||||||
createComplex("PropertyComp", createPrimitive("PropertyInt16", 1))));
|
createComplex("PropertyComp", createPrimitive("PropertyInt16", 1))));
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,12 +305,12 @@ public class EntityTypeProvider {
|
||||||
.setProperties(
|
.setProperties(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable,
|
PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable,
|
||||||
PropertyProvider.propertyComp_CTNavFiveProp,
|
PropertyProvider.propertyCompNav_CTNavFiveProp,
|
||||||
PropertyProvider.propertyCompAllPrim_CTAllPrim, PropertyProvider.propertyCompTwoPrim_CTTwoPrim,
|
PropertyProvider.propertyCompAllPrim_CTAllPrim, PropertyProvider.propertyCompTwoPrim_CTTwoPrim,
|
||||||
PropertyProvider.collPropertyString, PropertyProvider.collPropertyInt16,
|
PropertyProvider.collPropertyString, PropertyProvider.collPropertyInt16,
|
||||||
PropertyProvider.collPropertyComp_CTPrimComp,
|
PropertyProvider.collPropertyComp_CTPrimComp,
|
||||||
new Property()
|
new Property()
|
||||||
.setName("PropertyCompComp").setType(ComplexTypeProvider.nameCTCompNav)
|
.setName("PropertyCompCompNav").setType(ComplexTypeProvider.nameCTCompNav)
|
||||||
))
|
))
|
||||||
.setNavigationProperties(
|
.setNavigationProperties(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
|
@ -396,8 +396,9 @@ public class EntityTypeProvider {
|
||||||
new PropertyRef().setName("PropertyComp/PropertyString").setAlias("KeyAlias2"),
|
new PropertyRef().setName("PropertyComp/PropertyString").setAlias("KeyAlias2"),
|
||||||
new PropertyRef().setName("PropertyCompComp/PropertyComp/PropertyString").setAlias("KeyAlias3")))
|
new PropertyRef().setName("PropertyCompComp/PropertyComp/PropertyString").setAlias("KeyAlias3")))
|
||||||
.setProperties(
|
.setProperties(
|
||||||
Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComp_CTTwoPrim,
|
Arrays.asList(PropertyProvider.propertyInt16_NotNullable,
|
||||||
PropertyProvider.propertyCompComp_CTCompComp));
|
PropertyProvider.propertyComp_CTTwoPrim_NotNullable,
|
||||||
|
PropertyProvider.propertyCompComp_CTCompComp_NotNullable));
|
||||||
} else if (entityTypeName.equals(nameETCompMixPrimCollComp)) {
|
} else if (entityTypeName.equals(nameETCompMixPrimCollComp)) {
|
||||||
return new EntityType()
|
return new EntityType()
|
||||||
.setName("ETCompMixPrimCollComp")
|
.setName("ETCompMixPrimCollComp")
|
||||||
|
|
|
@ -580,6 +580,10 @@ public class PropertyProvider {
|
||||||
.setName("PropertyComp")
|
.setName("PropertyComp")
|
||||||
.setType(ComplexTypeProvider.nameCTNavFiveProp);
|
.setType(ComplexTypeProvider.nameCTNavFiveProp);
|
||||||
|
|
||||||
|
public static final Property propertyCompNav_CTNavFiveProp = new Property()
|
||||||
|
.setName("PropertyCompNav")
|
||||||
|
.setType(ComplexTypeProvider.nameCTNavFiveProp);
|
||||||
|
|
||||||
public static final Property propertyComp_CTPrimComp_NotNullable = new Property()
|
public static final Property propertyComp_CTPrimComp_NotNullable = new Property()
|
||||||
.setName("PropertyComp")
|
.setName("PropertyComp")
|
||||||
.setType(ComplexTypeProvider.nameCTPrimComp)
|
.setType(ComplexTypeProvider.nameCTPrimComp)
|
||||||
|
@ -589,6 +593,11 @@ public class PropertyProvider {
|
||||||
.setName("PropertyComp")
|
.setName("PropertyComp")
|
||||||
.setType(ComplexTypeProvider.nameCTTwoPrim);
|
.setType(ComplexTypeProvider.nameCTTwoPrim);
|
||||||
|
|
||||||
|
public static final Property propertyComp_CTTwoPrim_NotNullable = new Property()
|
||||||
|
.setName("PropertyComp")
|
||||||
|
.setType(ComplexTypeProvider.nameCTTwoPrim)
|
||||||
|
.setNullable(false);
|
||||||
|
|
||||||
public static final Property propertyCompAllPrim_CTAllPrim = new Property()
|
public static final Property propertyCompAllPrim_CTAllPrim = new Property()
|
||||||
.setName("PropertyCompAllPrim")
|
.setName("PropertyCompAllPrim")
|
||||||
.setType(ComplexTypeProvider.nameCTAllPrim);
|
.setType(ComplexTypeProvider.nameCTAllPrim);
|
||||||
|
@ -597,6 +606,11 @@ public class PropertyProvider {
|
||||||
.setName("PropertyCompComp")
|
.setName("PropertyCompComp")
|
||||||
.setType(ComplexTypeProvider.nameCTCompComp);
|
.setType(ComplexTypeProvider.nameCTCompComp);
|
||||||
|
|
||||||
|
public static final Property propertyCompComp_CTCompComp_NotNullable = new Property()
|
||||||
|
.setName("PropertyCompComp")
|
||||||
|
.setType(ComplexTypeProvider.nameCTCompComp)
|
||||||
|
.setNullable(false);
|
||||||
|
|
||||||
public static final Property propertyCompTwoPrim_CTTwoPrim = new Property()
|
public static final Property propertyCompTwoPrim_CTTwoPrim = new Property()
|
||||||
.setName("PropertyCompTwoPrim")
|
.setName("PropertyCompTwoPrim")
|
||||||
.setType(ComplexTypeProvider.nameCTTwoPrim);
|
.setType(ComplexTypeProvider.nameCTTwoPrim);
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class TypeDefinitionProvider {
|
||||||
public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) {
|
public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) {
|
||||||
if (nameTDString.equals(typeDefinitionName)) {
|
if (nameTDString.equals(typeDefinitionName)) {
|
||||||
return new TypeDefinition().setName(nameTDString.getName()).setUnderlyingType(
|
return new TypeDefinition().setName(nameTDString.getName()).setUnderlyingType(
|
||||||
EdmPrimitiveTypeKind.String.getFullQualifiedName());
|
EdmPrimitiveTypeKind.String.getFullQualifiedName()).setMaxLength(15);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class UriResourceImplTest {
|
||||||
assertEquals(UriResourceKind.complexProperty, impl.getKind());
|
assertEquals(UriResourceKind.complexProperty, impl.getKind());
|
||||||
|
|
||||||
EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
|
EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
|
||||||
EdmProperty property = (EdmProperty) entityType.getProperty("PropertyComp");
|
EdmProperty property = (EdmProperty) entityType.getProperty("PropertyCompNav");
|
||||||
impl.setProperty(property);
|
impl.setProperty(property);
|
||||||
|
|
||||||
assertEquals(property, impl.getProperty());
|
assertEquals(property, impl.getProperty());
|
||||||
|
|
|
@ -460,36 +460,36 @@ public class TestFullResourcePath {
|
||||||
@Test
|
@Test
|
||||||
public void runBfuncBnEsRtEntityPpCp() throws Exception {
|
public void runBfuncBnEsRtEntityPpCp() throws Exception {
|
||||||
|
|
||||||
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyComp")
|
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isEntitySet("ESKeyNav")
|
.isEntitySet("ESKeyNav")
|
||||||
.n()
|
.n()
|
||||||
.isFunction("BFCESKeyNavRTETKeyNav")
|
.isFunction("BFCESKeyNavRTETKeyNav")
|
||||||
.n()
|
.n()
|
||||||
.isComplex("PropertyComp")
|
.isComplex("PropertyCompNav")
|
||||||
.isType(ComplexTypeProvider.nameCTNavFiveProp);
|
.isType(ComplexTypeProvider.nameCTNavFiveProp);
|
||||||
|
|
||||||
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyComp/PropertyInt16")
|
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav/PropertyInt16")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isEntitySet("ESKeyNav")
|
.isEntitySet("ESKeyNav")
|
||||||
.n()
|
.n()
|
||||||
.isFunction("BFCESKeyNavRTETKeyNav")
|
.isFunction("BFCESKeyNavRTETKeyNav")
|
||||||
.n()
|
.n()
|
||||||
.isComplex("PropertyComp")
|
.isComplex("PropertyCompNav")
|
||||||
.isType(ComplexTypeProvider.nameCTNavFiveProp)
|
.isType(ComplexTypeProvider.nameCTNavFiveProp)
|
||||||
.n()
|
.n()
|
||||||
.isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
|
.isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
|
||||||
|
|
||||||
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyComp/PropertyInt16/$value")
|
testUri.run("ESKeyNav/olingo.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyCompNav/PropertyInt16/$value")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isEntitySet("ESKeyNav")
|
.isEntitySet("ESKeyNav")
|
||||||
.n()
|
.n()
|
||||||
.isFunction("BFCESKeyNavRTETKeyNav")
|
.isFunction("BFCESKeyNavRTETKeyNav")
|
||||||
.n()
|
.n()
|
||||||
.isComplex("PropertyComp")
|
.isComplex("PropertyCompNav")
|
||||||
.isType(ComplexTypeProvider.nameCTNavFiveProp)
|
.isType(ComplexTypeProvider.nameCTNavFiveProp)
|
||||||
.n()
|
.n()
|
||||||
.isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
|
.isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
|
||||||
|
@ -1351,7 +1351,7 @@ public class TestFullResourcePath {
|
||||||
.n()
|
.n()
|
||||||
.isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
|
.isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
|
||||||
|
|
||||||
testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyComp")
|
testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyCompNav")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isEntitySet("ESKeyNav")
|
.isEntitySet("ESKeyNav")
|
||||||
|
@ -1360,7 +1360,7 @@ public class TestFullResourcePath {
|
||||||
.isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
|
.isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
|
||||||
.isKeyPredicate(0, "PropertyInt16", "2")
|
.isKeyPredicate(0, "PropertyInt16", "2")
|
||||||
.n()
|
.n()
|
||||||
.isComplex("PropertyComp");
|
.isComplex("PropertyCompNav");
|
||||||
|
|
||||||
testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/NavPropertyETKeyNavOne")
|
testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/NavPropertyETKeyNavOne")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
|
@ -1387,13 +1387,13 @@ public class TestFullResourcePath {
|
||||||
.isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
|
.isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
|
||||||
.isKeyPredicate(0, "PropertyInt16", "4");
|
.isKeyPredicate(0, "PropertyInt16", "4");
|
||||||
|
|
||||||
testUri.run("ESKeyNav(1)/PropertyComp/NavPropertyETTwoKeyNavOne")
|
testUri.run("ESKeyNav(1)/PropertyCompNav/NavPropertyETTwoKeyNavOne")
|
||||||
.isKind(UriInfoKind.resource).goPath()
|
.isKind(UriInfoKind.resource).goPath()
|
||||||
.first()
|
.first()
|
||||||
.isEntitySet("ESKeyNav")
|
.isEntitySet("ESKeyNav")
|
||||||
.isKeyPredicate(0, "PropertyInt16", "1")
|
.isKeyPredicate(0, "PropertyInt16", "1")
|
||||||
.n()
|
.n()
|
||||||
.isComplex("PropertyComp")
|
.isComplex("PropertyCompNav")
|
||||||
.n()
|
.n()
|
||||||
.isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
|
.isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
|
||||||
|
|
||||||
|
@ -2500,7 +2500,7 @@ public class TestFullResourcePath {
|
||||||
.isSelectText("PropertyInt16")
|
.isSelectText("PropertyInt16")
|
||||||
.goSelectItem(0).isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
|
.goSelectItem(0).isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
|
||||||
|
|
||||||
testUri.run("ESKeyNav", "$expand=NavPropertyETKeyNavOne($select=PropertyComp/PropertyInt16)")
|
testUri.run("ESKeyNav", "$expand=NavPropertyETKeyNavOne($select=PropertyCompNav/PropertyInt16)")
|
||||||
.isKind(UriInfoKind.resource)
|
.isKind(UriInfoKind.resource)
|
||||||
.goPath().first()
|
.goPath().first()
|
||||||
.goExpand().first()
|
.goExpand().first()
|
||||||
|
@ -2508,7 +2508,7 @@ public class TestFullResourcePath {
|
||||||
.isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
|
.isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
|
||||||
.isType(EntityTypeProvider.nameETKeyNav)
|
.isType(EntityTypeProvider.nameETKeyNav)
|
||||||
.goUpExpandValidator()
|
.goUpExpandValidator()
|
||||||
.isSelectText("PropertyComp/PropertyInt16");
|
.isSelectText("PropertyCompNav/PropertyInt16");
|
||||||
|
|
||||||
testUri.runEx("ESKeyNav", "$expand=undefined")
|
testUri.runEx("ESKeyNav", "$expand=undefined")
|
||||||
.isExSemantic(UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
|
.isExSemantic(UriParserSemanticException.MessageKeys.EXPRESSION_PROPERTY_NOT_IN_TYPE);
|
||||||
|
@ -4330,8 +4330,8 @@ public class TestFullResourcePath {
|
||||||
.goParameter(0).isTypedLiteral(EntityTypeProvider.nameETBaseTwoKeyNav);
|
.goParameter(0).isTypedLiteral(EntityTypeProvider.nameETBaseTwoKeyNav);
|
||||||
|
|
||||||
testFilter
|
testFilter
|
||||||
.runOnETKeyNav("isof(olingo.odata.test1.ETBaseTwoKeyNav) eq true and PropertyComp/PropertyInt16 eq 1")
|
.runOnETKeyNav("isof(olingo.odata.test1.ETBaseTwoKeyNav) eq true and PropertyCompNav/PropertyInt16 eq 1")
|
||||||
.is("<<<isof(<olingo.odata.test1.ETBaseTwoKeyNav>)> eq <true>> and <<PropertyComp/PropertyInt16> eq <1>>>")
|
.is("<<<isof(<olingo.odata.test1.ETBaseTwoKeyNav>)> eq <true>> and <<PropertyCompNav/PropertyInt16> eq <1>>>")
|
||||||
.root().isBinary(BinaryOperatorKind.AND)
|
.root().isBinary(BinaryOperatorKind.AND)
|
||||||
.left().isBinary(BinaryOperatorKind.EQ)
|
.left().isBinary(BinaryOperatorKind.EQ)
|
||||||
.left().isMethod(MethodKind.ISOF, 1)
|
.left().isMethod(MethodKind.ISOF, 1)
|
||||||
|
@ -4378,12 +4378,12 @@ public class TestFullResourcePath {
|
||||||
.goParameter(0).goPath().isIt().goUpFilterValidator()
|
.goParameter(0).goPath().isIt().goUpFilterValidator()
|
||||||
.root().left().goParameter(1).isTypedLiteral(ComplexTypeProvider.nameCTTwoBase);
|
.root().left().goParameter(1).isTypedLiteral(ComplexTypeProvider.nameCTTwoBase);
|
||||||
|
|
||||||
testFilter.runOnETKeyNav("isof(PropertyComp/PropertyInt16,Edm.Int32)")
|
testFilter.runOnETKeyNav("isof(PropertyCompNav/PropertyInt16,Edm.Int32)")
|
||||||
.is("<isof(<PropertyComp/PropertyInt16>,<Edm.Int32>)>")
|
.is("<isof(<PropertyCompNav/PropertyInt16>,<Edm.Int32>)>")
|
||||||
.root()
|
.root()
|
||||||
.isMethod(MethodKind.ISOF, 2)
|
.isMethod(MethodKind.ISOF, 2)
|
||||||
.goParameter(0).goPath()
|
.goParameter(0).goPath()
|
||||||
.first().isComplex("PropertyComp")
|
.first().isComplex("PropertyCompNav")
|
||||||
.n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
|
.n().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
|
||||||
.goUpFilterValidator()
|
.goUpFilterValidator()
|
||||||
.root().goParameter(1).isTypedLiteral(PropertyProvider.nameInt32);
|
.root().goParameter(1).isTypedLiteral(PropertyProvider.nameInt32);
|
||||||
|
@ -4860,10 +4860,10 @@ public class TestFullResourcePath {
|
||||||
.first().isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
|
.first().isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
|
||||||
.n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
|
.n().isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
|
||||||
|
|
||||||
testFilter.runOrderByOnETTwoKeyNav("NavPropertyETKeyNavOne/PropertyComp")
|
testFilter.runOrderByOnETTwoKeyNav("NavPropertyETKeyNavOne/PropertyCompNav")
|
||||||
.isSortOrder(0, false).goOrder(0).goPath()
|
.isSortOrder(0, false).goOrder(0).goPath()
|
||||||
.first().isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
|
.first().isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
|
||||||
.n().isComplex("PropertyComp");
|
.n().isComplex("PropertyCompNav");
|
||||||
|
|
||||||
testFilter.runOrderByOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyInt16 eq 1")
|
testFilter.runOrderByOnETTwoKeyNav("PropertyComp/PropertyComp/PropertyInt16 eq 1")
|
||||||
.isSortOrder(0, false).goOrder(0).left().goPath()
|
.isSortOrder(0, false).goOrder(0).left().goPath()
|
||||||
|
|
Loading…
Reference in New Issue