use of uk.gov.gchq.gaffer.data.graph.Walk in project Gaffer by gchq.
the class GetWalksIT method shouldFilterWalksThatDoNotContainProperty5.
@Test
public void shouldFilterWalksThatDoNotContainProperty5() throws Exception {
final Iterable<Walk> walks = getWalksThatPassPredicateTest(new CollectionContains(5));
assertThat(getPaths(walks)).isEqualTo("AED");
}
use of uk.gov.gchq.gaffer.data.graph.Walk in project Gaffer by gchq.
the class GetWalksIT method shouldNotFilterWalksWhenNoPredicateSupplied.
@Test
public void shouldNotFilterWalksWhenNoPredicateSupplied() throws Exception {
final Conditional conditional = new Conditional();
conditional.setTransform(new OperationChain.Builder().first(new Map.Builder<>().first(new ExtractWalkEntities()).then(new IterableConcat()).build()).then(new ForEach.Builder<>().operation(new Map.Builder<>().first(new ExtractProperty(TestPropertyNames.PROP_1)).build()).build()).build());
final Iterable<Walk> walks = executeGetWalksApplyingConditional(conditional);
assertThat(getPaths(walks)).isEqualTo("AED,ABC");
}
use of uk.gov.gchq.gaffer.data.graph.Walk in project Gaffer by gchq.
the class GetWalksIT method shouldReturnNoResultsWhenNoEntityResults.
@Test
public void shouldReturnNoResultsWhenNoEntityResults() throws Exception {
// Given
final GetWalks op = new GetWalks.Builder().input(seedA).operations(new GetElements.Builder().view(new View.Builder().edge(TestGroups.EDGE).build()).build(), new OperationChain.Builder().first(new GetElements.Builder().view(new View.Builder().entity(TestGroups.ENTITY, new ViewElementDefinition.Builder().preAggregationFilter(new ElementFilter.Builder().select(TestPropertyNames.INT).execute(new IsMoreThan(10000)).build()).build()).build()).build()).then(new GetElements()).build()).build();
// When
final Iterable<Walk> results = graph.execute(op, getUser());
// Then
assertThat(Lists.newArrayList(results)).isEmpty();
}
use of uk.gov.gchq.gaffer.data.graph.Walk in project Gaffer by gchq.
the class GetWalksIT method shouldGetPathsWithMultipleSeedsAndMultipleEdgeTypes.
@Test
public void shouldGetPathsWithMultipleSeedsAndMultipleEdgeTypes() throws Exception {
// Given
final GetElements operation = new GetElements.Builder().directedType(DirectedType.DIRECTED).view(new View.Builder().edge(TestGroups.EDGE, new ViewElementDefinition.Builder().properties(TestPropertyNames.COUNT).build()).edge(TestGroups.EDGE_2, new ViewElementDefinition.Builder().properties(TestPropertyNames.COUNT).build()).build()).inOutType(SeededGraphFilters.IncludeIncomingOutgoingType.OUTGOING).build();
final GetWalks op = new GetWalks.Builder().input(seedA, seedE).operations(operation, operation).build();
// When
final Iterable<Walk> results = graph.execute(op, getUser());
// Then
assertThat(getPaths(results)).isEqualTo("AED,AEF,ABC,EDA,EFC");
}
use of uk.gov.gchq.gaffer.data.graph.Walk in project Gaffer by gchq.
the class GetWalksIT method shouldFilterWalksThatDoNotContainProperty2.
@Test
public void shouldFilterWalksThatDoNotContainProperty2() throws Exception {
final Iterable<Walk> walks = getWalksThatPassPredicateTest(new CollectionContains(2));
assertThat(getPaths(walks)).isEqualTo("ABC");
}
Aggregations