use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class SplitNodesPluginNGTest method testCreateParameters.
/**
* Test of createParameters method, of class SplitNodesPlugin.
*/
@Test
public void testCreateParameters() {
final SplitNodesPlugin instance = new SplitNodesPlugin();
final PluginParameters params = instance.createParameters();
assertEquals(params.getParameters().size(), 5);
assertTrue(params.getParameters().containsKey(SplitNodesPlugin.SPLIT_PARAMETER_ID));
assertTrue(params.getParameters().containsKey(SplitNodesPlugin.DUPLICATE_TRANSACTIONS_PARAMETER_ID));
assertTrue(params.getParameters().containsKey(SplitNodesPlugin.TRANSACTION_TYPE_PARAMETER_ID));
assertTrue(params.getParameters().containsKey(SplitNodesPlugin.ALL_OCCURRENCES_PARAMETER_ID));
assertTrue(params.getParameters().containsKey(SplitNodesPlugin.COMPLETE_WITH_SCHEMA_OPTION_ID));
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class SplitNodesPluginNGTest method testQueryWithNoTypes_WithoutDuplicateTransactions.
/**
* Test of query method, of class SplitNodesPlugin.
*
* @throws Exception
*/
@Test
public void testQueryWithNoTypes_WithoutDuplicateTransactions() throws Exception {
final SplitNodesPlugin instance = new SplitNodesPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setStringValue(SplitNodesPlugin.SPLIT_PARAMETER_ID, "@");
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getVertexCount(), 5);
assertEquals(graph.getTransactionCount(), 4);
assertEquals(graph.getVertexTransactionCount(vxId1), 3);
// Check transactions of new node (Assumed the new node is at vxId4 + 1)
assertEquals(graph.getVertexTransactionCount(vxId4 + 1), 1);
// assert new transaction is of type 'Correlation'
assertEquals(graph.getStringValue(transactionTypeAttributeId, graph.getVertexTransaction(vxId4 + 1, 0)), "Correlation");
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class SplitNodesPluginNGTest method testQueryWithNoResultingNodesToSplitTo_AllOccurancesSelected_WithoutDuplicateTransactions.
@Test
public void testQueryWithNoResultingNodesToSplitTo_AllOccurancesSelected_WithoutDuplicateTransactions() throws Exception {
final SplitNodesPlugin instance = new SplitNodesPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setStringValue(SplitNodesPlugin.SPLIT_PARAMETER_ID, "Y");
parameters.setBooleanValue(SplitNodesPlugin.ALL_OCCURRENCES_PARAMETER_ID, true);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
// Assert no new nodes are created
assertEquals(graph.getVertexCount(), 4);
assertEquals(graph.getTransactionCount(), 3);
assertEquals(graph.getStringValue(vertexIdentifierAttribute, vxId4), "YYY");
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class SplitNodesPluginNGTest method testQueryWithTypes_WithoutDuplicateTransactions.
@Test
public void testQueryWithTypes_WithoutDuplicateTransactions() throws Exception {
final SplitNodesPlugin instance = new SplitNodesPlugin();
final PluginParameters parameters = instance.createParameters();
parameters.setStringValue(SplitNodesPlugin.SPLIT_PARAMETER_ID, "@");
parameters.setStringValue(SplitNodesPlugin.TRANSACTION_TYPE_PARAMETER_ID, "Similarity");
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getVertexCount(), 5);
assertEquals(graph.getTransactionCount(), 4);
assertEquals(graph.getVertexTransactionCount(vxId1), 3);
// Check transactions of new node (Assumed the new node is at vxId4 + 1)
assertEquals(graph.getVertexTransactionCount(vxId4 + 1), 1);
// assert new transaction is of type 'Correlation'
assertEquals(graph.getStringValue(transactionTypeAttributeId, graph.getVertexTransaction(vxId4 + 1, 0)), "Similarity");
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class SplitNodesPluginNGTest method testQueryWithMultipleNodes_WithoutDuplicateTransactions.
@Test
public void testQueryWithMultipleNodes_WithoutDuplicateTransactions() 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);
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getVertexCount(), 6);
assertEquals(graph.getTransactionCount(), 5);
assertEquals(graph.getVertexTransactionCount(vxId3), 2);
assertEquals(graph.getVertexTransactionCount(vxId2), 3);
// Check transactions of new nodes (Assumed the new nodes are at vxId4 + 1 and vxId4 + 2)
assertEquals(graph.getVertexTransactionCount(vxId4 + 1), 1);
assertEquals(graph.getVertexTransactionCount(vxId4 + 2), 1);
// assert new transaction is of type 'Correlation'
assertEquals(graph.getStringValue(transactionTypeAttributeId, graph.getVertexTransaction(vxId4 + 1, 0)), "Correlation");
assertEquals(graph.getStringValue(transactionTypeAttributeId, graph.getVertexTransaction(vxId4 + 2, 0)), "Correlation");
}
Aggregations