From ae02762b9528bb496fdcba95ba9ef17fc7a8497f Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 3 Aug 2015 18:18:18 -0700 Subject: [PATCH 1/2] Rename test cases to use new test name patterns With elastic/elasticsearchelastic/elasticsearch#12623 base test classes were renamed to use "TestCase" suffix. This updates x-plugins to reflect those name changes. It also renames some tests that were marked with @Slow (which was forbidden with elastic/elasticsearchelastic/elasticsearch#12617 and elastic/elasticsearch elastic/elasticsearch#12618) to use the IT suffix to run under `mvn verify`. Original commit: elastic/x-pack-elasticsearch@05ffe2f202816f214983795aebfc89b4c80c1d52 --- .../marvel/MarvelPluginClientTests.java | 4 +- .../marvel/MarvelPluginTests.java | 8 +-- .../elasticsearch/marvel/MarvelRestIT.java | 6 +- .../marvel/MarvelVersionTests.java | 4 +- .../marvel/agent/AgentUtilsTests.java | 4 +- .../cluster/ClusterStateCollectorTests.java | 4 +- .../cluster/ClusterStatsCollectorTests.java | 4 +- ...sts.java => IndexRecoveryCollectorIT.java} | 8 +-- .../indices/IndexStatsCollectorTests.java | 4 +- .../node/NodeStatsCollectorTests.java | 4 +- .../agent/exporter/HttpESExporterTests.java | 10 ++- .../cluster/ClusterStateRendererTests.java | 4 +- .../cluster/ClusterStatsRendererTests.java | 4 +- .../indices/IndexRecoveryRendererTests.java | 4 +- .../indices/IndexStatsRendererTests.java | 4 +- .../renderer/node/NodeStatsRendererTests.java | 4 +- .../agent/settings/MarvelSettingTests.java | 4 +- .../settings/MarvelSettingsServiceTests.java | 4 +- .../license/LicenseIntegrationTests.java | 8 +-- .../elasticsearch/bench/HasherBenchmark.java | 5 -- .../integration/AbstractPrivilegeTests.java | 4 +- .../integration/ClearRealmsCacheTests.java | 4 +- .../integration/ClusterPrivilegeTests.java | 4 +- .../integration/LicensingTests.java | 4 +- .../MultipleIndicesPermissionsTests.java | 4 +- .../PermissionPrecedenceTests.java | 4 +- .../integration/ScrollIdSigningTests.java | 4 +- .../SearchGetAndSuggestPermissionsTests.java | 4 +- .../integration/SettingsFilterTests.java | 8 +-- .../ShieldCachePermissionTests.java | 4 +- .../integration/ShieldClearScrollTests.java | 4 +- ....java => AbstractAdLdapRealmTestCase.java} | 8 +-- .../integration/ldap/GroupMappingTests.java | 2 +- .../ldap/MultiGroupMappingTests.java | 2 +- .../ShieldPluginEnabledDisabledTests.java | 4 +- .../shield/ShieldPluginSettingsTests.java | 4 +- .../shield/ShieldPluginTests.java | 4 +- .../shield/ShieldVersionTests.java | 4 +- .../shield/VersionCompatibilityTests.java | 4 +- .../action/ShieldActionFilterTests.java | 4 +- .../action/ShieldActionMapperTests.java | 4 +- .../shield/audit/AuditTrailModuleTests.java | 4 +- .../shield/audit/AuditTrailServiceTests.java | 4 +- .../audit/index/IndexAuditLevelTests.java | 4 +- .../index/IndexAuditTrailEnabledTests.java | 8 +-- .../audit/index/IndexAuditTrailTests.java | 10 +-- .../RemoteIndexAuditTrailStartingTests.java | 4 +- .../audit/logfile/LoggingAuditTrailTests.java | 4 +- .../authc/AnonymousUserHolderTests.java | 4 +- .../shield/authc/AnonymousUserTests.java | 4 +- .../InternalAuthenticationServiceTests.java | 4 +- .../shield/authc/RealmsTests.java | 4 +- .../ActiveDirectoryGroupsResolverTests.java | 4 +- .../ActiveDirectoryRealmTests.java | 4 +- .../ActiveDirectorySessionFactoryTests.java | 12 ++-- .../authc/esusers/ESUsersRealmTests.java | 4 +- .../esusers/FileUserPasswdStoreTests.java | 4 +- .../esusers/FileUserRolesStoreTests.java | 4 +- .../shield/authc/ldap/LdapRealmTests.java | 4 +- .../authc/ldap/LdapSessionFactoryTests.java | 4 +- .../LdapUserSearchSessionFactoryTests.java | 10 +-- .../shield/authc/ldap/OpenLdapTests.java | 16 ++--- .../authc/ldap/SearchGroupsResolverTests.java | 4 +- .../UserAttributeGroupsResolverTests.java | 4 +- .../authc/ldap/support/LDAPServersTests.java | 4 +- .../{LdapTest.java => LdapTestCase.java} | 10 +-- .../ldap/support/SessionFactoryTests.java | 4 +- .../authc/pki/PkiAuthenticationTests.java | 6 +- .../authc/pki/PkiOptionalClientAuthTests.java | 5 +- .../shield/authc/pki/PkiRealmTests.java | 4 +- .../PkiWithoutClientAuthenticationTests.java | 6 +- .../shield/authc/pki/PkiWithoutSSLTests.java | 6 +- .../CachingUsernamePasswordRealmTests.java | 4 +- .../authc/support/DnRoleMapperTests.java | 4 +- .../shield/authc/support/HasherTests.java | 4 +- .../authc/support/SecuredStringTests.java | 4 +- .../support/UsernamePasswordTokenTests.java | 4 +- .../shield/authz/AnalyzeTests.java | 4 +- .../shield/authz/IndexAliasesTests.java | 4 +- .../InternalAuthorizationServiceTests.java | 4 +- .../shield/authz/PermissionTests.java | 4 +- .../shield/authz/PrivilegeTests.java | 4 +- .../shield/authz/SystemRoleTests.java | 4 +- .../DefaultIndicesResolverTests.java | 4 +- .../IndicesResolverIntegrationTests.java | 4 +- .../authz/store/FileRolesStoreTests.java | 4 +- .../crypto/InternalCryptoServiceTests.java | 4 +- .../shield/rest/ShieldRestFilterTests.java | 4 +- .../shield/ssl/ClientSSLServiceTests.java | 4 +- .../shield/ssl/SSLSettingsTests.java | 4 +- .../shield/ssl/ServerSSLServiceTests.java | 4 +- .../shield/support/AutomatonsTests.java | 4 +- .../shield/support/ShieldFilesTests.java | 4 +- .../shield/support/ValidationTests.java | 4 +- .../transport/ClientTransportFilterTests.java | 4 +- ...ServerTransportFilterIntegrationTests.java | 4 +- .../transport/ServerTransportFilterTests.java | 4 +- .../transport/TransportFilterTests.java | 8 +-- .../transport/filter/IPFilterTests.java | 4 +- .../filter/IpFilteringIntegrationTests.java | 8 +-- .../filter/IpFilteringUpdateTests.java | 8 +-- .../netty/HandshakeWaitingHandlerTests.java | 4 +- .../IPFilterNettyUpstreamHandlerTests.java | 4 +- .../netty/IPHostnameVerificationTests.java | 4 +- .../ShieldNettyHttpServerTransportTests.java | 4 +- .../netty/ShieldNettyTransportTests.java | 4 +- .../netty/SslHostnameVerificationTests.java | 4 +- .../transport/ssl/SslClientAuthTests.java | 4 +- .../transport/ssl/SslIntegrationTests.java | 4 +- .../transport/ssl/SslMultiPortTests.java | 4 +- .../tribe/{TribeTests.java => TribeIT.java} | 6 +- .../shield/tribe/TribeShieldLoadedTests.java | 4 +- ...tionTest.java => ShieldIntegTestCase.java} | 66 +++++++++---------- .../elasticsearch/test/ShieldRest0Tests.java | 4 +- .../elasticsearch/test/ShieldRest1Tests.java | 4 +- .../elasticsearch/test/ShieldRest2Tests.java | 4 +- .../elasticsearch/test/ShieldRest3Tests.java | 4 +- .../elasticsearch/test/ShieldRest4Tests.java | 4 +- .../elasticsearch/test/ShieldRest5Tests.java | 4 +- .../elasticsearch/test/ShieldRest6Tests.java | 4 +- .../elasticsearch/test/ShieldRest7Tests.java | 4 +- .../org/elasticsearch/test/ShieldRestIT.java | 4 +- .../test/ShieldRestTestCase.java | 19 +++--- .../test/ShieldSettingsSource.java | 4 +- .../transport/KnownActionsTests.java | 6 +- .../watcher/WatcherLifeCycleServiceTests.java | 4 +- .../watcher/WatcherPluginDisableTests.java | 8 +-- .../watcher/WatcherVersionTests.java | 4 +- .../actions/email/DataAttachmentTests.java | 4 +- .../actions/email/EmailActionTests.java | 4 +- .../actions/email/service/AccountTests.java | 4 +- .../actions/email/service/AccountsTests.java | 4 +- .../email/service/EmailTemplateTests.java | 4 +- .../actions/email/service/EmailTest.java | 4 +- .../email/service/HtmlSanitizerTests.java | 4 +- .../service/InternalEmailServiceTests.java | 4 +- ...ava => ManualPublicSmtpServersTester.java} | 9 +-- .../actions/index/IndexActionTests.java | 4 +- .../actions/logging/LoggingActionTests.java | 4 +- .../actions/throttler/AckThrottlerTests.java | 4 +- ...rottleTests.java => ActionThrottleIT.java} | 19 +++--- .../throttler/PeriodThrottlerTests.java | 4 +- .../throttler/WatchThrottlerTests.java | 4 +- .../actions/webhook/WebhookActionTests.java | 4 +- ...ts.java => WebhookHttpsIntegrationIT.java} | 10 ++- .../always/AlwaysConditionTests.java | 4 +- .../compare/CompareConditionTests.java | 4 +- .../condition/never/NeverConditionTests.java | 4 +- .../script/ScriptConditionTests.java | 4 +- .../execution/ExecutionServiceTests.java | 4 +- .../execution/ManualExecutionTests.java | 13 +++- .../execution/TriggeredWatchStoreTests.java | 4 +- .../history/HistoryStoreSettingsTests.java | 6 +- .../watcher/history/HistoryStoreTests.java | 4 +- .../watcher/input/InputRegistryTests.java | 4 +- .../watcher/input/http/HttpInputTests.java | 4 +- .../input/search/SearchInputTests.java | 8 +-- .../input/simple/SimpleInputTests.java | 4 +- .../support/DynamicIndexNameTests.java | 4 +- .../watcher/support/FilterXContentTests.java | 4 +- .../watcher/support/VariablesTests.java | 4 +- .../support/WatcherDateTimeUtilsTests.java | 4 +- .../WatcherIndexTemplateRegistryTests.java | 6 +- .../watcher/support/WatcherUtilsTests.java | 4 +- .../watcher/support/clock/ClockTests.java | 4 +- .../concurrent/FairKeyedLockTests.java | 4 +- .../watcher/support/http/HttpClientTests.java | 4 +- ...ests.java => HttpConnectionTimeoutIT.java} | 10 +-- .../support/http/HttpReadTimeoutTests.java | 4 +- .../http/HttpRequestTemplateTests.java | 4 +- .../support/http/HttpResponseTests.java | 4 +- .../support/template/TemplateTests.java | 4 +- .../xmustache/XMustacheScriptEngineTests.java | 4 +- .../template/xmustache/XMustacheTests.java | 4 +- .../support/xcontent/MapPathTests.java | 4 +- .../support/xcontent/XContentSourceTests.java | 4 +- .../test/AbstractWatcherIntegrationTests.java | 8 +-- .../watcher/test/WatcherTestUtils.java | 6 +- .../test/integration/BasicWatcherTests.java | 1 - .../test/integration/NoMasterNodeTests.java | 8 +-- .../watcher/test/rest/WatcherRestTests.java | 12 ++-- .../transform/chain/ChainTransformTests.java | 4 +- .../script/ScriptTransformTests.java | 4 +- .../search/SearchTransformTests.java | 8 +-- .../action/delete/ForceDeleteWatchTests.java | 3 +- ...hStatsTests.java => SlowWatchStatsIT.java} | 22 +++---- .../action/stats/WatcherStatsTests.java | 4 +- .../schedule/IntervalScheduleTests.java | 4 +- .../trigger/schedule/ScheduleTestCase.java | 4 +- .../schedule/ScheduleTriggerEventTests.java | 4 +- ...ts.java => BaseTriggerEngineTestCase.java} | 10 +-- .../engine/SchedulerScheduleEngineTests.java | 7 +- .../engine/TickerScheduleEngineTests.java | 2 +- .../watcher/watch/WatchLockServiceTests.java | 4 +- .../watcher/watch/WatchServiceTests.java | 4 +- .../watcher/watch/WatchStoreTests.java | 4 +- .../watcher/watch/WatchTests.java | 4 +- 197 files changed, 509 insertions(+), 542 deletions(-) rename marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/{IndexRecoveryCollectorTests.java => IndexRecoveryCollectorIT.java} (96%) rename shield/src/test/java/org/elasticsearch/integration/ldap/{AbstractAdLdapRealmTests.java => AbstractAdLdapRealmTestCase.java} (97%) rename shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/{LdapTest.java => LdapTestCase.java} (91%) rename shield/src/test/java/org/elasticsearch/shield/tribe/{TribeTests.java => TribeIT.java} (98%) rename shield/src/test/java/org/elasticsearch/test/{ShieldIntegrationTest.java => ShieldIntegTestCase.java} (80%) rename watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/{ManualPublicSmtpServersTests.java => ManualPublicSmtpServersTester.java} (97%) rename watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/{ActionThrottleTests.java => ActionThrottleIT.java} (98%) rename watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/{WebhookHttpsIntegrationTests.java => WebhookHttpsIntegrationIT.java} (96%) rename watcher/src/test/java/org/elasticsearch/watcher/support/http/{HttpConnectionTimeoutTests.java => HttpConnectionTimeoutIT.java} (96%) rename watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/{SlowWatchStatsTests.java => SlowWatchStatsIT.java} (88%) rename watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/{BaseTriggerEngineTests.java => BaseTriggerEngineTestCase.java} (98%) diff --git a/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginClientTests.java b/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginClientTests.java index 1fcbbe867bc..8b38cb215d5 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginClientTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginClientTests.java @@ -9,14 +9,14 @@ import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.util.Collection; import static org.hamcrest.Matchers.is; -public class MarvelPluginClientTests extends ElasticsearchTestCase { +public class MarvelPluginClientTests extends ESTestCase { @Test public void testModulesWithClientSettings() { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java b/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java index bc9024b3421..f9e2be7009c 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java @@ -11,16 +11,16 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.license.plugin.LicensePlugin; import org.elasticsearch.marvel.agent.AgentService; import org.elasticsearch.plugins.PluginInfo; -import org.elasticsearch.test.ElasticsearchIntegrationTest; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.tribe.TribeService; import org.junit.Test; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; +import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.hamcrest.Matchers.equalTo; @ClusterScope(scope = TEST, transportClientRatio = 0, numClientNodes = 0, numDataNodes = 0) -public class MarvelPluginTests extends ElasticsearchIntegrationTest { +public class MarvelPluginTests extends ESIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/MarvelRestIT.java b/marvel/src/test/java/org/elasticsearch/marvel/MarvelRestIT.java index e039c7e48b5..8bc0a72f70e 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/MarvelRestIT.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/MarvelRestIT.java @@ -7,13 +7,13 @@ package org.elasticsearch.marvel; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; import java.io.IOException; -public class MarvelRestIT extends ElasticsearchRestTestCase { +public class MarvelRestIT extends ESRestTestCase { public MarvelRestIT(@Name("yaml") RestTestCandidate testCandidate) { super(testCandidate); @@ -21,7 +21,7 @@ public class MarvelRestIT extends ElasticsearchRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(0, 1); + return ESRestTestCase.createParameters(0, 1); } } diff --git a/marvel/src/test/java/org/elasticsearch/marvel/MarvelVersionTests.java b/marvel/src/test/java/org/elasticsearch/marvel/MarvelVersionTests.java index d377aa59112..d2a99057be9 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/MarvelVersionTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/MarvelVersionTests.java @@ -5,12 +5,12 @@ */ package org.elasticsearch.marvel; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.Matchers.equalTo; -public class MarvelVersionTests extends ElasticsearchTestCase { +public class MarvelVersionTests extends ESTestCase { @Test public void testVersionFromString() { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/AgentUtilsTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/AgentUtilsTests.java index 923e027525f..6cdc221938c 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/AgentUtilsTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/AgentUtilsTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.marvel.agent; import org.elasticsearch.common.io.Streams; import org.elasticsearch.marvel.agent.support.AgentUtils; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.Test; @@ -24,7 +24,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; -public class AgentUtilsTests extends ElasticsearchTestCase { +public class AgentUtilsTests extends ESTestCase { @Test public void testVersionIsExtractableFromIndexTemplate() throws IOException { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java index 697d402d7ef..b4bc7ac2f3d 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.marvel.agent.exporter.MarvelDoc; import org.elasticsearch.marvel.agent.settings.MarvelSettingsService; -import org.elasticsearch.test.ElasticsearchSingleNodeTest; +import org.elasticsearch.test.ESSingleNodeTestCase; import org.junit.Test; import java.util.Collection; @@ -20,7 +20,7 @@ import java.util.Collection; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.*; -public class ClusterStateCollectorTests extends ElasticsearchSingleNodeTest { +public class ClusterStateCollectorTests extends ESSingleNodeTestCase { @Test public void testClusterStateCollectorNoIndices() throws Exception { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java index c358db2cb61..abc39949ccd 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java @@ -10,14 +10,14 @@ import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.marvel.agent.exporter.MarvelDoc; import org.elasticsearch.marvel.agent.settings.MarvelSettingsService; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.junit.Test; import java.util.Collection; import static org.hamcrest.Matchers.*; -public class ClusterStatsCollectorTests extends ElasticsearchIntegrationTest { +public class ClusterStatsCollectorTests extends ESIntegTestCase { @Test public void testClusterStatsCollector() throws Exception { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorIT.java similarity index 96% rename from marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java rename to marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorIT.java index 91755204ded..56fcb75363b 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorIT.java @@ -5,7 +5,6 @@ */ package org.elasticsearch.marvel.agent.collector.indices; -import org.apache.lucene.util.LuceneTestCase.Slow; import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse; import org.elasticsearch.action.admin.indices.recovery.ShardRecoveryResponse; import org.elasticsearch.cluster.ClusterName; @@ -17,7 +16,7 @@ import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.marvel.agent.exporter.MarvelDoc; import org.elasticsearch.marvel.agent.settings.MarvelSettingsService; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.junit.Test; import java.util.Collection; @@ -32,9 +31,8 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcke import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.*; -@Slow -@ElasticsearchIntegrationTest.ClusterScope(numDataNodes = 0) -public class IndexRecoveryCollectorTests extends ElasticsearchIntegrationTest { +@ESIntegTestCase.ClusterScope(numDataNodes = 0) +public class IndexRecoveryCollectorIT extends ESIntegTestCase { @Override diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java index 3f854518925..8124a626731 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.marvel.agent.exporter.MarvelDoc; import org.elasticsearch.marvel.agent.settings.MarvelSettingsService; -import org.elasticsearch.test.ElasticsearchSingleNodeTest; +import org.elasticsearch.test.ESSingleNodeTestCase; import org.junit.Test; import java.util.Collection; @@ -22,7 +22,7 @@ import java.util.Iterator; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.*; -public class IndexStatsCollectorTests extends ElasticsearchSingleNodeTest { +public class IndexStatsCollectorTests extends ESSingleNodeTestCase { @Test public void testIndexStatsCollectorNoIndices() throws Exception { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java index a10f8a8330a..fcac9a76da0 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java @@ -15,14 +15,14 @@ import org.elasticsearch.discovery.DiscoveryService; import org.elasticsearch.marvel.agent.exporter.MarvelDoc; import org.elasticsearch.marvel.agent.settings.MarvelSettingsService; import org.elasticsearch.node.service.NodeService; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.junit.Test; import java.util.Collection; import static org.hamcrest.Matchers.*; -public class NodeStatsCollectorTests extends ElasticsearchIntegrationTest { +public class NodeStatsCollectorTests extends ESIntegTestCase { @Test public void testNodeStatsCollector() throws Exception { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/HttpESExporterTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/HttpESExporterTests.java index 17fa6f20b2f..ba330828c1f 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/HttpESExporterTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/HttpESExporterTests.java @@ -8,7 +8,6 @@ package org.elasticsearch.marvel.agent.exporter; import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; -import org.apache.lucene.util.LuceneTestCase; import org.elasticsearch.action.admin.indices.stats.IndexStats; import org.elasticsearch.cluster.metadata.IndexTemplateMetaData; import org.elasticsearch.common.Strings; @@ -18,8 +17,8 @@ import org.elasticsearch.marvel.MarvelPlugin; import org.elasticsearch.marvel.agent.AgentService; import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc; import org.elasticsearch.node.Node; -import org.elasticsearch.test.ElasticsearchIntegrationTest; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.hamcrest.Matchers; import org.junit.Test; @@ -32,8 +31,8 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcke // Transport Client instantiation also calls the marvel plugin, which then fails to find modules -@ClusterScope(transportClientRatio = 0.0, scope = ElasticsearchIntegrationTest.Scope.TEST, numDataNodes = 0, numClientNodes = 0) -public class HttpESExporterTests extends ElasticsearchIntegrationTest { +@ClusterScope(transportClientRatio = 0.0, scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0) +public class HttpESExporterTests extends ESIntegTestCase { final static AtomicLong timeStampGenerator = new AtomicLong(); @@ -84,7 +83,6 @@ public class HttpESExporterTests extends ElasticsearchIntegrationTest { */ @Test - @LuceneTestCase.Slow public void testTemplateAdditionDespiteOfLateClusterForming() { Settings.Builder builder = Settings.builder() .put(AgentService.SETTINGS_INTERVAL, "200m") diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRendererTests.java index 631d2719de5..8d00e87e7d1 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRendererTests.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMarvelDoc; import org.elasticsearch.marvel.agent.renderer.Renderer; import org.elasticsearch.marvel.agent.renderer.RendererTestUtils; -import org.elasticsearch.test.ElasticsearchSingleNodeTest; +import org.elasticsearch.test.ESSingleNodeTestCase; import org.junit.Test; -public class ClusterStateRendererTests extends ElasticsearchSingleNodeTest { +public class ClusterStateRendererTests extends ESSingleNodeTestCase { private static final String SAMPLE_FILE = "/samples/marvel_cluster_state.json"; diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRendererTests.java index febc7da2ed6..600c08c286c 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRendererTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.io.Streams; import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMarvelDoc; import org.elasticsearch.marvel.agent.renderer.Renderer; import org.elasticsearch.marvel.agent.renderer.RendererTestUtils; -import org.elasticsearch.test.ElasticsearchSingleNodeTest; +import org.elasticsearch.test.ESSingleNodeTestCase; import org.junit.Test; -public class ClusterStatsRendererTests extends ElasticsearchSingleNodeTest { +public class ClusterStatsRendererTests extends ESSingleNodeTestCase { private static final String SAMPLE_FILE = "/samples/marvel_cluster_stats.json"; diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexRecoveryRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexRecoveryRendererTests.java index 335d7dfe6a4..c79cf8b7bea 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexRecoveryRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexRecoveryRendererTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMarvelDoc; import org.elasticsearch.marvel.agent.renderer.Renderer; import org.elasticsearch.marvel.agent.renderer.RendererTestUtils; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.util.ArrayList; @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public class IndexRecoveryRendererTests extends ElasticsearchTestCase { +public class IndexRecoveryRendererTests extends ESTestCase { private static final String SAMPLE_FILE = "/samples/marvel_index_recovery.json"; diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRendererTests.java index f70d3c8357c..54eb3530bc4 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRendererTests.java @@ -15,10 +15,10 @@ import org.elasticsearch.index.store.StoreStats; import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc; import org.elasticsearch.marvel.agent.renderer.Renderer; import org.elasticsearch.marvel.agent.renderer.RendererTestUtils; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; -public class IndexStatsRendererTests extends ElasticsearchTestCase { +public class IndexStatsRendererTests extends ESTestCase { private static final String SAMPLE_FILE = "/samples/marvel_index_stats.json"; diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRendererTests.java index 28c14ce855e..44ddd76e15e 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRendererTests.java @@ -11,10 +11,10 @@ import org.elasticsearch.marvel.agent.collector.node.NodeStatsMarvelDoc; import org.elasticsearch.marvel.agent.renderer.Renderer; import org.elasticsearch.marvel.agent.renderer.RendererTestUtils; import org.elasticsearch.node.service.NodeService; -import org.elasticsearch.test.ElasticsearchSingleNodeTest; +import org.elasticsearch.test.ESSingleNodeTestCase; import org.junit.Test; -public class NodeStatsRendererTests extends ElasticsearchSingleNodeTest { +public class NodeStatsRendererTests extends ESSingleNodeTestCase { private static final String SAMPLE_FILE = "/samples/marvel_node_stats.json"; diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingTests.java index c82d068e1d5..68b4b90dc28 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingTests.java @@ -7,13 +7,13 @@ package org.elasticsearch.marvel.agent.settings; import org.elasticsearch.common.Strings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.equalTo; -public class MarvelSettingTests extends ElasticsearchTestCase { +public class MarvelSettingTests extends ESTestCase { @Test public void testBooleanMarvelSetting() { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsServiceTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsServiceTests.java index 429e6f6a7c5..566cea93d61 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsServiceTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsServiceTests.java @@ -8,13 +8,13 @@ package org.elasticsearch.marvel.agent.settings; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.equalTo; -public class MarvelSettingsServiceTests extends ElasticsearchTestCase { +public class MarvelSettingsServiceTests extends ESTestCase { @Test public void testMarvelSettingService() { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java b/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java index 0d9b92675ca..e29b99512cd 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java @@ -19,19 +19,19 @@ import org.elasticsearch.license.plugin.core.LicensesService; import org.elasticsearch.marvel.MarvelPlugin; import org.elasticsearch.marvel.mode.Mode; import org.elasticsearch.plugins.AbstractPlugin; -import org.elasticsearch.test.ElasticsearchIntegrationTest; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.junit.Test; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE; +import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.hamcrest.Matchers.equalTo; @ClusterScope(scope = SUITE, transportClientRatio = 0, numClientNodes = 0) -public class LicenseIntegrationTests extends ElasticsearchIntegrationTest { +public class LicenseIntegrationTests extends ESIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/shield/src/test/java/org/elasticsearch/bench/HasherBenchmark.java b/shield/src/test/java/org/elasticsearch/bench/HasherBenchmark.java index 2e070bdfe3b..4b9977211f2 100644 --- a/shield/src/test/java/org/elasticsearch/bench/HasherBenchmark.java +++ b/shield/src/test/java/org/elasticsearch/bench/HasherBenchmark.java @@ -10,14 +10,9 @@ import org.elasticsearch.common.metrics.MeanMetric; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; -import org.junit.Ignore; import java.util.concurrent.ThreadLocalRandom; -/** - * - */ -@Ignore public class HasherBenchmark { private static final int WARMING_ITERS = 1000; diff --git a/shield/src/test/java/org/elasticsearch/integration/AbstractPrivilegeTests.java b/shield/src/test/java/org/elasticsearch/integration/AbstractPrivilegeTests.java index 79b32ba70b1..859b68e76cf 100644 --- a/shield/src/test/java/org/elasticsearch/integration/AbstractPrivilegeTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/AbstractPrivilegeTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; import org.junit.After; @@ -27,7 +27,7 @@ import static org.hamcrest.Matchers.*; /** * a helper class that contains a couple of HTTP helper methods */ -public abstract class AbstractPrivilegeTests extends ShieldIntegrationTest { +public abstract class AbstractPrivilegeTests extends ShieldIntegTestCase { protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray()))); diff --git a/shield/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java b/shield/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java index 4369de90859..90cf8118c23 100644 --- a/shield/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.SecuredStringTests; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.client.ShieldClient; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.junit.BeforeClass; import org.junit.Test; @@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class ClearRealmsCacheTests extends ShieldIntegrationTest { +public class ClearRealmsCacheTests extends ShieldIntegTestCase { private static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray()))); diff --git a/shield/src/test/java/org/elasticsearch/integration/ClusterPrivilegeTests.java b/shield/src/test/java/org/elasticsearch/integration/ClusterPrivilegeTests.java index 9334f0dcb9f..6dcecdd059b 100644 --- a/shield/src/test/java/org/elasticsearch/integration/ClusterPrivilegeTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/ClusterPrivilegeTests.java @@ -20,8 +20,8 @@ import org.junit.Test; import java.nio.file.Path; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; +import static org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; @ClusterScope(scope = TEST) public class ClusterPrivilegeTests extends AbstractPrivilegeTests { diff --git a/shield/src/test/java/org/elasticsearch/integration/LicensingTests.java b/shield/src/test/java/org/elasticsearch/integration/LicensingTests.java index e7a60c95060..19faad6e5bc 100644 --- a/shield/src/test/java/org/elasticsearch/integration/LicensingTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/LicensingTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.plugins.AbstractPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.shield.license.LicenseService; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.junit.Test; @@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class LicensingTests extends ShieldIntegrationTest { +public class LicensingTests extends ShieldIntegTestCase { public static final String ROLES = ShieldSettingsSource.DEFAULT_ROLE + ":\n" + diff --git a/shield/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java b/shield/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java index cb231762696..011a8a8bb01 100644 --- a/shield/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.SecuredStringTests; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.junit.Test; @@ -27,7 +27,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitC import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.is; -public class MultipleIndicesPermissionsTests extends ShieldIntegrationTest { +public class MultipleIndicesPermissionsTests extends ShieldIntegTestCase { protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray()))); diff --git a/shield/src/test/java/org/elasticsearch/integration/PermissionPrecedenceTests.java b/shield/src/test/java/org/elasticsearch/integration/PermissionPrecedenceTests.java index 581669bf83e..f424b8c8594 100644 --- a/shield/src/test/java/org/elasticsearch/integration/PermissionPrecedenceTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/PermissionPrecedenceTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.SecuredStringTests; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.Test; import java.util.List; @@ -31,7 +31,7 @@ import static org.hamcrest.Matchers.hasSize; * actions that are normally categorized as index actions as cluster actions - for example, * index template actions. */ -public class PermissionPrecedenceTests extends ShieldIntegrationTest { +public class PermissionPrecedenceTests extends ShieldIntegTestCase { protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("test123".toCharArray()))); diff --git a/shield/src/test/java/org/elasticsearch/integration/ScrollIdSigningTests.java b/shield/src/test/java/org/elasticsearch/integration/ScrollIdSigningTests.java index 7224802ca2e..9a449c8728f 100644 --- a/shield/src/test/java/org/elasticsearch/integration/ScrollIdSigningTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/ScrollIdSigningTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.shield.crypto.CryptoService; import org.elasticsearch.shield.crypto.InternalCryptoService; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.Test; import java.util.Locale; @@ -22,7 +22,7 @@ import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationExcepti import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.*; -public class ScrollIdSigningTests extends ShieldIntegrationTest { +public class ScrollIdSigningTests extends ShieldIntegTestCase { @Test public void testSearchAndClearScroll() throws Exception { diff --git a/shield/src/test/java/org/elasticsearch/integration/SearchGetAndSuggestPermissionsTests.java b/shield/src/test/java/org/elasticsearch/integration/SearchGetAndSuggestPermissionsTests.java index 30214ac15a2..0fcb673d6fb 100644 --- a/shield/src/test/java/org/elasticsearch/integration/SearchGetAndSuggestPermissionsTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/SearchGetAndSuggestPermissionsTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.SecuredStringTests; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.Test; import static org.elasticsearch.client.Requests.searchRequest; @@ -27,7 +27,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFa import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -public class SearchGetAndSuggestPermissionsTests extends ShieldIntegrationTest { +public class SearchGetAndSuggestPermissionsTests extends ShieldIntegTestCase { protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray()))); diff --git a/shield/src/test/java/org/elasticsearch/integration/SettingsFilterTests.java b/shield/src/test/java/org/elasticsearch/integration/SettingsFilterTests.java index 725ee5e55c4..d6bac4728f5 100644 --- a/shield/src/test/java/org/elasticsearch/integration/SettingsFilterTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/SettingsFilterTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.node.Node; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.ssl.AbstractSSLService; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; @@ -30,14 +30,14 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE; +import static org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.is; @ClusterScope(scope = SUITE) -public class SettingsFilterTests extends ShieldIntegrationTest { +public class SettingsFilterTests extends ShieldIntegTestCase { private CloseableHttpClient httpClient = HttpClients.createDefault(); diff --git a/shield/src/test/java/org/elasticsearch/integration/ShieldCachePermissionTests.java b/shield/src/test/java/org/elasticsearch/integration/ShieldCachePermissionTests.java index a16656f531a..0c00d7e7ffc 100644 --- a/shield/src/test/java/org/elasticsearch/integration/ShieldCachePermissionTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/ShieldCachePermissionTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.script.ScriptService; import org.elasticsearch.shield.authc.support.SecuredString; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.junit.Before; import org.junit.BeforeClass; @@ -24,7 +24,7 @@ import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basic import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; -public class ShieldCachePermissionTests extends ShieldIntegrationTest { +public class ShieldCachePermissionTests extends ShieldIntegTestCase { static final String READ_ONE_IDX_USER = "read_user"; diff --git a/shield/src/test/java/org/elasticsearch/integration/ShieldClearScrollTests.java b/shield/src/test/java/org/elasticsearch/integration/ShieldClearScrollTests.java index e77d5357ae0..5ff26a58751 100644 --- a/shield/src/test/java/org/elasticsearch/integration/ShieldClearScrollTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/ShieldClearScrollTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.action.search.MultiSearchResponse; import org.elasticsearch.action.search.SearchPhaseExecutionException; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -27,7 +27,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertThro import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; -public class ShieldClearScrollTests extends ShieldIntegrationTest { +public class ShieldClearScrollTests extends ShieldIntegTestCase { protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("change_me".toCharArray()))); diff --git a/shield/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTests.java b/shield/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java similarity index 97% rename from shield/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTests.java rename to shield/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java index a3e0b320dfa..1ce7c0ddc5d 100644 --- a/shield/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java @@ -17,8 +17,8 @@ import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.transport.netty.ShieldNettyTransport; -import org.elasticsearch.test.ElasticsearchIntegrationTest; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Ignore; @@ -39,9 +39,7 @@ import static org.hamcrest.Matchers.is; * This test assumes all subclass tests will be of type SUITE. It picks a random realm configuration for the tests, and * writes a group to role mapping file for each node. */ -@Ignore -@ElasticsearchIntegrationTest.Integration -abstract public class AbstractAdLdapRealmTests extends ShieldIntegrationTest { +abstract public class AbstractAdLdapRealmTestCase extends ShieldIntegTestCase { public static final String SHIELD_AUTHC_REALMS_EXTERNAL = "shield.authc.realms.external"; public static final String PASSWORD = "NickFuryHeartsES"; diff --git a/shield/src/test/java/org/elasticsearch/integration/ldap/GroupMappingTests.java b/shield/src/test/java/org/elasticsearch/integration/ldap/GroupMappingTests.java index 087945460fc..c8fe56e9a79 100644 --- a/shield/src/test/java/org/elasticsearch/integration/ldap/GroupMappingTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/ldap/GroupMappingTests.java @@ -15,7 +15,7 @@ import java.io.IOException; * The super class will provide appropriate group mappings via configGroupMappings() */ @Network -public class GroupMappingTests extends AbstractAdLdapRealmTests { +public class GroupMappingTests extends AbstractAdLdapRealmTestCase { @Test public void testAuthcAuthz() throws IOException { diff --git a/shield/src/test/java/org/elasticsearch/integration/ldap/MultiGroupMappingTests.java b/shield/src/test/java/org/elasticsearch/integration/ldap/MultiGroupMappingTests.java index 3147522aa7b..6ca3de93be2 100644 --- a/shield/src/test/java/org/elasticsearch/integration/ldap/MultiGroupMappingTests.java +++ b/shield/src/test/java/org/elasticsearch/integration/ldap/MultiGroupMappingTests.java @@ -14,7 +14,7 @@ import java.io.IOException; * This tests the mapping of multiple groups to a role */ @Network -public class MultiGroupMappingTests extends AbstractAdLdapRealmTests { +public class MultiGroupMappingTests extends AbstractAdLdapRealmTestCase { @Override protected String configRoles() { diff --git a/shield/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java b/shield/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java index be85422980a..c824a99add2 100644 --- a/shield/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.transport.ShieldServerTransportService; import org.elasticsearch.shield.transport.netty.ShieldNettyTransport; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; @@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class ShieldPluginEnabledDisabledTests extends ShieldIntegrationTest { +public class ShieldPluginEnabledDisabledTests extends ShieldIntegTestCase { private static boolean enabled; diff --git a/shield/src/test/java/org/elasticsearch/shield/ShieldPluginSettingsTests.java b/shield/src/test/java/org/elasticsearch/shield/ShieldPluginSettingsTests.java index 21d958f97e7..1fcf3ed9df6 100644 --- a/shield/src/test/java/org/elasticsearch/shield/ShieldPluginSettingsTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/ShieldPluginSettingsTests.java @@ -6,14 +6,14 @@ package org.elasticsearch.shield; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.Matchers.arrayContaining; -public class ShieldPluginSettingsTests extends ElasticsearchTestCase { +public class ShieldPluginSettingsTests extends ESTestCase { private static final String TRIBE_T1_SHIELD_ENABLED = "tribe.t1." + ShieldPlugin.ENABLED_SETTING_NAME; private static final String TRIBE_T2_SHIELD_ENABLED = "tribe.t2." + ShieldPlugin.ENABLED_SETTING_NAME; diff --git a/shield/src/test/java/org/elasticsearch/shield/ShieldPluginTests.java b/shield/src/test/java/org/elasticsearch/shield/ShieldPluginTests.java index ec516694860..bcd2626c6ff 100644 --- a/shield/src/test/java/org/elasticsearch/shield/ShieldPluginTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/ShieldPluginTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; @@ -24,7 +24,7 @@ import static org.elasticsearch.rest.RestStatus.UNAUTHORIZED; import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.*; -public class ShieldPluginTests extends ShieldIntegrationTest { +public class ShieldPluginTests extends ShieldIntegTestCase { @Override public Settings nodeSettings(int nodeOrdinal) { diff --git a/shield/src/test/java/org/elasticsearch/shield/ShieldVersionTests.java b/shield/src/test/java/org/elasticsearch/shield/ShieldVersionTests.java index 1523e7181fc..1b28ebf344d 100644 --- a/shield/src/test/java/org/elasticsearch/shield/ShieldVersionTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/ShieldVersionTests.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.shield; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.Matchers.equalTo; @@ -14,7 +14,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class ShieldVersionTests extends ElasticsearchTestCase { +public class ShieldVersionTests extends ESTestCase { @Test public void testStrings() throws Exception { diff --git a/shield/src/test/java/org/elasticsearch/shield/VersionCompatibilityTests.java b/shield/src/test/java/org/elasticsearch/shield/VersionCompatibilityTests.java index 070fe5d289a..2b2fddeb00b 100644 --- a/shield/src/test/java/org/elasticsearch/shield/VersionCompatibilityTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/VersionCompatibilityTests.java @@ -6,7 +6,7 @@ package org.elasticsearch.shield; import org.elasticsearch.Version; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.CoreMatchers.is; @@ -23,7 +23,7 @@ import static org.hamcrest.CoreMatchers.is; * In many cases we will just have to bump the version of the assert then, unless we want to break backwards compatibility, but the idea is that this class * helps keeping track of this and eventually making changes when needed. */ -public class VersionCompatibilityTests extends ElasticsearchTestCase { +public class VersionCompatibilityTests extends ESTestCase { @Test public void testCompatibility() { diff --git a/shield/src/test/java/org/elasticsearch/shield/action/ShieldActionFilterTests.java b/shield/src/test/java/org/elasticsearch/shield/action/ShieldActionFilterTests.java index 1d76cce941f..55f866c63f3 100644 --- a/shield/src/test/java/org/elasticsearch/shield/action/ShieldActionFilterTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/action/ShieldActionFilterTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.AuthenticationService; import org.elasticsearch.shield.authz.AuthorizationService; import org.elasticsearch.shield.crypto.CryptoService; import org.elasticsearch.shield.license.LicenseEventsNotifier; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Before; import org.junit.Test; @@ -29,7 +29,7 @@ import static org.mockito.Mockito.*; /** * */ -public class ShieldActionFilterTests extends ElasticsearchTestCase { +public class ShieldActionFilterTests extends ESTestCase { private AuthenticationService authcService; private AuthorizationService authzService; diff --git a/shield/src/test/java/org/elasticsearch/shield/action/ShieldActionMapperTests.java b/shield/src/test/java/org/elasticsearch/shield/action/ShieldActionMapperTests.java index 00ab477072c..bc0df3b1a33 100644 --- a/shield/src/test/java/org/elasticsearch/shield/action/ShieldActionMapperTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/action/ShieldActionMapperTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest; import org.elasticsearch.action.search.ClearScrollAction; import org.elasticsearch.action.search.ClearScrollRequest; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.KnownActionsTests; import org.junit.Test; @@ -19,7 +19,7 @@ import java.util.List; import static org.hamcrest.CoreMatchers.equalTo; -public class ShieldActionMapperTests extends ElasticsearchTestCase { +public class ShieldActionMapperTests extends ESTestCase { @Test public void testThatAllOrdinaryActionsRemainTheSame() { diff --git a/shield/src/test/java/org/elasticsearch/shield/audit/AuditTrailModuleTests.java b/shield/src/test/java/org/elasticsearch/shield/audit/AuditTrailModuleTests.java index ca786f440d5..862caf1def4 100644 --- a/shield/src/test/java/org/elasticsearch/shield/audit/AuditTrailModuleTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/audit/AuditTrailModuleTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.inject.Injector; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsModule; import org.elasticsearch.shield.audit.logfile.LoggingAuditTrail; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.Matchers.*; @@ -18,7 +18,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class AuditTrailModuleTests extends ElasticsearchTestCase { +public class AuditTrailModuleTests extends ESTestCase { @Test public void testEnabled() throws Exception { diff --git a/shield/src/test/java/org/elasticsearch/shield/audit/AuditTrailServiceTests.java b/shield/src/test/java/org/elasticsearch/shield/audit/AuditTrailServiceTests.java index 5952cd5236e..ca94ffe546d 100644 --- a/shield/src/test/java/org/elasticsearch/shield/audit/AuditTrailServiceTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/audit/AuditTrailServiceTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.shield.User; import org.elasticsearch.shield.authc.AuthenticationToken; import org.elasticsearch.shield.transport.filter.IPFilter; import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportMessage; import org.junit.Before; import org.junit.Test; @@ -26,7 +26,7 @@ import static org.mockito.Mockito.verify; /** * */ -public class AuditTrailServiceTests extends ElasticsearchTestCase { +public class AuditTrailServiceTests extends ESTestCase { private Set auditTrails; private AuditTrailService service; diff --git a/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditLevelTests.java b/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditLevelTests.java index 367342ac745..83955b5cb09 100644 --- a/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditLevelTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditLevelTests.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.shield.audit.index; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.util.EnumSet; @@ -13,7 +13,7 @@ import java.util.Locale; import static org.hamcrest.Matchers.*; -public class IndexAuditLevelTests extends ElasticsearchTestCase { +public class IndexAuditLevelTests extends ESTestCase { @Test public void testAllIndexAuditLevel() { diff --git a/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailEnabledTests.java b/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailEnabledTests.java index 90dd2d1a5e0..af2787a9989 100644 --- a/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailEnabledTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailEnabledTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResp import org.elasticsearch.action.exists.ExistsResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.shield.audit.logfile.LoggingAuditTrail; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import org.elasticsearch.test.ElasticsearchIntegrationTest.Scope; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.test.ShieldIntegTestCase; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.Test; @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.Matchers.*; @ClusterScope(scope = Scope.TEST, randomDynamicTemplates = false) -public class IndexAuditTrailEnabledTests extends ShieldIntegrationTest { +public class IndexAuditTrailEnabledTests extends ShieldIntegTestCase { IndexNameResolver.Rollover rollover = randomFrom(IndexNameResolver.Rollover.values()); diff --git a/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java b/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java index f34268ce12b..9cbb7e68cc9 100644 --- a/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java @@ -28,9 +28,9 @@ import org.elasticsearch.shield.authc.AuthenticationService; import org.elasticsearch.shield.authc.AuthenticationToken; import org.elasticsearch.shield.transport.filter.IPFilter; import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.InternalTestCluster; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.transport.TransportInfo; import org.elasticsearch.transport.TransportMessage; @@ -49,7 +49,7 @@ import java.util.Locale; import java.util.Map; import static org.elasticsearch.shield.audit.index.IndexNameResolver.Rollover.*; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE; +import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.elasticsearch.test.InternalTestCluster.clusterName; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; @@ -61,8 +61,8 @@ import static org.mockito.Mockito.*; /** * */ -@ElasticsearchIntegrationTest.ClusterScope(scope = SUITE, numDataNodes = 1) -public class IndexAuditTrailTests extends ShieldIntegrationTest { +@ESIntegTestCase.ClusterScope(scope = SUITE, numDataNodes = 1) +public class IndexAuditTrailTests extends ShieldIntegTestCase { public static final String SECOND_CLUSTER_NODE_PREFIX = "remote_" + SUITE_CLUSTER_NODE_PREFIX; diff --git a/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java b/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java index ef490606912..7817382601a 100644 --- a/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.test.InternalTestCluster; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.junit.After; import org.junit.Before; @@ -29,7 +29,7 @@ import static org.hamcrest.Matchers.is; /** * This test checks to ensure that the IndexAuditTrail starts properly when indexing to a remote cluster */ -public class RemoteIndexAuditTrailStartingTests extends ShieldIntegrationTest { +public class RemoteIndexAuditTrailStartingTests extends ShieldIntegTestCase { public static final String SECOND_CLUSTER_NODE_PREFIX = "remote_" + SUITE_CLUSTER_NODE_PREFIX; diff --git a/shield/src/test/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrailTests.java b/shield/src/test/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrailTests.java index ed5bbdc78fb..7ad4c4603f2 100644 --- a/shield/src/test/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrailTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrailTests.java @@ -20,7 +20,7 @@ import org.elasticsearch.shield.authc.AuthenticationToken; import org.elasticsearch.shield.rest.RemoteHostHeader; import org.elasticsearch.shield.transport.filter.IPFilter; import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportMessage; import org.junit.Before; import org.junit.Test; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; /** * */ -public class LoggingAuditTrailTests extends ElasticsearchTestCase { +public class LoggingAuditTrailTests extends ESTestCase { private static enum RestContent { diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserHolderTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserHolderTests.java index d568aaac65d..e17a87227d9 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserHolderTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserHolderTests.java @@ -9,14 +9,14 @@ import org.elasticsearch.common.io.stream.ByteBufferStreamInput; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.shield.User; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.nio.ByteBuffer; import static org.hamcrest.Matchers.*; -public class AnonymousUserHolderTests extends ElasticsearchTestCase { +public class AnonymousUserHolderTests extends ESTestCase { @Test public void testResolveAnonymousUser() throws Exception { diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserTests.java index 4baabfccc26..99dd036e884 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.Node; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.Test; import java.io.InputStreamReader; @@ -24,7 +24,7 @@ import java.util.Locale; import static org.hamcrest.Matchers.*; -public class AnonymousUserTests extends ShieldIntegrationTest { +public class AnonymousUserTests extends ShieldIntegTestCase { private boolean authorizationExceptionsEnabled = randomBoolean(); diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/InternalAuthenticationServiceTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/InternalAuthenticationServiceTests.java index f856d8de5c3..5c71f8ece77 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/InternalAuthenticationServiceTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/InternalAuthenticationServiceTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.shield.audit.AuditTrail; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.crypto.CryptoService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.transport.TransportMessage; import org.junit.Before; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.*; /** * */ -public class InternalAuthenticationServiceTests extends ElasticsearchTestCase { +public class InternalAuthenticationServiceTests extends ESTestCase { @Rule public ExpectedException thrown = ExpectedException.none(); diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/RealmsTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/RealmsTests.java index 450a424c87b..148f6bf2360 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/RealmsTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/RealmsTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.rest.RestRequest; import org.elasticsearch.shield.ShieldSettingsFilter; import org.elasticsearch.shield.User; import org.elasticsearch.shield.authc.esusers.ESUsersRealm; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportMessage; import org.junit.Before; import org.junit.Test; @@ -24,7 +24,7 @@ import static org.mockito.Mockito.mock; /** * */ -public class RealmsTests extends ElasticsearchTestCase { +public class RealmsTests extends ESTestCase { private Map factories; private ShieldSettingsFilter settingsFilter; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectoryGroupsResolverTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectoryGroupsResolverTests.java index 8ca91f1b9e6..4a0c53ec63b 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectoryGroupsResolverTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectoryGroupsResolverTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope; import org.elasticsearch.shield.authc.ldap.support.SessionFactory; import org.elasticsearch.shield.ssl.ClientSSLService; import org.elasticsearch.shield.support.NoOpLogger; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.junit.annotations.Network; import org.junit.After; import org.junit.Before; @@ -30,7 +30,7 @@ import java.util.regex.Pattern; import static org.hamcrest.Matchers.*; @Network -public class ActiveDirectoryGroupsResolverTests extends ElasticsearchTestCase { +public class ActiveDirectoryGroupsResolverTests extends ESTestCase { public static final String BRUCE_BANNER_DN = "cn=Bruce Banner,CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com"; private LDAPConnection ldapConnection; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectoryRealmTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectoryRealmTests.java index 26958c0ac2f..2bc8c16ef64 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectoryRealmTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectoryRealmTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.shield.User; import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.support.*; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; import org.junit.After; @@ -40,7 +40,7 @@ import static org.mockito.Mockito.*; * The username used to authenticate then has to be in the form of CN=user. Finally the username needs to be added as an * additional bind DN with a password in the test setup since it really is not a DN in the ldif file */ -public class ActiveDirectoryRealmTests extends ElasticsearchTestCase { +public class ActiveDirectoryRealmTests extends ESTestCase { private static final String PASSWORD = "password"; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectorySessionFactoryTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectorySessionFactoryTests.java index 526fb5b4171..86c8f935058 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectorySessionFactoryTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/activedirectory/ActiveDirectorySessionFactoryTests.java @@ -12,11 +12,11 @@ import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.ldap.LdapSessionFactory; import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope; import org.elasticsearch.shield.authc.ldap.support.LdapSession; -import org.elasticsearch.shield.authc.ldap.support.LdapTest; +import org.elasticsearch.shield.authc.ldap.support.LdapTestCase; import org.elasticsearch.shield.authc.ldap.support.SessionFactory; import org.elasticsearch.shield.authc.support.SecuredStringTests; import org.elasticsearch.shield.ssl.ClientSSLService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.junit.annotations.Network; import org.junit.Before; import org.junit.Test; @@ -29,7 +29,7 @@ import static org.elasticsearch.test.ShieldTestsUtils.assertAuthenticationExcept import static org.hamcrest.Matchers.*; @Network -public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase { +public class ActiveDirectorySessionFactoryTests extends ESTestCase { public static final String AD_LDAP_URL = "ldaps://54.213.145.20:636"; public static final String PASSWORD = "NickFuryHeartsES"; @@ -231,7 +231,7 @@ public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase { public void testStandardLdapConnection() throws Exception { String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com"; String userTemplate = "CN={0},CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com"; - Settings settings = LdapTest.buildLdapSettings(AD_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.SUB_TREE); + Settings settings = LdapTestCase.buildLdapSettings(AD_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.SUB_TREE); RealmConfig config = new RealmConfig("ad-as-ldap-test", settings, globalSettings); LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService); @@ -250,7 +250,7 @@ public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase { @Test @SuppressWarnings("unchecked") public void testStandardLdapWithAttributeGroups() throws Exception { String userTemplate = "CN={0},CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com"; - Settings settings = LdapTest.buildLdapSettings(AD_LDAP_URL, userTemplate, false); + Settings settings = LdapTestCase.buildLdapSettings(AD_LDAP_URL, userTemplate, false); RealmConfig config = new RealmConfig("ad-as-ldap-test", settings, globalSettings); LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService); @@ -283,7 +283,7 @@ public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase { String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com"; String userTemplate = "CN={0},CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com"; Settings settings = Settings.builder() - .put(LdapTest.buildLdapSettings(AD_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.SUB_TREE)) + .put(LdapTestCase.buildLdapSettings(AD_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.SUB_TREE)) .put(LdapSessionFactory.HOSTNAME_VERIFICATION_SETTING, true) .build(); RealmConfig config = new RealmConfig("ad-test", settings, globalSettings); diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/esusers/ESUsersRealmTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/esusers/ESUsersRealmTests.java index 930295fbffb..2168d8f1fe5 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/esusers/ESUsersRealmTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/esusers/ESUsersRealmTests.java @@ -26,7 +26,7 @@ import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredStringTests; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.watcher.ResourceWatcherService; import org.hamcrest.Matchers; @@ -41,7 +41,7 @@ import static org.mockito.Mockito.*; /** * */ -public class ESUsersRealmTests extends ElasticsearchTestCase { +public class ESUsersRealmTests extends ESTestCase { private RestController restController; private Client client; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStoreTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStoreTests.java index b42e9241d1f..eb78e34cedf 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStoreTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/esusers/FileUserPasswdStoreTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.RefreshListener; import org.elasticsearch.shield.authc.support.SecuredStringTests; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; import org.junit.After; @@ -41,7 +41,7 @@ import static org.mockito.Mockito.*; /** * */ -public class FileUserPasswdStoreTests extends ElasticsearchTestCase { +public class FileUserPasswdStoreTests extends ESTestCase { private Settings settings; private Environment env; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStoreTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStoreTests.java index d3333107e51..8803f6664f0 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStoreTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/esusers/FileUserRolesStoreTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.shield.audit.logfile.CapturingLogger; import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.support.RefreshListener; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; import org.junit.After; @@ -41,7 +41,7 @@ import static org.mockito.Mockito.*; /** * */ -public class FileUserRolesStoreTests extends ElasticsearchTestCase { +public class FileUserRolesStoreTests extends ESTestCase { private Settings settings; private Environment env; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapRealmTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapRealmTests.java index d7663a9d975..c66559dd558 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapRealmTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapRealmTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.rest.RestController; import org.elasticsearch.shield.User; import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope; -import org.elasticsearch.shield.authc.ldap.support.LdapTest; +import org.elasticsearch.shield.authc.ldap.support.LdapTestCase; import org.elasticsearch.shield.authc.ldap.support.SessionFactory; import org.elasticsearch.shield.authc.support.DnRoleMapper; import org.elasticsearch.shield.authc.support.SecuredString; @@ -30,7 +30,7 @@ import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.*; -public class LdapRealmTests extends LdapTest { +public class LdapRealmTests extends LdapTestCase { public static final String VALID_USER_TEMPLATE = "cn={0},ou=people,o=sevenSeas"; public static final String VALID_USERNAME = "Thomas Masterman Hardy"; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapSessionFactoryTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapSessionFactoryTests.java index 23b65f8ad2f..2b2d27ec9b6 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapSessionFactoryTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapSessionFactoryTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope; import org.elasticsearch.shield.authc.ldap.support.LdapSession; -import org.elasticsearch.shield.authc.ldap.support.LdapTest; +import org.elasticsearch.shield.authc.ldap.support.LdapTestCase; import org.elasticsearch.shield.authc.ldap.support.SessionFactory; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.SecuredStringTests; @@ -23,7 +23,7 @@ import java.util.List; import static org.hamcrest.Matchers.*; -public class LdapSessionFactoryTests extends LdapTest { +public class LdapSessionFactoryTests extends LdapTestCase { private Settings globalSettings; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapUserSearchSessionFactoryTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapUserSearchSessionFactoryTests.java index 18685b95bc6..be3e0ee613b 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapUserSearchSessionFactoryTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/LdapUserSearchSessionFactoryTests.java @@ -21,7 +21,7 @@ import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.activedirectory.ActiveDirectorySessionFactoryTests; import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope; import org.elasticsearch.shield.authc.ldap.support.LdapSession; -import org.elasticsearch.shield.authc.ldap.support.LdapTest; +import org.elasticsearch.shield.authc.ldap.support.LdapTestCase; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.SecuredStringTests; import org.elasticsearch.shield.ssl.ClientSSLService; @@ -45,7 +45,7 @@ import static org.hamcrest.Matchers.*; @ThreadLeakFilters(filters = { LdapUserSearchSessionFactoryTests.BackgroundConnectThreadLeakFilter.class }) -public class LdapUserSearchSessionFactoryTests extends LdapTest { +public class LdapUserSearchSessionFactoryTests extends LdapTestCase { private ClientSSLService clientSSLService; private Settings globalSettings; @@ -260,7 +260,7 @@ public class LdapUserSearchSessionFactoryTests extends LdapTest { String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com"; String userSearchBase = "CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com"; Settings settings = settingsBuilder() - .put(LdapTest.buildLdapSettings(ActiveDirectorySessionFactoryTests.AD_LDAP_URL, Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.SUB_TREE)) + .put(LdapTestCase.buildLdapSettings(ActiveDirectorySessionFactoryTests.AD_LDAP_URL, Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.SUB_TREE)) .put("user_search.base_dn", userSearchBase) .put("bind_dn", "ironman@ad.test.elasticsearch.com") .put("bind_password", ActiveDirectorySessionFactoryTests.PASSWORD) @@ -288,7 +288,7 @@ public class LdapUserSearchSessionFactoryTests extends LdapTest { String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; String userSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; RealmConfig config = new RealmConfig("oldap-test", settingsBuilder() - .put(LdapTest.buildLdapSettings(OpenLdapTests.OPEN_LDAP_URL, Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.ONE_LEVEL)) + .put(LdapTestCase.buildLdapSettings(OpenLdapTests.OPEN_LDAP_URL, Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.ONE_LEVEL)) .put("user_search.base_dn", userSearchBase) .put("bind_dn", "uid=blackwidow,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com") .put("bind_password", OpenLdapTests.PASSWORD) @@ -396,7 +396,7 @@ public class LdapUserSearchSessionFactoryTests extends LdapTest { String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com"; String userSearchBase = "CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com"; Settings ldapSettings = settingsBuilder() - .put(LdapTest.buildLdapSettings("ldaps://elastic.co:636", Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.SUB_TREE)) + .put(LdapTestCase.buildLdapSettings("ldaps://elastic.co:636", Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.SUB_TREE)) .put("user_search.base_dn", userSearchBase) .put("bind_dn", "ironman@ad.test.elasticsearch.com") .put("bind_password", ActiveDirectorySessionFactoryTests.PASSWORD) diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/OpenLdapTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/OpenLdapTests.java index 499b93996f1..2e4d000ceb0 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/OpenLdapTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/OpenLdapTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope; import org.elasticsearch.shield.authc.ldap.support.LdapSession; -import org.elasticsearch.shield.authc.ldap.support.LdapTest; +import org.elasticsearch.shield.authc.ldap.support.LdapTestCase; import org.elasticsearch.shield.authc.ldap.support.SessionFactory; import org.elasticsearch.shield.authc.support.SecuredStringTests; import org.elasticsearch.shield.ssl.ClientSSLService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.junit.annotations.Network; import org.junit.Before; import org.junit.Test; @@ -27,7 +27,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasItem; @Network -public class OpenLdapTests extends ElasticsearchTestCase { +public class OpenLdapTests extends ESTestCase { public static final String OPEN_LDAP_URL = "ldaps://54.200.235.244:636"; public static final String PASSWORD = "NickFuryHeartsES"; @@ -57,7 +57,7 @@ public class OpenLdapTests extends ElasticsearchTestCase { //openldap does not use cn as naming attributes by default String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; - RealmConfig config = new RealmConfig("oldap-test", LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL), globalSettings); + RealmConfig config = new RealmConfig("oldap-test", LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL), globalSettings); LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService); String[] users = new String[] { "blackwidow", "cap", "hawkeye", "hulk", "ironman", "thor" }; @@ -74,7 +74,7 @@ public class OpenLdapTests extends ElasticsearchTestCase { String groupSearchBase = "cn=Avengers,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; - RealmConfig config = new RealmConfig("oldap-test", LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.BASE), globalSettings); + RealmConfig config = new RealmConfig("oldap-test", LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.BASE), globalSettings); LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService); String[] users = new String[] { "blackwidow", "cap", "hawkeye", "hulk", "ironman", "thor" }; @@ -90,7 +90,7 @@ public class OpenLdapTests extends ElasticsearchTestCase { String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; Settings settings = Settings.builder() - .put(LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL)) + .put(LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL)) .put("group_search.filter", "(&(objectclass=posixGroup)(memberUID={0}))") .put("group_search.user_attribute", "uid") .build(); @@ -108,7 +108,7 @@ public class OpenLdapTests extends ElasticsearchTestCase { String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; Settings settings = Settings.builder() - .put(LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL)) + .put(LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL)) .put(SessionFactory.HOSTNAME_VERIFICATION_SETTING, false) .put(SessionFactory.TIMEOUT_TCP_READ_SETTING, "1ms") //1 millisecond .build(); @@ -130,7 +130,7 @@ public class OpenLdapTests extends ElasticsearchTestCase { String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; Settings settings = Settings.builder() - .put(LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL)) + .put(LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL)) .put(LdapSessionFactory.HOSTNAME_VERIFICATION_SETTING, true) .build(); diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/SearchGroupsResolverTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/SearchGroupsResolverTests.java index 6b217ea4970..8193e70e9fa 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/SearchGroupsResolverTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/SearchGroupsResolverTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope; import org.elasticsearch.shield.authc.ldap.support.SessionFactory; import org.elasticsearch.shield.ssl.ClientSSLService; import org.elasticsearch.shield.support.NoOpLogger; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.junit.annotations.Network; import org.junit.After; import org.junit.Before; @@ -29,7 +29,7 @@ import java.util.List; import static org.hamcrest.Matchers.*; @Network -public class SearchGroupsResolverTests extends ElasticsearchTestCase { +public class SearchGroupsResolverTests extends ESTestCase { public static final String BRUCE_BANNER_DN = "uid=hulk,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/UserAttributeGroupsResolverTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/UserAttributeGroupsResolverTests.java index 0c258df5cb4..93412aaad1e 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/UserAttributeGroupsResolverTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/UserAttributeGroupsResolverTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.shield.authc.activedirectory.ActiveDirectorySessionFact import org.elasticsearch.shield.authc.ldap.support.SessionFactory; import org.elasticsearch.shield.ssl.ClientSSLService; import org.elasticsearch.shield.support.NoOpLogger; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.junit.annotations.Network; import org.junit.After; import org.junit.Before; @@ -28,7 +28,7 @@ import java.util.List; import static org.hamcrest.Matchers.*; @Network -public class UserAttributeGroupsResolverTests extends ElasticsearchTestCase { +public class UserAttributeGroupsResolverTests extends ESTestCase { public static final String BRUCE_BANNER_DN = "cn=Bruce Banner,CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com"; private LDAPConnection ldapConnection; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LDAPServersTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LDAPServersTests.java index 6556a6ae48e..0d343ee9344 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LDAPServersTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LDAPServersTests.java @@ -5,13 +5,13 @@ */ package org.elasticsearch.shield.authc.ldap.support; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -public class LDAPServersTests extends ElasticsearchTestCase { +public class LDAPServersTests extends ESTestCase { @Test public void testConfigure_1ldaps() { diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LdapTest.java b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LdapTestCase.java similarity index 91% rename from shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LdapTest.java rename to shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LdapTestCase.java index e9f53e8d8b1..8944cd98f18 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LdapTest.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/LdapTestCase.java @@ -13,16 +13,16 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.ldap.LdapRealm; import org.elasticsearch.shield.authc.support.DnRoleMapper; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.ResourceWatcherService; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; -import static org.elasticsearch.shield.authc.ldap.LdapSessionFactory.*; +import static org.elasticsearch.shield.authc.ldap.LdapSessionFactory.HOSTNAME_VERIFICATION_SETTING; +import static org.elasticsearch.shield.authc.ldap.LdapSessionFactory.URLS_SETTING; +import static org.elasticsearch.shield.authc.ldap.LdapSessionFactory.USER_DN_TEMPLATES_SETTING; -@Ignore -public abstract class LdapTest extends ElasticsearchTestCase { +public abstract class LdapTestCase extends ESTestCase { protected InMemoryDirectoryServer ldapServer; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/SessionFactoryTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/SessionFactoryTests.java index 6c5fe6c9c00..a0f4f92245f 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/SessionFactoryTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/ldap/support/SessionFactoryTests.java @@ -11,13 +11,13 @@ import com.unboundid.util.ssl.TrustAllSSLSocketVerifier; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.support.SecuredString; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.*; -public class SessionFactoryTests extends ElasticsearchTestCase { +public class SessionFactoryTests extends ESTestCase { @Test public void connectionFactoryReturnsCorrectLDAPConnectionOptionsWithDefaultSettings() { diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiAuthenticationTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiAuthenticationTests.java index 760314fcb2e..98721918035 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiAuthenticationTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiAuthenticationTests.java @@ -20,8 +20,8 @@ import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.Node; import org.elasticsearch.shield.transport.SSLClientAuth; import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.transport.Transport; import org.junit.Test; @@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.*; * Test authentication via PKI on both REST and Transport layers */ @ClusterScope(numClientNodes = 0, numDataNodes = 1) -public class PkiAuthenticationTests extends ShieldIntegrationTest { +public class PkiAuthenticationTests extends ShieldIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiOptionalClientAuthTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiOptionalClientAuthTests.java index 704110d31ec..7a0fca9faac 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiOptionalClientAuthTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiOptionalClientAuthTests.java @@ -11,14 +11,13 @@ import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.http.HttpServerTransport; -import org.elasticsearch.license.plugin.LicensePlugin; import org.elasticsearch.node.Node; import org.elasticsearch.shield.ShieldPlugin; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.transport.SSLClientAuth; import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; @@ -38,7 +37,7 @@ import static org.elasticsearch.test.ShieldSettingsSource.DEFAULT_PASSWORD; import static org.elasticsearch.test.ShieldSettingsSource.DEFAULT_USER_NAME; import static org.hamcrest.Matchers.is; -public class PkiOptionalClientAuthTests extends ShieldIntegrationTest { +public class PkiOptionalClientAuthTests extends ShieldIntegTestCase { private static int randomClientPort; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiRealmTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiRealmTests.java index bba7b55f545..cb742840a86 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiRealmTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiRealmTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.shield.authc.support.DnRoleMapper; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.support.NoOpLogger; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.transport.TransportMessage; import org.junit.Before; @@ -31,7 +31,7 @@ import java.util.regex.Pattern; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.*; -public class PkiRealmTests extends ElasticsearchTestCase { +public class PkiRealmTests extends ESTestCase { private Settings globalSettings; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutClientAuthenticationTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutClientAuthenticationTests.java index 60b27e620ca..8af5d3ec13f 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutClientAuthenticationTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutClientAuthenticationTests.java @@ -18,8 +18,8 @@ import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.transport.SSLClientAuth; import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport; import org.elasticsearch.shield.transport.netty.ShieldNettyTransport; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; @@ -35,7 +35,7 @@ import java.util.Locale; import static org.hamcrest.Matchers.is; @ClusterScope(numClientNodes = 0, numDataNodes = 1) -public class PkiWithoutClientAuthenticationTests extends ShieldIntegrationTest { +public class PkiWithoutClientAuthenticationTests extends ShieldIntegTestCase { private TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutSSLTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutSSLTests.java index 650e15677b6..21e6e6833c9 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutSSLTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutSSLTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.Node; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; @@ -23,7 +23,7 @@ import org.junit.Test; import static org.hamcrest.Matchers.is; @ClusterScope(numClientNodes = 0, numDataNodes = 1) -public class PkiWithoutSSLTests extends ShieldIntegrationTest { +public class PkiWithoutSSLTests extends ShieldIntegTestCase { @Override public boolean sslTransportEnabled() { diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/support/CachingUsernamePasswordRealmTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/support/CachingUsernamePasswordRealmTests.java index 5755b5a8775..0e3979707af 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/support/CachingUsernamePasswordRealmTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/support/CachingUsernamePasswordRealmTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.shield.User; import org.elasticsearch.shield.authc.Realm; import org.elasticsearch.shield.authc.RealmConfig; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Before; import org.junit.Test; @@ -18,7 +18,7 @@ import java.util.concurrent.atomic.AtomicInteger; import static org.hamcrest.Matchers.*; -public class CachingUsernamePasswordRealmTests extends ElasticsearchTestCase { +public class CachingUsernamePasswordRealmTests extends ESTestCase { private Settings globalSettings; diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/support/DnRoleMapperTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/support/DnRoleMapperTests.java index 76e4caaf8a6..e9809a88258 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/support/DnRoleMapperTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/support/DnRoleMapperTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.shield.audit.logfile.CapturingLogger; import org.elasticsearch.shield.authc.RealmConfig; import org.elasticsearch.shield.authc.activedirectory.ActiveDirectoryRealm; import org.elasticsearch.shield.authc.ldap.LdapRealm; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; import org.junit.After; @@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class DnRoleMapperTests extends ElasticsearchTestCase { +public class DnRoleMapperTests extends ESTestCase { private static final String[] STARK_GROUP_DNS = new String[] { //groups can be named by different attributes, depending on the directory, diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/support/HasherTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/support/HasherTests.java index 2abd960848d..7c494a2317a 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/support/HasherTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/support/HasherTests.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.shield.authc.support; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.Matchers.sameInstance; @@ -13,7 +13,7 @@ import static org.hamcrest.Matchers.sameInstance; /** * */ -public class HasherTests extends ElasticsearchTestCase { +public class HasherTests extends ESTestCase { @Test public void testBcryptFamily_SelfGenerated() throws Exception { diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/support/SecuredStringTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/support/SecuredStringTests.java index 00939748cc0..bb2a5436c69 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/support/SecuredStringTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/support/SecuredStringTests.java @@ -5,14 +5,14 @@ */ package org.elasticsearch.shield.authc.support; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.nio.charset.StandardCharsets; import static org.hamcrest.Matchers.*; -public class SecuredStringTests extends ElasticsearchTestCase { +public class SecuredStringTests extends ESTestCase { public static SecuredString build(String password){ return new SecuredString(password.toCharArray()); } diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/support/UsernamePasswordTokenTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/support/UsernamePasswordTokenTests.java index 9fa2436173c..fb39e36b7b0 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/support/UsernamePasswordTokenTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/support/UsernamePasswordTokenTests.java @@ -9,7 +9,7 @@ import com.google.common.base.Charsets; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.common.Base64; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.junit.Rule; import org.junit.Test; @@ -23,7 +23,7 @@ import static org.mockito.Mockito.when; /** * */ -public class UsernamePasswordTokenTests extends ElasticsearchTestCase { +public class UsernamePasswordTokenTests extends ESTestCase { @Rule public ExpectedException thrown = ExpectedException.none(); diff --git a/shield/src/test/java/org/elasticsearch/shield/authz/AnalyzeTests.java b/shield/src/test/java/org/elasticsearch/shield/authz/AnalyzeTests.java index b516b08cce2..2b6f2f27c14 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authz/AnalyzeTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authz/AnalyzeTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.shield.authz; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.Test; import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.BASIC_AUTH_HEADER; @@ -16,7 +16,7 @@ import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basic import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationException; import static org.hamcrest.CoreMatchers.containsString; -public class AnalyzeTests extends ShieldIntegrationTest { +public class AnalyzeTests extends ShieldIntegTestCase { protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("test123".toCharArray()))); diff --git a/shield/src/test/java/org/elasticsearch/shield/authz/IndexAliasesTests.java b/shield/src/test/java/org/elasticsearch/shield/authz/IndexAliasesTests.java index 502db4816c9..79e7f5de9f5 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authz/IndexAliasesTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authz/IndexAliasesTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.Before; import org.junit.Test; @@ -23,7 +23,7 @@ import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationExcepti import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.CoreMatchers.*; -public class IndexAliasesTests extends ShieldIntegrationTest { +public class IndexAliasesTests extends ShieldIntegTestCase { protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("test123".toCharArray()))); diff --git a/shield/src/test/java/org/elasticsearch/shield/authz/InternalAuthorizationServiceTests.java b/shield/src/test/java/org/elasticsearch/shield/authz/InternalAuthorizationServiceTests.java index d2a57e1be3f..bee8b4a7032 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authz/InternalAuthorizationServiceTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authz/InternalAuthorizationServiceTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.shield.User; import org.elasticsearch.shield.audit.AuditTrail; import org.elasticsearch.shield.authc.AnonymousService; import org.elasticsearch.shield.authz.store.RolesStore; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.junit.Before; import org.junit.Test; @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.*; -public class InternalAuthorizationServiceTests extends ElasticsearchTestCase { +public class InternalAuthorizationServiceTests extends ESTestCase { private AuditTrail auditTrail; private RolesStore rolesStore; diff --git a/shield/src/test/java/org/elasticsearch/shield/authz/PermissionTests.java b/shield/src/test/java/org/elasticsearch/shield/authz/PermissionTests.java index 9cf74fce265..749ea868587 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authz/PermissionTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authz/PermissionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.shield.authz; import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; import org.elasticsearch.action.get.GetAction; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Before; import org.junit.Test; @@ -20,7 +20,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class PermissionTests extends ElasticsearchTestCase { +public class PermissionTests extends ESTestCase { private Permission.Global.Role permission; diff --git a/shield/src/test/java/org/elasticsearch/shield/authz/PrivilegeTests.java b/shield/src/test/java/org/elasticsearch/shield/authz/PrivilegeTests.java index 204b39acb55..1a103ae1bdf 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authz/PrivilegeTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authz/PrivilegeTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.search.SearchAction; import org.elasticsearch.action.suggest.SuggestAction; import org.elasticsearch.shield.support.AutomatonPredicate; import org.elasticsearch.shield.support.Automatons; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -23,7 +23,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class PrivilegeTests extends ElasticsearchTestCase { +public class PrivilegeTests extends ESTestCase { @Rule public ExpectedException thrown = ExpectedException.none(); diff --git a/shield/src/test/java/org/elasticsearch/shield/authz/SystemRoleTests.java b/shield/src/test/java/org/elasticsearch/shield/authz/SystemRoleTests.java index a49df2dd94c..b48f02fe5f9 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authz/SystemRoleTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authz/SystemRoleTests.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.shield.authz; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.Matchers.is; @@ -13,7 +13,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class SystemRoleTests extends ElasticsearchTestCase { +public class SystemRoleTests extends ESTestCase { @Test public void testCheck() throws Exception { diff --git a/shield/src/test/java/org/elasticsearch/shield/authz/indicesresolver/DefaultIndicesResolverTests.java b/shield/src/test/java/org/elasticsearch/shield/authz/indicesresolver/DefaultIndicesResolverTests.java index 857b7667733..5fd2687bb82 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authz/indicesresolver/DefaultIndicesResolverTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authz/indicesresolver/DefaultIndicesResolverTests.java @@ -29,7 +29,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.shield.User; import org.elasticsearch.shield.authz.AuthorizationService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Before; import org.junit.Test; @@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class DefaultIndicesResolverTests extends ElasticsearchTestCase { +public class DefaultIndicesResolverTests extends ESTestCase { private User user; private User userNoIndices; diff --git a/shield/src/test/java/org/elasticsearch/shield/authz/indicesresolver/IndicesResolverIntegrationTests.java b/shield/src/test/java/org/elasticsearch/shield/authz/indicesresolver/IndicesResolverIntegrationTests.java index 27a64fcf5e9..ec1a0eb7b7b 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authz/indicesresolver/IndicesResolverIntegrationTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authz/indicesresolver/IndicesResolverIntegrationTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.Requests; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.search.SearchHit; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.junit.Test; @@ -24,7 +24,7 @@ import java.util.List; import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationException; import static org.hamcrest.CoreMatchers.*; -public class IndicesResolverIntegrationTests extends ShieldIntegrationTest { +public class IndicesResolverIntegrationTests extends ShieldIntegTestCase { @Override protected String configRoles() { diff --git a/shield/src/test/java/org/elasticsearch/shield/authz/store/FileRolesStoreTests.java b/shield/src/test/java/org/elasticsearch/shield/authz/store/FileRolesStoreTests.java index 743b56654dd..71e56f3d0f1 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authz/store/FileRolesStoreTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authz/store/FileRolesStoreTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.shield.audit.logfile.CapturingLogger; import org.elasticsearch.shield.authc.support.RefreshListener; import org.elasticsearch.shield.authz.Permission; import org.elasticsearch.shield.authz.Privilege; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; import org.junit.Test; @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class FileRolesStoreTests extends ElasticsearchTestCase { +public class FileRolesStoreTests extends ESTestCase { @Test public void testParseFile() throws Exception { diff --git a/shield/src/test/java/org/elasticsearch/shield/crypto/InternalCryptoServiceTests.java b/shield/src/test/java/org/elasticsearch/shield/crypto/InternalCryptoServiceTests.java index d02542f37fe..054db859ff9 100644 --- a/shield/src/test/java/org/elasticsearch/shield/crypto/InternalCryptoServiceTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/crypto/InternalCryptoServiceTests.java @@ -9,7 +9,7 @@ import com.google.common.base.Charsets; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; import org.junit.After; @@ -31,7 +31,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class InternalCryptoServiceTests extends ElasticsearchTestCase { +public class InternalCryptoServiceTests extends ESTestCase { private ResourceWatcherService watcherService; private Settings settings; diff --git a/shield/src/test/java/org/elasticsearch/shield/rest/ShieldRestFilterTests.java b/shield/src/test/java/org/elasticsearch/shield/rest/ShieldRestFilterTests.java index d2551ab7f7d..85443fed301 100644 --- a/shield/src/test/java/org/elasticsearch/shield/rest/ShieldRestFilterTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/rest/ShieldRestFilterTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.rest.RestFilterChain; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.shield.User; import org.elasticsearch.shield.authc.AuthenticationService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Before; import org.junit.Test; @@ -24,7 +24,7 @@ import static org.mockito.Mockito.*; /** * */ -public class ShieldRestFilterTests extends ElasticsearchTestCase { +public class ShieldRestFilterTests extends ESTestCase { private AuthenticationService authcService; private RestChannel channel; diff --git a/shield/src/test/java/org/elasticsearch/shield/ssl/ClientSSLServiceTests.java b/shield/src/test/java/org/elasticsearch/shield/ssl/ClientSSLServiceTests.java index e7c81cbf2c8..dfa802586e7 100644 --- a/shield/src/test/java/org/elasticsearch/shield/ssl/ClientSSLServiceTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/ssl/ClientSSLServiceTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.env.Environment; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.junit.annotations.Network; import org.junit.Before; import org.junit.Test; @@ -26,7 +26,7 @@ import java.util.List; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.*; -public class ClientSSLServiceTests extends ElasticsearchTestCase { +public class ClientSSLServiceTests extends ESTestCase { Environment env; Path testclientStore; diff --git a/shield/src/test/java/org/elasticsearch/shield/ssl/SSLSettingsTests.java b/shield/src/test/java/org/elasticsearch/shield/ssl/SSLSettingsTests.java index b8165b3c1b2..5f1d0bcc433 100644 --- a/shield/src/test/java/org/elasticsearch/shield/ssl/SSLSettingsTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/ssl/SSLSettingsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.shield.ssl; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.shield.ssl.AbstractSSLService.SSLSettings; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import javax.net.ssl.KeyManagerFactory; @@ -17,7 +17,7 @@ import javax.net.ssl.TrustManagerFactory; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.*; -public class SSLSettingsTests extends ElasticsearchTestCase { +public class SSLSettingsTests extends ESTestCase { @Test public void testThatSSLSettingsWithEmptySettingsHaveCorrectDefaults() { diff --git a/shield/src/test/java/org/elasticsearch/shield/ssl/ServerSSLServiceTests.java b/shield/src/test/java/org/elasticsearch/shield/ssl/ServerSSLServiceTests.java index bb45f82f46b..c98edbc417f 100644 --- a/shield/src/test/java/org/elasticsearch/shield/ssl/ServerSSLServiceTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/ssl/ServerSSLServiceTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.env.Environment; import org.elasticsearch.shield.ShieldSettingsFilter; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Before; import org.junit.Test; @@ -24,7 +24,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.mock; -public class ServerSSLServiceTests extends ElasticsearchTestCase { +public class ServerSSLServiceTests extends ESTestCase { Path testnodeStore; ShieldSettingsFilter settingsFilter; diff --git a/shield/src/test/java/org/elasticsearch/shield/support/AutomatonsTests.java b/shield/src/test/java/org/elasticsearch/shield/support/AutomatonsTests.java index 422bcec4ff3..f8d284728bf 100644 --- a/shield/src/test/java/org/elasticsearch/shield/support/AutomatonsTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/support/AutomatonsTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.shield.support; import dk.brics.automaton.Automaton; import dk.brics.automaton.RunAutomaton; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.elasticsearch.shield.support.Automatons.*; @@ -16,7 +16,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class AutomatonsTests extends ElasticsearchTestCase { +public class AutomatonsTests extends ESTestCase { @Test public void testPatterns_UnionOfMultiplePatterns() throws Exception { diff --git a/shield/src/test/java/org/elasticsearch/shield/support/ShieldFilesTests.java b/shield/src/test/java/org/elasticsearch/shield/support/ShieldFilesTests.java index 21bf3e39f96..ae1e9f74f6d 100644 --- a/shield/src/test/java/org/elasticsearch/shield/support/ShieldFilesTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/support/ShieldFilesTests.java @@ -9,7 +9,7 @@ import com.google.common.base.Charsets; import com.google.common.collect.Sets; import com.google.common.jimfs.Configuration; import com.google.common.jimfs.Jimfs; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.io.PrintWriter; @@ -25,7 +25,7 @@ import static java.nio.file.attribute.PosixFilePermission.*; import static org.elasticsearch.shield.support.ShieldFiles.openAtomicMoveWriter; import static org.hamcrest.Matchers.*; -public class ShieldFilesTests extends ElasticsearchTestCase { +public class ShieldFilesTests extends ESTestCase { @Test public void testThatOriginalPermissionsAreKept() throws Exception { diff --git a/shield/src/test/java/org/elasticsearch/shield/support/ValidationTests.java b/shield/src/test/java/org/elasticsearch/shield/support/ValidationTests.java index 7fc073cfd67..0a0465b8484 100644 --- a/shield/src/test/java/org/elasticsearch/shield/support/ValidationTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/support/ValidationTests.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.shield.support; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.util.Arrays; @@ -18,7 +18,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class ValidationTests extends ElasticsearchTestCase { +public class ValidationTests extends ESTestCase { private static final char[] alphabet = { diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/ClientTransportFilterTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/ClientTransportFilterTests.java index e297cbf5102..4167a065932 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/ClientTransportFilterTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/ClientTransportFilterTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.shield.transport; import org.elasticsearch.shield.User; import org.elasticsearch.shield.authc.AuthenticationService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.junit.Before; import org.junit.Test; @@ -18,7 +18,7 @@ import static org.mockito.Mockito.verify; /** * */ -public class ClientTransportFilterTests extends ElasticsearchTestCase { +public class ClientTransportFilterTests extends ESTestCase { private AuthenticationService authcService; private ClientTransportFilter filter; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterIntegrationTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterIntegrationTests.java index d81a65f3498..b645f9569aa 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterIntegrationTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterIntegrationTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.node.Node; import org.elasticsearch.shield.ShieldPlugin; import org.elasticsearch.shield.authc.esusers.ESUsersRealm; import org.elasticsearch.shield.crypto.InternalCryptoService; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.transport.Transport; import org.junit.BeforeClass; @@ -34,7 +34,7 @@ import static org.elasticsearch.shield.test.ShieldTestUtils.writeFile; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -public class ServerTransportFilterIntegrationTests extends ShieldIntegrationTest { +public class ServerTransportFilterIntegrationTests extends ShieldIntegTestCase { private static int randomClientPort; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterTests.java index 72f9f8fe017..2e79d743e11 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.shield.User; import org.elasticsearch.shield.action.ShieldActionMapper; import org.elasticsearch.shield.authc.AuthenticationService; import org.elasticsearch.shield.authz.AuthorizationService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.transport.netty.NettyTransport; import org.elasticsearch.transport.netty.NettyTransportChannel; @@ -25,7 +25,7 @@ import static org.mockito.Mockito.*; /** * */ -public class ServerTransportFilterTests extends ElasticsearchTestCase { +public class ServerTransportFilterTests extends ESTestCase { private AuthenticationService authcService; private AuthorizationService authzService; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/TransportFilterTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/TransportFilterTests.java index 1147033c9d0..59fd096b788 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/TransportFilterTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/TransportFilterTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.plugins.AbstractPlugin; import org.elasticsearch.shield.action.ShieldActionMapper; import org.elasticsearch.shield.authc.AuthenticationService; import org.elasticsearch.shield.authz.AuthorizationService; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.*; import org.elasticsearch.transport.netty.NettyTransport; @@ -33,8 +33,8 @@ import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE; +import static org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.hamcrest.Matchers.equalTo; import static org.mockito.Matchers.isA; import static org.mockito.Mockito.*; @@ -43,7 +43,7 @@ import static org.mockito.Mockito.*; * */ @ClusterScope(scope = SUITE, numDataNodes = 0) -public class TransportFilterTests extends ElasticsearchIntegrationTest { +public class TransportFilterTests extends ESIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/filter/IPFilterTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/filter/IPFilterTests.java index c23b4da3793..e24437b2096 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/filter/IPFilterTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/filter/IPFilterTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.settings.NodeSettingsService; import org.elasticsearch.shield.audit.AuditTrail; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.junit.annotations.Network; import org.elasticsearch.transport.Transport; import org.junit.Before; @@ -31,7 +31,7 @@ import static org.mockito.Mockito.*; /** * */ -public class IPFilterTests extends ElasticsearchTestCase { +public class IPFilterTests extends ESTestCase { private IPFilter ipFilter; private AuditTrail auditTrail; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringIntegrationTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringIntegrationTests.java index bbe2770199e..7c3d15116e4 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringIntegrationTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringIntegrationTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.Node; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.transport.Transport; import org.junit.BeforeClass; import org.junit.Test; @@ -22,14 +22,14 @@ import java.io.OutputStream; import java.net.InetSocketAddress; import java.net.Socket; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope; +import static org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import static org.elasticsearch.test.ESIntegTestCase.Scope; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; // no client nodes, no transport clients, as they all get rejected on network connections @ClusterScope(scope = Scope.SUITE, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class IpFilteringIntegrationTests extends ShieldIntegrationTest { +public class IpFilteringIntegrationTests extends ShieldIntegTestCase { private static int randomClientPort; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringUpdateTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringUpdateTests.java index cf866596bfa..565d6935303 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringUpdateTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringUpdateTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.shield.transport.filter; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.Test; import java.net.InetAddress; @@ -17,12 +17,12 @@ import java.net.UnknownHostException; import java.util.Locale; import static org.elasticsearch.common.settings.Settings.settingsBuilder; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; +import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.is; @ClusterScope(scope = TEST, numDataNodes = 1) -public class IpFilteringUpdateTests extends ShieldIntegrationTest { +public class IpFilteringUpdateTests extends ShieldIntegTestCase { private final boolean httpEnabled = randomBoolean(); diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/netty/HandshakeWaitingHandlerTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/netty/HandshakeWaitingHandlerTests.java index 50134fb28c2..3c8b7718f2f 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/netty/HandshakeWaitingHandlerTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/netty/HandshakeWaitingHandlerTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.env.Environment; import org.elasticsearch.shield.ShieldSettingsFilter; import org.elasticsearch.shield.ssl.ServerSSLService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.jboss.netty.bootstrap.ClientBootstrap; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.buffer.ChannelBuffer; @@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.*; -public class HandshakeWaitingHandlerTests extends ElasticsearchTestCase { +public class HandshakeWaitingHandlerTests extends ESTestCase { private static final int CONCURRENT_CLIENT_REQUESTS = 20; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandlerTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandlerTests.java index 1f5026b990d..d121cc63040 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandlerTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandlerTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.settings.NodeSettingsService; import org.elasticsearch.shield.audit.AuditTrail; import org.elasticsearch.shield.transport.filter.IPFilter; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.Transport; import org.jboss.netty.channel.*; import org.junit.Before; @@ -32,7 +32,7 @@ import static org.mockito.Mockito.when; /** * */ -public class IPFilterNettyUpstreamHandlerTests extends ElasticsearchTestCase { +public class IPFilterNettyUpstreamHandlerTests extends ESTestCase { private IPFilterNettyUpstreamHandler nettyUpstreamHandler; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationTests.java index c4926d4bdc7..759c7ae0cba 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.shield.transport.netty; import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.Test; import java.nio.file.Files; @@ -16,7 +16,7 @@ import java.nio.file.Path; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.CoreMatchers.is; -public class IPHostnameVerificationTests extends ShieldIntegrationTest { +public class IPHostnameVerificationTests extends ShieldIntegTestCase { Path keystore; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransportTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransportTests.java index 44c1265bf0d..ebdb282244b 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransportTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransportTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.shield.ShieldSettingsFilter; import org.elasticsearch.shield.ssl.ServerSSLService; import org.elasticsearch.shield.transport.SSLClientAuth; import org.elasticsearch.shield.transport.filter.IPFilter; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.handler.ssl.SslHandler; import org.junit.Before; @@ -30,7 +30,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.is; import static org.mockito.Mockito.mock; -public class ShieldNettyHttpServerTransportTests extends ElasticsearchTestCase { +public class ShieldNettyHttpServerTransportTests extends ESTestCase { private ServerSSLService serverSSLService; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportTests.java index c777fc983d2..e313adbcb0e 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.shield.ShieldSettingsFilter; import org.elasticsearch.shield.ssl.ClientSSLService; import org.elasticsearch.shield.ssl.ServerSSLService; import org.elasticsearch.shield.transport.SSLClientAuth; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.netty.NettyTransport; import org.jboss.netty.channel.ChannelPipelineFactory; @@ -32,7 +32,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.mock; -public class ShieldNettyTransportTests extends ElasticsearchTestCase { +public class ShieldNettyTransportTests extends ESTestCase { private ServerSSLService serverSSLService; private ClientSSLService clientSSLService; diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationTests.java index b262c1ab32f..84f4db0fd60 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.transport.Transport; import org.junit.Test; @@ -23,7 +23,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -public class SslHostnameVerificationTests extends ShieldIntegrationTest { +public class SslHostnameVerificationTests extends ShieldIntegTestCase { @Override protected boolean sslTransportEnabled() { diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslClientAuthTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslClientAuthTests.java index 25d940f2863..f5c29067278 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslClientAuthTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslClientAuthTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.node.Node; import org.elasticsearch.shield.ShieldPlugin; import org.elasticsearch.shield.ssl.ClientSSLService; import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; @@ -35,7 +35,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.containsString; -public class SslClientAuthTests extends ShieldIntegrationTest { +public class SslClientAuthTests extends ShieldIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslIntegrationTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslIntegrationTests.java index 2222826d55f..fd96b1a3152 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslIntegrationTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslIntegrationTests.java @@ -26,7 +26,7 @@ import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.Node; import org.elasticsearch.shield.ssl.ClientSSLService; import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.transport.Transport; import org.junit.Test; @@ -42,7 +42,7 @@ import java.util.Locale; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.hamcrest.Matchers.*; -public class SslIntegrationTests extends ShieldIntegrationTest { +public class SslIntegrationTests extends ShieldIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslMultiPortTests.java b/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslMultiPortTests.java index 1353c501d9b..11a2bd68794 100644 --- a/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslMultiPortTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslMultiPortTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.shield.ShieldPlugin; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.transport.Transport; import org.junit.BeforeClass; @@ -25,7 +25,7 @@ import static org.elasticsearch.test.ShieldSettingsSource.DEFAULT_PASSWORD; import static org.elasticsearch.test.ShieldSettingsSource.DEFAULT_USER_NAME; import static org.hamcrest.CoreMatchers.is; -public class SslMultiPortTests extends ShieldIntegrationTest { +public class SslMultiPortTests extends ShieldIntegTestCase { private static int randomClientPort; private static int randomNonSslPort; diff --git a/shield/src/test/java/org/elasticsearch/shield/tribe/TribeTests.java b/shield/src/test/java/org/elasticsearch/shield/tribe/TribeIT.java similarity index 98% rename from shield/src/test/java/org/elasticsearch/shield/tribe/TribeTests.java rename to shield/src/test/java/org/elasticsearch/shield/tribe/TribeIT.java index 643daf1ffdb..7157194290a 100644 --- a/shield/src/test/java/org/elasticsearch/shield/tribe/TribeTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/tribe/TribeIT.java @@ -6,7 +6,6 @@ package org.elasticsearch.shield.tribe; import com.google.common.collect.ImmutableMap; -import org.apache.lucene.util.LuceneTestCase.Slow; import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; import org.elasticsearch.client.support.Headers; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -18,7 +17,7 @@ import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.crypto.InternalCryptoService; import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport; import org.elasticsearch.test.InternalTestCluster; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ShieldIntegTestCase; import org.elasticsearch.test.ShieldSettingsSource; import org.elasticsearch.transport.Transport; import org.elasticsearch.tribe.TribeService; @@ -37,8 +36,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitC import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.*; -@Slow -public class TribeTests extends ShieldIntegrationTest { +public class TribeIT extends ShieldIntegTestCase { //use known suite prefix since their threads are already ignored via ElasticsearchThreadFilter public static final String SECOND_CLUSTER_NODE_PREFIX = SUITE_CLUSTER_NODE_PREFIX; diff --git a/shield/src/test/java/org/elasticsearch/shield/tribe/TribeShieldLoadedTests.java b/shield/src/test/java/org/elasticsearch/shield/tribe/TribeShieldLoadedTests.java index 7c2a03a5ba7..ba1cbf8c34b 100644 --- a/shield/src/test/java/org/elasticsearch/shield/tribe/TribeShieldLoadedTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/tribe/TribeShieldLoadedTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.node.Node; import org.elasticsearch.node.NodeBuilder; import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.shield.ShieldPlugin; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.CoreMatchers.containsString; @@ -22,7 +22,7 @@ import static org.hamcrest.CoreMatchers.containsString; * tribes settings depending on how they will load shield or not. Main goal is to make sure that all tribes will run * shield too if the tribe node does. */ -public class TribeShieldLoadedTests extends ElasticsearchTestCase { +public class TribeShieldLoadedTests extends ESTestCase { @Test public void testShieldLoadedOnBothTribeNodeAndClients() { diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldIntegrationTest.java b/shield/src/test/java/org/elasticsearch/test/ShieldIntegTestCase.java similarity index 80% rename from shield/src/test/java/org/elasticsearch/test/ShieldIntegrationTest.java rename to shield/src/test/java/org/elasticsearch/test/ShieldIntegTestCase.java index 7283ce0729a..366dfb01d5a 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldIntegrationTest.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldIntegTestCase.java @@ -41,13 +41,11 @@ import static org.hamcrest.Matchers.hasSize; /** * Base class to run tests against a cluster with shield installed. - * The default {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope} is {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE}, + * The default {@link org.elasticsearch.test.ESIntegTestCase.Scope} is {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE}, * meaning that all subclasses that don't specify a different scope will share the same cluster with shield installed. * @see org.elasticsearch.test.ShieldSettingsSource */ -@Ignore -@ElasticsearchIntegrationTest.Integration -public abstract class ShieldIntegrationTest extends ElasticsearchIntegrationTest { +public abstract class ShieldIntegTestCase extends ESIntegTestCase { private static ShieldSettingsSource SHIELD_DEFAULT_SETTINGS; @@ -55,7 +53,7 @@ public abstract class ShieldIntegrationTest extends ElasticsearchIntegrationTest //The number of nodes is randomized though, but we can predict what the maximum number of nodes will be //and configure them all in unicast.hosts private static int maxNumberOfNodes() { - ClusterScope clusterScope = ShieldIntegrationTest.class.getAnnotation(ClusterScope.class); + ClusterScope clusterScope = ShieldIntegTestCase.class.getAnnotation(ClusterScope.class); if (clusterScope == null) { return InternalTestCluster.DEFAULT_MAX_NUM_DATA_NODES + InternalTestCluster.DEFAULT_MAX_NUM_CLIENT_NODES; } else { @@ -68,7 +66,7 @@ public abstract class ShieldIntegrationTest extends ElasticsearchIntegrationTest } private static ClusterScope getAnnotation(Class clazz) { - if (clazz == Object.class || clazz == ShieldIntegrationTest.class) { + if (clazz == Object.class || clazz == ShieldIntegTestCase.class) { return null; } ClusterScope annotation = clazz.getAnnotation(ClusterScope.class); @@ -88,8 +86,8 @@ public abstract class ShieldIntegrationTest extends ElasticsearchIntegrationTest } /** - * Settings used when the {@link org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope} is set to - * {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE} or {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#TEST} + * Settings used when the {@link org.elasticsearch.test.ESIntegTestCase.ClusterScope} is set to + * {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE} or {@link org.elasticsearch.test.ESIntegTestCase.Scope#TEST} * so that some of the configuration parameters can be overridden through test instance methods, similarly * to how {@link #nodeSettings(int)} and {@link #transportClientSettings()} work. */ @@ -113,7 +111,7 @@ public abstract class ShieldIntegrationTest extends ElasticsearchIntegrationTest } @Rule - //Rules are the only way to have something run before the before (final) method inherited from ElasticsearchIntegrationTest + //Rules are the only way to have something run before the before (final) method inherited from ESIntegTestCase public ExternalResource externalResource = new ExternalResource() { @Override protected void before() throws Throwable { @@ -185,64 +183,64 @@ public abstract class ShieldIntegrationTest extends ElasticsearchIntegrationTest } /** - * Allows to override the users config file when the {@link org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope} is set to - * {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE} or {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#TEST} + * Allows to override the users config file when the {@link org.elasticsearch.test.ESIntegTestCase.ClusterScope} is set to + * {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE} or {@link org.elasticsearch.test.ESIntegTestCase.Scope#TEST} */ protected String configUsers() { return SHIELD_DEFAULT_SETTINGS.configUsers(); } /** - * Allows to override the users_roles config file when the {@link org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope} is set to - * {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE} or {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#TEST} + * Allows to override the users_roles config file when the {@link org.elasticsearch.test.ESIntegTestCase.ClusterScope} is set to + * {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE} or {@link org.elasticsearch.test.ESIntegTestCase.Scope#TEST} */ protected String configUsersRoles() { return SHIELD_DEFAULT_SETTINGS.configUsersRoles(); } /** - * Allows to override the roles config file when the {@link org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope} is set to - * {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE} or {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#TEST} + * Allows to override the roles config file when the {@link org.elasticsearch.test.ESIntegTestCase.ClusterScope} is set to + * {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE} or {@link org.elasticsearch.test.ESIntegTestCase.Scope#TEST} */ protected String configRoles() { return SHIELD_DEFAULT_SETTINGS.configRoles(); } /** - * Allows to override the node client username (used while sending requests to the test cluster) when the {@link org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope} is set to - * {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE} or {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#TEST} + * Allows to override the node client username (used while sending requests to the test cluster) when the {@link org.elasticsearch.test.ESIntegTestCase.ClusterScope} is set to + * {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE} or {@link org.elasticsearch.test.ESIntegTestCase.Scope#TEST} */ protected String nodeClientUsername() { return SHIELD_DEFAULT_SETTINGS.nodeClientUsername(); } /** - * Allows to override the node client password (used while sending requests to the test cluster) when the {@link org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope} is set to - * {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE} or {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#TEST} + * Allows to override the node client password (used while sending requests to the test cluster) when the {@link org.elasticsearch.test.ESIntegTestCase.ClusterScope} is set to + * {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE} or {@link org.elasticsearch.test.ESIntegTestCase.Scope#TEST} */ protected SecuredString nodeClientPassword() { return SHIELD_DEFAULT_SETTINGS.nodeClientPassword(); } /** - * Allows to override the transport client username (used while sending requests to the test cluster) when the {@link org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope} is set to - * {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE} or {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#TEST} + * Allows to override the transport client username (used while sending requests to the test cluster) when the {@link org.elasticsearch.test.ESIntegTestCase.ClusterScope} is set to + * {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE} or {@link org.elasticsearch.test.ESIntegTestCase.Scope#TEST} */ protected String transportClientUsername() { return SHIELD_DEFAULT_SETTINGS.transportClientUsername(); } /** - * Allows to override the transport client password (used while sending requests to the test cluster) when the {@link org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope} is set to - * {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE} or {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#TEST} + * Allows to override the transport client password (used while sending requests to the test cluster) when the {@link org.elasticsearch.test.ESIntegTestCase.ClusterScope} is set to + * {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE} or {@link org.elasticsearch.test.ESIntegTestCase.Scope#TEST} */ protected SecuredString transportClientPassword() { return SHIELD_DEFAULT_SETTINGS.transportClientPassword(); } /** - * Allows to control whether ssl is enabled or not on the transport layer when the {@link org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope} is set to - * {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#SUITE} or {@link org.elasticsearch.test.ElasticsearchIntegrationTest.Scope#TEST} + * Allows to control whether ssl is enabled or not on the transport layer when the {@link org.elasticsearch.test.ESIntegTestCase.ClusterScope} is set to + * {@link org.elasticsearch.test.ESIntegTestCase.Scope#SUITE} or {@link org.elasticsearch.test.ESIntegTestCase.Scope#TEST} */ protected boolean sslTransportEnabled() { return randomBoolean(); @@ -263,48 +261,48 @@ public abstract class ShieldIntegrationTest extends ElasticsearchIntegrationTest @Override protected String configUsers() { - return ShieldIntegrationTest.this.configUsers(); + return ShieldIntegTestCase.this.configUsers(); } @Override protected String configUsersRoles() { - return ShieldIntegrationTest.this.configUsersRoles(); + return ShieldIntegTestCase.this.configUsersRoles(); } @Override protected String configRoles() { - return ShieldIntegrationTest.this.configRoles(); + return ShieldIntegTestCase.this.configRoles(); } @Override protected String nodeClientUsername() { - return ShieldIntegrationTest.this.nodeClientUsername(); + return ShieldIntegTestCase.this.nodeClientUsername(); } @Override protected SecuredString nodeClientPassword() { - return ShieldIntegrationTest.this.nodeClientPassword(); + return ShieldIntegTestCase.this.nodeClientPassword(); } @Override protected String transportClientUsername() { - return ShieldIntegrationTest.this.transportClientUsername(); + return ShieldIntegTestCase.this.transportClientUsername(); } @Override protected SecuredString transportClientPassword() { - return ShieldIntegrationTest.this.transportClientPassword(); + return ShieldIntegTestCase.this.transportClientPassword(); } @Override protected Class licensePluginClass() { - return ShieldIntegrationTest.this.licensePluginClass(); + return ShieldIntegTestCase.this.licensePluginClass(); } @Override protected String licensePluginName() { - return ShieldIntegrationTest.this.licensePluginName(); + return ShieldIntegTestCase.this.licensePluginName(); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest0Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest0Tests.java index 20eb8c72986..afe1200ef86 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest0Tests.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRest0Tests.java @@ -7,7 +7,7 @@ package org.elasticsearch.test; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; @@ -21,6 +21,6 @@ public class ShieldRest0Tests extends ShieldRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(0, 8); + return ESRestTestCase.createParameters(0, 8); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest1Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest1Tests.java index 521e8f394fe..eb30461b6e8 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest1Tests.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRest1Tests.java @@ -7,7 +7,7 @@ package org.elasticsearch.test; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; @@ -21,6 +21,6 @@ public class ShieldRest1Tests extends ShieldRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(1, 8); + return ESRestTestCase.createParameters(1, 8); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest2Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest2Tests.java index e5c87967e4d..86b3722d0b6 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest2Tests.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRest2Tests.java @@ -7,7 +7,7 @@ package org.elasticsearch.test; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; @@ -21,6 +21,6 @@ public class ShieldRest2Tests extends ShieldRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(2, 8); + return ESRestTestCase.createParameters(2, 8); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest3Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest3Tests.java index 57facbf6942..9c5c6352b76 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest3Tests.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRest3Tests.java @@ -7,7 +7,7 @@ package org.elasticsearch.test; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; @@ -21,6 +21,6 @@ public class ShieldRest3Tests extends ShieldRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(3, 8); + return ESRestTestCase.createParameters(3, 8); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest4Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest4Tests.java index d16eabf4b05..a83fc07c128 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest4Tests.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRest4Tests.java @@ -7,7 +7,7 @@ package org.elasticsearch.test; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; @@ -21,6 +21,6 @@ public class ShieldRest4Tests extends ShieldRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(4, 8); + return ESRestTestCase.createParameters(4, 8); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest5Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest5Tests.java index a3e95013cb1..a30c6955431 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest5Tests.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRest5Tests.java @@ -7,7 +7,7 @@ package org.elasticsearch.test; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; @@ -21,6 +21,6 @@ public class ShieldRest5Tests extends ShieldRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(5, 8); + return ESRestTestCase.createParameters(5, 8); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest6Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest6Tests.java index 60a4476188f..eb1e838809f 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest6Tests.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRest6Tests.java @@ -7,7 +7,7 @@ package org.elasticsearch.test; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; @@ -21,6 +21,6 @@ public class ShieldRest6Tests extends ShieldRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(6, 8); + return ESRestTestCase.createParameters(6, 8); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest7Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest7Tests.java index 4d74cf2ef0f..8bdc033e9c2 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest7Tests.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRest7Tests.java @@ -7,7 +7,7 @@ package org.elasticsearch.test; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; @@ -21,6 +21,6 @@ public class ShieldRest7Tests extends ShieldRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(7, 8); + return ESRestTestCase.createParameters(7, 8); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRestIT.java b/shield/src/test/java/org/elasticsearch/test/ShieldRestIT.java index c0d7a58ac1e..d0480c23492 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRestIT.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRestIT.java @@ -8,7 +8,7 @@ package org.elasticsearch.test; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; @@ -22,6 +22,6 @@ public class ShieldRestIT extends ShieldRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(0, 1); + return ESRestTestCase.createParameters(0, 1); } } diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRestTestCase.java b/shield/src/test/java/org/elasticsearch/test/ShieldRestTestCase.java index 81befa5b784..0b531798eca 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRestTestCase.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldRestTestCase.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.client.RestException; import org.junit.AfterClass; @@ -27,16 +27,15 @@ import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basic /** * Allows to run Elasticsearch REST tests against a cluster with shield installed. - * Subclasses {@link org.elasticsearch.test.ShieldIntegrationTest} that contains all the needed code to override the global + * Subclasses {@link ShieldIntegTestCase} that contains all the needed code to override the global * cluster settings and make sure shield is properly installed and configured. - * Delegates all of the tests to {@link org.elasticsearch.test.rest.ElasticsearchRestTestCase}. + * Delegates all of the tests to {@link org.elasticsearch.test.rest.ESRestTestCase}. */ -@ElasticsearchRestTestCase.Rest -@ElasticsearchIntegrationTest.ClusterScope(randomDynamicTemplates = false) +@ESRestTestCase.Rest +@ESIntegTestCase.ClusterScope(randomDynamicTemplates = false) @LuceneTestCase.SuppressFsync // we aren't trying to test this here, and it can make the test slow @LuceneTestCase.SuppressCodecs("*") // requires custom completion postings format -@Slow -public abstract class ShieldRestTestCase extends ShieldIntegrationTest { +public abstract class ShieldRestTestCase extends ShieldIntegTestCase { private final DelegatedRestTestCase delegate; @@ -55,12 +54,12 @@ public abstract class ShieldRestTestCase extends ShieldIntegrationTest { @BeforeClass public static void initExecutionContext() throws IOException, RestException { - ElasticsearchRestTestCase.initExecutionContext(); + ESRestTestCase.initExecutionContext(); } @AfterClass public static void close() { - ElasticsearchRestTestCase.close(); + ESRestTestCase.close(); } @Test @@ -73,7 +72,7 @@ public abstract class ShieldRestTestCase extends ShieldIntegrationTest { delegate.reset(); } - class DelegatedRestTestCase extends ElasticsearchRestTestCase { + class DelegatedRestTestCase extends ESRestTestCase { DelegatedRestTestCase(RestTestCandidate candidate) { super(candidate); diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java b/shield/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java index a118f1cc436..3093929c4c9 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java @@ -85,7 +85,7 @@ public class ShieldSettingsSource extends ClusterDiscoveryConfiguration.UnicastZ * @param parentFolder the parent folder that will contain all of the configuration files that need to be created * @param scope the scope of the test that is requiring an instance of ShieldSettingsSource */ - public ShieldSettingsSource(int numOfNodes, boolean sslTransportEnabled, Path parentFolder, ElasticsearchIntegrationTest.Scope scope) { + public ShieldSettingsSource(int numOfNodes, boolean sslTransportEnabled, Path parentFolder, ESIntegTestCase.Scope scope) { this(numOfNodes, sslTransportEnabled, generateKey(), parentFolder, scope); } @@ -98,7 +98,7 @@ public class ShieldSettingsSource extends ClusterDiscoveryConfiguration.UnicastZ * @param parentFolder the parent folder that will contain all of the configuration files that need to be created * @param scope the scope of the test that is requiring an instance of ShieldSettingsSource */ - public ShieldSettingsSource(int numOfNodes, boolean sslTransportEnabled, byte[] systemKey, Path parentFolder, ElasticsearchIntegrationTest.Scope scope) { + public ShieldSettingsSource(int numOfNodes, boolean sslTransportEnabled, byte[] systemKey, Path parentFolder, ESIntegTestCase.Scope scope) { super(numOfNodes, DEFAULT_SETTINGS); this.systemKey = systemKey; this.parentFolder = parentFolder; diff --git a/shield/src/test/java/org/elasticsearch/transport/KnownActionsTests.java b/shield/src/test/java/org/elasticsearch/transport/KnownActionsTests.java index 5057b6cfd83..0f1aefc4f07 100644 --- a/shield/src/test/java/org/elasticsearch/transport/KnownActionsTests.java +++ b/shield/src/test/java/org/elasticsearch/transport/KnownActionsTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.util.Callback; import org.elasticsearch.license.plugin.LicensePlugin; import org.elasticsearch.shield.action.ShieldActionModule; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; -import org.elasticsearch.test.ShieldIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.test.ShieldIntegTestCase; import org.junit.BeforeClass; import org.junit.Test; @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.is; @ClusterScope(numClientNodes = 0, numDataNodes = 1) -public class KnownActionsTests extends ShieldIntegrationTest { +public class KnownActionsTests extends ShieldIntegTestCase { private static ImmutableSet knownActions; private static ImmutableSet knownHandlers; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/WatcherLifeCycleServiceTests.java b/watcher/src/test/java/org/elasticsearch/watcher/WatcherLifeCycleServiceTests.java index 187441d5091..822f9649401 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/WatcherLifeCycleServiceTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/WatcherLifeCycleServiceTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.block.ClusterBlocks; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.gateway.GatewayService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.junit.Before; import org.junit.Test; @@ -24,7 +24,7 @@ import static org.mockito.Mockito.*; /** */ -public class WatcherLifeCycleServiceTests extends ElasticsearchTestCase { +public class WatcherLifeCycleServiceTests extends ESTestCase { private ClusterService clusterService; private WatcherService watcherService; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java b/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java index 315ecb56b34..aec5cae5ee7 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.license.plugin.LicensePlugin; import org.elasticsearch.node.Node; import org.elasticsearch.plugins.PluginsService; -import org.elasticsearch.test.ElasticsearchIntegrationTest; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; import org.elasticsearch.threadpool.ThreadPool; @@ -24,7 +24,7 @@ import org.elasticsearch.threadpool.ThreadPoolInfo; import org.elasticsearch.watcher.execution.InternalWatchExecutor; import org.junit.Test; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE; +import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; @@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.not; * */ @ClusterScope(scope = SUITE, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, maxNumDataNodes = 3) -public class WatcherPluginDisableTests extends ElasticsearchIntegrationTest { +public class WatcherPluginDisableTests extends ESIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/WatcherVersionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/WatcherVersionTests.java index 8420bca2986..a6a6d200f2b 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/WatcherVersionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/WatcherVersionTests.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.watcher; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.Matchers.equalTo; @@ -14,7 +14,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class WatcherVersionTests extends ElasticsearchTestCase { +public class WatcherVersionTests extends ESTestCase { @Test public void testStrings() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/DataAttachmentTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/DataAttachmentTests.java index a839b2cd618..938a763bd8a 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/DataAttachmentTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/DataAttachmentTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.watcher.actions.email; import com.google.common.collect.ImmutableMap; import org.elasticsearch.common.io.Streams; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.actions.email.service.Attachment; import org.junit.Test; @@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class DataAttachmentTests extends ElasticsearchTestCase { +public class DataAttachmentTests extends ESTestCase { @Test public void testCreate_Json() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/EmailActionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/EmailActionTests.java index 5f82efe1dfb..0a709548f9b 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/EmailActionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/EmailActionTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.actions.Action; import org.elasticsearch.watcher.actions.email.service.*; import org.elasticsearch.watcher.execution.WatchExecutionContext; @@ -41,7 +41,7 @@ import static org.mockito.Mockito.when; /** * */ -public class EmailActionTests extends ElasticsearchTestCase { +public class EmailActionTests extends ESTestCase { @Test public void testExecute() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/AccountTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/AccountTests.java index 48cc737fd49..4c77f97ec0d 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/AccountTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/AccountTests.java @@ -6,7 +6,7 @@ package org.elasticsearch.watcher.actions.email.service; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.actions.email.service.support.EmailServer; import org.elasticsearch.watcher.support.secret.Secret; import org.elasticsearch.watcher.support.secret.SecretService; @@ -27,7 +27,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class AccountTests extends ElasticsearchTestCase { +public class AccountTests extends ESTestCase { static final String USERNAME = "_user"; static final String PASSWORD = "_passwd"; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/AccountsTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/AccountsTests.java index 3515cda958f..6420874b83b 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/AccountsTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/AccountsTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.watcher.actions.email.service; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsException; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.support.secret.SecretService; import org.junit.Test; @@ -16,7 +16,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class AccountsTests extends ElasticsearchTestCase { +public class AccountsTests extends ESTestCase { @Test public void testSingleAccount() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/EmailTemplateTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/EmailTemplateTests.java index 4bcef5b868c..612685e37f1 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/EmailTemplateTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/EmailTemplateTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.support.template.Template; import org.elasticsearch.watcher.support.template.TemplateEngine; import org.junit.Test; @@ -27,7 +27,7 @@ import static org.mockito.Mockito.when; /** */ -public class EmailTemplateTests extends ElasticsearchTestCase { +public class EmailTemplateTests extends ESTestCase { @Test public void testEmailTemplate_Parser_SelfGenerated() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/EmailTest.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/EmailTest.java index 5372e1ac5d1..1c10339b033 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/EmailTest.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/EmailTest.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.joda.time.DateTimeZone; import org.junit.Test; @@ -23,7 +23,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class EmailTest extends ElasticsearchTestCase { +public class EmailTest extends ESTestCase { @Test public void testEmail_Parser_SelfGenerated() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/HtmlSanitizerTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/HtmlSanitizerTests.java index 0ca7d666f6b..84a00c02b3b 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/HtmlSanitizerTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/HtmlSanitizerTests.java @@ -6,7 +6,7 @@ package org.elasticsearch.watcher.actions.email.service; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.hamcrest.Matchers.equalTo; @@ -15,7 +15,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class HtmlSanitizerTests extends ElasticsearchTestCase { +public class HtmlSanitizerTests extends ESTestCase { @Test public void testDefault_WithTemplatePlaceholders() { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/InternalEmailServiceTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/InternalEmailServiceTests.java index 3bfde2a7ace..f4d3ad4a5a0 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/InternalEmailServiceTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/InternalEmailServiceTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.settings.NodeSettingsService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.shield.WatcherSettingsFilter; import org.elasticsearch.watcher.support.secret.Secret; import org.elasticsearch.watcher.support.secret.SecretService; @@ -23,7 +23,7 @@ import static org.mockito.Mockito.*; /** * */ -public class InternalEmailServiceTests extends ElasticsearchTestCase { +public class InternalEmailServiceTests extends ESTestCase { private InternalEmailService service; private Accounts accounts; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTester.java similarity index 97% rename from watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTests.java rename to watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTester.java index 20d1c644456..33fb2a82bb0 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTester.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.watcher.actions.email.service; +import org.apache.lucene.util.LuceneTestCase; import org.elasticsearch.common.cli.Terminal; import org.elasticsearch.common.inject.Provider; import org.elasticsearch.common.settings.Settings; @@ -13,16 +14,12 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.node.settings.NodeSettingsService; import org.elasticsearch.watcher.shield.WatcherSettingsFilter; import org.elasticsearch.watcher.support.secret.SecretService; -import org.junit.Ignore; import java.io.IOException; import java.io.InputStream; -/** - * - */ -@Ignore -public class ManualPublicSmtpServersTests { +@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/x-plugins/issues/379") +public class ManualPublicSmtpServersTester { private static final Terminal terminal = Terminal.DEFAULT; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/index/IndexActionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/index/IndexActionTests.java index 8a43eafa0c5..0a4753fad5b 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/index/IndexActionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/index/IndexActionTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.sort.SortOrder; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.watcher.actions.Action; import org.elasticsearch.watcher.actions.Action.Result.Status; import org.elasticsearch.watcher.execution.WatchExecutionContext; @@ -45,7 +45,7 @@ import static org.joda.time.DateTimeZone.UTC; /** */ -public class IndexActionTests extends ElasticsearchIntegrationTest { +public class IndexActionTests extends ESIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/logging/LoggingActionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/logging/LoggingActionTests.java index 9db7bd2477b..246d54d318c 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/logging/LoggingActionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/logging/LoggingActionTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.actions.Action; import org.elasticsearch.watcher.actions.email.service.Attachment; import org.elasticsearch.watcher.execution.WatchExecutionContext; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.*; /** */ -public class LoggingActionTests extends ElasticsearchTestCase { +public class LoggingActionTests extends ESTestCase { private ESLogger actionLogger; private LoggingLevel level; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/AckThrottlerTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/AckThrottlerTests.java index bcf22f2da35..7359b94d020 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/AckThrottlerTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/AckThrottlerTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.watcher.actions.throttler; import org.elasticsearch.watcher.support.clock.SystemClock; import org.joda.time.DateTime; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.actions.ActionStatus; import org.elasticsearch.watcher.execution.WatchExecutionContext; import org.elasticsearch.watcher.watch.Watch; @@ -25,7 +25,7 @@ import static org.mockito.Mockito.when; /** * */ -public class AckThrottlerTests extends ElasticsearchTestCase { +public class AckThrottlerTests extends ESTestCase { @Test public void testWhenAcked() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleIT.java similarity index 98% rename from watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleTests.java rename to watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleIT.java index 8b168418ea0..4ca01f71dc4 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleIT.java @@ -5,9 +5,7 @@ */ package org.elasticsearch.watcher.actions.throttler; -import org.apache.lucene.util.LuceneTestCase.Slow; import org.elasticsearch.ElasticsearchException; -import org.joda.time.DateTime; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.watcher.actions.Action; import org.elasticsearch.watcher.actions.ActionWrapper; @@ -34,6 +32,7 @@ import org.elasticsearch.watcher.trigger.manual.ManualTriggerEvent; import org.elasticsearch.watcher.trigger.schedule.IntervalSchedule; import org.elasticsearch.watcher.trigger.schedule.ScheduleTrigger; import org.elasticsearch.watcher.trigger.schedule.ScheduleTriggerEvent; +import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.Test; @@ -51,11 +50,9 @@ import static org.elasticsearch.watcher.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; -/** - */ -public class ActionThrottleTests extends AbstractWatcherIntegrationTests { +public class ActionThrottleIT extends AbstractWatcherIntegrationTests { - @Test @Slow + @Test public void testSingleActionAckThrottle() throws Exception { boolean useClientForAcking = randomBoolean(); @@ -95,7 +92,7 @@ public class ActionThrottleTests extends AbstractWatcherIntegrationTests { } } - @Test @Slow + @Test public void testRandomMultiActionAckThrottle() throws Exception { boolean useClientForAcking = randomBoolean(); @@ -143,7 +140,7 @@ public class ActionThrottleTests extends AbstractWatcherIntegrationTests { } } - @Test @Slow + @Test public void testDifferentThrottlePeriods() throws Exception { WatchSourceBuilder watchSourceBuilder = watchBuilder() .trigger(schedule(interval("60m"))); @@ -193,7 +190,7 @@ public class ActionThrottleTests extends AbstractWatcherIntegrationTests { } - @Test @Slow + @Test public void testDefaultThrottlePeriod() throws Exception { WatchSourceBuilder watchSourceBuilder = watchBuilder() .trigger(schedule(interval("60m"))); @@ -255,7 +252,7 @@ public class ActionThrottleTests extends AbstractWatcherIntegrationTests { }, 6, TimeUnit.SECONDS); } - @Test @Slow + @Test public void testWatchThrottlePeriod() throws Exception { WatchSourceBuilder watchSourceBuilder = watchBuilder() .trigger(schedule(interval("60m"))) @@ -317,7 +314,7 @@ public class ActionThrottleTests extends AbstractWatcherIntegrationTests { }, 20, TimeUnit.SECONDS); } - @Test @Slow + @Test public void testFailingActionDoesGetThrottled() throws Exception { TimeValue throttlePeriod = new TimeValue(60, TimeUnit.MINUTES); diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/PeriodThrottlerTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/PeriodThrottlerTests.java index 0f4d30e200d..a9844897357 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/PeriodThrottlerTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/PeriodThrottlerTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.watcher.actions.throttler; import org.joda.time.DateTime; import org.joda.time.PeriodType; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.actions.ActionStatus; import org.elasticsearch.watcher.execution.WatchExecutionContext; import org.elasticsearch.watcher.support.clock.SystemClock; @@ -25,7 +25,7 @@ import static org.mockito.Mockito.when; /** * */ -public class PeriodThrottlerTests extends ElasticsearchTestCase { +public class PeriodThrottlerTests extends ESTestCase { @Test public void testBelowPeriod_Successful() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/WatchThrottlerTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/WatchThrottlerTests.java index 4bdde5cb8cc..8581db74351 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/WatchThrottlerTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/WatchThrottlerTests.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.watcher.actions.throttler; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.execution.WatchExecutionContext; import org.elasticsearch.watcher.license.LicenseService; import org.junit.Test; @@ -17,7 +17,7 @@ import static org.mockito.Mockito.when; /** * */ -public class WatchThrottlerTests extends ElasticsearchTestCase { +public class WatchThrottlerTests extends ESTestCase { @Test public void testThrottle_DueToAck() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookActionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookActionTests.java index b03c6dd54f5..7d655189ce7 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookActionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookActionTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.actions.Action; import org.elasticsearch.watcher.actions.Action.Result.Status; @@ -57,7 +57,7 @@ import static org.mockito.Mockito.*; /** */ -public class WebhookActionTests extends ElasticsearchTestCase { +public class WebhookActionTests extends ESTestCase { static final String TEST_HOST = "test.com"; static final int TEST_PORT = 8089; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationIT.java similarity index 96% rename from watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationTests.java rename to watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationIT.java index 97c9f7661e0..3bd3d0635a6 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationIT.java @@ -9,7 +9,6 @@ import com.squareup.okhttp.mockwebserver.MockResponse; import com.squareup.okhttp.mockwebserver.MockWebServer; import com.squareup.okhttp.mockwebserver.QueueDispatcher; import com.squareup.okhttp.mockwebserver.RecordedRequest; -import org.apache.lucene.util.LuceneTestCase; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; @@ -39,12 +38,11 @@ import static org.elasticsearch.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.watcher.test.WatcherTestUtils.xContentSource; import static org.elasticsearch.watcher.trigger.TriggerBuilders.schedule; import static org.elasticsearch.watcher.trigger.schedule.Schedules.interval; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; -/** - */ -@LuceneTestCase.Slow -public class WebhookHttpsIntegrationTests extends AbstractWatcherIntegrationTests { +public class WebhookHttpsIntegrationIT extends AbstractWatcherIntegrationTests { private int webPort; private MockWebServer webServer; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/condition/always/AlwaysConditionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/condition/always/AlwaysConditionTests.java index 0a175f48b71..3fd57bdf696 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/condition/always/AlwaysConditionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/condition/always/AlwaysConditionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.condition.ConditionFactory; import org.elasticsearch.watcher.condition.ExecutableCondition; import org.junit.Test; @@ -19,7 +19,7 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; /** */ -public class AlwaysConditionTests extends ElasticsearchTestCase { +public class AlwaysConditionTests extends ESTestCase { @Test public void testExecute() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/condition/compare/CompareConditionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/condition/compare/CompareConditionTests.java index 183d17a2c3f..dde2f6ba2e5 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/condition/compare/CompareConditionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/condition/compare/CompareConditionTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.condition.compare.CompareCondition.Op; import org.elasticsearch.watcher.execution.WatchExecutionContext; import org.elasticsearch.watcher.support.clock.ClockMock; @@ -30,7 +30,7 @@ import static org.hamcrest.Matchers.notNullValue; /** */ -public class CompareConditionTests extends ElasticsearchTestCase { +public class CompareConditionTests extends ESTestCase { @Test public void testOpEval_EQ() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/condition/never/NeverConditionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/condition/never/NeverConditionTests.java index cc7de1196b2..9d2ac153e52 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/condition/never/NeverConditionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/condition/never/NeverConditionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.condition.ConditionFactory; import org.elasticsearch.watcher.condition.ExecutableCondition; import org.elasticsearch.watcher.condition.always.AlwaysCondition; @@ -20,7 +20,7 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; /** */ -public class NeverConditionTests extends ElasticsearchTestCase { +public class NeverConditionTests extends ESTestCase { @Test public void testExecute() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionTests.java index 8765e24cbe8..3168dcbda8e 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/condition/script/ScriptConditionTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptService.ScriptType; import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.condition.Condition; import org.elasticsearch.watcher.execution.WatchExecutionContext; @@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.*; /** */ -public class ScriptConditionTests extends ElasticsearchTestCase { +public class ScriptConditionTests extends ESTestCase { ThreadPool tp = null; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/execution/ExecutionServiceTests.java b/watcher/src/test/java/org/elasticsearch/watcher/execution/ExecutionServiceTests.java index 2fd5f89be12..5a3f02f401e 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/execution/ExecutionServiceTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/execution/ExecutionServiceTests.java @@ -10,7 +10,7 @@ import com.google.common.collect.ImmutableMap; import org.elasticsearch.cluster.ClusterState; import org.joda.time.DateTime; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.actions.*; import org.elasticsearch.watcher.actions.throttler.ActionThrottler; import org.elasticsearch.watcher.actions.throttler.Throttler; @@ -43,7 +43,7 @@ import static org.mockito.Mockito.*; /** */ -public class ExecutionServiceTests extends ElasticsearchTestCase { +public class ExecutionServiceTests extends ESTestCase { private Payload payload; private ExecutableInput input; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/execution/ManualExecutionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/execution/ManualExecutionTests.java index a36176df342..a44b5b4838f 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/execution/ManualExecutionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/execution/ManualExecutionTests.java @@ -55,7 +55,16 @@ import static org.elasticsearch.watcher.condition.ConditionBuilders.neverConditi import static org.elasticsearch.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.watcher.trigger.TriggerBuilders.schedule; import static org.elasticsearch.watcher.trigger.schedule.Schedules.cron; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.lessThan; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.startsWith; public class ManualExecutionTests extends AbstractWatcherIntegrationTests { @@ -315,7 +324,7 @@ public class ManualExecutionTests extends AbstractWatcherIntegrationTests { assertThat(record.result().executionDurationMs(), greaterThanOrEqualTo(100L)); } - @Test @Slow + @Test public void testForceDeletionOfLongRunningWatch() throws Exception { WatchSourceBuilder watchBuilder = watchBuilder() .trigger(schedule(cron("0 0 0 1 * ? 2099"))) diff --git a/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreTests.java b/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreTests.java index 5e061d5e73f..8eeb989c488 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/execution/TriggeredWatchStoreTests.java @@ -26,7 +26,7 @@ import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.search.internal.InternalSearchHit; import org.elasticsearch.search.internal.InternalSearchHits; import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.support.init.proxy.ClientProxy; import org.hamcrest.core.IsNull; import org.junit.Before; @@ -41,7 +41,7 @@ import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.*; -public class TriggeredWatchStoreTests extends ElasticsearchTestCase { +public class TriggeredWatchStoreTests extends ESTestCase { private ClientProxy clientProxy; private TriggeredWatch.Parser parser; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryStoreSettingsTests.java b/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryStoreSettingsTests.java index ba4a372f913..eabe5184cda 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryStoreSettingsTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryStoreSettingsTests.java @@ -7,13 +7,13 @@ package org.elasticsearch.watcher.history; import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.watcher.WatcherModule; import org.elasticsearch.watcher.test.AbstractWatcherIntegrationTests; import org.junit.Test; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; +import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -22,7 +22,7 @@ import static org.hamcrest.core.Is.is; /** */ @TestLogging("cluster:DEBUG,action.admin.cluster.settings:DEBUG,watcher:DEBUG") -@ElasticsearchIntegrationTest.ClusterScope(scope = TEST, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 1) +@ESIntegTestCase.ClusterScope(scope = TEST, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 1) public class HistoryStoreSettingsTests extends AbstractWatcherIntegrationTests { @Test diff --git a/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryStoreTests.java b/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryStoreTests.java index 1d3430e4224..ae279a7fb5c 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryStoreTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryStoreTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.execution.ExecutionState; import org.elasticsearch.watcher.execution.Wid; import org.elasticsearch.watcher.support.init.proxy.ClientProxy; @@ -27,7 +27,7 @@ import static org.mockito.Mockito.*; /** */ -public class HistoryStoreTests extends ElasticsearchTestCase { +public class HistoryStoreTests extends ESTestCase { private HistoryStore historyStore; private ClientProxy clientProxy; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/input/InputRegistryTests.java b/watcher/src/test/java/org/elasticsearch/watcher/input/InputRegistryTests.java index bfeac182ad4..818705b85d8 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/input/InputRegistryTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/input/InputRegistryTests.java @@ -9,7 +9,7 @@ import com.google.common.collect.ImmutableMap; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; @@ -17,7 +17,7 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; /** * */ -public class InputRegistryTests extends ElasticsearchTestCase { +public class InputRegistryTests extends ESTestCase { @Test(expected = ElasticsearchParseException.class) public void testParse_EmptyInput() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputTests.java b/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputTests.java index 1819ace9c32..be4edf44a73 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.actions.ActionStatus; import org.elasticsearch.watcher.actions.ActionWrapper; import org.elasticsearch.watcher.actions.ExecutableActions; @@ -58,7 +58,7 @@ import static org.mockito.Mockito.when; /** */ -public class HttpInputTests extends ElasticsearchTestCase { +public class HttpInputTests extends ESTestCase { private HttpClient httpClient; private HttpInputFactory httpParser; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/input/search/SearchInputTests.java b/watcher/src/test/java/org/elasticsearch/watcher/input/search/SearchInputTests.java index 8eb87fc94f7..13f1457c1b3 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/input/search/SearchInputTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/input/search/SearchInputTests.java @@ -20,8 +20,8 @@ import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.test.ElasticsearchIntegrationTest; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.watcher.actions.ActionStatus; import org.elasticsearch.watcher.actions.ActionWrapper; import org.elasticsearch.watcher.actions.ExecutableActions; @@ -58,7 +58,7 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.*; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE; +import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.elasticsearch.watcher.test.WatcherTestUtils.areJsonEquivalent; import static org.elasticsearch.watcher.test.WatcherTestUtils.getRandomSupportedSearchType; import static org.hamcrest.Matchers.*; @@ -67,7 +67,7 @@ import static org.joda.time.DateTimeZone.UTC; /** */ @ClusterScope(scope = SUITE, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 1) -public class SearchInputTests extends ElasticsearchIntegrationTest { +public class SearchInputTests extends ESIntegTestCase { private final static String TEMPLATE_QUERY = "{\"query\":{\"filtered\":{\"query\":{\"match\":{\"event_type\":{\"query\":\"a\"," + "\"type\":\"boolean\"}}},\"filter\":{\"range\":{\"_timestamp\":" + diff --git a/watcher/src/test/java/org/elasticsearch/watcher/input/simple/SimpleInputTests.java b/watcher/src/test/java/org/elasticsearch/watcher/input/simple/SimpleInputTests.java index 15d08e24d6a..0fd20ce5c89 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/input/simple/SimpleInputTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/input/simple/SimpleInputTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.input.ExecutableInput; import org.elasticsearch.watcher.input.Input; import org.elasticsearch.watcher.input.InputFactory; @@ -26,7 +26,7 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; /** */ -public class SimpleInputTests extends ElasticsearchTestCase { +public class SimpleInputTests extends ESTestCase { @Test public void textExecute() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/DynamicIndexNameTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/DynamicIndexNameTests.java index d9a9848fb1d..3de22eb3846 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/DynamicIndexNameTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/DynamicIndexNameTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.watcher.support; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.format.DateTimeFormat; @@ -20,7 +20,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class DynamicIndexNameTests extends ElasticsearchTestCase { +public class DynamicIndexNameTests extends ESTestCase { @Test public void testNormal() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/FilterXContentTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/FilterXContentTests.java index bc8d2151ca0..b4bee911152 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/FilterXContentTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/FilterXContentTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matchers; import org.junit.Test; @@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class FilterXContentTests extends ElasticsearchTestCase { +public class FilterXContentTests extends ESTestCase { @Test public void testPayloadFiltering() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/VariablesTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/VariablesTests.java index bfe7592c55f..24645e5c810 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/VariablesTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/VariablesTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.watcher.support; import com.google.common.collect.ImmutableMap; import org.joda.time.DateTime; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.execution.WatchExecutionContext; import org.elasticsearch.watcher.execution.Wid; import org.elasticsearch.watcher.test.WatcherTestUtils; @@ -25,7 +25,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class VariablesTests extends ElasticsearchTestCase { +public class VariablesTests extends ESTestCase { @Test public void testCreateCtxModel() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherDateTimeUtilsTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherDateTimeUtilsTests.java index 31b5d287b36..505cedcb8d5 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherDateTimeUtilsTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherDateTimeUtilsTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.util.concurrent.TimeUnit; @@ -26,7 +26,7 @@ import static org.hamcrest.Matchers.notNullValue; /** * */ -public class WatcherDateTimeUtilsTests extends ElasticsearchTestCase { +public class WatcherDateTimeUtilsTests extends ESTestCase { @Test(expected = ElasticsearchParseException.class) public void testParseTimeValue_Numeric() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherIndexTemplateRegistryTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherIndexTemplateRegistryTests.java index 044f07ad346..f739e5c7df6 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherIndexTemplateRegistryTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherIndexTemplateRegistryTests.java @@ -7,19 +7,19 @@ package org.elasticsearch.watcher.support; import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.watcher.WatcherModule; import org.elasticsearch.watcher.test.AbstractWatcherIntegrationTests; import org.junit.Test; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; +import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.core.Is.is; /** */ -@ElasticsearchIntegrationTest.ClusterScope(scope = TEST, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 1) +@ESIntegTestCase.ClusterScope(scope = TEST, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 1) public class WatcherIndexTemplateRegistryTests extends AbstractWatcherIntegrationTests { @Test diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherUtilsTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherUtilsTests.java index 43fd3309dbd..19329486cdf 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherUtilsTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/WatcherUtilsTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.*; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.input.search.ExecutableSearchInput; import org.elasticsearch.watcher.support.clock.SystemClock; import org.elasticsearch.watcher.support.template.Template; @@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class WatcherUtilsTests extends ElasticsearchTestCase { +public class WatcherUtilsTests extends ESTestCase { @Test public void testFlattenModel() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/clock/ClockTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/clock/ClockTests.java index 81642a35fd5..c20fae37c34 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/clock/ClockTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/clock/ClockTests.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.watcher.support.clock; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.joda.time.DateTimeZone.UTC; @@ -13,7 +13,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class ClockTests extends ElasticsearchTestCase { +public class ClockTests extends ESTestCase { @Test public void test_now_UTC() { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/concurrent/FairKeyedLockTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/concurrent/FairKeyedLockTests.java index e66836c123b..599940eae7d 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/concurrent/FairKeyedLockTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/concurrent/FairKeyedLockTests.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.watcher.support.concurrent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matchers; import org.junit.Test; @@ -22,7 +22,7 @@ import static org.hamcrest.Matchers.not; /** */ -public class FairKeyedLockTests extends ElasticsearchTestCase { +public class FairKeyedLockTests extends ESTestCase { @Test public void checkIfMapEmptyAfterLotsOfAcquireAndReleases() throws InterruptedException { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpClientTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpClientTests.java index 754ba21abd7..b4b3f88f2f0 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpClientTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpClientTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.junit.annotations.Network; import org.elasticsearch.watcher.support.http.auth.HttpAuthFactory; import org.elasticsearch.watcher.support.http.auth.HttpAuthRegistry; @@ -41,7 +41,7 @@ import static org.hamcrest.core.Is.is; /** */ -public class HttpClientTests extends ElasticsearchTestCase { +public class HttpClientTests extends ESTestCase { private MockWebServer webServer; private HttpClient httpClient; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutIT.java similarity index 96% rename from watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutTests.java rename to watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutIT.java index 668334c5fee..e70b47b93e3 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutIT.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchTimeoutException; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.env.Environment; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.support.http.auth.HttpAuthRegistry; import org.junit.Test; @@ -19,12 +19,12 @@ import static org.mockito.Mockito.mock; /** */ -public class HttpConnectionTimeoutTests extends ElasticsearchTestCase { +public class HttpConnectionTimeoutIT extends ESTestCase { // setting an unroutable IP to simulate a connection timeout private static final String UNROUTABLE_IP = "192.168.255.255"; - @Test @Slow + @Test public void testDefaultTimeout() throws Exception { Environment environment = new Environment(Settings.builder().put("path.home", createTempDir()).build()); HttpClient httpClient = new HttpClient(Settings.EMPTY, mock(HttpAuthRegistry.class), environment).start(); @@ -48,7 +48,7 @@ public class HttpConnectionTimeoutTests extends ElasticsearchTestCase { } } - @Test @Slow + @Test public void testDefaultTimeout_Custom() throws Exception { Environment environment = new Environment(Settings.builder().put("path.home", createTempDir()).build()); HttpClient httpClient = new HttpClient(Settings.builder() @@ -75,7 +75,7 @@ public class HttpConnectionTimeoutTests extends ElasticsearchTestCase { } } - @Test @Slow + @Test public void testTimeout_CustomPerRequest() throws Exception { Environment environment = new Environment(Settings.builder().put("path.home", createTempDir()).build()); HttpClient httpClient = new HttpClient(Settings.builder() diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpReadTimeoutTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpReadTimeoutTests.java index 233a59f626b..800f964bd61 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpReadTimeoutTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpReadTimeoutTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.ElasticsearchTimeoutException; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.env.Environment; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.support.http.auth.HttpAuthRegistry; import org.elasticsearch.watcher.support.secret.SecretService; import org.junit.After; @@ -27,7 +27,7 @@ import static org.mockito.Mockito.mock; /** */ -public class HttpReadTimeoutTests extends ElasticsearchTestCase { +public class HttpReadTimeoutTests extends ESTestCase { private MockWebServer webServer; private SecretService secretService; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpRequestTemplateTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpRequestTemplateTests.java index bd120fd0d03..34aefd17453 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpRequestTemplateTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpRequestTemplateTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.support.http.auth.HttpAuthFactory; import org.elasticsearch.watcher.support.http.auth.HttpAuthRegistry; import org.elasticsearch.watcher.support.http.auth.basic.BasicAuth; @@ -31,7 +31,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class HttpRequestTemplateTests extends ElasticsearchTestCase { +public class HttpRequestTemplateTests extends ESTestCase { @Test public void testBody_WithXContent() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpResponseTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpResponseTests.java index 08e13a15dc9..a1dfc5ab3dd 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpResponseTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpResponseTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.bytes.BytesReference; import com.google.common.collect.ImmutableMap; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.nio.charset.StandardCharsets; @@ -26,7 +26,7 @@ import static org.hamcrest.Matchers.notNullValue; /** * */ -public class HttpResponseTests extends ElasticsearchTestCase { +public class HttpResponseTests extends ESTestCase { @Test public void testParse_SelfGenerated() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/template/TemplateTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/template/TemplateTests.java index ecd07afdeaa..f5a610d7c09 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/template/TemplateTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/template/TemplateTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.script.ExecutableScript; import org.elasticsearch.script.ScriptService.ScriptType; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.support.init.proxy.ScriptServiceProxy; import org.elasticsearch.watcher.support.template.xmustache.XMustacheTemplateEngine; import org.junit.Before; @@ -32,7 +32,7 @@ import static org.mockito.Mockito.when; /** * */ -public class TemplateTests extends ElasticsearchTestCase { +public class TemplateTests extends ESTestCase { private ScriptServiceProxy proxy; private TemplateEngine engine; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/template/xmustache/XMustacheScriptEngineTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/template/xmustache/XMustacheScriptEngineTests.java index b9997df86ff..e9cd3a28042 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/template/xmustache/XMustacheScriptEngineTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/template/xmustache/XMustacheScriptEngineTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.script.CompiledScript; import org.elasticsearch.script.ScriptService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Before; import org.junit.Test; @@ -23,7 +23,7 @@ import java.util.Map; /** * */ -public class XMustacheScriptEngineTests extends ElasticsearchTestCase { +public class XMustacheScriptEngineTests extends ESTestCase { private XMustacheScriptEngineService engine; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/template/xmustache/XMustacheTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/template/xmustache/XMustacheTests.java index a41d2b9da8e..dc9f1214b87 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/template/xmustache/XMustacheTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/template/xmustache/XMustacheTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.script.CompiledScript; import org.elasticsearch.script.ScriptEngineService; import org.elasticsearch.script.ScriptService; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Before; import org.junit.Test; @@ -30,7 +30,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class XMustacheTests extends ElasticsearchTestCase { +public class XMustacheTests extends ESTestCase { private ScriptEngineService engine; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/xcontent/MapPathTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/xcontent/MapPathTests.java index 4bc17f8e14f..a9931776a2b 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/xcontent/MapPathTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/xcontent/MapPathTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.watcher.support.xcontent; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.util.List; @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class MapPathTests extends ElasticsearchTestCase { +public class MapPathTests extends ESTestCase { @Test public void testEval() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/xcontent/XContentSourceTests.java b/watcher/src/test/java/org/elasticsearch/watcher/support/xcontent/XContentSourceTests.java index c7f7d3c8598..2fca51bf253 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/xcontent/XContentSourceTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/xcontent/XContentSourceTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.elasticsearch.common.xcontent.XContentFactory.*; @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class XContentSourceTests extends ElasticsearchTestCase { +public class XContentSourceTests extends ESTestCase { @Test public void testToXContent() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java b/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java index 3115dcc927d..b9c11e48a7e 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java @@ -31,8 +31,8 @@ import org.elasticsearch.shield.authc.esusers.ESUsersRealm; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.crypto.InternalCryptoService; -import org.elasticsearch.test.ElasticsearchIntegrationTest; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.TestCluster; import org.elasticsearch.watcher.WatcherLifeCycleService; import org.elasticsearch.watcher.WatcherPlugin; @@ -75,7 +75,7 @@ import java.util.concurrent.atomic.AtomicReference; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE; +import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.elasticsearch.watcher.WatcherModule.*; import static org.hamcrest.Matchers.*; import static org.hamcrest.core.Is.is; @@ -84,7 +84,7 @@ import static org.hamcrest.core.IsNot.not; /** */ @ClusterScope(scope = SUITE, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, maxNumDataNodes = 3) -public abstract class AbstractWatcherIntegrationTests extends ElasticsearchIntegrationTest { +public abstract class AbstractWatcherIntegrationTests extends ESIntegTestCase { private static final boolean timeWarpEnabled = SystemPropertyUtil.getBoolean("tests.timewarp", true); diff --git a/watcher/src/test/java/org/elasticsearch/watcher/test/WatcherTestUtils.java b/watcher/src/test/java/org/elasticsearch/watcher/test/WatcherTestUtils.java index aad8eac7fb2..b54a7b16aab 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/test/WatcherTestUtils.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/test/WatcherTestUtils.java @@ -22,7 +22,7 @@ import org.elasticsearch.script.ScriptEngineService; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.groovy.GroovyScriptEngineService; import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; import org.elasticsearch.watcher.actions.ActionStatus; @@ -77,7 +77,7 @@ import static com.carrotsearch.randomizedtesting.RandomizedTest.randomInt; import static org.apache.lucene.util.LuceneTestCase.createTempDir; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; -import static org.elasticsearch.test.ElasticsearchTestCase.randomFrom; +import static org.elasticsearch.test.ESTestCase.randomFrom; import static org.joda.time.DateTimeZone.UTC; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; @@ -166,7 +166,7 @@ public final class WatcherTestUtils { public static Watch createTestWatch(String watchName, ScriptServiceProxy scriptService, HttpClient httpClient, EmailService emailService, ESLogger logger) throws AddressException { - return createTestWatch(watchName, ClientProxy.of(ElasticsearchIntegrationTest.client()), scriptService, httpClient, emailService, logger); + return createTestWatch(watchName, ClientProxy.of(ESIntegTestCase.client()), scriptService, httpClient, emailService, logger); } diff --git a/watcher/src/test/java/org/elasticsearch/watcher/test/integration/BasicWatcherTests.java b/watcher/src/test/java/org/elasticsearch/watcher/test/integration/BasicWatcherTests.java index c35682f1147..a90dc5c8f5b 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/test/integration/BasicWatcherTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/test/integration/BasicWatcherTests.java @@ -249,7 +249,6 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTests { } @Test - @LuceneTestCase.Slow public void testModifyWatchWithSameUnit() throws Exception { if (timeWarped()) { logger.info("Skipping testModifyWatches_ because timewarp is enabled"); diff --git a/watcher/src/test/java/org/elasticsearch/watcher/test/integration/NoMasterNodeTests.java b/watcher/src/test/java/org/elasticsearch/watcher/test/integration/NoMasterNodeTests.java index 30a14bde7eb..28664f13fa5 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/test/integration/NoMasterNodeTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/test/integration/NoMasterNodeTests.java @@ -5,7 +5,6 @@ */ package org.elasticsearch.watcher.test.integration; -import org.apache.lucene.util.LuceneTestCase.Slow; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.client.Client; @@ -18,7 +17,7 @@ import org.elasticsearch.discovery.zen.elect.ElectMasterService; import org.elasticsearch.discovery.zen.ping.ZenPing; import org.elasticsearch.discovery.zen.ping.ZenPingService; import org.elasticsearch.discovery.zen.ping.unicast.UnicastZenPing; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.discovery.ClusterDiscoveryConfiguration; import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.watcher.WatcherService; @@ -37,7 +36,7 @@ import java.util.concurrent.TimeUnit; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; +import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.watcher.actions.ActionBuilders.loggingAction; import static org.elasticsearch.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.watcher.condition.ConditionBuilders.alwaysCondition; @@ -50,9 +49,6 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.core.Is.is; -/** - */ -@Slow @TestLogging("discovery:TRACE,watcher:TRACE") @ClusterScope(scope = TEST, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 0) public class NoMasterNodeTests extends AbstractWatcherIntegrationTests { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/test/rest/WatcherRestTests.java b/watcher/src/test/java/org/elasticsearch/watcher/test/rest/WatcherRestTests.java index d2d41f6a9f0..9b3c7437c7c 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/test/rest/WatcherRestTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/test/rest/WatcherRestTests.java @@ -17,9 +17,9 @@ import org.elasticsearch.shield.ShieldPlugin; import org.elasticsearch.shield.authc.esusers.ESUsersRealm; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.junit.annotations.TestLogging; -import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; import org.elasticsearch.watcher.WatcherPlugin; @@ -30,13 +30,13 @@ import java.nio.file.Files; import java.nio.file.Path; import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basicAuthHeaderValue; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE; +import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; -@ElasticsearchRestTestCase.Rest +@ESRestTestCase.Rest @ClusterScope(scope = SUITE, numClientNodes = 1, transportClientRatio = 0, numDataNodes = 1, randomDynamicTemplates = false) @TestLogging("_root:DEBUG") -public class WatcherRestTests extends ElasticsearchRestTestCase { +public class WatcherRestTests extends ESRestTestCase { final boolean shieldEnabled = enableShield(); @@ -46,7 +46,7 @@ public class WatcherRestTests extends ElasticsearchRestTestCase { @ParametersFactory public static Iterable parameters() throws IOException, RestTestParseException { - return ElasticsearchRestTestCase.createParameters(0, 1); + return ESRestTestCase.createParameters(0, 1); } protected boolean enableShield() { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/transform/chain/ChainTransformTests.java b/watcher/src/test/java/org/elasticsearch/watcher/transform/chain/ChainTransformTests.java index c9dcac6f2a5..602c8987677 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/transform/chain/ChainTransformTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/transform/chain/ChainTransformTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.execution.WatchExecutionContext; import org.elasticsearch.watcher.transform.ExecutableTransform; import org.elasticsearch.watcher.transform.Transform; @@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock; /** * */ -public class ChainTransformTests extends ElasticsearchTestCase { +public class ChainTransformTests extends ESTestCase { @Test public void testExecute() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/transform/script/ScriptTransformTests.java b/watcher/src/test/java/org/elasticsearch/watcher/transform/script/ScriptTransformTests.java index e2421ecd733..c82de2eaa17 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/transform/script/ScriptTransformTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/transform/script/ScriptTransformTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.script.CompiledScript; import org.elasticsearch.script.ExecutableScript; import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.ScriptService.ScriptType; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.execution.WatchExecutionContext; import org.elasticsearch.watcher.support.Script; @@ -42,7 +42,7 @@ import static org.mockito.Mockito.when; /** * */ -public class ScriptTransformTests extends ElasticsearchTestCase { +public class ScriptTransformTests extends ESTestCase { ThreadPool tp = null; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/transform/search/SearchTransformTests.java b/watcher/src/test/java/org/elasticsearch/watcher/transform/search/SearchTransformTests.java index 46678b98cfd..c52cf356393 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/transform/search/SearchTransformTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/transform/search/SearchTransformTests.java @@ -22,8 +22,8 @@ import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.test.ElasticsearchIntegrationTest; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.watcher.actions.ActionStatus; import org.elasticsearch.watcher.actions.ActionWrapper; import org.elasticsearch.watcher.actions.ExecutableActions; @@ -62,7 +62,7 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.*; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE; +import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.elasticsearch.watcher.support.WatcherDateTimeUtils.parseDate; import static org.elasticsearch.watcher.test.WatcherTestUtils.*; import static org.hamcrest.Matchers.*; @@ -72,7 +72,7 @@ import static org.joda.time.DateTimeZone.UTC; * */ @ClusterScope(scope = SUITE, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 1) -public class SearchTransformTests extends ElasticsearchIntegrationTest { +public class SearchTransformTests extends ESIntegTestCase { @Override public Settings nodeSettings(int nodeOrdinal) { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/transport/action/delete/ForceDeleteWatchTests.java b/watcher/src/test/java/org/elasticsearch/watcher/transport/action/delete/ForceDeleteWatchTests.java index 6e4469b04e2..e5b5776371d 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/transport/action/delete/ForceDeleteWatchTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/transport/action/delete/ForceDeleteWatchTests.java @@ -5,7 +5,6 @@ */ package org.elasticsearch.watcher.transport.action.delete; -import org.apache.lucene.util.LuceneTestCase.Slow; import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.watcher.support.Script; import org.elasticsearch.watcher.test.AbstractWatcherIntegrationTests; @@ -36,7 +35,7 @@ public class ForceDeleteWatchTests extends AbstractWatcherIntegrationTests { return false; } - @Test @Slow @TestLogging("_root:DEBUG") + @Test @TestLogging("_root:DEBUG") public void testForceDelete_LongRunningWatch() throws Exception { PutWatchResponse putResponse = watcherClient().preparePutWatch("_name").setSource(watchBuilder() .trigger(schedule(interval("3s"))) diff --git a/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java b/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsIT.java similarity index 88% rename from watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java rename to watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsIT.java index bef84c29a97..69af545dd8a 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsIT.java @@ -5,12 +5,9 @@ */ package org.elasticsearch.watcher.transport.action.stats; -import org.apache.lucene.util.LuceneTestCase; -import org.joda.time.DateTime; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.watcher.WatcherState; import org.elasticsearch.watcher.actions.ActionBuilders; import org.elasticsearch.watcher.condition.ConditionBuilders; @@ -19,21 +16,24 @@ import org.elasticsearch.watcher.execution.QueuedWatch; import org.elasticsearch.watcher.input.InputBuilders; import org.elasticsearch.watcher.test.AbstractWatcherIntegrationTests; import org.elasticsearch.watcher.transport.actions.stats.WatcherStatsResponse; +import org.joda.time.DateTime; import org.junit.Test; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; +import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.watcher.trigger.TriggerBuilders.schedule; import static org.elasticsearch.watcher.trigger.schedule.Schedules.interval; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.lessThanOrEqualTo; +import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.nullValue; -/** - */ -@LuceneTestCase.Slow -@ElasticsearchIntegrationTest.ClusterScope(scope = TEST, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 2) -public class SlowWatchStatsTests extends AbstractWatcherIntegrationTests { +@ESIntegTestCase.ClusterScope(scope = TEST, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 2) +public class SlowWatchStatsIT extends AbstractWatcherIntegrationTests { @Override protected boolean timeWarped() { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/WatcherStatsTests.java b/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/WatcherStatsTests.java index 103a2d9587b..9510747163c 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/WatcherStatsTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/WatcherStatsTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.watcher.transport.action.stats; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.watcher.WatcherBuild; import org.elasticsearch.watcher.WatcherState; @@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; -import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; +import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.watcher.trigger.TriggerBuilders.schedule; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/IntervalScheduleTests.java b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/IntervalScheduleTests.java index 9a04341bbd2..7f970fd7aaa 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/IntervalScheduleTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/IntervalScheduleTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class IntervalScheduleTests extends ElasticsearchTestCase { +public class IntervalScheduleTests extends ESTestCase { @Test public void testParse_Number() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/ScheduleTestCase.java b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/ScheduleTestCase.java index 05ba8b31ea3..11670073c5d 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/ScheduleTestCase.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/ScheduleTestCase.java @@ -8,7 +8,7 @@ package org.elasticsearch.watcher.trigger.schedule; import com.google.common.primitives.Ints; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.trigger.schedule.support.*; import java.io.IOException; @@ -21,7 +21,7 @@ import static org.elasticsearch.watcher.trigger.schedule.Schedules.*; /** * */ -public abstract class ScheduleTestCase extends ElasticsearchTestCase { +public abstract class ScheduleTestCase extends ESTestCase { protected static String[] expressions(CronnableSchedule schedule) { return expressions(schedule.crons); diff --git a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/ScheduleTriggerEventTests.java b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/ScheduleTriggerEventTests.java index ef12a79be80..99c3a078f93 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/ScheduleTriggerEventTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/ScheduleTriggerEventTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.support.clock.SystemClock; import org.junit.Test; @@ -18,7 +18,7 @@ import static org.hamcrest.Matchers.is; /** */ -public class ScheduleTriggerEventTests extends ElasticsearchTestCase { +public class ScheduleTriggerEventTests extends ESTestCase { @Test diff --git a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/BaseTriggerEngineTests.java b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/BaseTriggerEngineTestCase.java similarity index 98% rename from watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/BaseTriggerEngineTests.java rename to watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/BaseTriggerEngineTestCase.java index cb2d5710b45..a197170fa2c 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/BaseTriggerEngineTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/BaseTriggerEngineTestCase.java @@ -5,10 +5,9 @@ */ package org.elasticsearch.watcher.trigger.schedule.engine; -import org.apache.lucene.util.LuceneTestCase.Slow; import org.elasticsearch.watcher.support.clock.SystemClock; import org.joda.time.DateTime; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.trigger.Trigger; import org.elasticsearch.watcher.trigger.TriggerEngine; import org.elasticsearch.watcher.trigger.TriggerEvent; @@ -32,12 +31,7 @@ import static org.joda.time.DateTimeZone.UTC; import static org.elasticsearch.watcher.trigger.schedule.Schedules.*; import static org.hamcrest.Matchers.is; -/** - * - */ -@Slow -@Ignore -public abstract class BaseTriggerEngineTests extends ElasticsearchTestCase { +public abstract class BaseTriggerEngineTestCase extends ESTestCase { private TriggerEngine engine; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/SchedulerScheduleEngineTests.java b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/SchedulerScheduleEngineTests.java index 27804d3276c..a5bdcafcf22 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/SchedulerScheduleEngineTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/SchedulerScheduleEngineTests.java @@ -5,7 +5,6 @@ */ package org.elasticsearch.watcher.trigger.schedule.engine; -import org.apache.lucene.util.LuceneTestCase.Slow; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.watcher.support.clock.SystemClock; import org.elasticsearch.watcher.trigger.TriggerEngine; @@ -13,11 +12,7 @@ import org.elasticsearch.watcher.trigger.schedule.ScheduleRegistry; import static org.mockito.Mockito.mock; -/** - * - */ -@Slow -public class SchedulerScheduleEngineTests extends BaseTriggerEngineTests { +public class SchedulerScheduleEngineTests extends BaseTriggerEngineTestCase { protected TriggerEngine createEngine() { return new SchedulerScheduleTriggerEngine(Settings.EMPTY, mock(ScheduleRegistry.class), SystemClock.INSTANCE); diff --git a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/TickerScheduleEngineTests.java b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/TickerScheduleEngineTests.java index 307ebe422cc..8be9366585c 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/TickerScheduleEngineTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/trigger/schedule/engine/TickerScheduleEngineTests.java @@ -14,7 +14,7 @@ import static org.mockito.Mockito.mock; /** */ -public class TickerScheduleEngineTests extends BaseTriggerEngineTests { +public class TickerScheduleEngineTests extends BaseTriggerEngineTestCase { @Override protected TriggerEngine createEngine() { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchLockServiceTests.java b/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchLockServiceTests.java index df5bd3b5caa..fee798ea458 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchLockServiceTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchLockServiceTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.watcher.watch; import org.elasticsearch.ElasticsearchTimeoutException; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.junit.Test; import java.util.ArrayList; @@ -20,7 +20,7 @@ import static org.hamcrest.Matchers.*; /** */ -public class WatchLockServiceTests extends ElasticsearchTestCase { +public class WatchLockServiceTests extends ESTestCase { @Test public void testLocking_notStarted() { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchServiceTests.java b/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchServiceTests.java index 4ffc3c624de..00ad4af3374 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchServiceTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchServiceTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.WatcherService; import org.elasticsearch.watcher.WatcherState; import org.elasticsearch.watcher.actions.ActionStatus; @@ -40,7 +40,7 @@ import static org.mockito.Mockito.*; /** */ -public class WatchServiceTests extends ElasticsearchTestCase { +public class WatchServiceTests extends ESTestCase { private TriggerService triggerService; private WatchStore watchStore; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchStoreTests.java b/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchStoreTests.java index cfe06841406..e45b49a034b 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchStoreTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchStoreTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHitField; import org.elasticsearch.search.internal.InternalSearchHit; import org.elasticsearch.search.internal.InternalSearchHits; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.support.init.proxy.ClientProxy; import org.junit.Before; import org.junit.Test; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.*; /** */ -public class WatchStoreTests extends ElasticsearchTestCase { +public class WatchStoreTests extends ESTestCase { private WatchStore watchStore; private ClientProxy clientProxy; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchTests.java b/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchTests.java index 060f190d9c5..25ef3b056ef 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/watch/WatchTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.test.ElasticsearchTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.watcher.actions.*; import org.elasticsearch.watcher.actions.email.DataAttachment; import org.elasticsearch.watcher.actions.email.EmailAction; @@ -108,7 +108,7 @@ import static org.hamcrest.Matchers.*; import static org.joda.time.DateTimeZone.UTC; import static org.mockito.Mockito.mock; -public class WatchTests extends ElasticsearchTestCase { +public class WatchTests extends ESTestCase { private ScriptServiceProxy scriptService; private ClientProxy client; From cfc4c6eca23fec9b62c4492c0ef5acb1ef3c9daf Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 3 Aug 2015 18:47:33 -0700 Subject: [PATCH 2/2] Rename integ tests back from IT extension Original commit: elastic/x-pack-elasticsearch@e4ffa393baf7b990a3ecf721b30731c25522fed0 --- ...ecoveryCollectorIT.java => IndexRecoveryCollectorTests.java} | 2 +- .../shield/tribe/{TribeIT.java => TribeTests.java} | 2 +- .../{ActionThrottleIT.java => ActionThrottleTests.java} | 2 +- ...ttpsIntegrationIT.java => WebhookHttpsIntegrationTests.java} | 2 +- ...ConnectionTimeoutIT.java => HttpConnectionTimeoutTests.java} | 2 +- .../stats/{SlowWatchStatsIT.java => SlowWatchStatsTests.java} | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/{IndexRecoveryCollectorIT.java => IndexRecoveryCollectorTests.java} (99%) rename shield/src/test/java/org/elasticsearch/shield/tribe/{TribeIT.java => TribeTests.java} (99%) rename watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/{ActionThrottleIT.java => ActionThrottleTests.java} (99%) rename watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/{WebhookHttpsIntegrationIT.java => WebhookHttpsIntegrationTests.java} (98%) rename watcher/src/test/java/org/elasticsearch/watcher/support/http/{HttpConnectionTimeoutIT.java => HttpConnectionTimeoutTests.java} (98%) rename watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/{SlowWatchStatsIT.java => SlowWatchStatsTests.java} (98%) diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorIT.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java similarity index 99% rename from marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorIT.java rename to marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java index 56fcb75363b..331505480e3 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorIT.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java @@ -32,7 +32,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitC import static org.hamcrest.Matchers.*; @ESIntegTestCase.ClusterScope(numDataNodes = 0) -public class IndexRecoveryCollectorIT extends ESIntegTestCase { +public class IndexRecoveryCollectorTests extends ESIntegTestCase { @Override diff --git a/shield/src/test/java/org/elasticsearch/shield/tribe/TribeIT.java b/shield/src/test/java/org/elasticsearch/shield/tribe/TribeTests.java similarity index 99% rename from shield/src/test/java/org/elasticsearch/shield/tribe/TribeIT.java rename to shield/src/test/java/org/elasticsearch/shield/tribe/TribeTests.java index 7157194290a..af8d70c01cf 100644 --- a/shield/src/test/java/org/elasticsearch/shield/tribe/TribeIT.java +++ b/shield/src/test/java/org/elasticsearch/shield/tribe/TribeTests.java @@ -36,7 +36,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitC import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.*; -public class TribeIT extends ShieldIntegTestCase { +public class TribeTests extends ShieldIntegTestCase { //use known suite prefix since their threads are already ignored via ElasticsearchThreadFilter public static final String SECOND_CLUSTER_NODE_PREFIX = SUITE_CLUSTER_NODE_PREFIX; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleIT.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleTests.java similarity index 99% rename from watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleIT.java rename to watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleTests.java index 4ca01f71dc4..7b42cf93d13 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleIT.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/throttler/ActionThrottleTests.java @@ -50,7 +50,7 @@ import static org.elasticsearch.watcher.trigger.schedule.Schedules.interval; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; -public class ActionThrottleIT extends AbstractWatcherIntegrationTests { +public class ActionThrottleTests extends AbstractWatcherIntegrationTests { @Test public void testSingleActionAckThrottle() throws Exception { diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationIT.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationTests.java similarity index 98% rename from watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationIT.java rename to watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationTests.java index 3bd3d0635a6..e8d99a10cc2 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationIT.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/webhook/WebhookHttpsIntegrationTests.java @@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; -public class WebhookHttpsIntegrationIT extends AbstractWatcherIntegrationTests { +public class WebhookHttpsIntegrationTests extends AbstractWatcherIntegrationTests { private int webPort; private MockWebServer webServer; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutIT.java b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutTests.java similarity index 98% rename from watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutIT.java rename to watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutTests.java index e70b47b93e3..c8011833356 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutIT.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/support/http/HttpConnectionTimeoutTests.java @@ -19,7 +19,7 @@ import static org.mockito.Mockito.mock; /** */ -public class HttpConnectionTimeoutIT extends ESTestCase { +public class HttpConnectionTimeoutTests extends ESTestCase { // setting an unroutable IP to simulate a connection timeout private static final String UNROUTABLE_IP = "192.168.255.255"; diff --git a/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsIT.java b/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java similarity index 98% rename from watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsIT.java rename to watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java index 69af545dd8a..10f11c4adfa 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsIT.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/transport/action/stats/SlowWatchStatsTests.java @@ -33,7 +33,7 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; @ESIntegTestCase.ClusterScope(scope = TEST, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, numDataNodes = 2) -public class SlowWatchStatsIT extends AbstractWatcherIntegrationTests { +public class SlowWatchStatsTests extends AbstractWatcherIntegrationTests { @Override protected boolean timeWarped() {