public class CliCommandTestBase extends CacheTestCase
DistributedTestCase.ExpectedException, DistributedTestCase.WaitCriterion, DistributedTestCase.WaitCriterion2| Modifier and Type | Field and Description |
|---|---|
protected static String |
USE_HTTP_SYSTEM_PROPERTY |
cachelogPerTest, reconnect, system, testName| Constructor and Description |
|---|
CliCommandTestBase(String name) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
commandResultToString(com.gemstone.gemfire.management.internal.cli.result.CommandResult commandResult) |
protected int |
countLinesInString(String stringToSearch,
boolean countBlankLines)
Counts the number of distinct lines in a String.
|
protected int |
countMatchesInString(String stringToSearch,
String stringToCount)
Utility method to determine how many times a string occurs in another string.
|
protected TestableGfsh |
createDefaultSetup(Properties props)
Create all of the components necessary for the default setup.
|
protected TestableGfsh |
createShell()
Create a TestableGfsh object.
|
protected void |
debug(String string) |
protected void |
destroyDefaultSetup()
Destroy all of the components created for the default setup.
|
protected void |
error(String string) |
protected void |
error(String string,
Throwable e) |
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult |
executeCommand(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,
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(String command)
Execute a command using the default shell.
|
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult |
executeCommandWithoutClear(TestableGfsh shell,
String command)
Execute a command in the provided shell.
|
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult |
extractCommandResult(Map<String,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 String |
getLineFromString(String stringToSearch,
int lineNumber)
Get a specific line from the string (using \n or \r as a line separator).
|
protected void |
info(String string) |
protected void |
printResult(com.gemstone.gemfire.management.internal.cli.result.CommandResult commandResult,
PrintStream printStream)
Utility method for viewing the results of a command.
|
void |
setUp()
Sets up the test (noop).
|
protected void |
shellConnect(String host,
int jmxPort,
int httpPort,
TestableGfsh shell)
Connect a shell to the JMX server at the given host and port
|
protected boolean |
stringContainsLine(String stringToSearch,
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 String USE_HTTP_SYSTEM_PROPERTY
public CliCommandTestBase(String name)
public void setUp()
throws Exception
DistributedTestCasesetUp in class DistributedTestCaseExceptionpublic void tearDown2()
throws Exception
DistributedTestCaseDistributedTestCase.tearDown() method, and should be over ridden in its place.tearDown2 in class CacheTestCaseExceptionprotected final TestableGfsh createDefaultSetup(Properties props)
props - Properties used when creating the cache for this default setup.protected final void destroyDefaultSetup()
protected void shellConnect(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(String command)
command - Command to executeprotected com.gemstone.gemfire.management.internal.cli.result.CommandResult executeCommand(TestableGfsh shell, String command)
shell - Shell in which to execute the command.command - Command to executeprotected com.gemstone.gemfire.management.internal.cli.result.CommandResult executeCommandWithoutClear(String command)
command - Command to executeprotected com.gemstone.gemfire.management.internal.cli.result.CommandResult executeCommandWithoutClear(TestableGfsh shell, 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,
PrintStream printStream)
commandResult - Results to dumpprintStream - Stream to dump the results toprotected String commandResultToString(com.gemstone.gemfire.management.internal.cli.result.CommandResult commandResult)
protected com.gemstone.gemfire.management.internal.cli.result.CommandResult extractCommandResult(Map<String,Object> commandOutput)
commandOutput - CommandOutput Map to searchprotected int countMatchesInString(String stringToSearch, String stringToCount)
stringToSearch - String to searchstringToCount - String to look for and countprotected boolean stringContainsLine(String stringToSearch, String stringPattern)
stringToSearch - String to searchstringPattern - Pattern to search forprotected int countLinesInString(String stringToSearch, boolean countBlankLines)
stringToSearch - String to search for lines.countBlankLines - Whether to count blank lines (true to count)protected String getLineFromString(String stringToSearch, int lineNumber)
stringToSearch - String to get the line fromlineNumber - Line number to getprotected void info(String string)
protected void debug(String string)
protected void error(String string)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.