Search in sources :

Example 6 with FederatedStoreProperties

use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.

the class FederatedGetSchemaHandlerTest method setup.

@BeforeEach
public void setup() throws StoreException {
    HashMapGraphLibrary.clear();
    CacheServiceLoader.shutdown();
    handler = new FederatedGetSchemaHandler();
    user = new User("testUser");
    context = new Context(user);
    properties = new FederatedStoreProperties();
    properties.set(HashMapCacheService.STATIC_CACHE, String.valueOf(true));
    fStore = new FederatedStore();
    fStore.initialise(TEST_FED_STORE, null, properties);
    library.clear();
}
Also used : Context(uk.gov.gchq.gaffer.store.Context) User(uk.gov.gchq.gaffer.user.User) FederatedStoreProperties(uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties) FederatedStore(uk.gov.gchq.gaffer.federatedstore.FederatedStore) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 7 with FederatedStoreProperties

use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.

the class FederatedAddGraphHandlerTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    CacheServiceLoader.shutdown();
    this.store = new FederatedStore();
    federatedStoreProperties = new FederatedStoreProperties();
    federatedStoreProperties.setCacheProperties(CACHE_SERVICE_CLASS_STRING);
    testUser = testUser();
    authUser = authUser();
    blankUser = blankUser();
    ignore = new IgnoreOptions();
}
Also used : FederatedStoreProperties(uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties) FederatedStore(uk.gov.gchq.gaffer.federatedstore.FederatedStore) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 8 with FederatedStoreProperties

use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.

the class FederatedRemoveGraphHandlerTest method shouldNotRemoveGraphConfiguredWithNoAccessWritePredicate.

@Test
public void shouldNotRemoveGraphConfiguredWithNoAccessWritePredicate() throws Exception {
    FederatedStore store = new FederatedStore();
    final FederatedStoreProperties federatedStoreProperties = new FederatedStoreProperties();
    federatedStoreProperties.setCacheProperties(CACHE_SERVICE_CLASS_STRING);
    store.initialise(FEDERATEDSTORE_GRAPH_ID, null, federatedStoreProperties);
    final AccessPredicate noAccessPredicate = new NoAccessPredicate();
    store.addGraphs(testUser.getOpAuths(), "other", false, false, null, noAccessPredicate, new GraphSerialisable.Builder().config(new GraphConfig(EXPECTED_GRAPH_ID)).schema(new Schema.Builder().build()).properties(PROPERTIES).build());
    assertEquals(1, store.getGraphs(testUser, null, ignore).size());
    new FederatedRemoveGraphHandler().doOperation(new RemoveGraph.Builder().graphId(EXPECTED_GRAPH_ID).build(), new Context(testUser), store);
    Collection<Graph> graphs = store.getGraphs(testUser, null, ignore);
    assertThat(graphs).hasSize(1);
}
Also used : Context(uk.gov.gchq.gaffer.store.Context) NoAccessPredicate(uk.gov.gchq.gaffer.access.predicate.NoAccessPredicate) FederatedStoreProperties(uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties) Schema(uk.gov.gchq.gaffer.store.schema.Schema) GraphConfig(uk.gov.gchq.gaffer.graph.GraphConfig) Graph(uk.gov.gchq.gaffer.graph.Graph) RemoveGraph(uk.gov.gchq.gaffer.federatedstore.operation.RemoveGraph) GraphSerialisable(uk.gov.gchq.gaffer.graph.GraphSerialisable) NoAccessPredicate(uk.gov.gchq.gaffer.access.predicate.NoAccessPredicate) AccessPredicate(uk.gov.gchq.gaffer.access.predicate.AccessPredicate) RemoveGraph(uk.gov.gchq.gaffer.federatedstore.operation.RemoveGraph) FederatedStore(uk.gov.gchq.gaffer.federatedstore.FederatedStore) Test(org.junit.jupiter.api.Test)

Example 9 with FederatedStoreProperties

use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.

the class FederatedAddGraphWithHooksHandlerTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    CacheServiceLoader.shutdown();
    this.store = new FederatedStore();
    federatedStoreProperties = new FederatedStoreProperties();
    federatedStoreProperties.setCacheProperties(CACHE_SERVICE_CLASS_STRING);
    testUser = testUser();
    authUser = authUser();
    blankUser = blankUser();
    ignore = new IgnoreOptions();
}
Also used : FederatedStoreProperties(uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties) FederatedStore(uk.gov.gchq.gaffer.federatedstore.FederatedStore) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 10 with FederatedStoreProperties

use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.

the class FederatedGetTraitsHandlerTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    federatedStore = new FederatedStore();
    properties = new FederatedStoreProperties();
    HashMapGraphLibrary.clear();
    CacheServiceLoader.shutdown();
    storeProperties = new StoreProperties();
    storeProperties.setStoreClass(TestStoreImpl.class);
}
Also used : FederatedStoreProperties(uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties) FederatedStoreProperties(uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties) StoreProperties(uk.gov.gchq.gaffer.store.StoreProperties) FederatedStore(uk.gov.gchq.gaffer.federatedstore.FederatedStore) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

FederatedStoreProperties (uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties)11 FederatedStore (uk.gov.gchq.gaffer.federatedstore.FederatedStore)7 Graph (uk.gov.gchq.gaffer.graph.Graph)6 Context (uk.gov.gchq.gaffer.store.Context)6 Test (org.junit.jupiter.api.Test)5 Schema (uk.gov.gchq.gaffer.store.schema.Schema)5 BeforeEach (org.junit.jupiter.api.BeforeEach)4 RemoveGraph (uk.gov.gchq.gaffer.federatedstore.operation.RemoveGraph)4 GraphConfig (uk.gov.gchq.gaffer.graph.GraphConfig)4 GraphSerialisable (uk.gov.gchq.gaffer.graph.GraphSerialisable)3 User (uk.gov.gchq.gaffer.user.User)3 HashMapCacheService (uk.gov.gchq.gaffer.cache.impl.HashMapCacheService)2 Element (uk.gov.gchq.gaffer.data.element.Element)2 AddGraph (uk.gov.gchq.gaffer.federatedstore.operation.AddGraph)2 GetAllElements (uk.gov.gchq.gaffer.operation.impl.get.GetAllElements)2 ArrayList (java.util.ArrayList)1 AccessPredicate (uk.gov.gchq.gaffer.access.predicate.AccessPredicate)1 NoAccessPredicate (uk.gov.gchq.gaffer.access.predicate.NoAccessPredicate)1 CloseableIterable (uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable)1 RoadAndRoadUseWithTimesAndCardinalitiesElementGenerator (uk.gov.gchq.gaffer.doc.user.generator.RoadAndRoadUseWithTimesAndCardinalitiesElementGenerator)1