Search in sources :

Example 11 with StoreGraph

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

the class GraphDistanceNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    // create an analytic graph
    final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
    graph = new StoreGraph(schema);
    // add attributes
    dAttribute = SnaConcept.GraphAttribute.DIAMETER.ensure(graph);
    rAttribute = SnaConcept.GraphAttribute.RADIUS.ensure(graph);
    aAttribute = SnaConcept.GraphAttribute.AVERAGE_DISTANCE.ensure(graph);
    // add vertices
    vxId0 = graph.addVertex();
    vxId1 = graph.addVertex();
    vxId2 = graph.addVertex();
    vxId3 = graph.addVertex();
    vxId4 = graph.addVertex();
    vxId5 = graph.addVertex();
    // add transactions
    txId0 = graph.addTransaction(vxId0, vxId1, true);
    txId1 = graph.addTransaction(vxId2, vxId1, true);
    txId2 = graph.addTransaction(vxId1, vxId3, true);
    txId3 = graph.addTransaction(vxId1, vxId4, true);
    txId4 = graph.addTransaction(vxId3, vxId5, true);
    txId5 = graph.addTransaction(vxId4, vxId5, true);
}
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 12 with StoreGraph

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

the class ConnectivityDegreePluginNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    // create an analytic graph
    final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
    graph = new StoreGraph(schema);
    // add attributes
    connectivityDegreeAttribute = SnaConcept.VertexAttribute.CONNECTIVITY_DEGREE.ensure(graph);
    componentSizeAttribute = SnaConcept.VertexAttribute.COMPONENT_SIZE.ensure(graph);
    // add vertices
    vxId0 = graph.addVertex();
    vxId1 = graph.addVertex();
    vxId2 = graph.addVertex();
    vxId3 = graph.addVertex();
    vxId4 = graph.addVertex();
    vxId5 = graph.addVertex();
    vxId6 = graph.addVertex();
    vxId7 = graph.addVertex();
    vxId8 = graph.addVertex();
    vxId9 = graph.addVertex();
    vxId10 = graph.addVertex();
    vxId11 = graph.addVertex();
    vxId12 = graph.addVertex();
    vxId13 = graph.addVertex();
    vxId14 = graph.addVertex();
    vxId15 = graph.addVertex();
    // add transactions
    txId0 = graph.addTransaction(vxId1, vxId1, true);
    txId1 = graph.addTransaction(vxId2, vxId3, true);
    txId2 = graph.addTransaction(vxId4, vxId5, true);
    txId3 = graph.addTransaction(vxId5, vxId6, true);
    txId4 = graph.addTransaction(vxId4, vxId6, true);
    txId5 = graph.addTransaction(vxId7, vxId8, true);
    txId6 = graph.addTransaction(vxId7, vxId9, true);
    txId7 = graph.addTransaction(vxId7, vxId10, true);
    txId8 = graph.addTransaction(vxId11, vxId12, true);
    txId9 = graph.addTransaction(vxId12, vxId13, true);
    txId10 = graph.addTransaction(vxId13, vxId14, true);
    txId11 = graph.addTransaction(vxId14, vxId15, true);
}
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 13 with StoreGraph

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

the class EccentricityPluginNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    // create an analytic graph
    final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
    graph = new StoreGraph(schema);
    // add attributes
    vertexEccentricityAttribute = SnaConcept.VertexAttribute.ECCENTRICITY.ensure(graph);
    // add vertices
    vxId0 = graph.addVertex();
    vxId1 = graph.addVertex();
    vxId2 = graph.addVertex();
    vxId3 = graph.addVertex();
    vxId4 = graph.addVertex();
    // add transactions
    txId0 = graph.addTransaction(vxId0, vxId1, true);
    txId1 = graph.addTransaction(vxId1, vxId2, true);
    txId2 = graph.addTransaction(vxId1, vxId3, true);
    txId3 = graph.addTransaction(vxId2, vxId3, true);
    txId4 = graph.addTransaction(vxId3, vxId4, true);
}
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 14 with StoreGraph

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

the class RatioOfReciprocityPluginNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    // create an analytic graph
    final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
    graph = new StoreGraph(schema);
    // add attributes
    transactionReciprocityAttribute = SnaConcept.TransactionAttribute.RATIO_OF_RECIPROCITY.ensure(graph);
    // add vertices
    vxId0 = graph.addVertex();
    vxId1 = graph.addVertex();
    vxId2 = graph.addVertex();
    vxId3 = graph.addVertex();
    vxId4 = graph.addVertex();
    // add transactions
    txId0 = graph.addTransaction(vxId0, vxId1, true);
    txId1 = graph.addTransaction(vxId1, vxId2, true);
    txId2 = graph.addTransaction(vxId1, vxId3, true);
    txId3 = graph.addTransaction(vxId2, vxId3, true);
    txId4 = graph.addTransaction(vxId3, vxId4, true);
    // add reciprocal transactions
    txId5 = graph.addTransaction(vxId2, vxId1, true);
    txId6 = graph.addTransaction(vxId2, vxId1, true);
    txId7 = graph.addTransaction(vxId3, vxId1, true);
    txId8 = graph.addTransaction(vxId3, vxId1, true);
    txId9 = graph.addTransaction(vxId3, vxId1, true);
    txId10 = graph.addTransaction(vxId3, vxId2, true);
    txId11 = graph.addTransaction(vxId3, vxId2, true);
    txId12 = graph.addTransaction(vxId3, vxId2, true);
    txId13 = graph.addTransaction(vxId3, vxId2, true);
}
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 15 with StoreGraph

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

the class WeightActionNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    // create an analytic graph
    final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
    graph = new StoreGraph(schema);
    // add attributes
    transactionWeightAttribute = AnalyticConcept.TransactionAttribute.WEIGHT.ensure(graph);
    // add vertices
    vxId0 = graph.addVertex();
    vxId1 = graph.addVertex();
    vxId2 = graph.addVertex();
    vxId3 = graph.addVertex();
    vxId4 = graph.addVertex();
    // add transactions
    txId0 = graph.addTransaction(vxId0, vxId1, true);
    txId1 = graph.addTransaction(vxId1, vxId2, true);
    txId2 = graph.addTransaction(vxId1, vxId3, true);
    txId3 = graph.addTransaction(vxId2, vxId3, true);
    txId4 = graph.addTransaction(vxId3, vxId4, true);
    // add more transactions
    txId5 = graph.addTransaction(vxId1, vxId2, true);
    txId6 = graph.addTransaction(vxId1, vxId3, true);
    txId7 = graph.addTransaction(vxId1, vxId3, true);
    txId8 = graph.addTransaction(vxId2, vxId3, true);
    txId9 = graph.addTransaction(vxId2, vxId3, true);
    txId10 = graph.addTransaction(vxId2, vxId3, true);
    txId11 = graph.addTransaction(vxId3, vxId4, true);
    txId12 = graph.addTransaction(vxId3, vxId4, true);
    txId13 = graph.addTransaction(vxId3, vxId4, true);
}
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

StoreGraph (au.gov.asd.tac.constellation.graph.StoreGraph)170 Test (org.testng.annotations.Test)75 Schema (au.gov.asd.tac.constellation.graph.schema.Schema)64 BeforeMethod (org.testng.annotations.BeforeMethod)61 ArrayList (java.util.ArrayList)19 Graph (au.gov.asd.tac.constellation.graph.Graph)17 DualGraph (au.gov.asd.tac.constellation.graph.locking.DualGraph)17 HashMap (java.util.HashMap)14 PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)13 GraphReadMethods (au.gov.asd.tac.constellation.graph.GraphReadMethods)11 PluginInteraction (au.gov.asd.tac.constellation.plugins.PluginInteraction)11 HashSet (java.util.HashSet)11 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)10 GraphRecordStore (au.gov.asd.tac.constellation.graph.processing.GraphRecordStore)10 PluginParameter (au.gov.asd.tac.constellation.plugins.parameters.PluginParameter)9 WritableGraph (au.gov.asd.tac.constellation.graph.WritableGraph)8 PluginException (au.gov.asd.tac.constellation.plugins.PluginException)8 GraphElementType (au.gov.asd.tac.constellation.graph.GraphElementType)7 GraphWriteMethods (au.gov.asd.tac.constellation.graph.GraphWriteMethods)7 SchemaVertexType (au.gov.asd.tac.constellation.graph.schema.type.SchemaVertexType)7