use of com.orientechnologies.orient.client.remote.OServerAdmin 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");
}
use of com.orientechnologies.orient.client.remote.OServerAdmin 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.client.remote.OServerAdmin in project orientdb by orientechnologies.
the class TestNetworkSerializerIndipendency method createDatabase.
private void createDatabase() throws IOException {
OServerAdmin admin = new OServerAdmin("remote:localhost/test");
admin.connect("root", "D2AFD02F20640EC8B7A5140F34FCA49D2289DB1F0D0598BB9DE8AAA75A0792F3");
admin.createDatabase("document", "plocal");
}
use of com.orientechnologies.orient.client.remote.OServerAdmin in project orientdb by orientechnologies.
the class TestNetworkSerializerIndipendency method dropDatabase.
private void dropDatabase() throws IOException {
OServerAdmin admin = new OServerAdmin("remote:localhost/test");
admin.connect("root", "D2AFD02F20640EC8B7A5140F34FCA49D2289DB1F0D0598BB9DE8AAA75A0792F3");
admin.dropDatabase("plocal");
}
use of com.orientechnologies.orient.client.remote.OServerAdmin in project orientdb by orientechnologies.
the class BinaryProtocolAnyResultTest method scriptReturnValueTest.
@Test
public void scriptReturnValueTest() throws IOException {
OServerAdmin server = new OServerAdmin("remote:localhost");
server.connect("root", "D2AFD02F20640EC8B7A5140F34FCA49D2289DB1F0D0598BB9DE8AAA75A0792F3");
server.createDatabase("test", "graph", "memory");
ODatabaseDocumentTx db = new ODatabaseDocumentTx("remote:localhost/test");
db.open("admin", "admin");
Object res = db.command(new OCommandScript("SQL", " let $one = select from OUser limit 1; return [$one,1]")).execute();
assertTrue(res instanceof List);
assertTrue(((List) res).get(0) instanceof Collection);
assertTrue(((List) res).get(1) instanceof Integer);
db.close();
}
Aggregations