public class CliCommandTestBase extends CacheTestCase
DistributedTestCase.ExpectedException, DistributedTestCase.WaitCriterion, DistributedTestCase.WaitCriterion2| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
USE_HTTP_SYSTEM_PROPERTY |
cachelogPerTest, reconnect, system, testName| Constructor and Description |
|---|
CliCommandTestBase(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
commandResultToString(com.gemstone.gemfire.management.internal.cli.result.CommandResult commandResult) |
protected int |
countLinesInString(java.lang.String stringToSearch,
boolean countBlankLines)
Counts the number of distinct lines in a String.
|
protected int |
countMatchesInString(java.lang.String stringToSearch,
java.lang.String stringToCount)
Utility method to determine how many times a string occurs in another string.
|
protected TestableGfsh |
createDefaultSetup(java.util.Properties props)
Create all of the components necessary for the default setup.
|
protected TestableGfsh |
createShell()
Create a TestableGfsh object.
|
protected void |
debug(java.lang.String string) |
protected void |
destroyDefaultSetup()
Destroy all of the components created for the default setup.
|
protected void |
error(java.lang.String string) |
protected void |
error(java.lang.String string,
java.lang.Throwable e) |
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult |
executeCommand(java.lang.String command)
Execute a command using the default shell and clear the shell events before returning.
|
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult |
executeCommand(TestableGfsh shell,
java.lang.String command)
Execute a command in the provided shell and clear the shell events before returning.
|
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult |
executeCommandWithoutClear(java.lang.String command)
Execute a command using the default shell.
|
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult |
executeCommandWithoutClear(TestableGfsh shell,
java.lang.String command)
Execute a command in the provided shell.
|
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult |
extractCommandResult(java.util.Map<java.lang.String,java.lang.Object> commandOutput)
Utility method for finding the CommandResult object in the Map of CommandOutput objects.
|
protected TestableGfsh |
getDefaultShell()
Get the default shell (will create one if it doesn't already exist).
|
protected java.lang.String |
getLineFromString(java.lang.String stringToSearch,
int lineNumber)
Get a specific line from the string (using \n or \r as a line separator).
|
protected void |
info(java.lang.String string) |
protected void |
printResult(com.gemstone.gemfire.management.internal.cli.result.CommandResult commandResult,
java.io.PrintStream printStream)
Utility method for viewing the results of a command.
|
void |
setUp()
Sets up the test (noop).
|
protected void |
shellConnect(java.lang.String host,
int jmxPort,
int httpPort,
TestableGfsh shell)
Connect a shell to the JMX server at the given host and port
|
protected boolean |
stringContainsLine(java.lang.String stringToSearch,
java.lang.String stringPattern)
Determines if a string contains a trimmed line that matches the pattern.
|
void |
tearDown2()
Tears down the test.
|
addExceptionTag1, basicGetCache, beginCacheXml, cleanDiskDirs, closeAllCache, closeCache, createLonerCache, createMcastCache, createMcastCache, createRegion, createRegion, createRootRegion, createRootRegion, disconnectFromDS, finishCacheXml, finishCacheXml, getCache, getCache, getCache, getCache, getClientCache, getDiskDirs, getGemfireCache, getInternalRegionArguments, getRootRegion, getRootRegion, hasCache, remoteTearDown, removeExceptionTag1, sendSerialMessageToAll, sendUnorderedMessageToAlladdExpectedException, addExpectedException, addHydraProperties, attachDebugger, checkBBFlag, cleanupAllVms, clearBBFlag, crashDistributedSystem, crashDistributedSystem, createLogWriter, disconnectAllFromDS, dumpAllStacks, dumpMyThreads, dumpStack, dumpStack, dumpStack, dumpStackTrace, fail, getAllDistributedSystemProperties, getDistributedSystemProperties, getDUnitLocatorAddress, getDUnitLocatorPort, getDUnitLocatorString, getDUnitLogLevel, getIPLiteral, getLogWriter, getLonerSystem, getMcastSystem, getMcastSystem, getRepeatTimeoutMs, getServerHostName, getSystem, getSystem, getTestClass, getTestName, getUniqueName, getVMCount, incBBFlag, invokeInEveryVM, invokeInEveryVM, invokeInEveryVM, invokeInEveryVM, invokeInEveryVMRepeatingIfNecessary, invokeInLocator, invokeRepeatingIfNecessary, isConnectedToDS, join, noteTiming, pause, pause, perVMSetUp, realTearDown, setDiskStoreForGateway, setSystem, setTestName, staticPause, tearDown, unregisterAllDataSerializersFromAllVms, unregisterDataSerializerInThisVM, unregisterInstantiatorsInThisVM, waitForBBFlag, waitForCriterion, waitMutexassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toStringprotected static final java.lang.String USE_HTTP_SYSTEM_PROPERTY
public void setUp()
throws java.lang.Exception
DistributedTestCasesetUp in class DistributedTestCasejava.lang.Exceptionpublic void tearDown2()
throws java.lang.Exception
DistributedTestCaseDistributedTestCase.tearDown() method, and should be over ridden in its place.tearDown2 in class CacheTestCasejava.lang.Exceptionprotected final TestableGfsh createDefaultSetup(java.util.Properties props)
props - Properties used when creating the cache for this default setup.protected final void destroyDefaultSetup()
protected void shellConnect(java.lang.String host,
int jmxPort,
int httpPort,
TestableGfsh shell)
host - Host of the JMX serverjmxPort - Port of the JMX servershell - Shell to connectprotected final TestableGfsh getDefaultShell()
protected TestableGfsh createShell()
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult executeCommand(java.lang.String command)
command - Command to executeprotected com.gemstone.gemfire.management.internal.cli.result.CommandResult executeCommand(TestableGfsh shell, java.lang.String command)
shell - Shell in which to execute the command.command - Command to executeprotected com.gemstone.gemfire.management.internal.cli.result.CommandResult executeCommandWithoutClear(java.lang.String command)
command - Command to executeprotected com.gemstone.gemfire.management.internal.cli.result.CommandResult executeCommandWithoutClear(TestableGfsh shell, java.lang.String command)
shell - Shell in which to execute the command.command - Command to executeprotected void printResult(com.gemstone.gemfire.management.internal.cli.result.CommandResult commandResult,
java.io.PrintStream printStream)
commandResult - Results to dumpprintStream - Stream to dump the results toprotected java.lang.String commandResultToString(com.gemstone.gemfire.management.internal.cli.result.CommandResult commandResult)
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult extractCommandResult(java.util.Map<java.lang.String,java.lang.Object> commandOutput)
commandOutput - CommandOutput Map to searchprotected int countMatchesInString(java.lang.String stringToSearch,
java.lang.String stringToCount)
stringToSearch - String to searchstringToCount - String to look for and countprotected boolean stringContainsLine(java.lang.String stringToSearch,
java.lang.String stringPattern)
stringToSearch - String to searchstringPattern - Pattern to search forprotected int countLinesInString(java.lang.String stringToSearch,
boolean countBlankLines)
stringToSearch - String to search for lines.countBlankLines - Whether to count blank lines (true to count)protected java.lang.String getLineFromString(java.lang.String stringToSearch,
int lineNumber)
stringToSearch - String to get the line fromlineNumber - Line number to getprotected void info(java.lang.String string)
protected void debug(java.lang.String string)
protected void error(java.lang.String string)
protected void error(java.lang.String string,
java.lang.Throwable e)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.