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();
}
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");
}
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();
}
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();
}
}
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();
}
}
Aggregations