Search in sources :

Example 1 with OrientDBDao

use of io.divide.dao.orientdb.OrientDBDao in project divide by HiddenStage.

the class TestUtils method setUp.

public static TestWrapper setUp() {
    TestWrapper container = new TestWrapper();
    container.time = System.nanoTime();
    container.db = new ODatabaseDocumentTx(OrientDBDao.DEFAULT_CONFIG);
    if (container.db.exists()) {
        container.db.open("admin", "admin");
    } else {
        container.db.create();
    }
    container.serverDao = new OrientDBDao((ODatabaseDocument) container.db);
    try {
        container.serverDao.query(new QueryBuilder().delete().from(Credentials.class).build());
    } catch (ServerDAO.DAOException e) {
        e.printStackTrace();
    }
    container.app = new TestApplication(container.serverDao);
    return container;
}
Also used : ServerDAO(io.divide.dao.ServerDAO) OrientDBDao(io.divide.dao.orientdb.OrientDBDao) ODatabaseDocument(com.orientechnologies.orient.core.db.document.ODatabaseDocument) ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) QueryBuilder(io.divide.shared.transitory.query.QueryBuilder)

Aggregations

ODatabaseDocument (com.orientechnologies.orient.core.db.document.ODatabaseDocument)1 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)1 ServerDAO (io.divide.dao.ServerDAO)1 OrientDBDao (io.divide.dao.orientdb.OrientDBDao)1 QueryBuilder (io.divide.shared.transitory.query.QueryBuilder)1