public abstract class ESSingleNodeTestCase extends ESTestCase
org.apache.lucene.util.LuceneTestCase.AwaitsFix, org.apache.lucene.util.LuceneTestCase.BadApple, org.apache.lucene.util.LuceneTestCase.Monster, org.apache.lucene.util.LuceneTestCase.Nightly, org.apache.lucene.util.LuceneTestCase.Slow, org.apache.lucene.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.util.LuceneTestCase.SuppressFileSystems, org.apache.lucene.util.LuceneTestCase.SuppressFsync, org.apache.lucene.util.LuceneTestCase.SuppressReproduceLine, org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks, org.apache.lucene.util.LuceneTestCase.SuppressTempFileChecks, org.apache.lucene.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.util.LuceneTestCase.WeeklycheckIndexFailed, failureAndSuccessEvents, loggerassertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_WEEKLY, VERBOSE| Constructor and Description |
|---|
ESSingleNodeTestCase() |
| Modifier and Type | Method and Description |
|---|---|
org.elasticsearch.client.Client |
client()
Returns a client to the single-node cluster.
|
protected org.elasticsearch.index.IndexService |
createIndex(java.lang.String index)
Create a new index on the singleton node with empty index settings.
|
protected org.elasticsearch.index.IndexService |
createIndex(java.lang.String index,
org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder createIndexRequestBuilder) |
protected org.elasticsearch.index.IndexService |
createIndex(java.lang.String index,
org.elasticsearch.common.settings.Settings settings)
Create a new index on the singleton node with the provided index settings.
|
protected org.elasticsearch.index.IndexService |
createIndex(java.lang.String index,
org.elasticsearch.common.settings.Settings settings,
java.lang.String type,
java.lang.Object... mappings)
Create a new index on the singleton node with the provided index settings.
|
protected org.elasticsearch.index.IndexService |
createIndex(java.lang.String index,
org.elasticsearch.common.settings.Settings settings,
java.lang.String type,
org.elasticsearch.common.xcontent.XContentBuilder mappings)
Create a new index on the singleton node with the provided index settings.
|
protected org.elasticsearch.search.internal.SearchContext |
createSearchContext(org.elasticsearch.index.IndexService indexService)
Create a new search context.
|
org.elasticsearch.cluster.health.ClusterHealthStatus |
ensureGreen(java.lang.String... indices)
Ensures the cluster has a green state via the cluster health API.
|
org.elasticsearch.cluster.health.ClusterHealthStatus |
ensureGreen(org.elasticsearch.common.unit.TimeValue timeout,
java.lang.String... indices)
Ensures the cluster has a green state via the cluster health API.
|
protected <T> T |
getInstanceFromNode(java.lang.Class<T> clazz)
Get an instance for a particular class using the injector of the singleton node.
|
protected java.util.Collection<java.lang.Class<? extends org.elasticsearch.plugins.Plugin>> |
getPlugins()
The plugin classes that should be added to the node.
|
protected org.elasticsearch.node.Node |
node()
Return a reference to the singleton node.
|
java.lang.String |
nodeName()
Returns the single test nodes name.
|
protected org.elasticsearch.common.settings.Settings |
nodeSettings()
Additional settings to add when creating the node.
|
protected java.util.Collection<java.lang.Class<? extends org.elasticsearch.plugins.Plugin>> |
pluginList(java.lang.Class<? extends org.elasticsearch.plugins.Plugin>... plugins)
Helper method to create list of plugins without specifying generic types.
|
protected boolean |
resetNodeAfterTest()
This method returns
true if the node that is used in the background should be reset
after each test. |
org.elasticsearch.index.Index |
resolveIndex(java.lang.String index) |
void |
setUp() |
static void |
setUpClass() |
protected void |
startNode() |
protected static void |
stopNode() |
void |
tearDown() |
static void |
tearDownClass() |
afterIfFailed, afterIfSuccessful, assertAllIndicesRemovedAndDeletionCompleted, assertArrayEquals, assertBusy, assertBusy, assertEquals, assertionsEnabled, assertPathHasBeenCleared, awaitBusy, awaitBusy, between, createAnalysisService, createAnalysisService, createAnalysisService, ensureAllSearchContextsReleased, ensureCheckIndexPassed, ensureCleanedUp, frequently, generateRandomStringArray, generateRandomStringArray, getBwcIndicesPath, getDataPath, getSuiteFailureMarker, iterations, maybeSet, newNodeEnvironment, newNodeEnvironment, newTestScriptModule, randomAsciiOfLength, randomAsciiOfLengthBetween, randomBoolean, randomByte, randomDateTimeZone, randomDouble, randomDoubleBetween, randomFloat, randomFrom, randomFrom, randomFrom, randomInt, randomInt, randomIntBetween, randomLong, randomPositiveTimeValue, randomRealisticUnicodeOfCodepointLength, randomRealisticUnicodeOfCodepointLengthBetween, randomRealisticUnicodeOfLength, randomRealisticUnicodeOfLengthBetween, randomShort, randomSubsetOf, randomSubsetOf, randomSubsetOf, randomTimeValue, randomUnicodeOfCodepointLength, randomUnicodeOfCodepointLengthBetween, randomUnicodeOfLength, randomUnicodeOfLengthBetween, randomUnique, randomValueOtherThan, randomValueOtherThanMany, resetCheckIndexStatus, restoreContentType, restoreFileSystem, scaledRandomIntBetween, setContentType, setFileSystem, settings, shuffleXContent, spinForAtLeastOneMillisecond, terminate, terminate, tmpPathsaddVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertFieldsEquals, assertFieldStatisticsEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, expectThrows, getBaseTempDirForTestClass, getDataInputStream, getOnlyLeafReader, getTestClass, getTestName, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, restoreSpins, runWithRestrictedPermissions, setIndexWriterMaxDocs, setupCPUCoreCount, setupSpins, slowFileExists, usually, usually, wrapReaderassertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, failprotected void startNode()
protected static void stopNode()
throws java.io.IOException
java.io.IOExceptionpublic void setUp()
throws java.lang.Exception
setUp in class org.apache.lucene.util.LuceneTestCasejava.lang.Exceptionpublic void tearDown()
throws java.lang.Exception
tearDown in class org.apache.lucene.util.LuceneTestCasejava.lang.Exceptionpublic static void setUpClass()
throws java.lang.Exception
java.lang.Exceptionpublic static void tearDownClass()
throws java.io.IOException
java.io.IOExceptionprotected boolean resetNodeAfterTest()
true if the node that is used in the background should be reset
after each test. This is useful if the test changes the cluster state metadata etc. The default is
false.protected java.util.Collection<java.lang.Class<? extends org.elasticsearch.plugins.Plugin>> getPlugins()
@SafeVarargs protected final java.util.Collection<java.lang.Class<? extends org.elasticsearch.plugins.Plugin>> pluginList(java.lang.Class<? extends org.elasticsearch.plugins.Plugin>... plugins)
protected org.elasticsearch.common.settings.Settings nodeSettings()
public org.elasticsearch.client.Client client()
public java.lang.String nodeName()
protected org.elasticsearch.node.Node node()
protected <T> T getInstanceFromNode(java.lang.Class<T> clazz)
protected org.elasticsearch.index.IndexService createIndex(java.lang.String index)
protected org.elasticsearch.index.IndexService createIndex(java.lang.String index,
org.elasticsearch.common.settings.Settings settings)
protected org.elasticsearch.index.IndexService createIndex(java.lang.String index,
org.elasticsearch.common.settings.Settings settings,
java.lang.String type,
org.elasticsearch.common.xcontent.XContentBuilder mappings)
protected org.elasticsearch.index.IndexService createIndex(java.lang.String index,
org.elasticsearch.common.settings.Settings settings,
java.lang.String type,
java.lang.Object... mappings)
protected org.elasticsearch.index.IndexService createIndex(java.lang.String index,
org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder createIndexRequestBuilder)
public org.elasticsearch.index.Index resolveIndex(java.lang.String index)
protected org.elasticsearch.search.internal.SearchContext createSearchContext(org.elasticsearch.index.IndexService indexService)
public org.elasticsearch.cluster.health.ClusterHealthStatus ensureGreen(java.lang.String... indices)
public org.elasticsearch.cluster.health.ClusterHealthStatus ensureGreen(org.elasticsearch.common.unit.TimeValue timeout,
java.lang.String... indices)
timeout - time out value to set on ClusterHealthRequest