test: unset 'shieldEnabled' and 'scheduleEngine' after test class is completed.

Original commit: elastic/x-pack-elasticsearch@3e9332df94
This commit is contained in:
Martijn van Groningen 2015-04-25 17:42:48 +02:00
parent 5d494a7b2d
commit 7f6c3814b7
1 changed files with 13 additions and 7 deletions

View File

@ -60,6 +60,7 @@ import org.elasticsearch.watcher.trigger.schedule.Schedules;
import org.elasticsearch.watcher.watch.Watch;
import org.elasticsearch.watcher.WatcherService;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import java.io.File;
@ -91,13 +92,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
@Override
protected Settings nodeSettings(int nodeOrdinal) {
if (scheduleEngine == null) {
scheduleEngine = randomFrom(ScheduleModule.Engine.values());
}
if (shieldEnabled == null) {
shieldEnabled = enableShield();
}
String scheduleImplName = scheduleEngine().name().toLowerCase(Locale.ROOT);
logger.info("using schedule engine [" + scheduleImplName + "]");
return ImmutableSettings.builder()
@ -160,6 +154,12 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
stopWatcher();
}
@AfterClass
public static void _cleanupClass() {
shieldEnabled = null;
scheduleEngine = null;
}
@Override
protected Settings transportClientSettings() {
if (!shieldEnabled) {
@ -503,6 +503,12 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
@Override
public void beforeTest(Random random, double transportClientRatio) throws IOException {
if (scheduleEngine == null) {
scheduleEngine = randomFrom(ScheduleModule.Engine.values());
}
if (shieldEnabled == null) {
shieldEnabled = enableShield();
}
testCluster.beforeTest(random, transportClientRatio);
}