Search in sources :

Example 16 with SchemaFactory

use of au.gov.asd.tac.constellation.graph.schema.SchemaFactory in project constellation by constellation-app.

the class VisualConceptNGTest method testVisualAttributesRegistered.

/**
 * Test whether all the attributes of VisualConcept are registered in the Visual Schema
 */
@Test
public void testVisualAttributesRegistered() {
    System.out.println("visualAttributesRegistered");
    final SchemaFactory schemaFactory = SchemaFactoryUtilities.getSchemaFactory(VisualSchemaFactory.VISUAL_SCHEMA_ID);
    final List<SchemaAttribute> registeredAttributes = new ArrayList<>();
    for (final Map<String, SchemaAttribute> graphElementAttributes : schemaFactory.getRegisteredAttributes().values()) {
        registeredAttributes.addAll(graphElementAttributes.values());
    }
    final VisualConcept instance = new VisualConcept();
    final Collection<SchemaAttribute> visualAttributes = instance.getSchemaAttributes();
    for (final SchemaAttribute visualAttribute : visualAttributes) {
        assertTrue(registeredAttributes.contains(visualAttribute));
    }
}
Also used : VisualSchemaFactory(au.gov.asd.tac.constellation.graph.schema.visual.VisualSchemaFactory) SchemaFactory(au.gov.asd.tac.constellation.graph.schema.SchemaFactory) ArrayList(java.util.ArrayList) SchemaAttribute(au.gov.asd.tac.constellation.graph.schema.attribute.SchemaAttribute) Test(org.testng.annotations.Test)

Aggregations

SchemaFactory (au.gov.asd.tac.constellation.graph.schema.SchemaFactory)16 Graph (au.gov.asd.tac.constellation.graph.Graph)6 SchemaAttribute (au.gov.asd.tac.constellation.graph.schema.attribute.SchemaAttribute)6 SchemaConcept (au.gov.asd.tac.constellation.graph.schema.concept.SchemaConcept)4 ArrayList (java.util.ArrayList)4 Attribute (au.gov.asd.tac.constellation.graph.Attribute)3 DualGraph (au.gov.asd.tac.constellation.graph.locking.DualGraph)3 Schema (au.gov.asd.tac.constellation.graph.schema.Schema)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 Label (javafx.scene.control.Label)3 GraphElementType (au.gov.asd.tac.constellation.graph.GraphElementType)2 WritableGraph (au.gov.asd.tac.constellation.graph.WritableGraph)2 AttributeType (au.gov.asd.tac.constellation.plugins.importexport.AttributeType)2 ImportAttributeDefinition (au.gov.asd.tac.constellation.plugins.importexport.ImportAttributeDefinition)2 ImportDefinition (au.gov.asd.tac.constellation.plugins.importexport.ImportDefinition)2 NewAttribute (au.gov.asd.tac.constellation.plugins.importexport.NewAttribute)2 RowFilter (au.gov.asd.tac.constellation.plugins.importexport.RowFilter)2 SchemaDestination (au.gov.asd.tac.constellation.plugins.importexport.SchemaDestination)2 AttributeTranslator (au.gov.asd.tac.constellation.plugins.importexport.translator.AttributeTranslator)2 PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)2