Search in sources :

Example 6 with ODatabaseExport

use of com.orientechnologies.orient.core.db.tool.ODatabaseExport in project orientdb by orientechnologies.

the class DbImportExportTest method testDbExport.

@Test
public void testDbExport() throws IOException {
    ODatabaseDocumentTx database = new ODatabaseDocumentTx(url);
    database.open("admin", "admin");
    // ADD A CUSTOM TO THE CLASS
    database.command(new OCommandSQL("alter class V custom onBeforeCreate=onBeforeCreateItem")).execute();
    ODatabaseExport export = new ODatabaseExport(database, testPath + "/" + exportFilePath, this);
    export.exportDatabase();
    export.close();
    database.close();
}
Also used : OCommandSQL(com.orientechnologies.orient.core.sql.OCommandSQL) ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) ODatabaseExport(com.orientechnologies.orient.core.db.tool.ODatabaseExport) Test(org.testng.annotations.Test)

Aggregations

ODatabaseExport (com.orientechnologies.orient.core.db.tool.ODatabaseExport)6 OCommandOutputListener (com.orientechnologies.orient.core.command.OCommandOutputListener)4 ODatabaseImport (com.orientechnologies.orient.core.db.tool.ODatabaseImport)3 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)2 OCommandSQL (com.orientechnologies.orient.core.sql.OCommandSQL)2 IOException (java.io.IOException)2 Test (org.testng.annotations.Test)2 ODatabaseDocumentInternal (com.orientechnologies.orient.core.db.ODatabaseDocumentInternal)1 ORecordHook (com.orientechnologies.orient.core.hook.ORecordHook)1 OSQLSynchQuery (com.orientechnologies.orient.core.sql.query.OSQLSynchQuery)1 OObjectDatabaseTx (com.orientechnologies.orient.object.db.OObjectDatabaseTx)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 SocketException (java.net.SocketException)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 GZIPInputStream (java.util.zip.GZIPInputStream)1 GZIPOutputStream (java.util.zip.GZIPOutputStream)1 Test (org.junit.Test)1 BeforeClass (org.testng.annotations.BeforeClass)1