Class AbstractInstallShardTest

java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.apache.solr.SolrTestCase
org.apache.solr.SolrTestCaseJ4
org.apache.solr.cloud.SolrCloudTestCase
org.apache.solr.cloud.api.collections.AbstractInstallShardTest

public abstract class AbstractInstallShardTest extends SolrCloudTestCase
Base class for testing the "Install Shard API" with various backup repositories.

Subclasses are expected to bootstrap a Solr cluster with a single configured backup repository. This base-class will populate that backup repository all data necessary for these tests.

See Also:
  • InstallShardData
  • Field Details

    • BACKUP_REPO_NAME

      protected static final String BACKUP_REPO_NAME
      See Also:
    • ERROR_BACKUP_REPO_NAME

      protected static final String ERROR_BACKUP_REPO_NAME
      See Also:
    • singleShardNumDocs

      protected static int singleShardNumDocs
    • replicasPerShard

      protected static int replicasPerShard
    • multiShardNumDocs

      protected static int multiShardNumDocs
    • singleShard1Uri

      protected static URI singleShard1Uri
    • nonExistentLocationUri

      protected static URI nonExistentLocationUri
    • multiShardUris

      protected static URI[] multiShardUris
    • collectionsToDelete

      protected List<String> collectionsToDelete
  • Constructor Details

    • AbstractInstallShardTest

      public AbstractInstallShardTest()
  • Method Details

    • seedDocGenerator

      public static void seedDocGenerator()
    • clearCollectionsToDelete

      public void clearCollectionsToDelete()
    • deleteTestCollections

      public void deleteTestCollections() throws Exception
      Throws:
      Exception
    • deleteAfterTest

      protected String deleteAfterTest(String collName)
    • bootstrapBackupRepositoryData

      public static void bootstrapBackupRepositoryData(String baseRepositoryLocation) throws Exception
      Throws:
      Exception
    • testInstallFailsIfCollectionIsNotInReadOnlyMode

      public void testInstallFailsIfCollectionIsNotInReadOnlyMode() throws Exception
      Throws:
      Exception
    • testInstallToSingleShardCollection

      public void testInstallToSingleShardCollection() throws Exception
      Throws:
      Exception
    • testInstallReportsErrorsAppropriately

      public void testInstallReportsErrorsAppropriately() throws Exception
      Throws:
      Exception
    • testSerialInstallToMultiShardCollection

      public void testSerialInstallToMultiShardCollection() throws Exception
      Throws:
      Exception
    • testParallelInstallToMultiShardCollection

      public void testParallelInstallToMultiShardCollection() throws Exception
      Throws:
      Exception
    • testInstallSucceedsOnASingleError

      public void testInstallSucceedsOnASingleError() throws Exception
      Throws:
      Exception
    • defaultSolrXmlTextWithBackupRepository

      public static String defaultSolrXmlTextWithBackupRepository(String backupRepositoryText)
      Builds a string representation of a valid solr.xml configuration, with the provided backup-repository configuration inserted
      Parameters:
      backupRepositoryText - a string representing the 'backup' XML tag to put in the constructed solr.xml
    • assertCollectionHasNumDocs

      protected static void assertCollectionHasNumDocs(String collection, int expectedNumDocs) throws Exception
      Throws:
      Exception
    • createAndAwaitEmptyCollection

      protected static String createAndAwaitEmptyCollection(int numShards, int replicasPerShard) throws Exception
      Throws:
      Exception
    • enableReadOnly

      protected static void enableReadOnly(String collectionName) throws Exception
      Throws:
      Exception