Search in sources :

Example 46 with ElementSeed

use of uk.gov.gchq.gaffer.operation.data.ElementSeed in project Gaffer by gchq.

the class AbstractOperationsTest method shouldGetElementsWithSeedsAndViewTest.

@Test
public void shouldGetElementsWithSeedsAndViewTest() throws OperationException {
    // Given
    final Graph graph = createGraph();
    final List<Element> elements = getInputDataForGetAllElementsTest();
    graph.execute(new AddElements.Builder().input(elements).build(), user);
    // When
    final List<ElementSeed> seeds = getSeeds();
    final View view = getView();
    final CloseableIterable<? extends Element> results = graph.execute(new GetElements.Builder().input(seeds).view(view).build(), user);
    // Then
    ElementUtil.assertElementEquals(getResultsForGetElementsWithSeedsAndViewTest(), results);
}
Also used : AddElements(uk.gov.gchq.gaffer.operation.impl.add.AddElements) Graph(uk.gov.gchq.gaffer.graph.Graph) Element(uk.gov.gchq.gaffer.data.element.Element) ElementSeed(uk.gov.gchq.gaffer.operation.data.ElementSeed) View(uk.gov.gchq.gaffer.data.elementdefinition.view.View) Test(org.junit.jupiter.api.Test)

Example 47 with ElementSeed

use of uk.gov.gchq.gaffer.operation.data.ElementSeed in project Gaffer by gchq.

the class StringVertexOperationsTest method getSeedsThatWontAppear.

@Override
protected List<ElementSeed> getSeedsThatWontAppear() {
    final List<ElementSeed> seeds = new ArrayList<>();
    seeds.add(new EntitySeed("vert100"));
    seeds.add(new EntitySeed("notpresentvert100"));
    seeds.add(new EntitySeed(""));
    return seeds;
}
Also used : ArrayList(java.util.ArrayList) EntitySeed(uk.gov.gchq.gaffer.operation.data.EntitySeed) ElementSeed(uk.gov.gchq.gaffer.operation.data.ElementSeed)

Example 48 with ElementSeed

use of uk.gov.gchq.gaffer.operation.data.ElementSeed in project Gaffer by gchq.

the class TypeValueVertexOperationsTest method getSeedsThatWontAppear.

@Override
protected List<ElementSeed> getSeedsThatWontAppear() {
    final List<ElementSeed> seeds = new ArrayList<>();
    seeds.add(new EntitySeed(new TypeValue("type0", "vrt10000")));
    seeds.add(new EntitySeed(new TypeValue("abc", "def")));
    seeds.add(new EdgeSeed(new TypeValue("abc", "def"), new TypeValue("type0", "src0"), true));
    return seeds;
}
Also used : EdgeSeed(uk.gov.gchq.gaffer.operation.data.EdgeSeed) ArrayList(java.util.ArrayList) EntitySeed(uk.gov.gchq.gaffer.operation.data.EntitySeed) TypeValue(uk.gov.gchq.gaffer.types.TypeValue) ElementSeed(uk.gov.gchq.gaffer.operation.data.ElementSeed)

Example 49 with ElementSeed

use of uk.gov.gchq.gaffer.operation.data.ElementSeed in project Gaffer by gchq.

the class TypeValueVertexOperationsTest method getSeeds.

@Override
public List<ElementSeed> getSeeds() {
    final List<ElementSeed> seeds = new ArrayList<>();
    seeds.add(new EntitySeed(new TypeValue("type0", "vrt10")));
    seeds.add(new EntitySeed(new TypeValue("type2", "src17")));
    seeds.add(new EdgeSeed(new TypeValue("type1", "src11"), new TypeValue("type1", "dst12"), true));
    return seeds;
}
Also used : EdgeSeed(uk.gov.gchq.gaffer.operation.data.EdgeSeed) ArrayList(java.util.ArrayList) EntitySeed(uk.gov.gchq.gaffer.operation.data.EntitySeed) TypeValue(uk.gov.gchq.gaffer.types.TypeValue) ElementSeed(uk.gov.gchq.gaffer.operation.data.ElementSeed)

Aggregations

ElementSeed (uk.gov.gchq.gaffer.operation.data.ElementSeed)49 Element (uk.gov.gchq.gaffer.data.element.Element)29 EntitySeed (uk.gov.gchq.gaffer.operation.data.EntitySeed)28 View (uk.gov.gchq.gaffer.data.elementdefinition.view.View)19 User (uk.gov.gchq.gaffer.user.User)14 ArrayList (java.util.ArrayList)13 HashSet (java.util.HashSet)13 EdgeSeed (uk.gov.gchq.gaffer.operation.data.EdgeSeed)13 GetElements (uk.gov.gchq.gaffer.operation.impl.get.GetElements)11 Test (org.junit.Test)8 Test (org.junit.jupiter.api.Test)8 IteratorSettingException (uk.gov.gchq.gaffer.accumulostore.key.exception.IteratorSettingException)8 Edge (uk.gov.gchq.gaffer.data.element.Edge)7 Graph (uk.gov.gchq.gaffer.graph.Graph)7 GetElementsInRanges (uk.gov.gchq.gaffer.accumulostore.operation.impl.GetElementsInRanges)6 Pair (uk.gov.gchq.gaffer.accumulostore.utils.Pair)6 ViewElementDefinition (uk.gov.gchq.gaffer.data.elementdefinition.view.ViewElementDefinition)5 AddElements (uk.gov.gchq.gaffer.operation.impl.add.AddElements)5 Entity (uk.gov.gchq.gaffer.data.element.Entity)4 Iterator (java.util.Iterator)3