use of au.gov.asd.tac.constellation.views.dataaccess.plugins.experimental.TestParametersPlugin.GraphElementTypeParameterValue in project constellation by constellation-app.
the class TestParametersPluginNGTest method testGraphElementType1.
/**
* Test of query method, of class TestParametersPlugin. Tests throwing
* runtime exception
*/
@Test
public void testGraphElementType1() throws Exception {
System.out.println("test graph element type1");
final TestParametersPlugin instance = new TestParametersPlugin();
final PluginParameters result = instance.createParameters();
// Set plugin query name here before execution
result.getParameters().get(CoreGlobalParameters.QUERY_NAME_PARAMETER_ID).setStringValue("TESTPARAMETERSPLUGIN");
// Set plugin parameters here before execution
final GraphElementTypeParameterValue graphElementType = new GraphElementTypeParameterValue();
assertTrue(graphElementType.set(GraphElementType.META));
// return false when setting same attribute
assertFalse(graphElementType.set(GraphElementType.META));
assertTrue(graphElementType.setObjectValue(GraphElementType.VERTEX));
// return false when setting same attribute
assertFalse(graphElementType.setObjectValue(GraphElementType.VERTEX));
for (final GraphElementType elementType : GraphElementType.values()) {
graphElementType.setObjectValue(elementType);
result.getParameters().get(TestParametersPlugin.ELEMENT_TYPE_PARAMETER_ID).setObjectValue(graphElementType);
// Ensure it is still selected as the correct value
assertEquals(SingleChoiceParameterType.getChoice((PluginParameter<SingleChoiceParameterType.SingleChoiceParameterValue>) result.getParameters().get(TestParametersPlugin.ELEMENT_TYPE_PARAMETER_ID)), elementType.getShortLabel());
}
}
use of au.gov.asd.tac.constellation.views.dataaccess.plugins.experimental.TestParametersPlugin.GraphElementTypeParameterValue in project constellation by constellation-app.
the class TestParametersPluginNGTest method testCreateParametersGraphElementType2.
/**
* Test of query method, of class TestParametersPlugin. Tests throwing
* runtime exception
*/
@Test
public void testCreateParametersGraphElementType2() throws Exception {
System.out.println("test CreateParameters graph element type2");
final TestParametersPlugin instance = new TestParametersPlugin();
final PluginParameters result = instance.createParameters();
// Set plugin query name here before execution
result.getParameters().get(CoreGlobalParameters.QUERY_NAME_PARAMETER_ID).setStringValue("TESTPARAMETERSPLUGIN");
// Set plugin parameters here before execution
final GraphElementTypeParameterValue graphElementType = new GraphElementTypeParameterValue();
for (final GraphElementType elementType : GraphElementType.values()) {
graphElementType.setObjectValue(elementType);
result.getParameters().get(TestParametersPlugin.ELEMENT_TYPE_PARAMETER_ID).setObjectValue(graphElementType);
// Ensure it is still selected as the correct value
assertEquals(SingleChoiceParameterType.getChoice((PluginParameter<SingleChoiceParameterType.SingleChoiceParameterValue>) result.getParameters().get(TestParametersPlugin.ELEMENT_TYPE_PARAMETER_ID)), elementType.getShortLabel());
}
}
use of au.gov.asd.tac.constellation.views.dataaccess.plugins.experimental.TestParametersPlugin.GraphElementTypeParameterValue in project constellation by constellation-app.
the class TestParametersPluginNGTest method testCreateParametersGraphElementType1.
/**
* Test of query method, of class TestParametersPlugin. Tests throwing
* runtime exception
*/
@Test(expectedExceptions = IllegalArgumentException.class)
public void testCreateParametersGraphElementType1() throws Exception {
System.out.println("test CreateParameters graph element type1");
final TestParametersPlugin instance = new TestParametersPlugin();
final PluginParameters result = instance.createParameters();
// Set plugin query name here before execution
result.getParameters().get(CoreGlobalParameters.QUERY_NAME_PARAMETER_ID).setStringValue("TESTPARAMETERSPLUGIN");
// Set plugin parameters here before execution - Should throw an exception here
final GraphElementTypeParameterValue graphElementType = new GraphElementTypeParameterValue();
graphElementType.setObjectValue((Object) "Unusable String Object");
}
Aggregations