use of com.orientechnologies.orient.core.db.OPartitionedDatabasePool in project orientdb by orientechnologies.
the class LuceneDropTest method testDeleteLuceneIndex.
@Test
public void testDeleteLuceneIndex() {
OPartitionedDatabasePool dbPool = new OPartitionedDatabasePool(dbName, "admin", "admin");
ODatabaseDocumentTx db = dbPool.acquire();
fillDb(db, insertcount);
db.close();
db = dbPool.acquire();
// @maggiolo00 Remove the next three lines and the test will not fail anymore
OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<ODocument>("select from test ");
List<ODocument> result = db.command(query).execute();
Assert.assertEquals(insertcount, result.size());
db.close();
dbPool.close();
//reopen to drop
db = new ODatabaseDocumentTx(dbName).open("admin", "admin");
db.drop();
File dbFolder = new File("./target/databases/" + this.getClass().getSimpleName());
Assert.assertEquals(false, dbFolder.exists());
}
use of com.orientechnologies.orient.core.db.OPartitionedDatabasePool in project orientdb by orientechnologies.
the class OPersistentEmbeddedMapTest method setup.
@BeforeMethod
public void setup() {
final String url = "memory:tmpdb";
new OObjectDatabaseTx(url).create().close();
pool = new OPartitionedDatabasePool(url, "admin", "admin");
OObjectDatabaseTx db = new OObjectDatabaseTx(pool.acquire());
try {
db.setAutomaticSchemaGeneration(true);
OEntityManager entityManager = db.getEntityManager();
entityManager.registerEntityClass(Car.class);
entityManager.registerEntityClass(Person.class);
db.getMetadata().getSchema().synchronizeSchema();
} finally {
db.close();
}
}
Aggregations