Fix failing test because of embedded import in remote
package com.orientechnologies.orient.test.database.auto;
import com.orientechnologies.orient.client.db.ODatabaseHelper;
+import com.orientechnologies.orient.client.remote.ODatabaseImportRemote;
import com.orientechnologies.orient.client.remote.OEngineRemote;
import com.orientechnologies.orient.core.command.OCommandOutputListener;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
@@ -102,6 +103,24 @@ public class CRUDObjectInheritanceTestSchemaFull extends ObjectDBBaseTest {
} else {
importDatabase.open("admin", "admin");
}
+
+ if (importDatabase.isRemote()) {
+ ODatabaseImportRemote impor = new ODatabaseImportRemote(importDatabase, EXPORT_DIR, listener);
+
+ // UNREGISTER ALL THE HOOKS
+ for (ORecordHook hook : new ArrayList<ORecordHook>(importDatabase.getHooks().keySet())) {
+ importDatabase.unregisterHook(hook);
+ }
+
+ impor.importDatabase();
+ impor.close();
+
+ importDatabase.close();
+ final File importDir = new File(EXPORT_DIR);
+ importDir.delete();
+ } else {
+
+
ODatabaseImport impor = new ODatabaseImport(importDatabase, EXPORT_DIR, listener);
// UNREGISTER ALL THE HOOKS
@@ -116,6 +135,7 @@ public class CRUDObjectInheritanceTestSchemaFull extends ObjectDBBaseTest {
importDatabase.close();
final File importDir = new File(EXPORT_DIR);
importDir.delete();
+ }
} catch (IOException e) {
Assert.fail("Export import didn't go as expected", e);
}
