use of uk.gov.gchq.gaffer.function.aggregate.Sum in project Gaffer by gchq.
the class GraphTest method shouldThrowExceptionIfSchemaIsInvalid.
@Test
public void shouldThrowExceptionIfSchemaIsInvalid() throws OperationException {
final StoreProperties storeProperties = new StoreProperties();
storeProperties.setStoreClass(StoreImpl.class.getName());
try {
new Graph.Builder().addSchema(new Schema.Builder().type("intnoagg", new TypeDefinition.Builder().clazz(Integer.class).build()).type("int", new TypeDefinition.Builder().clazz(Integer.class).aggregateFunction(new Sum()).build()).type("string", new TypeDefinition.Builder().clazz(String.class).aggregateFunction(new StringConcat()).build()).type("boolean", Boolean.class).edge("EDGE", new SchemaEdgeDefinition.Builder().source("string").destination("string").directed("boolean").property("p", "intnoagg").build()).entity("ENTITY", new SchemaEntityDefinition.Builder().vertex("string").property("p2", "int").build()).build()).storeProperties(storeProperties).build();
fail("exception expected");
} catch (final SchemaException e) {
assertNotNull(e.getMessage());
}
}
Aggregations