Tests: fix tests not to use CWD

This commit is contained in:
Robert Muir 2015-05-05 12:50:58 -04:00
parent edd811b710
commit 490b022cd3
2 changed files with 3 additions and 1 deletions

View File

@ -48,9 +48,10 @@ public class SimpleSmartChineseAnalysisTests extends ElasticsearchTestCase {
public void testDefaultsIcuAnalysis() {
Index index = new Index("test");
Settings settings = settingsBuilder()
.put("path.home", createTempDir())
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
.build();
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(EMPTY_SETTINGS), new EnvironmentModule(new Environment(EMPTY_SETTINGS)), new IndicesAnalysisModule()).createInjector();
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(EMPTY_SETTINGS), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
Injector injector = new ModulesBuilder().add(
new IndexSettingsModule(index, settings),
new IndexNameModule(index),

View File

@ -37,6 +37,7 @@ public class SimpleSmartChineseIntegrationTests extends ElasticsearchIntegration
protected Settings nodeSettings(int nodeOrdinal) {
return ImmutableSettings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put("path.home", createTempDir())
.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true)
.build();
}