Search in sources :

Example 31 with Parameters

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);
}
Also used : File(java.io.File) Parameters(junitparams.Parameters) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 32 with Parameters

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);
}
Also used : HostName(org.apache.geode.internal.util.HostName) Parameters(junitparams.Parameters) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Example 33 with Parameters

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);
}
Also used : HostName(org.apache.geode.internal.util.HostName) Parameters(junitparams.Parameters) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Example 34 with Parameters

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();
}
Also used : HostName(org.apache.geode.internal.util.HostName) Parameters(junitparams.Parameters) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Example 35 with Parameters

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());
}
Also used : Keeper(org.apache.geode.internal.AvailablePort.Keeper) HashSet(java.util.HashSet) Parameters(junitparams.Parameters) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Aggregations

Parameters (junitparams.Parameters)311 Test (org.junit.Test)311 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)55 DescriptorSet (com.spotify.protoman.descriptor.DescriptorSet)43 ValidationViolation (com.spotify.protoman.validation.ValidationViolation)43 SerializableRunnableIF (org.apache.geode.test.dunit.SerializableRunnableIF)41 QueryDataSource (org.apache.druid.query.QueryDataSource)30 TableDataSource (org.apache.druid.query.TableDataSource)30 GlobalTableDataSource (org.apache.druid.query.GlobalTableDataSource)26 DefaultDimensionSpec (org.apache.druid.query.dimension.DefaultDimensionSpec)26 CountAggregatorFactory (org.apache.druid.query.aggregation.CountAggregatorFactory)24 Method (java.lang.reflect.Method)19 LookupDataSource (org.apache.druid.query.LookupDataSource)19 IByteArrayKeyValueDatabase (org.aion.base.db.IByteArrayKeyValueDatabase)18 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)17 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)13 MapTableField (com.hazelcast.sql.impl.schema.map.MapTableField)12 Owner (org.candlepin.model.Owner)12 Product (org.candlepin.model.Product)12 CommandResult (org.apache.geode.management.internal.cli.result.CommandResult)11