database.close();
}
@Test
public void deleteInPool() {
ODatabaseDocumentTx db = ODatabaseDocumentPool.global().acquire(url, "admin", "admin");
final Long total = db.countClass("Profile");
final List<ODocument> resultset = db.query(new OSQLSynchQuery<Object>(
"select from Profile where sex = 'male' and salary > 120 and salary <= 133"));
final Number records = (Number) db.command(
new OCommandSQL("delete from Profile where sex = 'male' and salary > 120 and salary <= 133")).execute();
Assert.assertEquals(records.intValue(), resultset.size());
Assert.assertEquals(db.countClass("Profile"), total - records.intValue());
db.close();
}