Search in sources :

Example 6 with EntityIdExtractor

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

the class EntityIdExtractorTest method shouldGetOppositeMatchedVertexFromEdge.

@Test
public void shouldGetOppositeMatchedVertexFromEdge() {
    // Given
    final EntityIdExtractor extractor = new EntityIdExtractor(IdentifierType.ADJACENT_MATCHED_VERTEX);
    final Edge edge = new Edge.Builder().group(TestGroups.EDGE).source("1").dest("2").directed(false).build();
    // When
    final EntityId seed = extractor._apply(edge);
    // Then
    assertEquals("2", seed.getVertex());
}
Also used : EntityId(uk.gov.gchq.gaffer.data.element.id.EntityId) EntityIdExtractor(uk.gov.gchq.gaffer.operation.data.generator.EntityIdExtractor) Edge(uk.gov.gchq.gaffer.data.element.Edge) Test(org.junit.jupiter.api.Test)

Example 7 with EntityIdExtractor

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

the class EntityIdExtractorTest method shouldGetMatchedVertexFromEdge.

@Test
public void shouldGetMatchedVertexFromEdge() {
    // Given
    final EntityIdExtractor extractor = new EntityIdExtractor(IdentifierType.MATCHED_VERTEX);
    final Edge edge = new Edge.Builder().group(TestGroups.EDGE).source("1").dest("2").directed(false).build();
    // When
    final EntityId seed = extractor._apply(edge);
    // Then
    assertEquals("1", seed.getVertex());
}
Also used : EntityId(uk.gov.gchq.gaffer.data.element.id.EntityId) EntityIdExtractor(uk.gov.gchq.gaffer.operation.data.generator.EntityIdExtractor) Edge(uk.gov.gchq.gaffer.data.element.Edge) Test(org.junit.jupiter.api.Test)

Example 8 with EntityIdExtractor

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

the class EntityIdExtractorTest method shouldGetDestinationFromEdge.

@Test
public void shouldGetDestinationFromEdge() {
    // Given
    final EntityIdExtractor extractor = new EntityIdExtractor(IdentifierType.DESTINATION);
    final Edge edge = new Edge.Builder().group(TestGroups.EDGE).source("1").dest("2").directed(false).build();
    // When
    final EntityId seed = extractor._apply(edge);
    // Then
    assertEquals("2", seed.getVertex());
}
Also used : EntityId(uk.gov.gchq.gaffer.data.element.id.EntityId) EntityIdExtractor(uk.gov.gchq.gaffer.operation.data.generator.EntityIdExtractor) Edge(uk.gov.gchq.gaffer.data.element.Edge) Test(org.junit.jupiter.api.Test)

Aggregations

EntityIdExtractor (uk.gov.gchq.gaffer.operation.data.generator.EntityIdExtractor)8 Test (org.junit.jupiter.api.Test)6 Edge (uk.gov.gchq.gaffer.data.element.Edge)5 EntityId (uk.gov.gchq.gaffer.data.element.id.EntityId)5 Test (org.junit.Test)2 View (uk.gov.gchq.gaffer.data.elementdefinition.view.View)2 Builder (uk.gov.gchq.gaffer.operation.OperationChain.Builder)2 EntitySeed (uk.gov.gchq.gaffer.operation.data.EntitySeed)2 DiscardOutput (uk.gov.gchq.gaffer.operation.impl.DiscardOutput)2 GetElements (uk.gov.gchq.gaffer.operation.impl.get.GetElements)2 Entity (uk.gov.gchq.gaffer.data.element.Entity)1 ExportToGafferResultCache (uk.gov.gchq.gaffer.operation.impl.export.resultcache.ExportToGafferResultCache)1 GetGafferResultCacheExport (uk.gov.gchq.gaffer.operation.impl.export.resultcache.GetGafferResultCacheExport)1 ExportToSet (uk.gov.gchq.gaffer.operation.impl.export.set.ExportToSet)1 GetSetExport (uk.gov.gchq.gaffer.operation.impl.export.set.GetSetExport)1