tests: close update handlers created outside of solr

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@927058 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-03-24 13:58:41 +00:00
parent ba6bfab9b8
commit 954add8c31
1 changed files with 13 additions and 5 deletions

View File

@ -30,28 +30,36 @@ public class TestPropInject extends AbstractSolrTestCase {
return writer;
}
}
public void testMergePolicy() throws Exception {
IndexWriter writer = new ExposeWriterHandler().getWriter();
ExposeWriterHandler uh = new ExposeWriterHandler();
IndexWriter writer = uh.getWriter();
LogByteSizeMergePolicy mp = (LogByteSizeMergePolicy)writer.getMergePolicy();
assertEquals(64.0, mp.getMaxMergeMB());
uh.close();
}
public void testMergePolicyDefaults() throws Exception {
IndexWriter writer = new ExposeWriterHandler().getWriter();
ExposeWriterHandler uh = new ExposeWriterHandler();
IndexWriter writer = uh.getWriter();
LogByteSizeMergePolicy mp = (LogByteSizeMergePolicy)writer.getMergePolicy();
assertEquals(32.0, mp.getMaxMergeMB());
uh.close();
}
public void testProps() throws Exception {
IndexWriter writer = new ExposeWriterHandler().getWriter();
ExposeWriterHandler uh = new ExposeWriterHandler();
IndexWriter writer = uh.getWriter();
ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)writer.getMergeScheduler();
assertEquals(2, cms.getMaxThreadCount());
uh.close();
}
public void testPropsDefaults() throws Exception {
IndexWriter writer = new ExposeWriterHandler().getWriter();
ExposeWriterHandler uh = new ExposeWriterHandler();
IndexWriter writer = uh.getWriter();
ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)writer.getMergeScheduler();
assertEquals(4, cms.getMaxThreadCount());
uh.close();
}
}