diff --git a/src/test/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterTests.java b/src/test/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterTests.java index a7230364765..c38869b7e54 100644 --- a/src/test/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterTests.java +++ b/src/test/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterTests.java @@ -25,17 +25,17 @@ import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.WhitespaceTokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; import java.io.Reader; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; /** */ -public class TruncateTokenFilterTests { +public class TruncateTokenFilterTests extends ElasticSearchTestCase { @Test public void simpleTest() throws IOException { diff --git a/src/test/java/org/elasticsearch/ElasticSearchExceptionTests.java b/src/test/java/org/elasticsearch/ElasticSearchExceptionTests.java index d55064a49d6..dadd71d9b0a 100644 --- a/src/test/java/org/elasticsearch/ElasticSearchExceptionTests.java +++ b/src/test/java/org/elasticsearch/ElasticSearchExceptionTests.java @@ -19,17 +19,17 @@ package org.elasticsearch; -import org.elasticsearch.ElasticSearchException; import org.elasticsearch.index.Index; import org.elasticsearch.indices.IndexMissingException; import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.test.ElasticSearchTestCase; import org.elasticsearch.transport.RemoteTransportException; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class ElasticSearchExceptionTests { +public class ElasticSearchExceptionTests extends ElasticSearchTestCase { @Test public void testStatus() { diff --git a/src/test/java/org/elasticsearch/VersionTests.java b/src/test/java/org/elasticsearch/VersionTests.java index 1355a085abc..01898c11e67 100644 --- a/src/test/java/org/elasticsearch/VersionTests.java +++ b/src/test/java/org/elasticsearch/VersionTests.java @@ -19,6 +19,7 @@ package org.elasticsearch; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.Version.V_0_20_0; @@ -26,7 +27,7 @@ import static org.elasticsearch.Version.V_0_90_0; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -public class VersionTests { +public class VersionTests extends ElasticSearchTestCase { @Test public void testVersions() throws Exception { diff --git a/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java b/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java index b7c5ff6b6f6..f82445996ec 100644 --- a/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java +++ b/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java @@ -19,20 +19,20 @@ package org.elasticsearch.action.bulk; +import com.google.common.base.Charsets; import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.common.bytes.BytesArray; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; -import com.google.common.base.Charsets; - import static org.elasticsearch.common.io.Streams.copyToStringFromClasspath; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; -public class BulkRequestTests { +public class BulkRequestTests extends ElasticSearchTestCase { @Test public void testSimpleBulk1() throws Exception { diff --git a/src/test/java/org/elasticsearch/action/percolate/MultiPercolatorRequestTests.java b/src/test/java/org/elasticsearch/action/percolate/MultiPercolatorRequestTests.java index e25800584c8..1d9e400de49 100644 --- a/src/test/java/org/elasticsearch/action/percolate/MultiPercolatorRequestTests.java +++ b/src/test/java/org/elasticsearch/action/percolate/MultiPercolatorRequestTests.java @@ -22,16 +22,16 @@ import org.elasticsearch.action.support.IgnoreIndices; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.Map; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; /** */ -public class MultiPercolatorRequestTests { +public class MultiPercolatorRequestTests extends ElasticSearchTestCase { @Test public void testParseBulkRequests() throws Exception { diff --git a/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java b/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java index a69c58e0040..fa293382b1f 100644 --- a/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java +++ b/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.action.search; import org.elasticsearch.common.io.Streams; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -28,7 +29,7 @@ import static org.hamcrest.Matchers.nullValue; /** */ -public class MultiSearchRequestTests { +public class MultiSearchRequestTests extends ElasticSearchTestCase { @Test public void simpleAdd() throws Exception { diff --git a/src/test/java/org/elasticsearch/action/suggest/SuggestActionTests.java b/src/test/java/org/elasticsearch/action/suggest/SuggestActionTests.java index e244829715c..a8f14f3c0c5 100644 --- a/src/test/java/org/elasticsearch/action/suggest/SuggestActionTests.java +++ b/src/test/java/org/elasticsearch/action/suggest/SuggestActionTests.java @@ -28,7 +28,6 @@ import org.elasticsearch.search.suggest.SuggestSearchTests; import java.util.Arrays; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; /** diff --git a/src/test/java/org/elasticsearch/cluster/metadata/MappingMetaDataParserTests.java b/src/test/java/org/elasticsearch/cluster/metadata/MappingMetaDataParserTests.java index 7612c277b4b..daabf75e946 100644 --- a/src/test/java/org/elasticsearch/cluster/metadata/MappingMetaDataParserTests.java +++ b/src/test/java/org/elasticsearch/cluster/metadata/MappingMetaDataParserTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.common.compress.CompressedString; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.MapperParsingException; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; @@ -29,7 +30,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; -public class MappingMetaDataParserTests { +public class MappingMetaDataParserTests extends ElasticSearchTestCase { @Test public void testParseIdAlone() throws Exception { diff --git a/src/test/java/org/elasticsearch/cluster/metadata/MetaDataTests.java b/src/test/java/org/elasticsearch/cluster/metadata/MetaDataTests.java index 0606227a637..59e92a510ff 100644 --- a/src/test/java/org/elasticsearch/cluster/metadata/MetaDataTests.java +++ b/src/test/java/org/elasticsearch/cluster/metadata/MetaDataTests.java @@ -23,6 +23,7 @@ import com.google.common.collect.Sets; import org.elasticsearch.action.support.IgnoreIndices; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.indices.IndexMissingException; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static com.google.common.collect.Sets.newHashSet; @@ -31,7 +32,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class MetaDataTests { +public class MetaDataTests extends ElasticSearchTestCase { @Test public void convertWildcardsJustIndicesTests() { diff --git a/src/test/java/org/elasticsearch/cluster/metadata/ToAndFromJsonMetaDataTests.java b/src/test/java/org/elasticsearch/cluster/metadata/ToAndFromJsonMetaDataTests.java index 050e1cffaff..8b67ab05d2d 100644 --- a/src/test/java/org/elasticsearch/cluster/metadata/ToAndFromJsonMetaDataTests.java +++ b/src/test/java/org/elasticsearch/cluster/metadata/ToAndFromJsonMetaDataTests.java @@ -21,6 +21,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -36,7 +37,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class ToAndFromJsonMetaDataTests { +public class ToAndFromJsonMetaDataTests extends ElasticSearchTestCase { @Test public void testSimpleJsonFromAndTo() throws IOException { diff --git a/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeFiltersTests.java b/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeFiltersTests.java index 7de0627652f..eb2d88665db 100644 --- a/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeFiltersTests.java +++ b/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeFiltersTests.java @@ -24,6 +24,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.DummyTransportAddress; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.node.DiscoveryNodeFilters.OpType.AND; @@ -33,7 +34,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class DiscoveryNodeFiltersTests { +public class DiscoveryNodeFiltersTests extends ElasticSearchTestCase { @Test public void nameMatch() { diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/AddIncrementallyTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/AddIncrementallyTests.java index 6a55d61aff8..9f3e73057e7 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/AddIncrementallyTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/AddIncrementallyTests.java @@ -12,6 +12,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllo import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.ImmutableSettings; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.Matcher; import org.hamcrest.Matchers; import org.junit.Test; @@ -27,7 +28,7 @@ import static org.elasticsearch.cluster.routing.allocation.RoutingAllocationTest import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; import static org.hamcrest.MatcherAssert.assertThat; -public class AddIncrementallyTests { +public class AddIncrementallyTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(AddIncrementallyTests.class); @Test diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocatePostApiFlagTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocatePostApiFlagTests.java index 60211f2cebb..ddb441ef78a 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocatePostApiFlagTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocatePostApiFlagTests.java @@ -24,6 +24,7 @@ import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -39,7 +40,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class AllocatePostApiFlagTests { +public class AllocatePostApiFlagTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(AllocatePostApiFlagTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocationCommandsTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocationCommandsTests.java index f04832abb4e..c8e7dd9ec52 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocationCommandsTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocationCommandsTests.java @@ -37,6 +37,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -53,7 +54,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class AllocationCommandsTests { +public class AllocationCommandsTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(AllocationCommandsTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java index de32a3fa515..4fa7d95ae8e 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java @@ -36,6 +36,7 @@ import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.gateway.none.NoneGatewayAllocator; import org.elasticsearch.node.settings.NodeSettingsService; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.Matchers; import org.junit.Test; @@ -52,7 +53,7 @@ import static org.elasticsearch.cluster.routing.allocation.RoutingAllocationTest import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; import static org.hamcrest.MatcherAssert.assertThat; -public class BalanceConfigurationTests { +public class BalanceConfigurationTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(BalanceConfigurationTests.class); // TODO maybe we can randomize these numbers somehow diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/ClusterRebalanceRoutingTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/ClusterRebalanceRoutingTests.java index b92c23e4091..7313a33e6a4 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/ClusterRebalanceRoutingTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/ClusterRebalanceRoutingTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -39,7 +40,7 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class ClusterRebalanceRoutingTests { +public class ClusterRebalanceRoutingTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(ClusterRebalanceRoutingTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/ConcurrentRebalanceRoutingTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/ConcurrentRebalanceRoutingTests.java index 3a8d77769f3..930a2e9d577 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/ConcurrentRebalanceRoutingTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/ConcurrentRebalanceRoutingTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -39,7 +40,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; -public class ConcurrentRebalanceRoutingTests { +public class ConcurrentRebalanceRoutingTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(ConcurrentRebalanceRoutingTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/DeadNodesAllocationTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/DeadNodesAllocationTests.java index 1401f85a092..873724a186a 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/DeadNodesAllocationTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/DeadNodesAllocationTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands; import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -41,7 +42,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class DeadNodesAllocationTests { +public class DeadNodesAllocationTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(DeadNodesAllocationTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/DisableAllocationTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/DisableAllocationTests.java index 1e0915060d1..ebdb35f4fec 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/DisableAllocationTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/DisableAllocationTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.DisableAllocationDec import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.ImmutableSettings; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -42,7 +43,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class DisableAllocationTests { +public class DisableAllocationTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(DisableAllocationTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/ElectReplicaAsPrimaryDuringRelocationTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/ElectReplicaAsPrimaryDuringRelocationTests.java index 419bb8a3678..6bb27df3294 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/ElectReplicaAsPrimaryDuringRelocationTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/ElectReplicaAsPrimaryDuringRelocationTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -43,7 +44,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class ElectReplicaAsPrimaryDuringRelocationTests { +public class ElectReplicaAsPrimaryDuringRelocationTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(ElectReplicaAsPrimaryDuringRelocationTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedNodeRoutingTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedNodeRoutingTests.java index 017b2b51ff4..d611a5df372 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedNodeRoutingTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedNodeRoutingTests.java @@ -27,6 +27,7 @@ import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -41,7 +42,7 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class FailedNodeRoutingTests { +public class FailedNodeRoutingTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(FailedNodeRoutingTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedShardsRoutingTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedShardsRoutingTests.java index 6cd30e559a6..387d19530c8 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedShardsRoutingTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedShardsRoutingTests.java @@ -29,6 +29,7 @@ import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands; import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -45,7 +46,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class FailedShardsRoutingTests { +public class FailedShardsRoutingTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(FailedShardsRoutingTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/FilterRoutingTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/FilterRoutingTests.java index 5b19972993f..fc6d927ffd7 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/FilterRoutingTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/FilterRoutingTests.java @@ -27,6 +27,7 @@ import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.Matchers; import org.junit.Test; @@ -45,7 +46,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class FilterRoutingTests { +public class FilterRoutingTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(FilterRoutingTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/IndexBalanceTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/IndexBalanceTests.java index e88f4780a87..ab246cc5398 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/IndexBalanceTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/IndexBalanceTests.java @@ -27,6 +27,7 @@ import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.ImmutableSettings; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -44,7 +45,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class IndexBalanceTests { +public class IndexBalanceTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(IndexBalanceTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/PrimaryElectionRoutingTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/PrimaryElectionRoutingTests.java index 5710a8ae87e..777f9d439a1 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/PrimaryElectionRoutingTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/PrimaryElectionRoutingTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -43,7 +44,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class PrimaryElectionRoutingTests { +public class PrimaryElectionRoutingTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(PrimaryElectionRoutingTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/PrimaryNotRelocatedWhileBeingRecoveredTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/PrimaryNotRelocatedWhileBeingRecoveredTests.java index 7e372a38dc6..a919b9eb8ed 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/PrimaryNotRelocatedWhileBeingRecoveredTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/PrimaryNotRelocatedWhileBeingRecoveredTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -42,7 +43,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class PrimaryNotRelocatedWhileBeingRecoveredTests { +public class PrimaryNotRelocatedWhileBeingRecoveredTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(PrimaryNotRelocatedWhileBeingRecoveredTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/RebalanceAfterActiveTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/RebalanceAfterActiveTests.java index 12b2c2eb986..1591ab409c0 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/RebalanceAfterActiveTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/RebalanceAfterActiveTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -43,7 +44,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class RebalanceAfterActiveTests { +public class RebalanceAfterActiveTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(RebalanceAfterActiveTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/ReplicaAllocatedAfterPrimaryTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/ReplicaAllocatedAfterPrimaryTests.java index d6ac14f8e3e..802fee9f9e8 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/ReplicaAllocatedAfterPrimaryTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/ReplicaAllocatedAfterPrimaryTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -42,7 +43,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class ReplicaAllocatedAfterPrimaryTests { +public class ReplicaAllocatedAfterPrimaryTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(ReplicaAllocatedAfterPrimaryTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/RoutingAllocationTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/RoutingAllocationTests.java index a5e2edbb6f6..ea7cf69262d 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/RoutingAllocationTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/RoutingAllocationTests.java @@ -23,12 +23,13 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.transport.TransportAddress; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Ignore; import java.util.Map; @Ignore("Not a test") -public class RoutingAllocationTests { +public class RoutingAllocationTests extends ElasticSearchTestCase { public static DiscoveryNode newNode(String nodeId) { return new DiscoveryNode(nodeId, DummyTransportAddress.INSTANCE, Version.CURRENT); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/ShardVersioningTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/ShardVersioningTests.java index d11d078b363..46738562177 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/ShardVersioningTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/ShardVersioningTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -39,7 +40,7 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class ShardVersioningTests { +public class ShardVersioningTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(ShardVersioningTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/ShardsLimitAllocationTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/ShardsLimitAllocationTests.java index 614cf1fd5d7..2997fd54c42 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/ShardsLimitAllocationTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/ShardsLimitAllocationTests.java @@ -30,6 +30,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocatio import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.ImmutableSettings; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -45,7 +46,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class ShardsLimitAllocationTests { +public class ShardsLimitAllocationTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(ShardsLimitAllocationTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/SingleShardNoReplicasRoutingTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/SingleShardNoReplicasRoutingTests.java index b0767ea2d3c..7081f3a4d1b 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/SingleShardNoReplicasRoutingTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/SingleShardNoReplicasRoutingTests.java @@ -29,6 +29,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.List; @@ -50,7 +51,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class SingleShardNoReplicasRoutingTests { +public class SingleShardNoReplicasRoutingTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(SingleShardNoReplicasRoutingTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/SingleShardOneReplicaRoutingTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/SingleShardOneReplicaRoutingTests.java index 229516d8b73..a17655ef850 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/SingleShardOneReplicaRoutingTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/SingleShardOneReplicaRoutingTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -42,7 +43,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class SingleShardOneReplicaRoutingTests { +public class SingleShardOneReplicaRoutingTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(SingleShardOneReplicaRoutingTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/TenShardsOneReplicaRoutingTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/TenShardsOneReplicaRoutingTests.java index 6ae82dc11e3..1bbb7783c17 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/TenShardsOneReplicaRoutingTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/TenShardsOneReplicaRoutingTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -41,7 +42,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class TenShardsOneReplicaRoutingTests { +public class TenShardsOneReplicaRoutingTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(TenShardsOneReplicaRoutingTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/ThrottlingAllocationTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/ThrottlingAllocationTests.java index bc78bed88ff..6db4f00a767 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/ThrottlingAllocationTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/ThrottlingAllocationTests.java @@ -24,6 +24,7 @@ import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -40,7 +41,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class ThrottlingAllocationTests { +public class ThrottlingAllocationTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(ThrottlingAllocationTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/UpdateNumberOfReplicasTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/UpdateNumberOfReplicasTests.java index 3573f604ff5..1af71954d7d 100644 --- a/src/test/java/org/elasticsearch/cluster/routing/allocation/UpdateNumberOfReplicasTests.java +++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/UpdateNumberOfReplicasTests.java @@ -6,6 +6,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -22,7 +23,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class UpdateNumberOfReplicasTests { +public class UpdateNumberOfReplicasTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(UpdateNumberOfReplicasTests.class); diff --git a/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java b/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java index c9ca23f08a6..ed8f8fe6f95 100644 --- a/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java +++ b/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java @@ -29,6 +29,7 @@ import org.elasticsearch.cluster.routing.allocation.AllocationService; import org.elasticsearch.common.io.stream.BytesStreamInput; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.transport.DummyTransportAddress; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -41,7 +42,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class ClusterSerializationTests { +public class ClusterSerializationTests extends ElasticSearchTestCase { @Test public void testClusterStateSerialization() throws Exception { diff --git a/src/test/java/org/elasticsearch/cluster/settings/ClusterSettingsTests.java b/src/test/java/org/elasticsearch/cluster/settings/ClusterSettingsTests.java index ad1f9f121a3..c35fb0cfb67 100644 --- a/src/test/java/org/elasticsearch/cluster/settings/ClusterSettingsTests.java +++ b/src/test/java/org/elasticsearch/cluster/settings/ClusterSettingsTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.elasticsearch.node.NodeBuilder; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.Matchers; import org.junit.Test; @@ -33,7 +34,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; -public class ClusterSettingsTests { +public class ClusterSettingsTests extends ElasticSearchTestCase { @Test public void clusterNonExistingSettingsUpdate() { diff --git a/src/test/java/org/elasticsearch/cluster/settings/SettingsValidatorTests.java b/src/test/java/org/elasticsearch/cluster/settings/SettingsValidatorTests.java index 5a860335eb5..c148efe74a3 100644 --- a/src/test/java/org/elasticsearch/cluster/settings/SettingsValidatorTests.java +++ b/src/test/java/org/elasticsearch/cluster/settings/SettingsValidatorTests.java @@ -19,6 +19,7 @@ package org.elasticsearch.cluster.settings; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -28,7 +29,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class SettingsValidatorTests { +public class SettingsValidatorTests extends ElasticSearchTestCase { @Test public void testValidators() throws Exception { diff --git a/src/test/java/org/elasticsearch/cluster/structure/RoutingIteratorTests.java b/src/test/java/org/elasticsearch/cluster/structure/RoutingIteratorTests.java index fa8f5f894c5..0cfd97ce079 100644 --- a/src/test/java/org/elasticsearch/cluster/structure/RoutingIteratorTests.java +++ b/src/test/java/org/elasticsearch/cluster/structure/RoutingIteratorTests.java @@ -30,7 +30,7 @@ import org.elasticsearch.cluster.routing.operation.hash.djb.DjbHashFunction; import org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.cluster.routing.allocation.RoutingAllocationTests; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder; @@ -44,7 +44,7 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; -public class RoutingIteratorTests { +public class RoutingIteratorTests extends ElasticSearchTestCase { @Test public void testEmptyIterator() { diff --git a/src/test/java/org/elasticsearch/common/compress/CompressedStringTests.java b/src/test/java/org/elasticsearch/common/compress/CompressedStringTests.java index 70188f54975..bfb0635b589 100644 --- a/src/test/java/org/elasticsearch/common/compress/CompressedStringTests.java +++ b/src/test/java/org/elasticsearch/common/compress/CompressedStringTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.common.compress; import org.elasticsearch.common.settings.ImmutableSettings; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -31,7 +32,7 @@ import static org.hamcrest.Matchers.not; /** * */ -public class CompressedStringTests { +public class CompressedStringTests extends ElasticSearchTestCase { @Test public void simpleTestsLZF() throws IOException { diff --git a/src/test/java/org/elasticsearch/common/geo/GeoJSONShapeParserTests.java b/src/test/java/org/elasticsearch/common/geo/GeoJSONShapeParserTests.java index 359ac661508..87c49290947 100644 --- a/src/test/java/org/elasticsearch/common/geo/GeoJSONShapeParserTests.java +++ b/src/test/java/org/elasticsearch/common/geo/GeoJSONShapeParserTests.java @@ -19,36 +19,27 @@ package org.elasticsearch.common.geo; -import static org.junit.Assert.assertEquals; +import com.spatial4j.core.shape.Shape; +import com.spatial4j.core.shape.jts.JtsGeometry; +import com.spatial4j.core.shape.jts.JtsPoint; +import com.vividsolutions.jts.geom.*; +import org.elasticsearch.common.geo.builders.ShapeBuilder; +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.hamcrest.ElasticSearchGeoAssertions; +import org.junit.Test; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.elasticsearch.common.geo.builders.ShapeBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.junit.Test; - -import com.spatial4j.core.shape.Shape; -import com.spatial4j.core.shape.jts.JtsGeometry; -import com.spatial4j.core.shape.jts.JtsPoint; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.GeometryFactory; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.LinearRing; -import com.vividsolutions.jts.geom.MultiPoint; -import com.vividsolutions.jts.geom.MultiPolygon; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.geom.Polygon; - -import static org.elasticsearch.test.hamcrest.ElasticSearchGeoAssertions.assertEquals; /** * Tests for {@link GeoJSONShapeParser} */ -public class GeoJSONShapeParserTests { +public class GeoJSONShapeParserTests extends ElasticSearchTestCase { private final static GeometryFactory GEOMETRY_FACTORY = new GeometryFactory(); @@ -259,7 +250,7 @@ public class GeoJSONShapeParserTests { private void assertGeometryEquals(Shape expected, String geoJson) throws IOException { XContentParser parser = JsonXContent.jsonXContent.createParser(geoJson); parser.nextToken(); - assertEquals(ShapeBuilder.parse(parser).build(), expected); + ElasticSearchGeoAssertions.assertEquals(ShapeBuilder.parse(parser).build(), expected); } } diff --git a/src/test/java/org/elasticsearch/common/geo/ShapeBuilderTests.java b/src/test/java/org/elasticsearch/common/geo/ShapeBuilderTests.java index f0878eb39e9..001ec941d05 100644 --- a/src/test/java/org/elasticsearch/common/geo/ShapeBuilderTests.java +++ b/src/test/java/org/elasticsearch/common/geo/ShapeBuilderTests.java @@ -26,6 +26,7 @@ import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.Polygon; import org.elasticsearch.common.geo.builders.ShapeBuilder; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.test.hamcrest.ElasticSearchGeoAssertions.assertMultiLineString; @@ -34,7 +35,7 @@ import static org.junit.Assert.assertEquals; /** * Tests for {@link ShapeBuilder} */ -public class ShapeBuilderTests { +public class ShapeBuilderTests extends ElasticSearchTestCase { @Test public void testNewPoint() { diff --git a/src/test/java/org/elasticsearch/common/io/StreamsTests.java b/src/test/java/org/elasticsearch/common/io/StreamsTests.java index 79387063cde..fd5a01d94d2 100644 --- a/src/test/java/org/elasticsearch/common/io/StreamsTests.java +++ b/src/test/java/org/elasticsearch/common/io/StreamsTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.common.io; import com.google.common.base.Charsets; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.*; @@ -32,7 +33,7 @@ import static org.hamcrest.Matchers.equalTo; /** * Unit tests for {@link org.elasticsearch.common.io.Streams}. */ -public class StreamsTests { +public class StreamsTests extends ElasticSearchTestCase { @Test public void testCopyFromInputStream() throws IOException { diff --git a/src/test/java/org/elasticsearch/common/io/streams/BytesStreamsTests.java b/src/test/java/org/elasticsearch/common/io/streams/BytesStreamsTests.java index 7f53866c507..0d1f0539e25 100644 --- a/src/test/java/org/elasticsearch/common/io/streams/BytesStreamsTests.java +++ b/src/test/java/org/elasticsearch/common/io/streams/BytesStreamsTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.common.io.streams; import org.apache.lucene.util.Constants; import org.elasticsearch.common.io.stream.BytesStreamInput; import org.elasticsearch.common.io.stream.BytesStreamOutput; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -32,7 +33,7 @@ import static org.junit.Assume.assumeTrue; /** * */ -public class BytesStreamsTests { +public class BytesStreamsTests extends ElasticSearchTestCase { @Test public void testSimpleStreams() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/io/streams/HandlesStreamsTests.java b/src/test/java/org/elasticsearch/common/io/streams/HandlesStreamsTests.java index 5914d36d063..2749e460407 100644 --- a/src/test/java/org/elasticsearch/common/io/streams/HandlesStreamsTests.java +++ b/src/test/java/org/elasticsearch/common/io/streams/HandlesStreamsTests.java @@ -23,6 +23,7 @@ import org.elasticsearch.common.io.stream.BytesStreamInput; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.HandlesStreamInput; import org.elasticsearch.common.io.stream.HandlesStreamOutput; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -31,7 +32,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class HandlesStreamsTests { +public class HandlesStreamsTests extends ElasticSearchTestCase { @Test public void testSharedStringHandles() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/joda/DateMathParserTests.java b/src/test/java/org/elasticsearch/common/joda/DateMathParserTests.java index 4b1a81f6407..5d5aec7b2f0 100644 --- a/src/test/java/org/elasticsearch/common/joda/DateMathParserTests.java +++ b/src/test/java/org/elasticsearch/common/joda/DateMathParserTests.java @@ -1,5 +1,6 @@ package org.elasticsearch.common.joda; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.concurrent.TimeUnit; @@ -9,7 +10,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class DateMathParserTests { +public class DateMathParserTests extends ElasticSearchTestCase { @Test public void dataMathTests() { diff --git a/src/test/java/org/elasticsearch/common/lucene/all/SimpleAllTests.java b/src/test/java/org/elasticsearch/common/lucene/all/SimpleAllTests.java index cf980c27eb5..41bb2a987fb 100644 --- a/src/test/java/org/elasticsearch/common/lucene/all/SimpleAllTests.java +++ b/src/test/java/org/elasticsearch/common/lucene/all/SimpleAllTests.java @@ -29,6 +29,7 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -39,7 +40,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class SimpleAllTests { +public class SimpleAllTests extends ElasticSearchTestCase { @Test public void testAllEntriesRead() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/lucene/search/MatchAllDocsFilterTests.java b/src/test/java/org/elasticsearch/common/lucene/search/MatchAllDocsFilterTests.java index e3578d1d95f..767ad92e7c2 100644 --- a/src/test/java/org/elasticsearch/common/lucene/search/MatchAllDocsFilterTests.java +++ b/src/test/java/org/elasticsearch/common/lucene/search/MatchAllDocsFilterTests.java @@ -30,6 +30,7 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -38,7 +39,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class MatchAllDocsFilterTests { +public class MatchAllDocsFilterTests extends ElasticSearchTestCase { @Test public void testMatchAllDocsFilter() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/lucene/search/MoreLikeThisQueryTests.java b/src/test/java/org/elasticsearch/common/lucene/search/MoreLikeThisQueryTests.java index b630ddeaa0d..f800acfb716 100644 --- a/src/test/java/org/elasticsearch/common/lucene/search/MoreLikeThisQueryTests.java +++ b/src/test/java/org/elasticsearch/common/lucene/search/MoreLikeThisQueryTests.java @@ -30,6 +30,7 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -38,7 +39,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class MoreLikeThisQueryTests { +public class MoreLikeThisQueryTests extends ElasticSearchTestCase { @Test public void testSimple() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/lucene/search/MultiPhrasePrefixQueryTests.java b/src/test/java/org/elasticsearch/common/lucene/search/MultiPhrasePrefixQueryTests.java index b9dd7675994..1ec5bff71de 100644 --- a/src/test/java/org/elasticsearch/common/lucene/search/MultiPhrasePrefixQueryTests.java +++ b/src/test/java/org/elasticsearch/common/lucene/search/MultiPhrasePrefixQueryTests.java @@ -26,12 +26,13 @@ import org.apache.lucene.index.*; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.RAMDirectory; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class MultiPhrasePrefixQueryTests { +public class MultiPhrasePrefixQueryTests extends ElasticSearchTestCase { @Test public void simpleTests() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/lucene/search/TermsFilterTests.java b/src/test/java/org/elasticsearch/common/lucene/search/TermsFilterTests.java index eb22c09e714..4861d1fe7d0 100644 --- a/src/test/java/org/elasticsearch/common/lucene/search/TermsFilterTests.java +++ b/src/test/java/org/elasticsearch/common/lucene/search/TermsFilterTests.java @@ -32,6 +32,7 @@ import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.FixedBitSet; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.docset.DocIdSets; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -40,7 +41,7 @@ import static org.hamcrest.Matchers.nullValue; /** */ -public class TermsFilterTests { +public class TermsFilterTests extends ElasticSearchTestCase { @Test public void testTermFilter() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterLuceneTests.java b/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterLuceneTests.java index 53b68909cdc..87562f86586 100644 --- a/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterLuceneTests.java +++ b/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterLuceneTests.java @@ -13,6 +13,7 @@ import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -25,13 +26,14 @@ import static org.hamcrest.core.IsEqual.equalTo; /** * Tests ported from Lucene. */ -public class XBooleanFilterLuceneTests { +public class XBooleanFilterLuceneTests extends ElasticSearchTestCase { private Directory directory; private AtomicReader reader; @Before public void setUp() throws Exception { + super.setUp(); directory = new RAMDirectory(); IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(Lucene.VERSION, new WhitespaceAnalyzer(Lucene.VERSION))); @@ -48,6 +50,7 @@ public class XBooleanFilterLuceneTests { @After public void tearDown() throws Exception { + super.tearDown(); reader.close(); directory.close(); } diff --git a/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterTests.java b/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterTests.java index 243bf044156..27c79e30d56 100644 --- a/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterTests.java +++ b/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterTests.java @@ -15,6 +15,7 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.FixedBitSet; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -23,18 +24,18 @@ import java.util.ArrayList; import java.util.List; import static org.apache.lucene.search.BooleanClause.Occur.*; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsEqual.equalTo; /** */ -public class XBooleanFilterTests { +public class XBooleanFilterTests extends ElasticSearchTestCase { private Directory directory; private AtomicReader reader; @Before public void setup() throws Exception { + super.setUp(); char[][] documentMatrix = new char[][] { {'a', 'b', 'c', 'd', 'v'}, {'a', 'b', 'c', 'd', 'z'}, @@ -58,6 +59,7 @@ public class XBooleanFilterTests { @After public void tearDown() throws Exception { + super.tearDown(); reader.close(); directory.close(); } diff --git a/src/test/java/org/elasticsearch/common/lucene/store/InputStreamIndexInputTests.java b/src/test/java/org/elasticsearch/common/lucene/store/InputStreamIndexInputTests.java index 96cc86b4081..5dfdd42cca6 100644 --- a/src/test/java/org/elasticsearch/common/lucene/store/InputStreamIndexInputTests.java +++ b/src/test/java/org/elasticsearch/common/lucene/store/InputStreamIndexInputTests.java @@ -23,6 +23,7 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.RAMDirectory; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -34,7 +35,7 @@ import static org.hamcrest.Matchers.lessThan; /** * */ -public class InputStreamIndexInputTests { +public class InputStreamIndexInputTests extends ElasticSearchTestCase { @Test public void testSingleReadSingleByteLimit() throws IOException { diff --git a/src/test/java/org/elasticsearch/common/path/PathTrieTests.java b/src/test/java/org/elasticsearch/common/path/PathTrieTests.java index aa4fa50437e..d7d01478497 100644 --- a/src/test/java/org/elasticsearch/common/path/PathTrieTests.java +++ b/src/test/java/org/elasticsearch/common/path/PathTrieTests.java @@ -19,6 +19,7 @@ package org.elasticsearch.common.path; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.Map; @@ -31,7 +32,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class PathTrieTests { +public class PathTrieTests extends ElasticSearchTestCase { @Test public void testPath() { diff --git a/src/test/java/org/elasticsearch/common/settings/loader/JsonSettingsLoaderTests.java b/src/test/java/org/elasticsearch/common/settings/loader/JsonSettingsLoaderTests.java index c2e853928ec..e2df888fe26 100644 --- a/src/test/java/org/elasticsearch/common/settings/loader/JsonSettingsLoaderTests.java +++ b/src/test/java/org/elasticsearch/common/settings/loader/JsonSettingsLoaderTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.common.settings.loader; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; @@ -29,7 +30,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class JsonSettingsLoaderTests { +public class JsonSettingsLoaderTests extends ElasticSearchTestCase { @Test public void testSimpleJsonSettings() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java b/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java index ebe7ec5770d..ef97acd1d2a 100644 --- a/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java +++ b/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.common.settings.loader; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; @@ -29,7 +30,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class YamlSettingsLoaderTests { +public class YamlSettingsLoaderTests extends ElasticSearchTestCase { @Test public void testSimpleYamlSettings() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/unit/ByteSizeUnitTests.java b/src/test/java/org/elasticsearch/common/unit/ByteSizeUnitTests.java index 4a79db26f34..0dcb5188517 100644 --- a/src/test/java/org/elasticsearch/common/unit/ByteSizeUnitTests.java +++ b/src/test/java/org/elasticsearch/common/unit/ByteSizeUnitTests.java @@ -19,6 +19,7 @@ package org.elasticsearch.common.unit; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.common.unit.ByteSizeUnit.*; @@ -28,7 +29,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class ByteSizeUnitTests { +public class ByteSizeUnitTests extends ElasticSearchTestCase { @Test public void testBytes() { diff --git a/src/test/java/org/elasticsearch/common/unit/ByteSizeValueTests.java b/src/test/java/org/elasticsearch/common/unit/ByteSizeValueTests.java index 1fcff0df626..7b0a9bd7128 100644 --- a/src/test/java/org/elasticsearch/common/unit/ByteSizeValueTests.java +++ b/src/test/java/org/elasticsearch/common/unit/ByteSizeValueTests.java @@ -19,6 +19,7 @@ package org.elasticsearch.common.unit; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.MatcherAssert; import org.junit.Test; @@ -29,7 +30,7 @@ import static org.hamcrest.Matchers.is; /** * */ -public class ByteSizeValueTests { +public class ByteSizeValueTests extends ElasticSearchTestCase { @Test public void testActual() { diff --git a/src/test/java/org/elasticsearch/common/unit/DistanceUnitTests.java b/src/test/java/org/elasticsearch/common/unit/DistanceUnitTests.java index 7ffc45ed71c..ca849f56095 100644 --- a/src/test/java/org/elasticsearch/common/unit/DistanceUnitTests.java +++ b/src/test/java/org/elasticsearch/common/unit/DistanceUnitTests.java @@ -19,6 +19,7 @@ package org.elasticsearch.common.unit; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -28,7 +29,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class DistanceUnitTests { +public class DistanceUnitTests extends ElasticSearchTestCase { @Test public void testSimpleDistanceUnit() { diff --git a/src/test/java/org/elasticsearch/common/unit/TimeValueTests.java b/src/test/java/org/elasticsearch/common/unit/TimeValueTests.java index 5439259a11d..d01555eb550 100644 --- a/src/test/java/org/elasticsearch/common/unit/TimeValueTests.java +++ b/src/test/java/org/elasticsearch/common/unit/TimeValueTests.java @@ -19,6 +19,7 @@ package org.elasticsearch.common.unit; +import org.elasticsearch.test.ElasticSearchTestCase; import org.joda.time.PeriodType; import org.junit.Test; @@ -31,7 +32,7 @@ import static org.hamcrest.Matchers.lessThan; /** * */ -public class TimeValueTests { +public class TimeValueTests extends ElasticSearchTestCase { @Test public void testSimple() { diff --git a/src/test/java/org/elasticsearch/common/util/SlicedDoubleListTests.java b/src/test/java/org/elasticsearch/common/util/SlicedDoubleListTests.java index 948da7bdf5a..8b8282d667d 100644 --- a/src/test/java/org/elasticsearch/common/util/SlicedDoubleListTests.java +++ b/src/test/java/org/elasticsearch/common/util/SlicedDoubleListTests.java @@ -18,15 +18,16 @@ */ package org.elasticsearch.common.util; +import org.elasticsearch.test.ElasticSearchTestCase; +import org.junit.Test; + import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -import org.junit.Test; - /** * Tests for {@link SlicedDoubleList} */ -public class SlicedDoubleListTests { +public class SlicedDoubleListTests extends ElasticSearchTestCase { @Test public void testCapacity() { diff --git a/src/test/java/org/elasticsearch/common/util/SlicedLongListTests.java b/src/test/java/org/elasticsearch/common/util/SlicedLongListTests.java index 8ad7988fd41..b51421fef2a 100644 --- a/src/test/java/org/elasticsearch/common/util/SlicedLongListTests.java +++ b/src/test/java/org/elasticsearch/common/util/SlicedLongListTests.java @@ -18,6 +18,7 @@ */ package org.elasticsearch.common.util; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -26,7 +27,7 @@ import static org.hamcrest.Matchers.equalTo; /** * Tests for {@link SlicedLongList} */ -public class SlicedLongListTests { +public class SlicedLongListTests extends ElasticSearchTestCase { @Test public void testCapacity() { diff --git a/src/test/java/org/elasticsearch/common/util/SlicedObjectListTests.java b/src/test/java/org/elasticsearch/common/util/SlicedObjectListTests.java index b55319090cd..8662cc4e72a 100644 --- a/src/test/java/org/elasticsearch/common/util/SlicedObjectListTests.java +++ b/src/test/java/org/elasticsearch/common/util/SlicedObjectListTests.java @@ -18,16 +18,17 @@ */ package org.elasticsearch.common.util; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; - import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.RamUsageEstimator; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; /** * Tests for {@link SlicedObjectList} */ -public class SlicedObjectListTests { +public class SlicedObjectListTests extends ElasticSearchTestCase { public class TestList extends SlicedObjectList { diff --git a/src/test/java/org/elasticsearch/common/util/concurrent/PrioritizedExecutorsTests.java b/src/test/java/org/elasticsearch/common/util/concurrent/PrioritizedExecutorsTests.java index 969a1a856fa..9ec697cfcbc 100644 --- a/src/test/java/org/elasticsearch/common/util/concurrent/PrioritizedExecutorsTests.java +++ b/src/test/java/org/elasticsearch/common/util/concurrent/PrioritizedExecutorsTests.java @@ -21,6 +21,7 @@ package org.elasticsearch.common.util.concurrent; import org.elasticsearch.common.Priority; import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.ArrayList; @@ -34,7 +35,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class PrioritizedExecutorsTests { +public class PrioritizedExecutorsTests extends ElasticSearchTestCase { @Test public void testPriorityQueue() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/xcontent/builder/BuilderRawFieldTests.java b/src/test/java/org/elasticsearch/common/xcontent/builder/BuilderRawFieldTests.java index 697897f1110..2974d16e961 100644 --- a/src/test/java/org/elasticsearch/common/xcontent/builder/BuilderRawFieldTests.java +++ b/src/test/java/org/elasticsearch/common/xcontent/builder/BuilderRawFieldTests.java @@ -24,6 +24,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -34,7 +35,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class BuilderRawFieldTests { +public class BuilderRawFieldTests extends ElasticSearchTestCase { @Test public void testJsonRawField() throws IOException { diff --git a/src/test/java/org/elasticsearch/common/xcontent/builder/XContentBuilderTests.java b/src/test/java/org/elasticsearch/common/xcontent/builder/XContentBuilderTests.java index b0cc0d383bc..2a36d38a96c 100644 --- a/src/test/java/org/elasticsearch/common/xcontent/builder/XContentBuilderTests.java +++ b/src/test/java/org/elasticsearch/common/xcontent/builder/XContentBuilderTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentGenerator; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.*; @@ -38,7 +39,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class XContentBuilderTests { +public class XContentBuilderTests extends ElasticSearchTestCase { @Test public void verifyReuseJsonGenerator() throws Exception { diff --git a/src/test/java/org/elasticsearch/common/xcontent/smile/JsonVsSmileTests.java b/src/test/java/org/elasticsearch/common/xcontent/smile/JsonVsSmileTests.java index d89afe93b25..bc93cc5c845 100644 --- a/src/test/java/org/elasticsearch/common/xcontent/smile/JsonVsSmileTests.java +++ b/src/test/java/org/elasticsearch/common/xcontent/smile/JsonVsSmileTests.java @@ -24,6 +24,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentGenerator; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -35,7 +36,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class JsonVsSmileTests { +public class JsonVsSmileTests extends ElasticSearchTestCase { // @Test public void testBinarySmileField() throws Exception { // JsonGenerator gen = new SmileFactory().createJsonGenerator(new ByteArrayOutputStream()); diff --git a/src/test/java/org/elasticsearch/common/xcontent/support/XContentHelperTests.java b/src/test/java/org/elasticsearch/common/xcontent/support/XContentHelperTests.java index 28a16f353d6..33a5f5f607d 100644 --- a/src/test/java/org/elasticsearch/common/xcontent/support/XContentHelperTests.java +++ b/src/test/java/org/elasticsearch/common/xcontent/support/XContentHelperTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.common.xcontent.support; import org.elasticsearch.common.xcontent.XContentHelper; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.Matchers; import org.junit.Test; @@ -30,7 +31,7 @@ import java.util.Map; import static org.hamcrest.MatcherAssert.assertThat; -public class XContentHelperTests { +public class XContentHelperTests extends ElasticSearchTestCase { Map getMap(Object... keyValues) { Map map = new HashMap(); diff --git a/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java b/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java index ddd71c086ae..e190d93284b 100644 --- a/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java +++ b/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.Arrays; @@ -38,7 +39,7 @@ import static org.hamcrest.core.IsEqual.equalTo; /** */ -public class XContentMapValuesTests { +public class XContentMapValuesTests extends ElasticSearchTestCase { @Test public void testFilter() throws Exception { diff --git a/src/test/java/org/elasticsearch/deps/jackson/JacksonLocationTests.java b/src/test/java/org/elasticsearch/deps/jackson/JacksonLocationTests.java index f0a0abd826c..39744ee07ea 100644 --- a/src/test/java/org/elasticsearch/deps/jackson/JacksonLocationTests.java +++ b/src/test/java/org/elasticsearch/deps/jackson/JacksonLocationTests.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import org.elasticsearch.common.io.stream.BytesStreamOutput; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -34,7 +35,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class JacksonLocationTests { +public class JacksonLocationTests extends ElasticSearchTestCase { @Test public void testLocationExtraction() throws IOException { diff --git a/src/test/java/org/elasticsearch/deps/joda/SimpleJodaTests.java b/src/test/java/org/elasticsearch/deps/joda/SimpleJodaTests.java index 013e139db0a..d504aacbdc3 100644 --- a/src/test/java/org/elasticsearch/deps/joda/SimpleJodaTests.java +++ b/src/test/java/org/elasticsearch/deps/joda/SimpleJodaTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.deps.joda; import org.elasticsearch.common.joda.FormatDateTimeFormatter; import org.elasticsearch.common.joda.Joda; import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.test.ElasticSearchTestCase; import org.joda.time.DateTimeZone; import org.joda.time.MutableDateTime; import org.joda.time.format.*; @@ -36,7 +37,7 @@ import static org.junit.Assert.fail; /** * */ -public class SimpleJodaTests { +public class SimpleJodaTests extends ElasticSearchTestCase { @Test public void testMultiParsers() { diff --git a/src/test/java/org/elasticsearch/deps/joda/TimeZoneRoundingTests.java b/src/test/java/org/elasticsearch/deps/joda/TimeZoneRoundingTests.java index 42e725035ad..3e0502fc28b 100644 --- a/src/test/java/org/elasticsearch/deps/joda/TimeZoneRoundingTests.java +++ b/src/test/java/org/elasticsearch/deps/joda/TimeZoneRoundingTests.java @@ -21,6 +21,7 @@ package org.elasticsearch.deps.joda; import org.elasticsearch.common.joda.TimeZoneRounding; import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.test.ElasticSearchTestCase; import org.joda.time.Chronology; import org.joda.time.DateTimeZone; import org.joda.time.chrono.ISOChronology; @@ -32,7 +33,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class TimeZoneRoundingTests { +public class TimeZoneRoundingTests extends ElasticSearchTestCase { @Test public void testUTCMonthRounding() { diff --git a/src/test/java/org/elasticsearch/deps/lucene/SimpleLuceneTests.java b/src/test/java/org/elasticsearch/deps/lucene/SimpleLuceneTests.java index 785503a763f..9d80b7cc720 100644 --- a/src/test/java/org/elasticsearch/deps/lucene/SimpleLuceneTests.java +++ b/src/test/java/org/elasticsearch/deps/lucene/SimpleLuceneTests.java @@ -27,6 +27,7 @@ import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.NumericUtils; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -38,7 +39,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class SimpleLuceneTests { +public class SimpleLuceneTests extends ElasticSearchTestCase { @Test public void testSortValues() throws Exception { diff --git a/src/test/java/org/elasticsearch/deps/lucene/VectorHighlighterTests.java b/src/test/java/org/elasticsearch/deps/lucene/VectorHighlighterTests.java index ee8addee422..da8519b07d1 100644 --- a/src/test/java/org/elasticsearch/deps/lucene/VectorHighlighterTests.java +++ b/src/test/java/org/elasticsearch/deps/lucene/VectorHighlighterTests.java @@ -29,6 +29,7 @@ import org.apache.lucene.search.vectorhighlight.FastVectorHighlighter; import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -37,7 +38,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class VectorHighlighterTests { +public class VectorHighlighterTests extends ElasticSearchTestCase { @Test public void testVectorHighlighter() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/VersionTypeTests.java b/src/test/java/org/elasticsearch/index/VersionTypeTests.java index 263b87877b8..5a2be25d383 100644 --- a/src/test/java/org/elasticsearch/index/VersionTypeTests.java +++ b/src/test/java/org/elasticsearch/index/VersionTypeTests.java @@ -20,14 +20,12 @@ package org.elasticsearch.index; import org.elasticsearch.common.lucene.uid.Versions; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -public class VersionTypeTests { +public class VersionTypeTests extends ElasticSearchTestCase { @Test public void testInternalVersionConflict() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/aliases/IndexAliasesServiceTests.java b/src/test/java/org/elasticsearch/index/aliases/IndexAliasesServiceTests.java index d99c4426156..20a86476287 100644 --- a/src/test/java/org/elasticsearch/index/aliases/IndexAliasesServiceTests.java +++ b/src/test/java/org/elasticsearch/index/aliases/IndexAliasesServiceTests.java @@ -46,6 +46,7 @@ import org.elasticsearch.index.similarity.SimilarityModule; import org.elasticsearch.indices.InvalidAliasNameException; import org.elasticsearch.indices.query.IndicesQueriesModule; import org.elasticsearch.script.ScriptModule; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -58,7 +59,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class IndexAliasesServiceTests { +public class IndexAliasesServiceTests extends ElasticSearchTestCase { public static IndexAliasesService newIndexAliasesService() { return new IndexAliasesService(new Index("test"), ImmutableSettings.Builder.EMPTY_SETTINGS, newIndexQueryParserService()); } diff --git a/src/test/java/org/elasticsearch/index/analysis/AnalysisModuleTests.java b/src/test/java/org/elasticsearch/index/analysis/AnalysisModuleTests.java index d3653e791f6..830a37d85af 100644 --- a/src/test/java/org/elasticsearch/index/analysis/AnalysisModuleTests.java +++ b/src/test/java/org/elasticsearch/index/analysis/AnalysisModuleTests.java @@ -43,6 +43,7 @@ import org.elasticsearch.index.analysis.filter1.MyFilterTokenFilterFactory; import org.elasticsearch.index.settings.IndexSettingsModule; import org.elasticsearch.indices.analysis.IndicesAnalysisModule; import org.elasticsearch.indices.analysis.IndicesAnalysisService; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.MatcherAssert; import org.junit.Test; @@ -57,7 +58,7 @@ import static org.hamcrest.Matchers.instanceOf; /** * */ -public class AnalysisModuleTests { +public class AnalysisModuleTests extends ElasticSearchTestCase { @Test public void testSimpleConfigurationJson() { diff --git a/src/test/java/org/elasticsearch/index/analysis/CompoundAnalysisTests.java b/src/test/java/org/elasticsearch/index/analysis/CompoundAnalysisTests.java index c7ace081898..001e4e2dac7 100644 --- a/src/test/java/org/elasticsearch/index/analysis/CompoundAnalysisTests.java +++ b/src/test/java/org/elasticsearch/index/analysis/CompoundAnalysisTests.java @@ -36,6 +36,7 @@ import org.elasticsearch.index.analysis.compound.DictionaryCompoundWordTokenFilt import org.elasticsearch.index.settings.IndexSettingsModule; import org.elasticsearch.indices.analysis.IndicesAnalysisModule; import org.elasticsearch.indices.analysis.IndicesAnalysisService; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.MatcherAssert; import org.junit.Test; @@ -48,7 +49,7 @@ import static org.hamcrest.Matchers.*; /** */ -public class CompoundAnalysisTests { +public class CompoundAnalysisTests extends ElasticSearchTestCase { @Test public void testDefaultsCompoundAnalysis() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/cache/filter/FilterCacheTests.java b/src/test/java/org/elasticsearch/index/cache/filter/FilterCacheTests.java index 95defe25723..cc5e8baf123 100644 --- a/src/test/java/org/elasticsearch/index/cache/filter/FilterCacheTests.java +++ b/src/test/java/org/elasticsearch/index/cache/filter/FilterCacheTests.java @@ -35,6 +35,7 @@ import org.elasticsearch.common.lucene.search.XConstantScoreQuery; import org.elasticsearch.common.lucene.search.XFilteredQuery; import org.elasticsearch.index.Index; import org.elasticsearch.index.cache.filter.none.NoneFilterCache; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -46,7 +47,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class FilterCacheTests { +public class FilterCacheTests extends ElasticSearchTestCase { @Test diff --git a/src/test/java/org/elasticsearch/index/cache/id/SimpleIdCacheTests.java b/src/test/java/org/elasticsearch/index/cache/id/SimpleIdCacheTests.java index d54a94c4ddd..b0ff835fb27 100644 --- a/src/test/java/org/elasticsearch/index/cache/id/SimpleIdCacheTests.java +++ b/src/test/java/org/elasticsearch/index/cache/id/SimpleIdCacheTests.java @@ -55,6 +55,7 @@ import org.elasticsearch.index.settings.IndexSettingsService; import org.elasticsearch.index.shard.service.IndexShard; import org.elasticsearch.index.similarity.SimilarityService; import org.elasticsearch.index.store.IndexStore; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -68,7 +69,7 @@ import static org.hamcrest.Matchers.nullValue; /** */ -public class SimpleIdCacheTests { +public class SimpleIdCacheTests extends ElasticSearchTestCase { @Test public void testDeletedDocuments() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/codec/postingformat/DefaultPostingsFormatTests.java b/src/test/java/org/elasticsearch/index/codec/postingformat/DefaultPostingsFormatTests.java index 114663e47ea..746ed95f588 100644 --- a/src/test/java/org/elasticsearch/index/codec/postingformat/DefaultPostingsFormatTests.java +++ b/src/test/java/org/elasticsearch/index/codec/postingformat/DefaultPostingsFormatTests.java @@ -32,6 +32,7 @@ import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.index.codec.postingsformat.BloomFilterPostingsFormat; import org.elasticsearch.index.codec.postingsformat.ElasticSearch090PostingsFormat; import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -46,7 +47,7 @@ import static org.hamcrest.Matchers.*; /** * Simple smoke test for {@link ElasticSearch090PostingsFormat} */ -public class DefaultPostingsFormatTests { +public class DefaultPostingsFormatTests extends ElasticSearchTestCase { private final class TestCodec extends Lucene45Codec { diff --git a/src/test/java/org/elasticsearch/index/deletionpolicy/SnapshotDeletionPolicyTests.java b/src/test/java/org/elasticsearch/index/deletionpolicy/SnapshotDeletionPolicyTests.java index 44d10ebb4bc..87dd578203e 100644 --- a/src/test/java/org/elasticsearch/index/deletionpolicy/SnapshotDeletionPolicyTests.java +++ b/src/test/java/org/elasticsearch/index/deletionpolicy/SnapshotDeletionPolicyTests.java @@ -28,19 +28,19 @@ import org.apache.lucene.store.RAMDirectory; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; import static org.apache.lucene.index.DirectoryReader.listCommits; import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; /** * A set of tests for {@link org.elasticsearch.index.deletionpolicy.SnapshotDeletionPolicy}. */ -public class SnapshotDeletionPolicyTests { +public class SnapshotDeletionPolicyTests extends ElasticSearchTestCase { protected final ShardId shardId = new ShardId(new Index("index"), 1); @@ -50,16 +50,17 @@ public class SnapshotDeletionPolicyTests { @Before public void setUp() throws Exception { + super.setUp(); dir = new RAMDirectory(); deletionPolicy = new SnapshotDeletionPolicy(new KeepOnlyLastDeletionPolicy(shardId, EMPTY_SETTINGS)); - // LUCENE 4 UPGRADE: Not sure about version. - indexWriter = new IndexWriter(dir, new IndexWriterConfig(Lucene.VERSION, Lucene.STANDARD_ANALYZER) + indexWriter = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, Lucene.STANDARD_ANALYZER) .setIndexDeletionPolicy(deletionPolicy) .setOpenMode(IndexWriterConfig.OpenMode.CREATE)); } @After public void tearDown() throws Exception { + super.tearDown(); indexWriter.close(); dir.close(); } diff --git a/src/test/java/org/elasticsearch/index/fielddata/ordinals/SingleOrdinalsTests.java b/src/test/java/org/elasticsearch/index/fielddata/ordinals/SingleOrdinalsTests.java index f0fc111d9ed..cefaab37687 100644 --- a/src/test/java/org/elasticsearch/index/fielddata/ordinals/SingleOrdinalsTests.java +++ b/src/test/java/org/elasticsearch/index/fielddata/ordinals/SingleOrdinalsTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.index.fielddata.ordinals; import org.elasticsearch.common.settings.ImmutableSettings; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -31,7 +32,7 @@ import static org.hamcrest.Matchers.*; /** */ -public class SingleOrdinalsTests { +public class SingleOrdinalsTests extends ElasticSearchTestCase { @Test public void testSvValues() throws IOException { diff --git a/src/test/java/org/elasticsearch/index/gateway/CommitPointsTests.java b/src/test/java/org/elasticsearch/index/gateway/CommitPointsTests.java index 46e60332d17..613dd090aab 100644 --- a/src/test/java/org/elasticsearch/index/gateway/CommitPointsTests.java +++ b/src/test/java/org/elasticsearch/index/gateway/CommitPointsTests.java @@ -21,9 +21,9 @@ package org.elasticsearch.index.gateway; import com.google.common.base.Charsets; import com.google.common.collect.Lists; - import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.ArrayList; @@ -35,7 +35,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class CommitPointsTests { +public class CommitPointsTests extends ElasticSearchTestCase { private final ESLogger logger = Loggers.getLogger(CommitPointsTests.class); diff --git a/src/test/java/org/elasticsearch/index/mapper/UidTests.java b/src/test/java/org/elasticsearch/index/mapper/UidTests.java index c6f34227f77..91d4a92261f 100644 --- a/src/test/java/org/elasticsearch/index/mapper/UidTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/UidTests.java @@ -20,11 +20,13 @@ package org.elasticsearch.index.mapper; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.bytes.HashedBytesArray; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; + import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class UidTests { +public class UidTests extends ElasticSearchTestCase { @Test public void testCreateAndSplitId() { diff --git a/src/test/java/org/elasticsearch/index/mapper/all/SimpleAllMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/all/SimpleAllMapperTests.java index 9096a4473b8..ce864f47bc1 100644 --- a/src/test/java/org/elasticsearch/index/mapper/all/SimpleAllMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/all/SimpleAllMapperTests.java @@ -30,6 +30,7 @@ import org.elasticsearch.common.lucene.all.AllTokenStream; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.Matchers; import org.junit.Test; @@ -41,7 +42,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class SimpleAllMapperTests { +public class SimpleAllMapperTests extends ElasticSearchTestCase { @Test public void testSimpleAllMappers() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/analyzer/AnalyzerMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/analyzer/AnalyzerMapperTests.java index 616ae96a7e6..b41b8f12f11 100644 --- a/src/test/java/org/elasticsearch/index/mapper/analyzer/AnalyzerMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/analyzer/AnalyzerMapperTests.java @@ -23,8 +23,9 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.analysis.FieldNameAnalyzer; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -34,7 +35,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class AnalyzerMapperTests { +public class AnalyzerMapperTests extends ElasticSearchTestCase { @Test public void testAnalyzerMapping() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/boost/BoostMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/boost/BoostMappingTests.java index fc673a96f47..c3ac30a50c9 100644 --- a/src/test/java/org/elasticsearch/index/mapper/boost/BoostMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/boost/BoostMappingTests.java @@ -22,9 +22,10 @@ package org.elasticsearch.index.mapper.boost; import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.internal.BoostFieldMapper; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -32,7 +33,7 @@ import static org.hamcrest.Matchers.equalTo; /** */ -public class BoostMappingTests { +public class BoostMappingTests extends ElasticSearchTestCase { @Test public void testDefaultMapping() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/boost/CustomBoostMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/boost/CustomBoostMappingTests.java index faaafd89c96..60ed34004ca 100644 --- a/src/test/java/org/elasticsearch/index/mapper/boost/CustomBoostMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/boost/CustomBoostMappingTests.java @@ -21,14 +21,15 @@ package org.elasticsearch.index.mapper.boost; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class CustomBoostMappingTests { +public class CustomBoostMappingTests extends ElasticSearchTestCase { @Test public void testCustomBoostValues() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/boost/FieldLevelBoostTests.java b/src/test/java/org/elasticsearch/index/mapper/boost/FieldLevelBoostTests.java index f3919e8d89c..e39be5c3638 100644 --- a/src/test/java/org/elasticsearch/index/mapper/boost/FieldLevelBoostTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/boost/FieldLevelBoostTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -33,7 +34,7 @@ import static org.hamcrest.Matchers.closeTo; /** */ -public class FieldLevelBoostTests { +public class FieldLevelBoostTests extends ElasticSearchTestCase { @Test public void testFieldLevelBoost() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/camelcase/CamelCaseFieldNameTests.java b/src/test/java/org/elasticsearch/index/mapper/camelcase/CamelCaseFieldNameTests.java index 66d8546e7e7..bd0d65b250c 100644 --- a/src/test/java/org/elasticsearch/index/mapper/camelcase/CamelCaseFieldNameTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/camelcase/CamelCaseFieldNameTests.java @@ -21,8 +21,9 @@ package org.elasticsearch.index.mapper.camelcase; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -32,7 +33,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class CamelCaseFieldNameTests { +public class CamelCaseFieldNameTests extends ElasticSearchTestCase { @Test public void testCamelCaseFieldNameStaysAsIs() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapperTests.java index c88fef06327..0c24528da82 100644 --- a/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapperTests.java @@ -22,8 +22,9 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.core.CompletionFieldMapper; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -34,7 +35,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; -public class CompletionFieldMapperTests { +public class CompletionFieldMapperTests extends ElasticSearchTestCase { @Test public void testDefaultConfiguration() throws IOException { diff --git a/src/test/java/org/elasticsearch/index/mapper/compound/CompoundTypesTests.java b/src/test/java/org/elasticsearch/index/mapper/compound/CompoundTypesTests.java index 45445a689f1..a52b8e8bf51 100644 --- a/src/test/java/org/elasticsearch/index/mapper/compound/CompoundTypesTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/compound/CompoundTypesTests.java @@ -21,15 +21,16 @@ package org.elasticsearch.index.mapper.compound; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.equalTo; -public class CompoundTypesTests { +public class CompoundTypesTests extends ElasticSearchTestCase { @Test public void testStringType() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/date/SimpleDateMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/date/SimpleDateMappingTests.java index d1318a1a1e9..e341f1f4e8b 100644 --- a/src/test/java/org/elasticsearch/index/mapper/date/SimpleDateMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/date/SimpleDateMappingTests.java @@ -19,18 +19,6 @@ package org.elasticsearch.index.mapper.date; -import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.Matchers.nullValue; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - import org.apache.lucene.analysis.NumericTokenStream.NumericTermAttribute; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.search.Filter; @@ -42,19 +30,25 @@ import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.index.mapper.*; import org.elasticsearch.index.mapper.core.DateFieldMapper; import org.elasticsearch.index.mapper.core.LongFieldMapper; import org.elasticsearch.index.mapper.core.StringFieldMapper; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.Test; -public class SimpleDateMappingTests { +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.*; + +public class SimpleDateMappingTests extends ElasticSearchTestCase { @Test public void testAutomaticDateParser() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/dynamic/DynamicMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/dynamic/DynamicMappingTests.java index 52158581b7e..5e60626bf2b 100644 --- a/src/test/java/org/elasticsearch/index/mapper/dynamic/DynamicMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/dynamic/DynamicMappingTests.java @@ -21,9 +21,10 @@ package org.elasticsearch.index.mapper.dynamic; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.StrictDynamicMappingException; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -32,7 +33,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; -public class DynamicMappingTests { +public class DynamicMappingTests extends ElasticSearchTestCase { @Test public void testDynamicTrue() throws IOException { diff --git a/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/genericstore/GenericStoreDynamicTemplateTests.java b/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/genericstore/GenericStoreDynamicTemplateTests.java index 843db35f349..f7c9e819779 100644 --- a/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/genericstore/GenericStoreDynamicTemplateTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/genericstore/GenericStoreDynamicTemplateTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMappers; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.common.io.Streams.copyToBytesFromClasspath; @@ -35,7 +36,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class GenericStoreDynamicTemplateTests { +public class GenericStoreDynamicTemplateTests extends ElasticSearchTestCase { @Test public void testSimple() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/pathmatch/PathMatchDynamicTemplateTests.java b/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/pathmatch/PathMatchDynamicTemplateTests.java index 44fc11f9b6d..27790e2c03c 100644 --- a/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/pathmatch/PathMatchDynamicTemplateTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/pathmatch/PathMatchDynamicTemplateTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMappers; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.common.io.Streams.copyToBytesFromClasspath; @@ -35,7 +36,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class PathMatchDynamicTemplateTests { +public class PathMatchDynamicTemplateTests extends ElasticSearchTestCase { @Test public void testSimple() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/simple/SimpleDynamicTemplatesTests.java b/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/simple/SimpleDynamicTemplatesTests.java index f4dce29e02a..63fcfd94b4e 100644 --- a/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/simple/SimpleDynamicTemplatesTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/simple/SimpleDynamicTemplatesTests.java @@ -28,6 +28,7 @@ import org.elasticsearch.index.mapper.DocumentFieldMappers; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMappers; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.Matchers; import org.junit.Test; @@ -39,7 +40,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class SimpleDynamicTemplatesTests { +public class SimpleDynamicTemplatesTests extends ElasticSearchTestCase { @Test public void testMatchTypeOnly() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapperTests.java index bd2832a5ca9..91fd8599a96 100644 --- a/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapperTests.java @@ -18,12 +18,6 @@ */ package org.elasticsearch.index.mapper.geo; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.instanceOf; - -import java.io.IOException; - import org.apache.lucene.spatial.prefix.PrefixTreeStrategy; import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree; import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree; @@ -32,9 +26,16 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; -public class GeoShapeFieldMapperTests { +import java.io.IOException; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.instanceOf; + +public class GeoShapeFieldMapperTests extends ElasticSearchTestCase { @Test public void testDefaultConfiguration() throws IOException { diff --git a/src/test/java/org/elasticsearch/index/mapper/geo/GeohashMappingGeoPointTests.java b/src/test/java/org/elasticsearch/index/mapper/geo/GeohashMappingGeoPointTests.java index 12db2c23a92..ee9101668d3 100644 --- a/src/test/java/org/elasticsearch/index/mapper/geo/GeohashMappingGeoPointTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/geo/GeohashMappingGeoPointTests.java @@ -22,8 +22,9 @@ package org.elasticsearch.index.mapper.geo; import org.elasticsearch.common.geo.GeoHashUtils; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.hamcrest.MatcherAssert; import org.junit.Test; @@ -32,7 +33,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class GeohashMappingGeoPointTests { +public class GeohashMappingGeoPointTests extends ElasticSearchTestCase { @Test public void testLatLonValues() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/geo/LatLonAndGeohashMappingGeoPointTests.java b/src/test/java/org/elasticsearch/index/mapper/geo/LatLonAndGeohashMappingGeoPointTests.java index 8e34e178eaa..f3aabc0cf38 100644 --- a/src/test/java/org/elasticsearch/index/mapper/geo/LatLonAndGeohashMappingGeoPointTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/geo/LatLonAndGeohashMappingGeoPointTests.java @@ -22,8 +22,9 @@ package org.elasticsearch.index.mapper.geo; import org.elasticsearch.common.geo.GeoHashUtils; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -33,7 +34,7 @@ import static org.hamcrest.Matchers.notNullValue; /** * */ -public class LatLonAndGeohashMappingGeoPointTests { +public class LatLonAndGeohashMappingGeoPointTests extends ElasticSearchTestCase { @Test public void testLatLonValues() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/geo/LatLonMappingGeoPointTests.java b/src/test/java/org/elasticsearch/index/mapper/geo/LatLonMappingGeoPointTests.java index a53bf205900..58d741de81a 100644 --- a/src/test/java/org/elasticsearch/index/mapper/geo/LatLonMappingGeoPointTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/geo/LatLonMappingGeoPointTests.java @@ -23,8 +23,9 @@ import org.elasticsearch.common.geo.GeoHashUtils; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -33,7 +34,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class LatLonMappingGeoPointTests { +public class LatLonMappingGeoPointTests extends ElasticSearchTestCase { @Test public void testNormalizeLatLonValuesDefault() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/id/IdMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/id/IdMappingTests.java index cf4193e32d5..4c5bd69ec5e 100644 --- a/src/test/java/org/elasticsearch/index/mapper/id/IdMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/id/IdMappingTests.java @@ -24,10 +24,11 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperParsingException; +import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.internal.IdFieldMapper; import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -35,7 +36,7 @@ import static org.hamcrest.Matchers.*; /** */ -public class IdMappingTests { +public class IdMappingTests extends ElasticSearchTestCase { @Test public void simpleIdTests() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/index/IndexTypeMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/index/IndexTypeMapperTests.java index e3eb02af34e..3ef9bc412c5 100644 --- a/src/test/java/org/elasticsearch/index/mapper/index/IndexTypeMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/index/IndexTypeMapperTests.java @@ -21,9 +21,10 @@ package org.elasticsearch.index.mapper.index; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.internal.IndexFieldMapper; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -32,7 +33,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class IndexTypeMapperTests { +public class IndexTypeMapperTests extends ElasticSearchTestCase { @Test public void simpleIndexMapperTests() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/ip/SimpleIpMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/ip/SimpleIpMappingTests.java index c8a5634c70a..31cd62fc018 100644 --- a/src/test/java/org/elasticsearch/index/mapper/ip/SimpleIpMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/ip/SimpleIpMappingTests.java @@ -19,13 +19,14 @@ package org.elasticsearch.index.mapper.ip; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Ignore; /** * */ @Ignore("No tests?") -public class SimpleIpMappingTests { +public class SimpleIpMappingTests extends ElasticSearchTestCase { // No Longer enabled... // @Test public void testAutoIpDetection() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/merge/TestMergeMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/merge/TestMergeMapperTests.java index ccbc1c467c5..0b518c0a62a 100644 --- a/src/test/java/org/elasticsearch/index/mapper/merge/TestMergeMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/merge/TestMergeMapperTests.java @@ -22,8 +22,9 @@ package org.elasticsearch.index.mapper.merge; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.index.mapper.DocumentMapper.MergeFlags.mergeFlags; @@ -33,7 +34,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class TestMergeMapperTests { +public class TestMergeMapperTests extends ElasticSearchTestCase { @Test public void test1Merge() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldTests.java b/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldTests.java index e329366de33..a910f76fe52 100644 --- a/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.common.io.Streams.copyToBytesFromClasspath; @@ -37,7 +38,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class MultiFieldTests { +public class MultiFieldTests extends ElasticSearchTestCase { @Test public void testMultiField() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/multifield/merge/JavaMultiFieldMergeTests.java b/src/test/java/org/elasticsearch/index/mapper/multifield/merge/JavaMultiFieldMergeTests.java index 7ee819d0d6e..3b864699ea0 100644 --- a/src/test/java/org/elasticsearch/index/mapper/multifield/merge/JavaMultiFieldMergeTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/multifield/merge/JavaMultiFieldMergeTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.Arrays; @@ -39,7 +40,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class JavaMultiFieldMergeTests { +public class JavaMultiFieldMergeTests extends ElasticSearchTestCase { @Test public void testMergeMultiField() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/nested/NestedMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/nested/NestedMappingTests.java index d1fb54f4614..5183f38833f 100644 --- a/src/test/java/org/elasticsearch/index/mapper/nested/NestedMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/nested/NestedMappingTests.java @@ -21,17 +21,18 @@ package org.elasticsearch.index.mapper.nested; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.internal.TypeFieldMapper; import org.elasticsearch.index.mapper.object.ObjectMapper; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; -public class NestedMappingTests { +public class NestedMappingTests extends ElasticSearchTestCase { @Test public void emptyNested() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/numeric/SimpleNumericTests.java b/src/test/java/org/elasticsearch/index/mapper/numeric/SimpleNumericTests.java index 6753115549b..57e1135721a 100644 --- a/src/test/java/org/elasticsearch/index/mapper/numeric/SimpleNumericTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/numeric/SimpleNumericTests.java @@ -21,14 +21,11 @@ package org.elasticsearch.index.mapper.numeric; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.index.mapper.*; import org.elasticsearch.index.mapper.core.DoubleFieldMapper; import org.elasticsearch.index.mapper.core.LongFieldMapper; import org.elasticsearch.index.mapper.core.StringFieldMapper; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; @@ -37,7 +34,7 @@ import static org.hamcrest.Matchers.*; /** */ -public class SimpleNumericTests { +public class SimpleNumericTests extends ElasticSearchTestCase { @Test public void testNumericDetectionEnabled() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/object/NullValueObjectMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/object/NullValueObjectMappingTests.java index 37db5d5e3f4..4a9cec23ac6 100644 --- a/src/test/java/org/elasticsearch/index/mapper/object/NullValueObjectMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/object/NullValueObjectMappingTests.java @@ -21,8 +21,9 @@ package org.elasticsearch.index.mapper.object; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -33,7 +34,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class NullValueObjectMappingTests { +public class NullValueObjectMappingTests extends ElasticSearchTestCase { @Test public void testNullValueObject() throws IOException { diff --git a/src/test/java/org/elasticsearch/index/mapper/object/SimpleObjectMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/object/SimpleObjectMappingTests.java index 16ae932e5d4..691b5743c8a 100644 --- a/src/test/java/org/elasticsearch/index/mapper/object/SimpleObjectMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/object/SimpleObjectMappingTests.java @@ -24,11 +24,12 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; /** */ -public class SimpleObjectMappingTests { +public class SimpleObjectMappingTests extends ElasticSearchTestCase { @Test public void testDifferentInnerObjectTokenFailure() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/overridetype/OverrideTypeMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/overridetype/OverrideTypeMappingTests.java index be316987bc3..947fdec5769 100644 --- a/src/test/java/org/elasticsearch/index/mapper/overridetype/OverrideTypeMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/overridetype/OverrideTypeMappingTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.index.mapper.overridetype; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -30,7 +31,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class OverrideTypeMappingTests { +public class OverrideTypeMappingTests extends ElasticSearchTestCase { @Test public void testOverrideType() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/parent/ParentMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/parent/ParentMappingTests.java index a28be7299f0..6795aa6aee6 100644 --- a/src/test/java/org/elasticsearch/index/mapper/parent/ParentMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/parent/ParentMappingTests.java @@ -20,11 +20,8 @@ package org.elasticsearch.index.mapper.parent; import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.SourceToParse; -import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.*; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -33,7 +30,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class ParentMappingTests { +public class ParentMappingTests extends ElasticSearchTestCase { @Test public void parentNotMapped() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/path/PathMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/path/PathMapperTests.java index fdee499177d..e875b0c6333 100644 --- a/src/test/java/org/elasticsearch/index/mapper/path/PathMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/path/PathMapperTests.java @@ -21,6 +21,7 @@ package org.elasticsearch.index.mapper.path; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -33,7 +34,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class PathMapperTests { +public class PathMapperTests extends ElasticSearchTestCase { @Test public void testPathMapping() throws IOException { diff --git a/src/test/java/org/elasticsearch/index/mapper/routing/RoutingTypeMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/routing/RoutingTypeMapperTests.java index 8b515542d4a..64458177cf2 100644 --- a/src/test/java/org/elasticsearch/index/mapper/routing/RoutingTypeMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/routing/RoutingTypeMapperTests.java @@ -23,9 +23,10 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.SourceToParse; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.Map; @@ -36,7 +37,7 @@ import static org.hamcrest.Matchers.*; /** * */ -public class RoutingTypeMapperTests { +public class RoutingTypeMapperTests extends ElasticSearchTestCase { @Test public void simpleRoutingMapperTests() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/simple/SimpleMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/simple/SimpleMapperTests.java index 415a8faadc1..125684a5ddf 100644 --- a/src/test/java/org/elasticsearch/index/mapper/simple/SimpleMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/simple/SimpleMapperTests.java @@ -19,28 +19,23 @@ package org.elasticsearch.index.mapper.simple; +import com.google.common.base.Charsets; import org.apache.lucene.document.Document; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.DocumentMapperParser; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.*; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; -import com.google.common.base.Charsets; - import static org.elasticsearch.common.io.Streams.copyToBytesFromClasspath; import static org.elasticsearch.common.io.Streams.copyToStringFromClasspath; import static org.elasticsearch.index.mapper.MapperBuilders.*; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; /** * */ -public class SimpleMapperTests { +public class SimpleMapperTests extends ElasticSearchTestCase { @Test public void testSimpleMapper() throws Exception { @@ -128,7 +123,7 @@ public class SimpleMapperTests { BytesReference json = new BytesArray("".getBytes(Charsets.UTF_8)); try { docMapper.parse("person", "1", json).rootDoc(); - assertThat("this point is never reached", false); + fail("this point is never reached"); } catch (MapperParsingException e) { assertThat(e.getMessage(), equalTo("failed to parse, document is empty")); } diff --git a/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java index 0233adf5ac8..df7e31a7944 100644 --- a/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java @@ -22,15 +22,16 @@ package org.elasticsearch.index.mapper.size; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.SourceToParse; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; -public class SizeMappingTests { +public class SizeMappingTests extends ElasticSearchTestCase { @Test public void testSizeEnabled() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/source/CompressSourceMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/source/CompressSourceMappingTests.java index f9fbeeaaa89..821c867df7b 100644 --- a/src/test/java/org/elasticsearch/index/mapper/source/CompressSourceMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/source/CompressSourceMappingTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -33,7 +34,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class CompressSourceMappingTests { +public class CompressSourceMappingTests extends ElasticSearchTestCase { @Test public void testCompressDisabled() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/timestamp/TimestampMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/timestamp/TimestampMappingTests.java index ac8b0d8ed67..96c0b512b3b 100644 --- a/src/test/java/org/elasticsearch/index/mapper/timestamp/TimestampMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/timestamp/TimestampMappingTests.java @@ -19,26 +19,27 @@ package org.elasticsearch.index.mapper.timestamp; -import java.util.Locale; -import java.util.Map; - import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.SourceToParse; import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; +import java.util.Locale; +import java.util.Map; + import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; /** */ -public class TimestampMappingTests { +public class TimestampMappingTests extends ElasticSearchTestCase { @Test public void testSimpleDisabled() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/ttl/TTLMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/ttl/TTLMappingTests.java index 958d0ab751c..b562eca88db 100644 --- a/src/test/java/org/elasticsearch/index/mapper/ttl/TTLMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/ttl/TTLMappingTests.java @@ -23,17 +23,18 @@ package org.elasticsearch.index.mapper.ttl; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.MapperTestUtils; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.SourceToParse; import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; -public class TTLMappingTests { +public class TTLMappingTests extends ElasticSearchTestCase { @Test public void testSimpleDisabled() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().string(); diff --git a/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseDocumentTypeLevelsTests.java b/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseDocumentTypeLevelsTests.java index e73c806caae..ba713465a8c 100644 --- a/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseDocumentTypeLevelsTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseDocumentTypeLevelsTests.java @@ -21,8 +21,9 @@ package org.elasticsearch.index.mapper.typelevels; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -32,7 +33,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class ParseDocumentTypeLevelsTests { +public class ParseDocumentTypeLevelsTests extends ElasticSearchTestCase { @Test public void testNoLevel() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseMappingTypeLevelTests.java b/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseMappingTypeLevelTests.java index 1ad8ad15d0d..e1dd441a274 100644 --- a/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseMappingTypeLevelTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseMappingTypeLevelTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.index.mapper.typelevels; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperTestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -30,7 +31,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class ParseMappingTypeLevelTests { +public class ParseMappingTypeLevelTests extends ElasticSearchTestCase { @Test public void testTypeLevel() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/query/GeoShapeQueryBuilderTests.java b/src/test/java/org/elasticsearch/index/query/GeoShapeQueryBuilderTests.java index 9df8ae637b3..728db8b3f5c 100644 --- a/src/test/java/org/elasticsearch/index/query/GeoShapeQueryBuilderTests.java +++ b/src/test/java/org/elasticsearch/index/query/GeoShapeQueryBuilderTests.java @@ -22,9 +22,10 @@ package org.elasticsearch.index.query; import org.elasticsearch.common.geo.builders.EnvelopeBuilder; import org.elasticsearch.common.geo.builders.ShapeBuilder; import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; -public class GeoShapeQueryBuilderTests { +public class GeoShapeQueryBuilderTests extends ElasticSearchTestCase { @Test // see #3878 public void testThatXContentSerializationInsideOfArrayWorks() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/query/guice/IndexQueryParserModuleTests.java b/src/test/java/org/elasticsearch/index/query/guice/IndexQueryParserModuleTests.java index 3cd2eb960d6..d9390d40030 100644 --- a/src/test/java/org/elasticsearch/index/query/guice/IndexQueryParserModuleTests.java +++ b/src/test/java/org/elasticsearch/index/query/guice/IndexQueryParserModuleTests.java @@ -40,6 +40,7 @@ import org.elasticsearch.index.settings.IndexSettingsModule; import org.elasticsearch.index.similarity.SimilarityModule; import org.elasticsearch.indices.query.IndicesQueriesModule; import org.elasticsearch.script.ScriptModule; +import org.elasticsearch.test.ElasticSearchTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPoolModule; import org.junit.Test; @@ -51,7 +52,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class IndexQueryParserModuleTests { +public class IndexQueryParserModuleTests extends ElasticSearchTestCase { @Test public void testCustomInjection() { diff --git a/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java b/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java index 093be31c2dd..d7c3eca5b4e 100644 --- a/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java +++ b/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java @@ -41,6 +41,7 @@ import org.elasticsearch.index.settings.IndexSettingsModule; import org.elasticsearch.index.similarity.SimilarityModule; import org.elasticsearch.indices.query.IndicesQueriesModule; import org.elasticsearch.script.ScriptModule; +import org.elasticsearch.test.ElasticSearchTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPoolModule; import org.junit.Test; @@ -51,7 +52,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class IndexQueryParserPlugin2Tests { +public class IndexQueryParserPlugin2Tests extends ElasticSearchTestCase { @Test public void testCustomInjection() { diff --git a/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java b/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java index f799832260e..866d6fb4d8c 100644 --- a/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java +++ b/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java @@ -41,6 +41,7 @@ import org.elasticsearch.index.settings.IndexSettingsModule; import org.elasticsearch.index.similarity.SimilarityModule; import org.elasticsearch.indices.query.IndicesQueriesModule; import org.elasticsearch.script.ScriptModule; +import org.elasticsearch.test.ElasticSearchTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPoolModule; import org.junit.Test; @@ -51,7 +52,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class IndexQueryParserPluginTests { +public class IndexQueryParserPluginTests extends ElasticSearchTestCase { @Test public void testCustomInjection() { diff --git a/src/test/java/org/elasticsearch/index/search/geo/GeoDistanceTests.java b/src/test/java/org/elasticsearch/index/search/geo/GeoDistanceTests.java index 1b32e19f7c5..01968bbdc67 100644 --- a/src/test/java/org/elasticsearch/index/search/geo/GeoDistanceTests.java +++ b/src/test/java/org/elasticsearch/index/search/geo/GeoDistanceTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.index.search.geo; import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.unit.DistanceUnit; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -29,7 +30,7 @@ import static org.hamcrest.Matchers.*; /** */ -public class GeoDistanceTests { +public class GeoDistanceTests extends ElasticSearchTestCase { @Test public void testDistanceCheck() { diff --git a/src/test/java/org/elasticsearch/index/search/geo/GeoHashUtilsTests.java b/src/test/java/org/elasticsearch/index/search/geo/GeoHashUtilsTests.java index 2510738d64d..ee5925de0ba 100644 --- a/src/test/java/org/elasticsearch/index/search/geo/GeoHashUtilsTests.java +++ b/src/test/java/org/elasticsearch/index/search/geo/GeoHashUtilsTests.java @@ -21,6 +21,7 @@ package org.elasticsearch.index.search.geo; import org.elasticsearch.common.geo.GeoHashUtils; import org.elasticsearch.common.geo.GeoPoint; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -28,7 +29,7 @@ import static org.junit.Assert.assertEquals; /** * */ -public class GeoHashUtilsTests { +public class GeoHashUtilsTests extends ElasticSearchTestCase { /** * Pass condition: lat=42.6, lng=-5.6 should be encoded as "ezs42e44yx96", diff --git a/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java b/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java index 3c091279860..aaa7a3c8767 100644 --- a/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java +++ b/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java @@ -19,25 +19,23 @@ package org.elasticsearch.index.search.geo; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.lessThanOrEqualTo; -import static org.hamcrest.Matchers.not; - +import com.spatial4j.core.context.SpatialContext; +import com.spatial4j.core.distance.DistanceUtils; import org.apache.lucene.spatial.prefix.tree.Cell; import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree; import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; -import com.spatial4j.core.context.SpatialContext; -import com.spatial4j.core.distance.DistanceUtils; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.*; /** * */ -public class GeoUtilsTests { +public class GeoUtilsTests extends ElasticSearchTestCase { /** * Test special values like inf, NaN and -0.0. diff --git a/src/test/java/org/elasticsearch/index/similarity/SimilarityTests.java b/src/test/java/org/elasticsearch/index/similarity/SimilarityTests.java index a56e4992c9e..69cb48d8e59 100644 --- a/src/test/java/org/elasticsearch/index/similarity/SimilarityTests.java +++ b/src/test/java/org/elasticsearch/index/similarity/SimilarityTests.java @@ -33,6 +33,7 @@ import org.elasticsearch.index.codec.CodecModule; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperServiceModule; import org.elasticsearch.index.settings.IndexSettingsModule; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -41,7 +42,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; -public class SimilarityTests { +public class SimilarityTests extends ElasticSearchTestCase { @Test public void testResolveDefaultSimilarities() { diff --git a/src/test/java/org/elasticsearch/index/store/distributor/DistributorTests.java b/src/test/java/org/elasticsearch/index/store/distributor/DistributorTests.java index 9a2130cda7d..a5896385c05 100644 --- a/src/test/java/org/elasticsearch/index/store/distributor/DistributorTests.java +++ b/src/test/java/org/elasticsearch/index/store/distributor/DistributorTests.java @@ -21,6 +21,7 @@ package org.elasticsearch.index.store.distributor; import org.apache.lucene.store.*; import org.elasticsearch.index.store.DirectoryService; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.File; @@ -31,7 +32,7 @@ import static org.hamcrest.Matchers.*; /** */ -public class DistributorTests { +public class DistributorTests extends ElasticSearchTestCase { @Test public void testLeastUsedDistributor() throws Exception { diff --git a/src/test/java/org/elasticsearch/index/store/memory/SimpleByteBufferStoreTests.java b/src/test/java/org/elasticsearch/index/store/memory/SimpleByteBufferStoreTests.java index e87b74a2018..186ad85f840 100644 --- a/src/test/java/org/elasticsearch/index/store/memory/SimpleByteBufferStoreTests.java +++ b/src/test/java/org/elasticsearch/index/store/memory/SimpleByteBufferStoreTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.index.store.memory; import org.apache.lucene.store.*; import org.apache.lucene.store.bytebuffer.ByteBufferDirectory; import org.elasticsearch.cache.memory.ByteBufferCache; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.io.IOException; @@ -32,7 +33,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class SimpleByteBufferStoreTests { +public class SimpleByteBufferStoreTests extends ElasticSearchTestCase { @Test public void test1BufferNoCache() throws Exception { diff --git a/src/test/java/org/elasticsearch/node/internal/InternalSettingsPerparerTests.java b/src/test/java/org/elasticsearch/node/internal/InternalSettingsPerparerTests.java index 9b5f46bce0d..69fa3fd5104 100644 --- a/src/test/java/org/elasticsearch/node/internal/InternalSettingsPerparerTests.java +++ b/src/test/java/org/elasticsearch/node/internal/InternalSettingsPerparerTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.node.internal; import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -30,7 +31,7 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class InternalSettingsPerparerTests { +public class InternalSettingsPerparerTests extends ElasticSearchTestCase { @Before public void setupSystemProperties() { System.setProperty("es.node.zone", "foo"); diff --git a/src/test/java/org/elasticsearch/rest/util/RestUtilsTests.java b/src/test/java/org/elasticsearch/rest/util/RestUtilsTests.java index 34b90d84a9b..bf7509bc10d 100644 --- a/src/test/java/org/elasticsearch/rest/util/RestUtilsTests.java +++ b/src/test/java/org/elasticsearch/rest/util/RestUtilsTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.rest.util; import org.elasticsearch.rest.support.RestUtils; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.Map; @@ -31,7 +32,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class RestUtilsTests { +public class RestUtilsTests extends ElasticSearchTestCase { @Test public void testDecodeQueryString() { diff --git a/src/test/java/org/elasticsearch/script/NativeScriptTests.java b/src/test/java/org/elasticsearch/script/NativeScriptTests.java index bdee66ba9f8..a424225abd2 100644 --- a/src/test/java/org/elasticsearch/script/NativeScriptTests.java +++ b/src/test/java/org/elasticsearch/script/NativeScriptTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.common.inject.ModulesBuilder; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsModule; +import org.elasticsearch.test.ElasticSearchTestCase; import org.junit.Test; import java.util.Map; @@ -32,7 +33,7 @@ import java.util.Map; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class NativeScriptTests { +public class NativeScriptTests extends ElasticSearchTestCase { @Test public void testNativeScript() { diff --git a/src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java b/src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java index 9b5e4d87953..9a368ba8bfb 100644 --- a/src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java +++ b/src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.threadpool; import com.google.common.util.concurrent.ListeningExecutorService; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor; +import org.elasticsearch.test.ElasticSearchTestCase; import org.elasticsearch.threadpool.ThreadPool.Names; import org.junit.Test; @@ -31,12 +32,11 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; /** */ -public class UpdateThreadPoolSettingsTests { +public class UpdateThreadPoolSettingsTests extends ElasticSearchTestCase { private ThreadPool.Info info(ThreadPool threadPool, String name) { for (ThreadPool.Info info : threadPool.info()) {