Search in sources :

Example 31 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 32 with OServer

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

the class OLiveQueryShutdownTest 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(OLiveQueryShutdownTest.class.getSimpleName(), "graph", "memory");
}
Also used : OServer(com.orientechnologies.orient.server.OServer) OServerAdmin(com.orientechnologies.orient.client.remote.OServerAdmin)

Example 33 with OServer

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

the class RemoteIndexSupportTest 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();
    OServerAdmin server = new OServerAdmin("remote:localhost");
    server.connect("root", "D2AFD02F20640EC8B7A5140F34FCA49D2289DB1F0D0598BB9DE8AAA75A0792F3");
    server.createDatabase("test", "graph", "memory");
}
Also used : OServer(com.orientechnologies.orient.server.OServer) OServerAdmin(com.orientechnologies.orient.client.remote.OServerAdmin) Before(org.junit.Before)

Example 34 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)

Aggregations

OServer (com.orientechnologies.orient.server.OServer)34 OServerAdmin (com.orientechnologies.orient.client.remote.OServerAdmin)10 Before (org.junit.Before)10 File (java.io.File)5 OHazelcastPlugin (com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin)4 ODatabaseDocumentInternal (com.orientechnologies.orient.core.db.ODatabaseDocumentInternal)3 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)3 OCommandExecutionException (com.orientechnologies.orient.core.exception.OCommandExecutionException)3 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)3 BeforeClass (org.junit.BeforeClass)2 Test (org.junit.Test)2 OException (com.orientechnologies.common.exception.OException)1 OPartitionedDatabasePoolFactory (com.orientechnologies.orient.core.db.OPartitionedDatabasePoolFactory)1 ODatabaseDocument (com.orientechnologies.orient.core.db.document.ODatabaseDocument)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 OServerNetworkListener (com.orientechnologies.orient.server.network.OServerNetworkListener)1