use of uk.gov.gchq.gaffer.store.library.HashMapGraphLibrary in project Gaffer by gchq.
the class GraphConfigTest method getTestObject.
@Override
protected GraphConfig getTestObject() {
final String graphId = "graphId";
final GraphLibrary library = new HashMapGraphLibrary();
final View view = new View.Builder().globalElements(new GlobalViewElementDefinition.Builder().groupBy().build()).build();
final GraphHook hook1 = new AddOperationsToChain();
final GraphHook hook2 = new OperationChainLimiter();
return new GraphConfig.Builder().graphId(graphId).library(library).description("testGraphConfig").addHook(hook1).addHook(hook2).view(view).build();
}
use of uk.gov.gchq.gaffer.store.library.HashMapGraphLibrary in project Gaffer by gchq.
the class AddSchemaToLibraryHandlerTest method shouldAddSchemaWithGraphLibrary.
@Test
public void shouldAddSchemaWithGraphLibrary() throws Exception {
// given
HashMapGraphLibrary library = new HashMapGraphLibrary();
store.setGraphLibrary(library);
store.initialise(TEST_STORE_ID, new Schema(), new StoreProperties());
// when
store.execute(new Builder().schema(schema).id(TEST_SCHEMA_ID).build(), new Context(StoreUser.blankUser()));
// then
Schema actualSchema = library.getSchema(TEST_SCHEMA_ID);
assertEquals(schema, actualSchema);
}
use of uk.gov.gchq.gaffer.store.library.HashMapGraphLibrary in project Gaffer by gchq.
the class AddStorePropertiesToLibraryHandlerTest method shouldAddSchemaWithGraphLibrary.
@Test
public void shouldAddSchemaWithGraphLibrary() throws Exception {
HashMapGraphLibrary library = new HashMapGraphLibrary();
store.setGraphLibrary(library);
store.initialise(TEST_STORE_ID, new Schema(), new StoreProperties());
store.execute(new Builder().storeProperties(props).id(TEST_PROPS_ID).build(), new Context(StoreUser.blankUser()));
StoreProperties actualProps = library.getProperties(TEST_PROPS_ID);
assertEquals(props.getProperties(), actualProps.getProperties());
}
use of uk.gov.gchq.gaffer.store.library.HashMapGraphLibrary in project Gaffer by gchq.
the class FederatedStoreWrongGraphIDsTest method setUp.
@BeforeEach
public void setUp() throws Exception {
CacheServiceLoader.shutdown();
fedProps = new FederatedStoreProperties();
fedProps.setCacheProperties(CACHE_SERVICE_CLASS_STRING);
store = new FederatedStore();
library = new HashMapGraphLibrary();
HashMapGraphLibrary.clear();
library.addProperties(PROP_1, PROPERTIES);
library.addSchema(SCHEMA_1, new Schema.Builder().entity(E1_GROUP, new SchemaEntityDefinition.Builder().vertex("string").build()).type("string", String.class).build());
store.setGraphLibrary(library);
blankContext = new Context(StoreUser.blankUser());
}
use of uk.gov.gchq.gaffer.store.library.HashMapGraphLibrary in project Gaffer by gchq.
the class FederatedStorePublicAccessTest method setUp.
@BeforeEach
public void setUp() throws Exception {
CacheServiceLoader.shutdown();
fedProps = new FederatedStoreProperties();
fedProps.setCacheProperties(CACHE_SERVICE_CLASS_STRING);
store = new FederatedStore();
library = new HashMapGraphLibrary();
HashMapGraphLibrary.clear();
library.addProperties(PROP_1, PROPERTIES);
library.addSchema(SCHEMA_1, new Schema.Builder().build());
store.setGraphLibrary(library);
}
Aggregations