Search in sources :

Example 1 with TSVDropperToGraphPlugin

use of au.gov.asd.tac.constellation.views.dataaccess.templates.TSVDropper.TSVDropperToGraphPlugin in project constellation by constellation-app.

the class TSVDropperNGTest method testTSVDropperToGraphPlugin.

@Test
public void testTSVDropperToGraphPlugin() throws InterruptedException, PluginException {
    final PluginInteraction interaction = mock(PluginInteraction.class);
    final PluginParameters parameters = mock(PluginParameters.class);
    final StoreGraph graph = new StoreGraph(new AnalyticSchemaFactory().createSchema());
    VisualConcept.VertexAttribute.X.ensure(graph);
    VisualConcept.VertexAttribute.Y.ensure(graph);
    VisualConcept.VertexAttribute.Z.ensure(graph);
    final RecordStore recordStore = new GraphRecordStore();
    recordStore.add();
    recordStore.set(GraphRecordStoreUtilities.SOURCE + VisualConcept.VertexAttribute.IDENTIFIER, "foo");
    recordStore.set(GraphRecordStoreUtilities.DESTINATION + VisualConcept.VertexAttribute.IDENTIFIER, "bar");
    final File file = new File(TSVDropperNGTest.class.getResource("./resources/sample.tsv").getFile());
    final List<File> files = new ArrayList<>();
    files.add(file);
    final TSVDropperToGraphPlugin plugin = new TSVDropperToGraphPlugin(recordStore, files);
    final RecordStore expResult = plugin.query(recordStore, interaction, parameters);
    assertEquals(recordStore, expResult);
}
Also used : PluginInteraction(au.gov.asd.tac.constellation.plugins.PluginInteraction) AnalyticSchemaFactory(au.gov.asd.tac.constellation.graph.schema.analytic.AnalyticSchemaFactory) RecordStore(au.gov.asd.tac.constellation.graph.processing.RecordStore) GraphRecordStore(au.gov.asd.tac.constellation.graph.processing.GraphRecordStore) ArrayList(java.util.ArrayList) GraphRecordStore(au.gov.asd.tac.constellation.graph.processing.GraphRecordStore) TSVDropperToGraphPlugin(au.gov.asd.tac.constellation.views.dataaccess.templates.TSVDropper.TSVDropperToGraphPlugin) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) File(java.io.File) StoreGraph(au.gov.asd.tac.constellation.graph.StoreGraph) Test(org.testng.annotations.Test)

Aggregations

StoreGraph (au.gov.asd.tac.constellation.graph.StoreGraph)1 GraphRecordStore (au.gov.asd.tac.constellation.graph.processing.GraphRecordStore)1 RecordStore (au.gov.asd.tac.constellation.graph.processing.RecordStore)1 AnalyticSchemaFactory (au.gov.asd.tac.constellation.graph.schema.analytic.AnalyticSchemaFactory)1 PluginInteraction (au.gov.asd.tac.constellation.plugins.PluginInteraction)1 PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)1 TSVDropperToGraphPlugin (au.gov.asd.tac.constellation.views.dataaccess.templates.TSVDropper.TSVDropperToGraphPlugin)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Test (org.testng.annotations.Test)1