use of uk.gov.gchq.gaffer.data.graph.Walk in project Gaffer by gchq.
the class GetWalksIT method shouldGetPathsWithMultipleSeeds.
@Test
public void shouldGetPathsWithMultipleSeeds() 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()).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,ABC,EDA");
}
use of uk.gov.gchq.gaffer.data.graph.Walk in project Gaffer by gchq.
the class GetWalksIT method shouldGetPathsWithModifiedViews.
@Test
public void shouldGetPathsWithModifiedViews() throws OperationException {
// Given
final GetElements operation = new GetElements.Builder().directedType(DirectedType.DIRECTED).inOutType(SeededGraphFilters.IncludeIncomingOutgoingType.OUTGOING).view(new View.Builder().edge(TestGroups.EDGE, new ViewElementDefinition.Builder().preAggregationFilter(new ElementFilter.Builder().select(TestPropertyNames.COUNT).execute(new IsMoreThan(0L)).build()).build()).build()).build();
final GetWalks op = new GetWalks.Builder().input(seedA).operations(operation, operation).build();
// When
final Iterable<Walk> results = graph.execute(op, getUser());
// Then
assertThat(getPaths(results)).isEqualTo("AED,ABC");
}
use of uk.gov.gchq.gaffer.data.graph.Walk in project Gaffer by gchq.
the class GetWalksIT method shouldFilterAllWalksWhenNoneContainProperty.
@Test
public void shouldFilterAllWalksWhenNoneContainProperty() throws Exception {
final Iterable<Walk> walks = getWalksThatPassPredicateTest(new CollectionContains(6));
assertThat(getPaths(walks)).isEmpty();
}
use of uk.gov.gchq.gaffer.data.graph.Walk in project Gaffer by gchq.
the class GetWalksIT method shouldReturnAllWalksWhenConditionalIsUnconfigured.
@Test
public void shouldReturnAllWalksWhenConditionalIsUnconfigured() throws Exception {
final Iterable<Walk> walks = executeGetWalksApplyingConditional(new 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 shouldGetPathsWithWhile.
@Test
public void shouldGetPathsWithWhile() 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()).build()).inOutType(SeededGraphFilters.IncludeIncomingOutgoingType.OUTGOING).build();
final GetWalks op = new Builder().input(seedA).operations(new While.Builder<>().conditional(new Conditional(// This will always be true
new Exists(), new Map.Builder<>().first(new AssertEntityIdsUnwrapped()).build())).operation(operation).maxRepeats(2).build()).build();
// When
final Iterable<Walk> results = graph.execute(op, getUser());
// Then
assertThat(getPaths(results)).isEqualTo("AED,ABC");
}
Aggregations