use of au.gov.asd.tac.constellation.plugins.PluginInteraction 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.PluginInteraction 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);
}
use of au.gov.asd.tac.constellation.plugins.PluginInteraction in project constellation by constellation-app.
the class RemoveUnusedAttributesPluginNGTest method testAllNullAttributes.
/**
* Test of edit method, of class RemoveUnusedAttributesPlugin.
*
* @throws java.lang.Exception
*/
@Test
public void testAllNullAttributes() throws Exception {
PluginInteraction interaction = null;
PluginParameters parameters = null;
RemoveUnusedAttributesPlugin instance = new RemoveUnusedAttributesPlugin();
instance.edit(graph, interaction, parameters);
assertEquals(graph.getAttribute(GraphElementType.VERTEX, "test1"), GraphConstants.NOT_FOUND);
assertEquals(graph.getAttribute(GraphElementType.VERTEX, "test2"), GraphConstants.NOT_FOUND);
assertEquals(graph.getAttribute(GraphElementType.VERTEX, "test3"), GraphConstants.NOT_FOUND);
assertEquals(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);
}
use of au.gov.asd.tac.constellation.plugins.PluginInteraction in project constellation by constellation-app.
the class RemoveUnusedAttributesPluginNGTest method testSomeNullKeyAttributes.
@Test
public void testSomeNullKeyAttributes() throws Exception {
// adding values to some attributes
graph.setPrimaryKey(GraphElementType.VERTEX, vertexAttribute1);
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);
assertNotEquals(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);
}
use of au.gov.asd.tac.constellation.plugins.PluginInteraction in project constellation by constellation-app.
the class ExtractTypesFromTextPluginNGTest method testRegexQuery.
/**
* Test of query method in class ExtractTypesFromTextPlugin using a string
* where a detection regex is picked up
*
* @throws Exception
*/
@Test
public void testRegexQuery() throws Exception {
RecordStore query = new GraphRecordStore();
ExtractTypesFromTextPlugin instance = new ExtractTypesFromTextPlugin();
PluginInteraction interaction = new TextPluginInteraction();
PluginParameters parameters = instance.createParameters();
parameters.getParameters().get(ExtractTypesFromTextPlugin.TEXT_PARAMETER_ID).setStringValue("abc@def.ghi");
RecordStore result = instance.query(query, interaction, parameters);
RecordStore expResult = new GraphRecordStore();
expResult.add();
expResult.set(GraphRecordStoreUtilities.SOURCE + VisualConcept.VertexAttribute.IDENTIFIER, "abc@def.ghi");
expResult.set(GraphRecordStoreUtilities.SOURCE + AnalyticConcept.VertexAttribute.TYPE, AnalyticConcept.VertexType.EMAIL_ADDRESS);
expResult.set(GraphRecordStoreUtilities.SOURCE + AnalyticConcept.VertexAttribute.SEED, "true");
assertEquals(result, expResult);
}
Aggregations