Search in sources :

Example 36 with JanusGraphDBEngine

use of org.onap.aai.serialization.engines.JanusGraphDBEngine in project aai-aai-common by onap.

the class DbSerializerDeltasTest method setup.

@Before
public void setup() throws Exception {
    // createGraph();
    version = schemaVersions.getDefaultVersion();
    loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, version);
    dbEngine = new JanusGraphDBEngine(queryStyle, loader);
    engine = new JanusGraphDBEngine(queryStyle, loader);
}
Also used : JanusGraphDBEngine(org.onap.aai.serialization.engines.JanusGraphDBEngine) Before(org.junit.Before)

Example 37 with JanusGraphDBEngine

use of org.onap.aai.serialization.engines.JanusGraphDBEngine in project aai-aai-common by onap.

the class EdgerPairCanBeBothCousinAndParentChildTest method setup.

@Before
public void setup() throws UnsupportedEncodingException, AAIException, URISyntaxException {
    version = schemaVersions.getDefaultVersion();
    loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, version);
    engine = new JanusGraphDBEngine(queryStyle, loader);
    initData();
}
Also used : JanusGraphDBEngine(org.onap.aai.serialization.engines.JanusGraphDBEngine)

Example 38 with JanusGraphDBEngine

use of org.onap.aai.serialization.engines.JanusGraphDBEngine in project aai-aai-common by onap.

the class HttpEntry method setHttpEntryProperties.

public HttpEntry setHttpEntryProperties(SchemaVersion version) {
    this.version = version;
    this.loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, version);
    this.dbEngine = new JanusGraphDBEngine(queryStyle, loader);
    getDbEngine().startTransaction();
    this.notification = new UEBNotification(loader, loaderFactory, schemaVersions);
    if ("true".equals(AAIConfig.get("aai.notification.depth.all.enabled", "true"))) {
        this.notificationDepth = AAIProperties.MAXIMUM_DEPTH;
    } else {
        this.notificationDepth = AAIProperties.MINIMUM_DEPTH;
    }
    return this;
}
Also used : UEBNotification(org.onap.aai.rest.ueb.UEBNotification) JanusGraphDBEngine(org.onap.aai.serialization.engines.JanusGraphDBEngine)

Example 39 with JanusGraphDBEngine

use of org.onap.aai.serialization.engines.JanusGraphDBEngine in project aai-aai-common by onap.

the class AggregateFormatTest method createLoaderEngineSetup.

private void createLoaderEngineSetup() throws AAIException {
    if (loader == null) {
        loader = loaderFactory.createLoaderForVersion(factoryType, version);
        dbEngine = spy(new JanusGraphDBEngine(QueryStyle.TRAVERSAL, loader));
        DBSerializer serializer = new DBSerializer(version, dbEngine, factoryType, "Junit");
        aggregate = new Aggregate.Builder(loader, serializer, urlBuilder).build();
        TransactionalGraphEngine.Admin spyAdmin = spy(dbEngine.asAdmin());
        when(dbEngine.tx()).thenReturn(graph);
        when(dbEngine.asAdmin()).thenReturn(spyAdmin);
        when(spyAdmin.getReadOnlyTraversalSource()).thenReturn(graph.traversal().withStrategies(ReadOnlyStrategy.instance()));
        when(spyAdmin.getTraversalSource()).thenReturn(graph.traversal());
    }
}
Also used : TransactionalGraphEngine(org.onap.aai.serialization.engines.TransactionalGraphEngine) DBSerializer(org.onap.aai.serialization.db.DBSerializer) JanusGraphDBEngine(org.onap.aai.serialization.engines.JanusGraphDBEngine) UrlBuilder(org.onap.aai.serialization.queryformats.utils.UrlBuilder)

Example 40 with JanusGraphDBEngine

use of org.onap.aai.serialization.engines.JanusGraphDBEngine in project aai-aai-common by onap.

the class LegacyQueryTest method setup.

public void setup() {
    version = new SchemaVersion("v10");
    dbEngine = new JanusGraphDBEngine(QueryStyle.GREMLIN_TRAVERSAL, loaderFactory.createLoaderForVersion(ModelType.MOXY, version), false);
}
Also used : SchemaVersion(org.onap.aai.setup.SchemaVersion) JanusGraphDBEngine(org.onap.aai.serialization.engines.JanusGraphDBEngine)

Aggregations

JanusGraphDBEngine (org.onap.aai.serialization.engines.JanusGraphDBEngine)78 TransactionalGraphEngine (org.onap.aai.serialization.engines.TransactionalGraphEngine)51 GraphTraversalSource (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource)45 Before (org.junit.Before)40 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)27 DBSerializer (org.onap.aai.serialization.db.DBSerializer)10 JanusGraphManagement (org.janusgraph.core.schema.JanusGraphManagement)8 SchemaVersion (org.onap.aai.setup.SchemaVersion)8 Loader (org.onap.aai.introspection.Loader)7 AAIException (org.onap.aai.exceptions.AAIException)5 ModelType (org.onap.aai.introspection.ModelType)3 QueryStyle (org.onap.aai.serialization.engines.QueryStyle)3 UrlBuilder (org.onap.aai.serialization.queryformats.utils.UrlBuilder)3 Properties (java.util.Properties)2 Test (org.junit.Test)2 NotificationHelper (org.onap.aai.migration.NotificationHelper)2 UEBNotification (org.onap.aai.rest.ueb.UEBNotification)2 JCommander (com.beust.jcommander.JCommander)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 URI (java.net.URI)1