Fixing problems with too many threads for indexing.
This commit is contained in:
parent
499511d5ef
commit
8f4b448dcb
12 changed files with 367 additions and 238 deletions
|
@ -0,0 +1,33 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.vitro.webapp.search.indexing;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.apache.log4j.Level;
|
||||
import org.junit.Test;
|
||||
|
||||
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();
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
Assert.fail(e.getMessage());
|
||||
}
|
||||
ibt.kill();
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
Assert.fail(e.getMessage());
|
||||
}
|
||||
Assert.assertFalse(ibt.isAlive());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue