use of org.apache.geode.distributed.LocatorLauncher.Builder in project geode by apache.
the class LocatorLauncherIntegrationTest method testBuilderParseArgumentsWithValuesSeparatedWithCommas.
@Test
public void testBuilderParseArgumentsWithValuesSeparatedWithCommas() throws Exception {
// given: a new builder and working directory
String expectedWorkingDirectory = this.temporaryFolder.getRoot().getCanonicalPath();
Builder builder = new Builder();
// when: parsing many arguments
builder.parseArguments("start", "memberOne", "--bind-address", InetAddress.getLocalHost().getHostAddress(), "--dir", expectedWorkingDirectory, "--hostname-for-clients", "Tucows", "--pid", "1234", "--port", "11235", "--redirect-output", "--force", "--debug");
// then: the getters should return properly parsed values
assertThat(builder.getCommand()).isEqualTo(Command.START);
assertThat(builder.getBindAddress()).isEqualTo(InetAddress.getLocalHost());
assertThat(builder.getWorkingDirectory()).isEqualTo(expectedWorkingDirectory);
assertThat(builder.getHostnameForClients()).isEqualTo("Tucows");
assertThat(builder.getPid().intValue()).isEqualTo(1234);
assertThat(builder.getPort().intValue()).isEqualTo(11235);
assertThat(builder.getRedirectOutput()).isTrue();
assertThat(builder.getForce()).isTrue();
assertThat(builder.getDebug()).isTrue();
}
use of org.apache.geode.distributed.LocatorLauncher.Builder in project geode by apache.
the class LocatorLauncherTest method testBuildWithMemberNameSetInApiPropertiesOnStart.
@Test
public void testBuildWithMemberNameSetInApiPropertiesOnStart() {
LocatorLauncher launcher = new Builder().setCommand(LocatorLauncher.Command.START).set(NAME, "locatorABC").build();
assertThat(launcher).isNotNull();
assertEquals(LocatorLauncher.Command.START, launcher.getCommand());
assertNull(launcher.getMemberName());
assertEquals("locatorABC", launcher.getProperties().getProperty(NAME));
}
Aggregations