Search in sources :

Example 6 with StoreProperties

use of uk.gov.gchq.gaffer.store.StoreProperties in project Gaffer by gchq.

the class StoreIT method shouldCreateStoreAndValidateSchemas.

@Test
public void shouldCreateStoreAndValidateSchemas() throws IOException, SchemaException, StoreException {
    // Given
    final TestStore testStore = new TestStore();
    final Schema schema = Schema.fromJson(StreamUtil.schemas(getClass()));
    // When
    testStore.initialise(schema, new StoreProperties());
    // Then
    assertTrue(testStore.getSchema().getEdges().containsKey(TestGroups.EDGE));
    assertTrue(testStore.getSchema().getEdges().containsKey(TestGroups.EDGE));
    assertTrue(testStore.getSchema().getEntities().containsKey(TestGroups.ENTITY));
    assertTrue(testStore.getSchema().getEntities().containsKey(TestGroups.ENTITY));
    assertFalse(testStore.getSchema().getEdges().containsKey(TestGroups.EDGE_2));
    assertFalse(testStore.getSchema().getEntities().containsKey(TestGroups.ENTITY_2));
    assertFalse(testStore.getSchema().getEdges().containsKey(TestGroups.EDGE_2));
    assertFalse(testStore.getSchema().getEntities().containsKey(TestGroups.ENTITY_2));
    assertTrue(testStore.getSchema().validate());
}
Also used : Schema(uk.gov.gchq.gaffer.store.schema.Schema) StoreProperties(uk.gov.gchq.gaffer.store.StoreProperties) Test(org.junit.Test)

Aggregations

StoreProperties (uk.gov.gchq.gaffer.store.StoreProperties)6 Test (org.junit.Test)4 Schema (uk.gov.gchq.gaffer.store.schema.Schema)4 TypeDefinition (uk.gov.gchq.gaffer.store.schema.TypeDefinition)2 IOException (java.io.IOException)1 Before (org.junit.Before)1 SchemaException (uk.gov.gchq.gaffer.data.elementdefinition.exception.SchemaException)1 StringConcat (uk.gov.gchq.gaffer.function.aggregate.StringConcat)1 Sum (uk.gov.gchq.gaffer.function.aggregate.Sum)1 Graph (uk.gov.gchq.gaffer.graph.Graph)1 StoreException (uk.gov.gchq.gaffer.store.StoreException)1 SchemaEdgeDefinition (uk.gov.gchq.gaffer.store.schema.SchemaEdgeDefinition)1