use of uk.gov.gchq.gaffer.store.schema.Schema in project Gaffer by gchq.
the class ByteEntityBloomElementFunctorTest method setup.
@Before
public void setup() {
schema = new Schema.Builder().vertexSerialiser(new JavaSerialiser()).edge(TestGroups.EDGE).entity(TestGroups.ENTITY).build();
elementConverter = new ByteEntityAccumuloElementConverter(schema);
}
use of uk.gov.gchq.gaffer.store.schema.Schema in project Gaffer by gchq.
the class Gaffer1BloomElementFunctorTest method setup.
@Before
public void setup() {
schema = new Schema.Builder().vertexSerialiser(new JavaSerialiser()).edge(TestGroups.EDGE).entity(TestGroups.ENTITY).build();
elementConverter = new ClassicAccumuloElementConverter(schema);
}
use of uk.gov.gchq.gaffer.store.schema.Schema in project Gaffer by gchq.
the class IteratorSettingBuilderTest method shouldAddCompactSchemaToIteratorSetting.
@Test
public void shouldAddCompactSchemaToIteratorSetting() throws Exception {
// Given
final IteratorSetting setting = mock(IteratorSetting.class);
final Schema schema = mock(Schema.class);
final String compactSchemaJson = "CompactSchema";
given(schema.toCompactJson()).willReturn(compactSchemaJson.getBytes());
// When
new IteratorSettingBuilder(setting).schema(schema);
// Then
verify(setting).addOption(AccumuloStoreConstants.SCHEMA, compactSchemaJson);
}
use of uk.gov.gchq.gaffer.store.schema.Schema in project Gaffer by gchq.
the class TableUtilsTest method shouldThrowExceptionIfTableNameIsNotSpecifiedWhenCreatingTable.
@Test(expected = AccumuloRuntimeException.class)
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(SingleUseMockAccumuloStore.class.getName());
final AccumuloStore store = new AccumuloStore();
store.initialise(schema, properties);
// When
TableUtils.createTable(store);
fail("The expected exception was not thrown.");
}
use of uk.gov.gchq.gaffer.store.schema.Schema in project Gaffer by gchq.
the class TableUtilsTest method shouldThrowExceptionIfTableNameIsNotSpecifiedWhenCreatingAGraph.
@Test(expected = AccumuloRuntimeException.class)
public void shouldThrowExceptionIfTableNameIsNotSpecifiedWhenCreatingAGraph() {
// 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(SingleUseMockAccumuloStore.class.getName());
// When
new Graph.Builder().addSchema(schema).storeProperties(properties).build();
fail("The expected exception was not thrown.");
}
Aggregations