Package org.apache.accumulo.harness
Class SharedMiniClusterBase
- java.lang.Object
-
- org.apache.accumulo.harness.WithTestNames
-
- org.apache.accumulo.harness.AccumuloITBase
-
- org.apache.accumulo.harness.SharedMiniClusterBase
-
- All Implemented Interfaces:
ClusterUsers
- Direct Known Subclasses:
BulkNewIT
,CompactionExecutorIT
,ConditionalWriterIT
,DeletedTablesDontFlushIT
,ExternalCompaction_1_IT
,ExternalCompaction_2_IT
,ExternalCompaction_3_IT
,ExternalCompactionMetricsIT
,FileNormalizationIT
,HalfClosedTablet2IT
,HalfClosedTabletIT
,ManagerApiIT
,MemoryStarvedMajCIT
,MemoryStarvedMinCIT
,MemoryStarvedScanIT
,NamespacesIT
,NewTableConfigurationIT
,PropStoreConfigIT
,ScanServerConcurrentTabletScanIT
,ScanServerIT
,ScanServerIT_NoServers
,ScanServerMetadataEntriesCleanIT
,ScanServerMetadataEntriesIT
,ScanServerMultipleScansIT
,ShellAuthenticatorIT
,ShellCreateNamespaceIT
,ShellCreateTableIT
,ShellIT
,ShellServerIT
,SplitCancelsMajCIT
,SummaryIT
,ZooPropEditorIT
@Tag("MiniClusterOnly") public abstract class SharedMiniClusterBase extends AccumuloITBase implements ClusterUsers
Integration-Test base class which starts one MAC for the entire Integration Test. This IT type is faster and more geared for testing typical, expected behavior of a cluster. For more advanced testing seeAccumuloClusterHarness
There isn't a good way to build this off of theAccumuloClusterHarness
(as would be the logical place) because we need to start the MiniAccumuloCluster in a static BeforeAll-annotated method. Because it is static and invoked before any other BeforeAll methods in the implementation, the actual test classes can't expose any information to tell the base class that it is to perform the one-MAC-per-class semantics. Implementations of this class must be sure to invokestartMiniCluster()
orstartMiniClusterWithConfig(MiniClusterConfigurationCallback)
in a method annotated with theBeforeAll
JUnit annotation andstopMiniCluster()
in a method annotated with theAfterAll
JUnit annotation.
-
-
Field Summary
Fields Modifier and Type Field Description static String
TRUE
-
Fields inherited from class org.apache.accumulo.harness.AccumuloITBase
MINI_CLUSTER_ONLY, STANDALONE_CAPABLE_CLUSTER, SUNNY_DAY, ZOOKEEPER_TESTING_SERVER
-
-
Constructor Summary
Constructors Constructor Description SharedMiniClusterBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
getAdminPrincipal()
ClusterUser
getAdminUser()
static ClientInfo
getClientInfo()
static Properties
getClientProps()
static MiniAccumuloClusterImpl
getCluster()
static TestingKdc
getKdc()
static File
getMiniClusterDir()
static String
getPrincipal()
static String
getRootPassword()
static AuthenticationToken
getToken()
ClusterUser
getUser(int offset)
static boolean
saslEnabled()
static void
startMiniCluster()
Starts a MiniAccumuloCluster instance with the default configuration.static void
startMiniClusterWithConfig(MiniClusterConfigurationCallback miniClusterCallback)
Starts a MiniAccumuloCluster instance with the default configuration but also provides the caller the opportunity to update the configuration before the MiniAccumuloCluster is started.static void
stopMiniCluster()
Stops the MiniAccumuloCluster and related services if they are running.-
Methods inherited from class org.apache.accumulo.harness.AccumuloITBase
createTestDir, defaultTimeout, getOnlyElement, getOnlyElement, getSslDir, getUniqueNames, initJar
-
Methods inherited from class org.apache.accumulo.harness.WithTestNames
setTestName, testName
-
-
-
-
Field Detail
-
TRUE
public static final String TRUE
-
-
Method Detail
-
startMiniCluster
public static void startMiniCluster() throws Exception
Starts a MiniAccumuloCluster instance with the default configuration.- Throws:
Exception
-
startMiniClusterWithConfig
public static void startMiniClusterWithConfig(MiniClusterConfigurationCallback miniClusterCallback) throws Exception
Starts a MiniAccumuloCluster instance with the default configuration but also provides the caller the opportunity to update the configuration before the MiniAccumuloCluster is started.- Parameters:
miniClusterCallback
- A callback to configure the minicluster before it is started.- Throws:
Exception
-
stopMiniCluster
public static void stopMiniCluster()
Stops the MiniAccumuloCluster and related services if they are running.
-
getRootPassword
public static String getRootPassword()
-
getToken
public static AuthenticationToken getToken()
-
getPrincipal
public static String getPrincipal()
-
getCluster
public static MiniAccumuloClusterImpl getCluster()
-
getMiniClusterDir
public static File getMiniClusterDir()
-
getClientProps
public static Properties getClientProps()
-
getKdc
public static TestingKdc getKdc()
-
getAdminUser
public ClusterUser getAdminUser()
- Specified by:
getAdminUser
in interfaceClusterUsers
-
getUser
public ClusterUser getUser(int offset)
- Specified by:
getUser
in interfaceClusterUsers
-
getClientInfo
public static ClientInfo getClientInfo()
-
saslEnabled
public static boolean saslEnabled()
-
getAdminPrincipal
public static String getAdminPrincipal()
-
-