use of org.testng.annotations.AfterMethod in project databus by linkedin.
the class TestEventLogWriter method tearDown.
@AfterMethod
public void tearDown() throws Exception {
System.gc();
assertTrue(_writeDir.isDirectory());
for (File f : _writeDir.listFiles()) {
if (f.isDirectory()) {
for (File fil : f.listFiles()) {
assertTrue(fil.delete());
}
}
assertTrue(f.delete());
}
assertTrue(_writeDir.canWrite());
assertTrue(_writeDir.delete());
}
use of org.testng.annotations.AfterMethod in project orientdb by orientechnologies.
the class LinkSetIndexTest method afterMethod.
@AfterMethod
public void afterMethod() throws Exception {
database.command(new OCommandSQL("DELETE FROM LinkSetIndexTestClass")).execute();
List<ODocument> result = database.command(new OCommandSQL("select from LinkSetIndexTestClass")).execute();
Assert.assertEquals(result.size(), 0);
result = database.command(new OCommandSQL("select key, rid from index:linkSetIndex")).execute();
Assert.assertEquals(result.size(), 0);
database.close();
}
use of org.testng.annotations.AfterMethod in project orientdb by orientechnologies.
the class OEmbeddedRidBagTest method afterMethod.
@AfterMethod
public void afterMethod() throws IOException {
OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD.setValue(topThreshold);
OGlobalConfiguration.RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD.setValue(bottomThreshold);
if (database.getStorage() instanceof OStorageProxy) {
OServerAdmin server = new OServerAdmin(database.getURL()).connect("root", ODatabaseHelper.getServerRootPassword());
server.setGlobalConfiguration(OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD, topThreshold);
server.setGlobalConfiguration(OGlobalConfiguration.RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD, bottomThreshold);
server.close();
}
}
use of org.testng.annotations.AfterMethod in project orientdb by orientechnologies.
the class OSBTreeRidBagTest method afterMethod.
@AfterMethod
public void afterMethod() throws IOException {
OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD.setValue(topThreshold);
OGlobalConfiguration.RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD.setValue(bottomThreshold);
if (database.getStorage() instanceof OStorageProxy) {
OServerAdmin server = new OServerAdmin(database.getURL()).connect("root", ODatabaseHelper.getServerRootPassword());
server.setGlobalConfiguration(OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD, topThreshold);
server.setGlobalConfiguration(OGlobalConfiguration.RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD, bottomThreshold);
server.close();
}
}
use of org.testng.annotations.AfterMethod in project elasticsearch-jdbc by jprante.
the class AbstractSinkTest method afterMethod.
@AfterMethod
@Parameters({ "stopurl", "user", "password", "delete" })
public void afterMethod(String stopurl, String user, String password, @Optional String resourceName) throws Exception {
logger.info("remove table {}", resourceName);
if (resourceName == null || "".equals(resourceName)) {
return;
}
logger.debug("cleaning...");
// clean up tables
Connection connection = source.getConnectionForWriting();
if (connection == null) {
throw new IOException("no connection");
}
sqlScript(connection, resourceName);
// before dropping tables, open read connection must be closed to avoid hangs in mysql/postgresql
logger.debug("closing reads...");
source.closeReading();
// we can drop database by a magic 'stop' URL
source = newSource().setUrl(stopurl).setUser(user).setPassword(password).setLocale(Locale.getDefault()).setTimeZone(TimeZone.getDefault());
try {
logger.info("connecting to stop URL...");
// activate stop URL
source.getConnectionForWriting();
} catch (Exception e) {
// exception is expected, ignore
}
source.closeWriting();
logger.info("stopped");
// delete test index
try {
client("1").admin().indices().prepareDelete(index).execute().actionGet();
logger.info("index {} deleted", index);
} catch (Exception e) {
logger.warn(e.getMessage());
}
stopNodes();
}
Aggregations