Changing the models that the SearchReindexingListener listens to. NIHVIVO-2076

This commit is contained in:
bdc34 2011-02-09 16:08:42 +00:00
parent 61812f7a1e
commit 1341d23a25
10 changed files with 327 additions and 323 deletions

View file

@ -13,21 +13,25 @@ import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
public class IndexBuilderThreadTest extends AbstractTestClass {
@Test
public void testStoppingTheThread(){
setLoggerLevel(IndexBuilderThread.class, Level.OFF);
IndexBuilderThread ibt = new IndexBuilderThread(null);
ibt.start();
public void testStoppingTheThread(){
setLoggerLevel(IndexBuilder.class, Level.OFF);
IndexBuilder ib = new IndexBuilder();
Assert.assertNotSame(Thread.State.NEW, ib.getState() );
Assert.assertNotSame(Thread.State.TERMINATED, ib.getState() );
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Assert.fail(e.getMessage());
}
ibt.kill();
ib.stopIndexingThread();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Assert.fail(e.getMessage());
}
Assert.assertFalse(ibt.isAlive());
Assert.assertFalse(ib.isAlive());
Assert.assertSame(Thread.State.TERMINATED, ib.getState() );
}
}