log.error("Start reader. Sleep error: " + e.getMessage(), e);
}
}
log.info("Begin cleaner...");
DeleteThread cleaner = new DeleteThread(repository.login(this.credentials /*
* session.getCredentials
* ()
*/, "ws1"));
cleaner.start();
log.info("<<<<<<<<<<<<<<<<<<<< Wait cycle >>>>>>>>>>>>>>>>>>>>>");
// 360 - 60 min
// 4320 - 12 hours
int cycles = 180; // 5min
while (cycles >= 0)
{
Thread.yield();
try
{
Thread.sleep(10000);
}
catch (InterruptedException e)
{
log.error("Test lifecycle. Sleep error: " + e.getMessage(), e);
}
log.info("<<<<<<<<<<<<<<<<<<<< Cycle " + cycles + " >>>>>>>>>>>>>>>>>>>>>");
cycles--;
}
log.info("<<<<<<<<<<<<<<<<<<<< Stopping >>>>>>>>>>>>>>>>>>>>>");
for (ReadThread reader : readers)
{
try
{
reader.testStop();
reader.join(3000);
Thread.yield();
}
catch (InterruptedException e)
{
log.error("Test lifecycle. Readed stop error: " + e.getMessage(), e);
}
}
try
{
creator.testStop();
creator.join();
Thread.yield();
}
catch (InterruptedException e)
{
log.error("Test lifecycle. Creator stop error: " + e.getMessage(), e);
}
try
{
cleaner.testStop();
cleaner.join();
Thread.yield();
}
catch (InterruptedException e)
{
log.error("Test lifecycle. Cleaner stop error: " + e.getMessage(), e);