Search in sources :

Example 36 with Schema

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

the class GraphRecordStoreUtilitiesNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
    graph = new StoreGraph(schema);
    graph.getSchema().newGraph(graph);
}
Also used : Schema(au.gov.asd.tac.constellation.graph.schema.Schema) StoreGraph(au.gov.asd.tac.constellation.graph.StoreGraph) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 37 with Schema

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

the class CompleteGraphBuilderPluginNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
    graph = new StoreGraph(schema);
}
Also used : Schema(au.gov.asd.tac.constellation.graph.schema.Schema) StoreGraph(au.gov.asd.tac.constellation.graph.StoreGraph) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 38 with Schema

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

the class GraphVisualAccessNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
    sGraph = new StoreGraph();
    vxId1 = sGraph.addVertex();
    vxId2 = sGraph.addVertex();
    tId1 = sGraph.addTransaction(vxId1, vxId2, true);
    graph = new DualGraph(schema, sGraph);
}
Also used : Schema(au.gov.asd.tac.constellation.graph.schema.Schema) DualGraph(au.gov.asd.tac.constellation.graph.locking.DualGraph) StoreGraph(au.gov.asd.tac.constellation.graph.StoreGraph) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 39 with Schema

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

the class HopHalfNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    final Schema ss = SchemaFactoryUtilities.getSchemaFactory(VisualSchemaFactory.VISUAL_SCHEMA_ID).createSchema();
    graph = new StoreGraph(ss);
    attrX = graph.addAttribute(GraphElementType.VERTEX, FloatAttributeDescription.ATTRIBUTE_NAME, "x", "x", 0.0, null);
    if (attrX == Graph.NOT_FOUND) {
        fail();
    }
    attrY = graph.addAttribute(GraphElementType.VERTEX, FloatAttributeDescription.ATTRIBUTE_NAME, "y", "y", 0.0, null);
    if (attrY == Graph.NOT_FOUND) {
        fail();
    }
    attrZ = graph.addAttribute(GraphElementType.VERTEX, FloatAttributeDescription.ATTRIBUTE_NAME, "z", "z", 0.0, null);
    if (attrZ == Graph.NOT_FOUND) {
        fail();
    }
    vAttrId = graph.addAttribute(GraphElementType.VERTEX, BooleanAttributeDescription.ATTRIBUTE_NAME, "selected", "selected", false, null);
    if (vAttrId == Graph.NOT_FOUND) {
        fail();
    }
    tAttrId = graph.addAttribute(GraphElementType.TRANSACTION, BooleanAttributeDescription.ATTRIBUTE_NAME, "selected", "selected", false, null);
    if (tAttrId == Graph.NOT_FOUND) {
        fail();
    }
    vxId1 = graph.addVertex();
    graph.setFloatValue(attrX, vxId1, 1.0f);
    graph.setFloatValue(attrY, vxId1, 1.0f);
    graph.setBooleanValue(vAttrId, vxId1, false);
    vxId2 = graph.addVertex();
    graph.setFloatValue(attrX, vxId2, 5.0f);
    graph.setFloatValue(attrY, vxId2, 1.0f);
    graph.setBooleanValue(vAttrId, vxId2, false);
    vxId3 = graph.addVertex();
    graph.setFloatValue(attrX, vxId3, 1.0f);
    graph.setFloatValue(attrY, vxId3, 5.0f);
    graph.setBooleanValue(vAttrId, vxId3, false);
    vxId4 = graph.addVertex();
    graph.setFloatValue(attrX, vxId4, 5.0f);
    graph.setFloatValue(attrY, vxId4, 5.0f);
    graph.setBooleanValue(vAttrId, vxId4, false);
    vxId5 = graph.addVertex();
    graph.setFloatValue(attrX, vxId5, 10.0f);
    graph.setFloatValue(attrY, vxId5, 10.0f);
    graph.setBooleanValue(vAttrId, vxId5, false);
    vxId6 = graph.addVertex();
    graph.setFloatValue(attrX, vxId6, 15.0f);
    graph.setFloatValue(attrY, vxId6, 15.0f);
    graph.setBooleanValue(vAttrId, vxId6, false);
    vxId7 = graph.addVertex();
    graph.setFloatValue(attrX, vxId7, 100.0f);
    graph.setFloatValue(attrY, vxId7, 100.0f);
    graph.setBooleanValue(vAttrId, vxId7, false);
    txId1 = graph.addTransaction(vxId1, vxId2, false);
    txId2 = graph.addTransaction(vxId1, vxId3, false);
    txId3 = graph.addTransaction(vxId2, vxId4, true);
    txId4 = graph.addTransaction(vxId4, vxId2, true);
    txId5 = graph.addTransaction(vxId5, vxId6, false);
}
Also used : Schema(au.gov.asd.tac.constellation.graph.schema.Schema) StoreGraph(au.gov.asd.tac.constellation.graph.StoreGraph) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 40 with Schema

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

