in hugegraph-test/src/main/java/org/apache/hugegraph/core/PropertyKeyCoreTest.java [226:355]
public void testAddPropertyKeyWithAggregateTypeInvalid() {
SchemaManager schema = graph().schema();
// Invalid cardinality
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueList().calcMin().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueSet().calcMin().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueList().calcMax().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueSet().calcMax().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueList().calcSum().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueSet().calcSum().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueList().calcOld().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueSet().calcOld().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueSingle().calcSet().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueSingle().calcList().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueSet().calcList().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueList().calcSet().create();
});
// Invalid data type
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asText().valueSingle().calcMin().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asBlob().valueSingle().calcMin().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asBoolean().valueSingle().calcMin().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asUUID().valueSingle().calcMin().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asText().valueSingle().calcMax().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asBlob().valueSingle().calcMax().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asBoolean().valueSingle().calcMax().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asUUID().valueSingle().calcMax().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asText().valueSingle().calcSum().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asBlob().valueSingle().calcSum().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asBoolean().valueSingle().calcSum().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asUUID().valueSingle().calcSum().create();
});
Assert.assertThrows(NotAllowException.class, () -> {
schema.propertyKey("aggregateProperty")
.asDate().valueSingle().calcSum().create();
});
}