diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java index 6c0274390..ac9332b65 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java @@ -49,8 +49,8 @@ public class ComplexTypeProvider { public static final FullQualifiedName nameCTTwoBasePrimCompNav = new FullQualifiedName(SchemaProvider.NAMESPACE, "CTTwoBasePrimCompNav"); public static final FullQualifiedName nameCTTwoPrim = new FullQualifiedName(SchemaProvider.NAMESPACE, "CTTwoPrim"); - public static final FullQualifiedName nameCTMixEnumTypeDefColl = new FullQualifiedName(SchemaProvider.NAMESPACE, - "CTMixEnumTypeDefColl"); + public static final FullQualifiedName nameCTMixEnumDefColl = new FullQualifiedName(SchemaProvider.NAMESPACE, + "CTMixEnumDefColl"); public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { @@ -163,9 +163,9 @@ public class ComplexTypeProvider { .setName("CTTwoBasePrimCompNav") .setBaseType(nameCTBasePrimCompNav); - } else if (complexTypeName.equals(nameCTMixEnumTypeDefColl)) { + } else if (complexTypeName.equals(nameCTMixEnumDefColl)) { return new ComplexType() - .setName(nameCTMixEnumTypeDefColl.getName()) + .setName(nameCTMixEnumDefColl.getName()) .setProperties(Arrays.asList( PropertyProvider.propertyEnumString_ENString, PropertyProvider.collPropertyEnumString_ENString, diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java index 2a5ef8f97..7cf15faa6 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java @@ -95,7 +95,7 @@ public class ContainerProvider { entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBaseTwoKeyNav")); entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompMixPrimCollComp")); entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESFourKeyAlias")); - entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMixEnumTypeDefCollComp")); + entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMixEnumDefCollComp")); // Singletons List singletons = new ArrayList(); @@ -263,9 +263,10 @@ public class ContainerProvider { return new EntitySet() .setName("ESFourKeyAlias") .setType(EntityTypeProvider.nameETFourKeyAlias); - } else if (name.equals("ESMixEnumTypeDefCollComp")) { - return new EntitySet().setName("ESMixEnumTypeDefCollComp").setType( - EntityTypeProvider.nameETMixEnumTypeDefCollComp); + + } else if (name.equals("ESMixEnumDefCollComp")) { + return new EntitySet().setName("ESMixEnumDefCollComp").setType( + EntityTypeProvider.nameETMixEnumDefCollComp); } } diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java index e78c5d439..7230a5572 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java @@ -76,8 +76,8 @@ public class EntityTypeProvider { public static final FullQualifiedName nameETAbstractBase = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETAbstractBase"); - public static final FullQualifiedName nameETMixEnumTypeDefCollComp = new FullQualifiedName(SchemaProvider.NAMESPACE, - "ETMixEnumTypeDefCollComp"); + public static final FullQualifiedName nameETMixEnumDefCollComp = new FullQualifiedName(SchemaProvider.NAMESPACE, + "ETMixEnumDefCollComp"); public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { if (entityTypeName.equals(nameETAllPrim)) { @@ -418,9 +418,9 @@ public class EntityTypeProvider { .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable)); - } else if (entityTypeName.equals(nameETMixEnumTypeDefCollComp)) { + } else if (entityTypeName.equals(nameETMixEnumDefCollComp)) { return new EntityType() - .setName(nameETMixEnumTypeDefCollComp.getName()) + .setName(nameETMixEnumDefCollComp.getName()) .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16"))) .setProperties(Arrays.asList( PropertyProvider.propertyInt16_NotNullable, diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java index 636fbee4a..66dcc9e75 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java @@ -517,12 +517,12 @@ public class PropertyProvider { .setType(ComplexTypeProvider.nameCTMixPrimCollComp); public static final Property propertyComp_CTMixEnumTypeDefColl = new Property() - .setName("PropertyCTMixEnumTypeDefColl") - .setType(ComplexTypeProvider.nameCTMixEnumTypeDefColl); + .setName("PropertyCompMixedEnumTypeDefColl") + .setType(ComplexTypeProvider.nameCTMixEnumDefColl); public static final Property propertyCompColl_CTMixEnumTypeDefColl = new Property() - .setName("CollPropertyCTMixEnumTypeDefColl") - .setType(ComplexTypeProvider.nameCTMixEnumTypeDefColl) + .setName("CollPropertyCompMixedEnumDefColl") + .setType(ComplexTypeProvider.nameCTMixEnumDefColl) .setCollection(true); // Navigation Properties ------------------------------------------------------------------------------------------- @@ -599,11 +599,11 @@ public class PropertyProvider { // TypeDefinition Properties --------------------------------------------------------------------------------------- public static final Property propertyTypeDefinition_TDString = new Property() - .setName("PropertyTypeDefinitionString") + .setName("PropertyDefString") .setType(TypeDefinitionProvider.nameTDString); public static final Property collPropertyTypeDefinition_TDString = new Property() - .setName("CollPropertyTypeDefinitionString") + .setName("CollPropertyDefString") .setType(TypeDefinitionProvider.nameTDString) .setCollection(true); } 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 1b628f41e..320c1a40b 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 @@ -78,7 +78,7 @@ public class SchemaProvider { entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyPrimNav)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAbstract)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAbstractBase)); - entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMixEnumTypeDefCollComp)); + entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMixEnumDefCollComp)); // ComplexTypes List complexType = new ArrayList(); @@ -97,7 +97,7 @@ public class SchemaProvider { complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTBasePrimCompNav)); complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoBasePrimCompNav)); complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompNav)); - complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTMixEnumTypeDefColl)); + complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTMixEnumDefColl)); // TypeDefinitions List typeDefinitions = new ArrayList(); 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 911f24d29..3e308eb54 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 @@ -4452,39 +4452,39 @@ public class TestFullResourcePath { @Test public void testHas() throws ExpressionVisitException, ODataApplicationException, UriParserException { - testFilter.runOnETMixEnumTypeDefCollComp("PropertyEnumString has olingo.odata.test1.ENString'String1'") + testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has olingo.odata.test1.ENString'String1'") .is("< has >>") .isBinary(BinaryOperatorKind.HAS) .root().left().goPath().isComplex("PropertyEnumString").isType(EnumTypeProvider.nameENString) .goUpFilterValidator() .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String1")); - testFilter.runOnETMixEnumTypeDefCollComp( - "PropertyCTMixEnumTypeDefColl/PropertyEnumString has olingo.odata.test1.ENString'String2'") - .is("< has >>") + testFilter.runOnETMixEnumDefCollComp( + "PropertyCompMixedEnumTypeDefColl/PropertyEnumString has olingo.odata.test1.ENString'String2'") + .is("< has >>") .isBinary(BinaryOperatorKind.HAS) .root().left().goPath() - .first().isComplex("PropertyCTMixEnumTypeDefColl") + .first().isComplex("PropertyCompMixedEnumTypeDefColl") .n().isComplex("PropertyEnumString").isType(EnumTypeProvider.nameENString) .isType(EnumTypeProvider.nameENString) .goUpFilterValidator() .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String2")); testFilter - .runOnETMixEnumTypeDefCollComp( - "PropertyCTMixEnumTypeDefColl/PropertyEnumString has olingo.odata.test1.ENString'String2' eq true") - .is("<< has " + - ">> eq >") + .runOnETMixEnumDefCollComp( + "PropertyCompMixedEnumTypeDefColl/PropertyEnumString has olingo.odata.test1.ENString'String2' eq true") + .is("<< has " + + ">> eq >") .isBinary(BinaryOperatorKind.EQ) .root().left() .isBinary(BinaryOperatorKind.HAS) .root().left().left().goPath() - .first().isComplex("PropertyCTMixEnumTypeDefColl") + .first().isComplex("PropertyCompMixedEnumTypeDefColl") .n().isComplex("PropertyEnumString").isType(EnumTypeProvider.nameENString) .goUpFilterValidator() .root().left().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String2")); - testFilter.runOnETMixEnumTypeDefCollComp("PropertyEnumString has olingo.odata.test1.ENString'String3'") + testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has olingo.odata.test1.ENString'String3'") .is("< has >>") .isBinary(BinaryOperatorKind.HAS) .root().left().goPath() @@ -4493,7 +4493,7 @@ public class TestFullResourcePath { .goUpFilterValidator() .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String3")); - testFilter.runOnETMixEnumTypeDefCollComp("PropertyEnumString has olingo.odata.test1.ENString'String,String3'") + testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has olingo.odata.test1.ENString'String,String3'") .is("< has >>") .isBinary(BinaryOperatorKind.HAS) .root().left().goPath() @@ -4502,7 +4502,7 @@ public class TestFullResourcePath { .goUpFilterValidator() .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String", "String3")); - testFilter.runOnETMixEnumTypeDefCollComp("PropertyEnumString has null") + testFilter.runOnETMixEnumDefCollComp("PropertyEnumString has null") .is("< has >") .root() .isBinary(BinaryOperatorKind.HAS) @@ -4719,38 +4719,41 @@ public class TestFullResourcePath { .goUpFilterValidator() .root().right().isLiteral("12:34:55.12345678901"); - testFilter.runOnETMixEnumTypeDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String1'") + testFilter.runOnETMixEnumDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String1'") .is("< eq >>") .isBinary(BinaryOperatorKind.EQ) .root().left().goPath().isComplex("PropertyEnumString").isType(EnumTypeProvider.nameENString) .goUpFilterValidator() .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String1")); - testFilter.runOnETMixEnumTypeDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String2'") + testFilter.runOnETMixEnumDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String2'") .is("< eq >>") .isBinary(BinaryOperatorKind.EQ) .root().left().goPath().isComplex("PropertyEnumString").isType(EnumTypeProvider.nameENString) .goUpFilterValidator() .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String2")); - testFilter.runOnETMixEnumTypeDefCollComp( - "PropertyCTMixEnumTypeDefColl/PropertyEnumString eq olingo.odata.test1.ENString'String3'") - .is("< eq >>") + testFilter.runOnETMixEnumDefCollComp( + "PropertyCompMixedEnumTypeDefColl/PropertyEnumString eq olingo.odata.test1.ENString'String3'") + .is("< eq >>") .isBinary(BinaryOperatorKind.EQ) .root().left().goPath() - .first().isComplex("PropertyCTMixEnumTypeDefColl") + .first().isComplex("PropertyCompMixedEnumTypeDefColl") .n().isComplex("PropertyEnumString").isType(EnumTypeProvider.nameENString).goUpFilterValidator() .root().right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String3")); - testFilter.runOnETMixEnumTypeDefCollComp( - "PropertyCTMixEnumTypeDefColl/PropertyEnumString eq PropertyCTMixEnumTypeDefColl/PropertyEnumString") - .is("< eq >") + testFilter + .runOnETMixEnumDefCollComp( + "PropertyCompMixedEnumTypeDefColl/PropertyEnumString eq " + + "PropertyCompMixedEnumTypeDefColl/PropertyEnumString") + .is("< eq " + + ">") .isBinary(BinaryOperatorKind.EQ) .root().left().goPath() - .first().isComplex("PropertyCTMixEnumTypeDefColl") + .first().isComplex("PropertyCompMixedEnumTypeDefColl") .n().isComplex("PropertyEnumString").isType(EnumTypeProvider.nameENString).goUpFilterValidator() .root().right().goPath() - .first().isComplex("PropertyCTMixEnumTypeDefColl") + .first().isComplex("PropertyCompMixedEnumTypeDefColl") .n().isComplex("PropertyEnumString").isType(EnumTypeProvider.nameENString).goUpFilterValidator(); } @@ -5070,12 +5073,12 @@ public class TestFullResourcePath { .goUpFilterValidator() .goOrder(0).right().isLiteral("12:34:55.123456789012"); - testFilter.runOrderByOnETMixEnumTypeDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String1'") + testFilter.runOrderByOnETMixEnumDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String1'") .isSortOrder(0, false) .goOrder(0).left().goPath().isComplex("PropertyEnumString").goUpFilterValidator() .goOrder(0).right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String1")); - testFilter.runOrderByOnETMixEnumTypeDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String1' desc") + testFilter.runOrderByOnETMixEnumDefCollComp("PropertyEnumString eq olingo.odata.test1.ENString'String1' desc") .isSortOrder(0, true) .goOrder(0).left().goPath().isComplex("PropertyEnumString").goUpFilterValidator() .goOrder(0).right().isEnum(EnumTypeProvider.nameENString, Arrays.asList("String1")); diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java index ff77f940b..f5304566d 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java @@ -113,8 +113,8 @@ public class FilterValidator implements TestValidator { return runUriOrderBy("ESTwoKeyNav", "$orderby=" + orderBy.trim()); } - public FilterValidator runOrderByOnETMixEnumTypeDefCollComp(final String orderBy) throws UriParserException { - return runUriOrderBy("ESMixEnumTypeDefCollComp", "$orderby=" + orderBy.trim()); + public FilterValidator runOrderByOnETMixEnumDefCollComp(final String orderBy) throws UriParserException { + return runUriOrderBy("ESMixEnumDefCollComp", "$orderby=" + orderBy.trim()); } public FilterValidator runOrderByOnETTwoKeyNavEx(final String orderBy) throws UriParserException { @@ -125,8 +125,8 @@ public class FilterValidator implements TestValidator { return runUri("ESTwoKeyNav", "$filter=" + filter.trim()); } - public FilterValidator runOnETMixEnumTypeDefCollComp(final String filter) throws UriParserException { - return runUri("ESMixEnumTypeDefCollComp", "$filter=" + filter.trim()); + public FilterValidator runOnETMixEnumDefCollComp(final String filter) throws UriParserException { + return runUri("ESMixEnumDefCollComp", "$filter=" + filter.trim()); } public FilterValidator runOnETTwoKeyNavSingle(final String filter) throws UriParserException {