Search in sources :

Example 6 with LayerName

use of au.gov.asd.tac.constellation.graph.schema.visual.attribute.objects.LayerName in project constellation by constellation-app.

the class LayerNameAttributeDescriptionNGTest method testConvertFromString.

/**
 * Test of convertFromString method, of class LayerNameAttributeDescription.
 */
@Test
public void testConvertFromString() {
    System.out.println("convertFromString");
    final LayerNameAttributeDescription instance = new LayerNameAttributeDescription();
    final LayerName nullResult = instance.convertFromString(null);
    assertEquals(nullResult, new LayerName(Graph.NOT_FOUND, "DEFAULT"));
    final LayerName blankResult = instance.convertFromString("   ");
    assertEquals(blankResult, new LayerName(Graph.NOT_FOUND, "DEFAULT"));
    final LayerName defaultResult = instance.convertFromString("DEFAULT");
    assertEquals(defaultResult, new LayerName(Graph.NOT_FOUND, "DEFAULT"));
    final LayerName invalidResult = instance.convertFromString("Not a Layer");
    assertNull(invalidResult);
    final LayerName validResult = instance.convertFromString("3,Test Layer");
    assertEquals(validResult, new LayerName(3, "Test Layer"));
}
Also used : LayerName(au.gov.asd.tac.constellation.graph.schema.visual.attribute.objects.LayerName) Test(org.testng.annotations.Test)

Aggregations

LayerName (au.gov.asd.tac.constellation.graph.schema.visual.attribute.objects.LayerName)6 Test (org.testng.annotations.Test)3 Attribute (au.gov.asd.tac.constellation.graph.Attribute)1 Graph (au.gov.asd.tac.constellation.graph.Graph)1 GraphAttribute (au.gov.asd.tac.constellation.graph.GraphAttribute)1 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)1 WritableGraph (au.gov.asd.tac.constellation.graph.WritableGraph)1 CopyToNewGraphPlugin (au.gov.asd.tac.constellation.graph.interaction.plugins.clipboard.CopyToNewGraphPlugin)1 Plugin (au.gov.asd.tac.constellation.plugins.Plugin)1 PluginException (au.gov.asd.tac.constellation.plugins.PluginException)1 PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)1 SimpleReadPlugin (au.gov.asd.tac.constellation.plugins.templates.SimpleReadPlugin)1 ConstellationColor (au.gov.asd.tac.constellation.utilities.color.ConstellationColor)1 IntNode (com.fasterxml.jackson.databind.node.IntNode)1 TextNode (com.fasterxml.jackson.databind.node.TextNode)1 Color (java.awt.Color)1 ZonedDateTime (java.time.ZonedDateTime)1 ArrayList (java.util.ArrayList)1 BitSet (java.util.BitSet)1 HashMap (java.util.HashMap)1