Search in sources :

Example 1 with MiniAccumuloStore

use of uk.gov.gchq.gaffer.accumulostore.MiniAccumuloStore in project Gaffer by gchq.

the class TableUtilsTest method shouldThrowExceptionIfTableNameIsNotSpecifiedWhenCreatingTable.

@Test
public void shouldThrowExceptionIfTableNameIsNotSpecifiedWhenCreatingTable() throws StoreException, TableExistsException {
    // Given
    final Schema schema = new Schema.Builder().type("int", Integer.class).type("string", String.class).type("boolean", Boolean.class).edge("EDGE", new SchemaEdgeDefinition.Builder().source("string").destination("string").directed("boolean").build()).build();
    final AccumuloProperties properties = new AccumuloProperties();
    properties.setStoreClass(PROPERTIES.getStoreClass());
    properties.setZookeepers((PROPERTIES.getZookeepers()));
    final AccumuloStore store = new MiniAccumuloStore();
    assertThatIllegalArgumentException().isThrownBy(() -> store.initialise(null, schema, properties));
    // When
    assertThatExceptionOfType(AccumuloRuntimeException.class).isThrownBy(() -> TableUtils.createTable(store));
}
Also used : AccumuloProperties(uk.gov.gchq.gaffer.accumulostore.AccumuloProperties) Schema(uk.gov.gchq.gaffer.store.schema.Schema) AccumuloRuntimeException(uk.gov.gchq.gaffer.accumulostore.key.AccumuloRuntimeException) MiniAccumuloStore(uk.gov.gchq.gaffer.accumulostore.MiniAccumuloStore) SingleUseMiniAccumuloStore(uk.gov.gchq.gaffer.accumulostore.SingleUseMiniAccumuloStore) AccumuloStore(uk.gov.gchq.gaffer.accumulostore.AccumuloStore) MiniAccumuloStore(uk.gov.gchq.gaffer.accumulostore.MiniAccumuloStore) SingleUseMiniAccumuloStore(uk.gov.gchq.gaffer.accumulostore.SingleUseMiniAccumuloStore) Test(org.junit.jupiter.api.Test)

Example 2 with MiniAccumuloStore

use of uk.gov.gchq.gaffer.accumulostore.MiniAccumuloStore in project Gaffer by gchq.

the class TableUtilsTest method shouldThrowExceptionIfTableNameIsNotSpecified.

@Test
public void shouldThrowExceptionIfTableNameIsNotSpecified() throws StoreException {
    // Given
    final Schema schema = new Schema.Builder().type("int", Integer.class).type("string", String.class).type("boolean", Boolean.class).edge("EDGE", new SchemaEdgeDefinition.Builder().source("string").destination("string").directed("boolean").build()).build();
    final AccumuloProperties properties = new AccumuloProperties();
    properties.setStoreClass(PROPERTIES.getStoreClass());
    properties.setZookeepers(PROPERTIES.getZookeepers());
    final AccumuloStore store = new MiniAccumuloStore();
    assertThatIllegalArgumentException().isThrownBy(() -> store.initialise(null, schema, properties));
    // When
    assertThatExceptionOfType(AccumuloRuntimeException.class).isThrownBy(() -> TableUtils.ensureTableExists(store));
}
Also used : AccumuloProperties(uk.gov.gchq.gaffer.accumulostore.AccumuloProperties) Schema(uk.gov.gchq.gaffer.store.schema.Schema) AccumuloRuntimeException(uk.gov.gchq.gaffer.accumulostore.key.AccumuloRuntimeException) MiniAccumuloStore(uk.gov.gchq.gaffer.accumulostore.MiniAccumuloStore) SingleUseMiniAccumuloStore(uk.gov.gchq.gaffer.accumulostore.SingleUseMiniAccumuloStore) AccumuloStore(uk.gov.gchq.gaffer.accumulostore.AccumuloStore) MiniAccumuloStore(uk.gov.gchq.gaffer.accumulostore.MiniAccumuloStore) SingleUseMiniAccumuloStore(uk.gov.gchq.gaffer.accumulostore.SingleUseMiniAccumuloStore) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 AccumuloProperties (uk.gov.gchq.gaffer.accumulostore.AccumuloProperties)2 AccumuloStore (uk.gov.gchq.gaffer.accumulostore.AccumuloStore)2 MiniAccumuloStore (uk.gov.gchq.gaffer.accumulostore.MiniAccumuloStore)2 SingleUseMiniAccumuloStore (uk.gov.gchq.gaffer.accumulostore.SingleUseMiniAccumuloStore)2 AccumuloRuntimeException (uk.gov.gchq.gaffer.accumulostore.key.AccumuloRuntimeException)2 Schema (uk.gov.gchq.gaffer.store.schema.Schema)2