Search in sources :

Example 21 with OServer

use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.

the class RemoteRidBagTest method before.

@Before
public void before() throws Exception {
    server = new OServer();
    server.setServerRootDirectory(SERVER_DIRECTORY);
    server.startup(getClass().getResourceAsStream("orientdb-server-config.xml"));
    server.activate();
    final OServerAdmin serverAdmin = new OServerAdmin("remote:localhost");
    serverAdmin.connect("root", "D2AFD02F20640EC8B7A5140F34FCA49D2289DB1F0D0598BB9DE8AAA75A0792F3");
    serverAdmin.createDatabase("RemoteRidBagTest", "document", "memory");
    clientA = Executors.newSingleThreadExecutor();
    clientB = Executors.newSingleThreadExecutor();
    clientA.submit(new Runnable() {

        @Override
        public void run() {
            dbA = new ODatabaseDocumentTx("remote:localhost/RemoteRidBagTest").open("admin", "admin");
        }
    }).get();
    clientB.submit(new Runnable() {

        @Override
        public void run() {
            dbB = new ODatabaseDocumentTx("remote:localhost/RemoteRidBagTest").open("admin", "admin");
        }
    }).get();
}
Also used : OServer(com.orientechnologies.orient.server.OServer) ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) OServerAdmin(com.orientechnologies.orient.client.remote.OServerAdmin) Before(org.junit.Before)

Example 22 with OServer

use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.

the class OLiveQueryShotdownTest method bootServer.

public void bootServer() throws Exception {
    server = new OServer();
    server.setServerRootDirectory(SERVER_DIRECTORY);
    server.startup(getClass().getResourceAsStream("orientdb-server-config.xml"));
    server.activate();
    OServerAdmin server = new OServerAdmin("remote:localhost");
    server.connect("root", "D2AFD02F20640EC8B7A5140F34FCA49D2289DB1F0D0598BB9DE8AAA75A0792F3");
    server.createDatabase(OLiveQueryShotdownTest.class.getSimpleName(), "graph", "memory");
}
Also used : OServer(com.orientechnologies.orient.server.OServer) OServerAdmin(com.orientechnologies.orient.client.remote.OServerAdmin)

Example 23 with OServer

use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.

the class RunServerTest method before.

@BeforeSuite
public void before() throws Exception {
    server = new OServer();
    server.startup(RunServerTest.class.getClassLoader().getResourceAsStream("orientdb-server-config.xml"));
    server.activate();
}
Also used : OServer(com.orientechnologies.orient.server.OServer) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 24 with OServer

use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.

the class OServerTest method testRestart.

/**
   * Test for https://github.com/orientechnologies/orientdb/issues/1667
   */
@Test
public void testRestart() throws Exception {
    // set ORIENTDB_HOME
    final String buildDirectory = System.getProperty("buildDirectory", ".");
    System.setProperty("ORIENTDB_HOME", buildDirectory + File.separator + OServerTest.class.getSimpleName());
    OLogManager.instance().info(this, "ORIENTDB_HOME: " + System.getProperty("ORIENTDB_HOME"));
    // loop for start & stop server
    for (int i = 0; i < 5; i++) {
        OLogManager.instance().info(this, "Iteration " + i);
        OServer server = new OServer(false).activate();
        // create database if does not exist
        OObjectDatabaseTx database = new OObjectDatabaseTx("plocal:" + System.getProperty("ORIENTDB_HOME") + "/test-db");
        if (!database.exists())
            database.create();
        database.open("admin", "admin");
        database.countClass("ouser");
        database.close();
        server.shutdown();
    }
}
Also used : OServer(com.orientechnologies.orient.server.OServer) OObjectDatabaseTx(com.orientechnologies.orient.object.db.OObjectDatabaseTx) Test(org.testng.annotations.Test)

Example 25 with OServer

use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.

the class BaseHttpTest method startServer.

protected void startServer() throws Exception {
    if (server == null) {
        server = new OServer(false);
        server.startup(getClass().getResourceAsStream(getServerCfg()));
        server.activate();
    }
}
Also used : OServer(com.orientechnologies.orient.server.OServer)

Aggregations

OServer (com.orientechnologies.orient.server.OServer)25 Before (org.junit.Before)9 OServerAdmin (com.orientechnologies.orient.client.remote.OServerAdmin)8 OHazelcastPlugin (com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin)4 File (java.io.File)4 ODatabaseDocumentInternal (com.orientechnologies.orient.core.db.ODatabaseDocumentInternal)3 OCommandExecutionException (com.orientechnologies.orient.core.exception.OCommandExecutionException)3 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)3 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)2 BeforeClass (org.junit.BeforeClass)2 OException (com.orientechnologies.common.exception.OException)1 OCommandSQL (com.orientechnologies.orient.core.sql.OCommandSQL)1 OCommandSQLParsingException (com.orientechnologies.orient.core.sql.OCommandSQLParsingException)1 OSQLSynchQuery (com.orientechnologies.orient.core.sql.query.OSQLSynchQuery)1 OObjectDatabaseTx (com.orientechnologies.orient.object.db.OObjectDatabaseTx)1 ODistributedConfiguration (com.orientechnologies.orient.server.distributed.ODistributedConfiguration)1 OrientGraphRemoteTest (com.tinkerpop.blueprints.impls.orient.OrientGraphRemoteTest)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1