use of junitparams.Parameters in project geode by apache.
the class StatArchiveHandlerIntegrationTest method getRenameArchiveName_withOldArchives_rollsMainId.
@Test
@Parameters({ "1,1", "1,10", "10,1", "10,10" })
public void getRenameArchiveName_withOldArchives_rollsMainId(final int mainCount, final int childCount) throws Exception {
StatArchiveHandler handler = new StatArchiveHandler(this.mockConfig, this.mockCollector, this.rollingFileHandler);
createEmptyArchiveFiles(this.dir, this.name, this.ext, mainCount, childCount);
File renamed = handler.getRenameArchiveName(this.archive);
assertThat(renamed).doesNotExist().hasParent(this.dir).hasName(this.name + formatIds(mainCount + 1, 1) + this.ext);
}
use of junitparams.Parameters in project geode by apache.
the class HostNameTest method shouldBeNullIfEnvValueNotAvailableOnOS.
@Test
@Parameters({ MAC_OSX_NAME, LINUX_OS_NAME, SOLARIS_OS_NAME, WINDOWS_OS_NAME })
public void shouldBeNullIfEnvValueNotAvailableOnOS(String osName) throws IOException {
setHostNamePropertiesNull(osName);
String result = new HostName().getHostNameFromEnv();
assertThat(result).isEqualTo(null);
}
use of junitparams.Parameters in project geode by apache.
the class HostNameTest method shouldUseComputerNameIfAvailableOnOS.
@Test
@Parameters({ MAC_OSX_NAME, LINUX_OS_NAME, SOLARIS_OS_NAME, WINDOWS_OS_NAME })
public void shouldUseComputerNameIfAvailableOnOS(String osName) throws IOException {
setHostNameProperties(osName);
String result = new HostName().determineHostName();
assertThat(result).isEqualTo(EXPECTED_HOSTNAME);
}
use of junitparams.Parameters in project geode by apache.
the class HostNameTest method shouldExecHostNameIfEnvValueNotAvailableOnOS.
@Test
@Parameters({ MAC_OSX_NAME, LINUX_OS_NAME, SOLARIS_OS_NAME, WINDOWS_OS_NAME })
public void shouldExecHostNameIfEnvValueNotAvailableOnOS(String osName) throws IOException {
setHostNamePropertiesNull(osName);
String result = new HostName().determineHostName();
assertThat(result).isNotNull();
}
use of junitparams.Parameters in project geode by apache.
the class AvailablePortHelperIntegrationTest method getRandomAvailableTCPPortRangeKeepers_returnsUniqueKeepers.
@Test
@Parameters({ "true", "false" })
public void getRandomAvailableTCPPortRangeKeepers_returnsUniqueKeepers(final boolean useMembershipPortRange) throws Exception {
List<Keeper> results = getRandomAvailableTCPPortRangeKeepers(10, useMembershipPortRange);
Set<Integer> ports = new HashSet<>();
for (Keeper keeper : results) {
ports.add(keeper.getPort());
}
assertThat(ports).hasSize(results.size());
}
Aggregations