Skip to content

Commit

Permalink
GEODE-2138: Replaced Gemfire with Geode in the output of start locato…
Browse files Browse the repository at this point in the history
…r and start server command. Added test to verify the same.

* this closes apache#328
  • Loading branch information
Nilkanth Patel authored and jinmeiliao committed Jan 10, 2017
1 parent f03925e commit bfa76e9
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,57 @@ public void test001StartLocatorFailsFastOnMissingGemFirePropertiesFile() throws
StringUtils.EMPTY_STRING, gemfirePropertiesPathname)));
}

/**
* Test to verify GEODE-2138
*
* @throws IOException
*/
@Test
public void testVersionTitleForStartServerAndLocator() throws IOException {
final int locatorPort = AvailablePortHelper.getRandomAvailableTCPPort();

String pathname = (getClass().getSimpleName() + "_" + getTestMethodName());
String pathnameLoc = pathname + "_loc";
String pathnameSer = pathname + "_ser";

File workingDirectoryLoc = temporaryFolder.newFolder(pathnameLoc);
File workingDirectorySer = temporaryFolder.newFolder(pathnameSer);

assertTrue(workingDirectoryLoc.isDirectory() || workingDirectoryLoc.mkdir());
assertTrue(workingDirectorySer.isDirectory() || workingDirectorySer.mkdir());

try {
// verify the start locator output does not contain string "gemfire"
CommandStringBuilder locCommand = new CommandStringBuilder(CliStrings.START_LOCATOR);
locCommand.addOption(CliStrings.START_LOCATOR__MEMBER_NAME, pathnameLoc);
locCommand.addOption(CliStrings.START_LOCATOR__CONNECT, Boolean.FALSE.toString());
locCommand.addOption(CliStrings.START_LOCATOR__DIR, workingDirectoryLoc.getCanonicalPath());
locCommand.addOption(CliStrings.START_LOCATOR__PORT, String.valueOf(locatorPort));

CommandResult locResult = executeCommand(locCommand.toString());
assertNotNull(locResult);
assertEquals(Result.Status.OK, locResult.getStatus());
String locatorOutput = toString(locResult);
assertNotNull(locatorOutput);
assertTrue("Locator output was: " + locatorOutput, !locatorOutput.contains("Gemfire"));

// verify the start server output does not contain string "gemfire"
CommandStringBuilder serCommand = new CommandStringBuilder(CliStrings.START_SERVER);
serCommand.addOption(CliStrings.START_SERVER__NAME, pathnameSer);
serCommand.addOption(CliStrings.START_SERVER__DIR, workingDirectorySer.getCanonicalPath());

CommandResult serResult = executeCommand(serCommand.toString());
assertNotNull(serResult);
assertEquals(Result.Status.OK, serResult.getStatus());
String serverOutput = toString(serResult);

assertTrue("Server start output was: " + serverOutput, !serverOutput.contains("Gemfire"));
} finally {
stopLocator(workingDirectoryLoc);
stopServer(IOUtils.tryGetCanonicalPathElseGetAbsolutePath(workingDirectorySer));
}
}

@Test
public void test002StartLocatorFailsFastOnMissingGemFireSecurityPropertiesFile()
throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7117,9 +7117,9 @@ public class LocalizedStrings {
public static final StringId Launcher_Command_START_PID_UNAVAILABLE_ERROR_MESSAGE = new StringId(
5249, "The process ID could not be determined while starting {0} {1} in {2}: {3}");
public static final StringId Launcher_ServiceStatus_STARTING_MESSAGE = new StringId(5250,
"Starting {0} in {1} on {2} as {3} at {4}\nProcess ID: {5}\nGemFire Version: {6}\nJava Version: {7}\nLog File: {8}\nJVM Arguments: {9}\nClass-Path: {10}");
"Starting {0} in {1} on {2} as {3} at {4}\nProcess ID: {5}\nGeode Version: {6}\nJava Version: {7}\nLog File: {8}\nJVM Arguments: {9}\nClass-Path: {10}");
public static final StringId Launcher_ServiceStatus_RUNNING_MESSAGE = new StringId(5251,
"{0} in {1} on {2} as {3} is currently {4}.\nProcess ID: {5}\nUptime: {6}\nGemFire Version: {7}\nJava Version: {8}\nLog File: {9}\nJVM Arguments: {10}\nClass-Path: {11}");
"{0} in {1} on {2} as {3} is currently {4}.\nProcess ID: {5}\nUptime: {6}\nGeode Version: {7}\nJava Version: {8}\nLog File: {9}\nJVM Arguments: {10}\nClass-Path: {11}");
public static final StringId Launcher_ServiceStatus_STOPPED_MESSAGE =
new StringId(5252, "{0} in {1} on {2} has been requested to stop.");
public static final StringId Launcher_ServiceStatus_MESSAGE =
Expand Down

0 comments on commit bfa76e9

Please sign in to comment.