the class HopOneNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    final Schema ss = SchemaFactoryUtilities.getSchemaFactory(VisualSchemaFactory.VISUAL_SCHEMA_ID).createSchema();
    graph = new StoreGraph(ss);
    attrX = graph.addAttribute(GraphElementType.VERTEX, FloatAttributeDescription.ATTRIBUTE_NAME, "x", "x", 0.0, null);
    if (attrX == Graph.NOT_FOUND) {
        fail();
    }
    attrY = graph.addAttribute(GraphElementType.VERTEX, FloatAttributeDescription.ATTRIBUTE_NAME, "y", "y", 0.0, null);
    if (attrY == Graph.NOT_FOUND) {
        fail();
    }
    attrZ = graph.addAttribute(GraphElementType.VERTEX, FloatAttributeDescription.ATTRIBUTE_NAME, "z", "z", 0.0, null);
    if (attrZ == Graph.NOT_FOUND) {
        fail();
    }
    vAttrId = graph.addAttribute(GraphElementType.VERTEX, BooleanAttributeDescription.ATTRIBUTE_NAME, "selected", "selected", false, null);
    if (vAttrId == Graph.NOT_FOUND) {
        fail();
    }
    tAttrId = graph.addAttribute(GraphElementType.TRANSACTION, BooleanAttributeDescription.ATTRIBUTE_NAME, "selected", "selected", false, null);
    if (tAttrId == Graph.NOT_FOUND) {
        fail();
    }
    vxId1 = graph.addVertex();
    graph.setFloatValue(attrX, vxId1, 1.0f);
    graph.setFloatValue(attrY, vxId1, 1.0f);
    graph.setBooleanValue(vAttrId, vxId1, false);
    vxId2 = graph.addVertex();
    graph.setFloatValue(attrX, vxId2, 5.0f);
    graph.setFloatValue(attrY, vxId2, 1.0f);
    graph.setBooleanValue(vAttrId, vxId2, false);
    vxId3 = graph.addVertex();
    graph.setFloatValue(attrX, vxId3, 1.0f);
    graph.setFloatValue(attrY, vxId3, 5.0f);
    graph.setBooleanValue(vAttrId, vxId3, false);
    vxId4 = graph.addVertex();
    graph.setFloatValue(attrX, vxId4, 5.0f);
    graph.setFloatValue(attrY, vxId4, 5.0f);
    graph.setBooleanValue(vAttrId, vxId4, false);
    vxId5 = graph.addVertex();
    graph.setFloatValue(attrX, vxId5, 10.0f);
    graph.setFloatValue(attrY, vxId5, 10.0f);
    graph.setBooleanValue(vAttrId, vxId5, false);
    vxId6 = graph.addVertex();
    graph.setFloatValue(attrX, vxId6, 15.0f);
    graph.setFloatValue(attrY, vxId6, 15.0f);
    graph.setBooleanValue(vAttrId, vxId6, false);
    vxId7 = graph.addVertex();
    graph.setFloatValue(attrX, vxId7, 100.0f);
    graph.setFloatValue(attrY, vxId7, 100.0f);
    graph.setBooleanValue(vAttrId, vxId7, false);
    txId1 = graph.addTransaction(vxId1, vxId2, false);
    txId2 = graph.addTransaction(vxId1, vxId3, false);
    txId3 = graph.addTransaction(vxId2, vxId4, true);
    txId4 = graph.addTransaction(vxId4, vxId2, true);
    txId5 = graph.addTransaction(vxId5, vxId6, false);
}
Also used : Schema(au.gov.asd.tac.constellation.graph.schema.Schema) StoreGraph(au.gov.asd.tac.constellation.graph.StoreGraph) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Schema (au.gov.asd.tac.constellation.graph.schema.Schema)74 StoreGraph (au.gov.asd.tac.constellation.graph.StoreGraph)63 BeforeMethod (org.testng.annotations.BeforeMethod)50 DualGraph (au.gov.asd.tac.constellation.graph.locking.DualGraph)17 Graph (au.gov.asd.tac.constellation.graph.Graph)15 Test (org.testng.annotations.Test)13 WritableGraph (au.gov.asd.tac.constellation.graph.WritableGraph)10 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)8 ArrayList (java.util.ArrayList)8 GraphRecordStore (au.gov.asd.tac.constellation.graph.processing.GraphRecordStore)7 IOException (java.io.IOException)6 PluginException (au.gov.asd.tac.constellation.plugins.PluginException)5 PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)5 HashMap (java.util.HashMap)5 HashSet (java.util.HashSet)4 Set (java.util.Set)4 GraphElementType (au.gov.asd.tac.constellation.graph.GraphElementType)3 SchemaFactory (au.gov.asd.tac.constellation.graph.schema.SchemaFactory)3 CopyToNewGraphPlugin (au.gov.asd.tac.constellation.graph.interaction.plugins.clipboard.CopyToNewGraphPlugin)2 SchemaAttribute (au.gov.asd.tac.constellation.graph.schema.attribute.SchemaAttribute)2