use of org.pentaho.metaverse.api.IGraphWriter in project pentaho-metaverse by pentaho.
the class LineageWriterTest method testOutputLineageGraph.
@Test
public void testOutputLineageGraph() throws Exception {
Graph g = new TinkerGraph();
IMetaverseBuilder builder = new MetaverseBuilder(g);
holder.setMetaverseBuilder(builder);
writer.setGraphOutputStream(System.out);
IGraphWriter graphWriter = mock(IGraphWriter.class);
writer.setGraphWriter(graphWriter);
writer.outputLineageGraph(holder);
}
use of org.pentaho.metaverse.api.IGraphWriter in project pentaho-metaverse by pentaho.
the class LineageWriterTest method testGetSetGraphWriter.
@Test
public void testGetSetGraphWriter() throws Exception {
assertNull(writer.getGraphWriter());
IGraphWriter graphWriter = mock(IGraphWriter.class);
writer.setGraphWriter(graphWriter);
assertEquals(graphWriter, writer.getGraphWriter());
}
use of org.pentaho.metaverse.api.IGraphWriter in project pentaho-metaverse by pentaho.
the class BaseRuntimeExtensionPointTest method testWriteLineageHolder.
@Test
public void testWriteLineageHolder() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
assertEquals(0, baos.size());
PrintStream stringStream = new PrintStream(baos);
IGraphWriter graphWriter = mock(IGraphWriter.class);
IExecutionProfile executionProfile = new ExecutionProfile();
executionProfile.setName("testName");
IMetaverseBuilder builder = mock(IMetaverseBuilder.class);
LineageHolder holder = new LineageHolder(executionProfile, builder);
LineageWriter lineageWriter = new LineageWriter();
lineageWriter.setProfileOutputStream(stringStream);
lineageWriter.setGraphOutputStream(System.out);
lineageWriter.setOutputStrategy("all");
lineageWriter.setGraphWriter(graphWriter);
extensionPoint.setLineageWriter(lineageWriter);
extensionPoint.writeLineageInfo(holder);
assertNotEquals(0, baos.size());
assertTrue(baos.toString().contains("testName"));
verify(graphWriter, times(1)).outputGraph(any(Graph.class), any(OutputStream.class));
}
use of org.pentaho.metaverse.api.IGraphWriter in project pentaho-metaverse by pentaho.
the class FileSystemLineageWriterTest method testGetSetGraphOutputStream.
@Test
public void testGetSetGraphOutputStream() {
assertNull(writer.getGraphOutputStream(null));
IGraphWriter graphWriter = new GraphMLWriter();
writer.setGraphWriter(graphWriter);
assertNotNull(writer.getGraphOutputStream(holder));
graphWriter = new GraphSONWriter();
writer.setGraphWriter(graphWriter);
assertNotNull(writer.getGraphOutputStream(holder));
graphWriter = new GraphCsvWriter();
writer.setGraphWriter(graphWriter);
assertNotNull(writer.getGraphOutputStream(holder));
}
use of org.pentaho.metaverse.api.IGraphWriter in project pentaho-metaverse by pentaho.
the class FileSystemLineageWriterTest method testGetSetGraphWriter.
@Test
public void testGetSetGraphWriter() throws Exception {
IGraphWriter graphWriter = writer.getGraphWriter();
assertNotNull(graphWriter);
writer.setGraphWriter(null);
assertNull(writer.getGraphWriter());
}
Aggregations