use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class MergeNodesPluginNGTest method editMergeNodeTypeNotFound.
@Test(expectedExceptions = PluginException.class)
public void editMergeNodeTypeNotFound() throws InterruptedException, PluginException {
final GraphWriteMethods graph = mock(GraphWriteMethods.class);
final PluginInteraction interaction = mock(PluginInteraction.class);
final PluginParameters parameters = mock(PluginParameters.class);
final PluginParameter pluginParameter = mock(PluginParameter.class);
final Map<String, PluginParameter<?>> pluginParameters = Map.of("MergeNodesPlugin.merge_type", pluginParameter);
when(parameters.getParameters()).thenReturn(pluginParameters);
when(pluginParameter.getStringValue()).thenReturn("Something Random");
mergeNodesPlugin.edit(graph, interaction, parameters);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class MergeTransactionsPluginNGTest method testCreateParameters.
/**
* Test of createParameters method, of class MergeTransactionsPlugin.
*/
@Test
public void testCreateParameters() {
MergeTransactionsPlugin instance = new MergeTransactionsPlugin();
PluginParameters result = instance.createParameters();
// Test the correct number of parameters were added
final int expResult = 5;
assertEquals(result.getParameters().size(), expResult);
assertTrue(result.hasParameter(MergeTransactionsPlugin.MERGE_TYPE_PARAMETER_ID));
assertTrue(result.hasParameter(MergeTransactionsPlugin.LEAD_PARAMETER_ID));
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class MergeTransactionsPluginNGTest method testEditNullTypeName.
/**
* Test of edit method with a null merge transaction type name
*
* @throws Exception
*/
@Test(expectedExceptions = PluginException.class)
public void testEditNullTypeName() throws Exception {
MergeTransactionsPlugin instance = new MergeTransactionsPlugin();
PluginInteraction interaction = new TextPluginInteraction();
PluginParameters parameters = instance.createParameters();
instance.edit(graph, interaction, parameters);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class RemoveNodesPluginNGTest method testEditAttributesNotFound.
/**
* Test of edit method, of class RemoveNodesPlugin. selected and identifier
* attributes not found
*
* @throws InterruptedException
* @throws PluginException
*/
@Test
public void testEditAttributesNotFound() throws InterruptedException, PluginException {
System.out.println("editAttributesNotFound");
final RemoveNodesPlugin instance = new RemoveNodesPlugin();
final PluginParameters parameters = instance.createParameters();
PluginExecution.withPlugin(instance).withParameters(parameters).executeNow(graph);
assertEquals(graph.getVertexCount(), 4);
assertEquals(graph.getTransactionCount(), 4);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameters in project constellation by constellation-app.
the class RemoveUnusedAttributesPluginNGTest method testSomeNullAttributes.
@Test
public void testSomeNullAttributes() throws Exception {
// adding values to some attributes
graph.setStringValue(vertexAttribute2, vertex2, "some words");
graph.setStringValue(vertexAttribute3, vertex1, "some words");
graph.setStringValue(transactionAttribute1, transaction1, "some words");
PluginInteraction interaction = null;
PluginParameters parameters = null;
RemoveUnusedAttributesPlugin instance = new RemoveUnusedAttributesPlugin();
instance.edit(graph, interaction, parameters);
assertEquals(graph.getAttribute(GraphElementType.VERTEX, "test1"), GraphConstants.NOT_FOUND);
assertNotEquals(graph.getAttribute(GraphElementType.VERTEX, "test2"), GraphConstants.NOT_FOUND);
assertNotEquals(graph.getAttribute(GraphElementType.VERTEX, "test3"), GraphConstants.NOT_FOUND);
assertNotEquals(graph.getAttribute(GraphElementType.TRANSACTION, "test4"), GraphConstants.NOT_FOUND);
assertEquals(graph.getAttribute(GraphElementType.TRANSACTION, "test5"), GraphConstants.NOT_FOUND);
assertEquals(graph.getAttribute(GraphElementType.TRANSACTION, "test6"), GraphConstants.NOT_FOUND);
}
Aggregations