use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class SplitNodesPluginNGTest method testQueryWithNoResultingNodesToSplitTo_AllOccurancesNotSelected_WithoutDuplicateTransactions.
@Test
public void testQueryWithNoResultingNodesToSplitTo_AllOccurancesNotSelected_WithoutDuplicateTransactions() throws Exception {
final SplitNodesPlugin instance = new SplitNodesPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setStringValue(SplitNodesPlugin.SPLIT_PARAMETER_ID, "Y");
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
// Assert the node is renamed to "YY"
assertEquals(graph.getVertexCount(), 4);
assertEquals(graph.getTransactionCount(), 3);
assertEquals(graph.getStringValue(vertexIdentifierAttribute, vxId4), "YY");
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class SplitNodesPluginSplitLogicNGTest method testQueryAllOccurancesNotSelected_SplitParameterRepeatsInTheMiddle.
@Test
public void testQueryAllOccurancesNotSelected_SplitParameterRepeatsInTheMiddle() throws Exception {
final SplitNodesPlugin instance = new SplitNodesPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setStringValue(SplitNodesPlugin.SPLIT_PARAMETER_ID, ",");
graph.setBooleanValue(vertexSelectedAttribute, vxId2, true);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getVertexCount(), 5);
assertEquals(graph.getTransactionCount(), 4);
// Creates 2 nodes (v and ,v)
assertEquals(graph.getStringValue(vertexIdentifierAttribute, vxId2), "v");
assertEquals(graph.getStringValue(vertexIdentifierAttribute, vxId4 + 1), ",v");
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class SplitNodesPluginSplitLogicNGTest method testQueryAllOccurancesSelected_SplitParameterRepeatsInTheMiddle.
@Test
public void testQueryAllOccurancesSelected_SplitParameterRepeatsInTheMiddle() throws Exception {
final SplitNodesPlugin instance = new SplitNodesPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setStringValue(SplitNodesPlugin.SPLIT_PARAMETER_ID, ",");
parameters.setBooleanValue(SplitNodesPlugin.ALL_OCCURRENCES_PARAMETER_ID, true);
graph.setBooleanValue(vertexSelectedAttribute, vxId2, true);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getVertexCount(), 5);
assertEquals(graph.getTransactionCount(), 4);
// Creates 2 nodes (v and v)
assertEquals(graph.getStringValue(vertexIdentifierAttribute, vxId2), "v");
assertEquals(graph.getStringValue(vertexIdentifierAttribute, vxId4 + 1), "v");
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class SplitNodesPluginSplitLogicNGTest method testQueryAllOccurancesSelected_SplitParameterRepeatsInTheEnd.
@Test
public void testQueryAllOccurancesSelected_SplitParameterRepeatsInTheEnd() throws Exception {
final SplitNodesPlugin instance = new SplitNodesPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setStringValue(SplitNodesPlugin.SPLIT_PARAMETER_ID, ",");
parameters.setBooleanValue(SplitNodesPlugin.ALL_OCCURRENCES_PARAMETER_ID, true);
graph.setBooleanValue(vertexSelectedAttribute, vxId4, true);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getVertexCount(), 4);
assertEquals(graph.getTransactionCount(), 3);
// Node renamed to "v"
assertEquals(graph.getStringValue(vertexIdentifierAttribute, vxId4), "v");
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class TestParametersPluginNGTest method testQueryCrash1.
/**
* Test of query method, of class TestParametersPlugin. Tests not throwing
* runtime exception
*/
@Test
public void testQueryCrash1() throws Exception {
System.out.println("test query crash1");
final TestParametersPlugin instance = new TestParametersPlugin();
final PluginParameters result = instance.createParameters();
final GraphRecordStore recordStore = new GraphRecordStore();
final DefaultPluginInteraction interaction = new DefaultPluginInteraction(null, null);
// Set plugin query name here before execution
result.getParameters().get(CoreGlobalParameters.QUERY_NAME_PARAMETER_ID).setStringValue("TESTPARAMETERSPLUGIN");
// Set plugin parameters here before execution
result.getParameters().get(TestParametersPlugin.CRASH_PARAMETER_ID).setBooleanValue(false);
instance.query(recordStore, interaction, result);
}
Aggregations