@Test public void testNonOverlappingCollections() throws Exception { FlinkAsciiGraphLoader loader = getSocialNetworkLoader(); GraphCollection col01 = loader.getGraphCollectionByVariables("g0", "g1"); GraphCollection col23 = loader.getGraphCollectionByVariables("g2", "g3"); GraphCollection result = col01.difference(col23); checkAssertions(col01, result, "non"); result = col01.differenceWithSmallResult(col23); checkAssertions(col01, result, "small non"); }
/** * Test using multiple aggregation functions on an empty graph collection * * @throws Exception if the execution or IO fails. */ @Test public void testEmptyCollectionWithMultipleAggregationFunctions() throws Exception { FlinkAsciiGraphLoader loader = getSocialNetworkLoader(); GraphCollection collection = loader.getGraphCollectionByVariables("g0") .difference(loader.getGraphCollectionByVariables("g1")); VertexCount vertexCount = new VertexCount(); EdgeCount edgeCount = new EdgeCount(); Count count = new Count(); GraphCollection expected = collection .apply(new ApplyAggregation(vertexCount)) .apply(new ApplyAggregation(edgeCount)) .apply(new ApplyAggregation(count)); GraphCollection output = collection.apply(new ApplyAggregation(vertexCount, edgeCount, count)); collectAndAssertTrue(expected.equalsByGraphData(output)); } }
@Test public void testOverlappingCollections() throws Exception { FlinkAsciiGraphLoader loader = getSocialNetworkLoader(); GraphCollection col02 = loader.getGraphCollectionByVariables("g0", "g2"); GraphCollection col12 = loader.getGraphCollectionByVariables("g1", "g2"); GraphCollection expectation = loader.getGraphCollectionByVariables("g0"); GraphCollection result = col02.difference(col12); checkAssertions(expectation, result, ""); result = col02.differenceWithSmallResult(col12); checkAssertions(expectation, result, "small"); }
@Test public void testTotalOverlappingCollections() throws Exception { FlinkAsciiGraphLoader loader = getSocialNetworkLoader(); GraphCollection col01 = loader.getGraphCollectionByVariables("g0", "g1"); GraphCollection expectation = getConfig().getGraphCollectionFactory().createEmptyCollection(); GraphCollection result = col01.difference(col01); checkAssertions(expectation, result, "total"); result = col01.differenceWithSmallResult(col01); checkAssertions(expectation, result, "small total"); } }