Search in sources :

Example 26 with Builder

use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.

the class ServerLauncherTest method testSetAndGetHostnameForClients.

@Test
public void testSetAndGetHostnameForClients() {
    final Builder builder = new Builder();
    assertNull(builder.getHostNameForClients());
    assertSame(builder, builder.setHostNameForClients("Pegasus"));
    assertEquals("Pegasus", builder.getHostNameForClients());
}
Also used : Builder(org.apache.geode.distributed.ServerLauncher.Builder) UnitTest(org.apache.geode.test.junit.categories.UnitTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test)

Example 27 with Builder

use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.

the class ServerLauncherTest method testSetAndGetCriticalHeapPercentage.

@Test
public void testSetAndGetCriticalHeapPercentage() {
    Builder builder = new Builder();
    assertNull(builder.getCriticalHeapPercentage());
    assertSame(builder, builder.setCriticalHeapPercentage(55.5f));
    assertEquals(55.5f, builder.getCriticalHeapPercentage().floatValue(), 0.0f);
    assertSame(builder, builder.setCriticalHeapPercentage(null));
    assertNull(builder.getCriticalHeapPercentage());
}
Also used : Builder(org.apache.geode.distributed.ServerLauncher.Builder) UnitTest(org.apache.geode.test.junit.categories.UnitTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test)

Example 28 with Builder

use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.

the class ServerLauncherTest method testBuildWithMemberNameSetInApiPropertiesOnStart.

@Test
public void testBuildWithMemberNameSetInApiPropertiesOnStart() {
    ServerLauncher launcher = new Builder().setCommand(ServerLauncher.Command.START).set(NAME, "serverABC").build();
    assertNotNull(launcher);
    assertEquals(ServerLauncher.Command.START, launcher.getCommand());
    assertNull(launcher.getMemberName());
    assertEquals("serverABC", launcher.getProperties().getProperty(NAME));
}
Also used : Builder(org.apache.geode.distributed.ServerLauncher.Builder) UnitTest(org.apache.geode.test.junit.categories.UnitTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test)

Example 29 with Builder

use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.

the class ServerLauncherTest method testSetAndGetServerPort.

@Test
public void testSetAndGetServerPort() {
    Builder builder = new Builder();
    assertEquals(ServerLauncher.DEFAULT_SERVER_PORT, builder.getServerPort());
    assertSame(builder, builder.setServerPort(0));
    assertEquals(0, builder.getServerPort().intValue());
    assertSame(builder, builder.setServerPort(1));
    assertEquals(1, builder.getServerPort().intValue());
    assertSame(builder, builder.setServerPort(80));
    assertEquals(80, builder.getServerPort().intValue());
    assertSame(builder, builder.setServerPort(1024));
    assertEquals(1024, builder.getServerPort().intValue());
    assertSame(builder, builder.setServerPort(65535));
    assertEquals(65535, builder.getServerPort().intValue());
    assertSame(builder, builder.setServerPort(null));
    assertEquals(ServerLauncher.DEFAULT_SERVER_PORT, builder.getServerPort());
}
Also used : Builder(org.apache.geode.distributed.ServerLauncher.Builder) UnitTest(org.apache.geode.test.junit.categories.UnitTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test)

Example 30 with Builder

use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.

the class ServerLauncherTest method testSetAndGetMaxConnections.

@Test
public void testSetAndGetMaxConnections() {
    Builder builder = new Builder();
    assertNull(builder.getMaxConnections());
    assertSame(builder, builder.setMaxConnections(1000));
    assertEquals(1000, builder.getMaxConnections().intValue());
    assertSame(builder, builder.setMaxConnections(null));
    assertNull(builder.getMaxConnections());
}
Also used : Builder(org.apache.geode.distributed.ServerLauncher.Builder) UnitTest(org.apache.geode.test.junit.categories.UnitTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test)

Aggregations

Builder (org.apache.geode.distributed.ServerLauncher.Builder)56 Test (org.junit.Test)56 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)31 UnitTest (org.apache.geode.test.junit.categories.UnitTest)29 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)27 File (java.io.File)18 Cache (org.apache.geode.cache.Cache)14 Expectations (org.jmock.Expectations)12 ServerState (org.apache.geode.distributed.ServerLauncher.ServerState)11 ArrayList (java.util.ArrayList)4 CacheServer (org.apache.geode.cache.server.CacheServer)4 InternalDistributedSystem (org.apache.geode.distributed.internal.InternalDistributedSystem)3 FileNotFoundException (java.io.FileNotFoundException)2 FileWriter (java.io.FileWriter)2 PrintWriter (java.io.PrintWriter)2 BindException (java.net.BindException)2 Properties (java.util.Properties)2 CacheCreation (org.apache.geode.internal.cache.xmlcache.CacheCreation)2 RegionAttributesCreation (org.apache.geode.internal.cache.xmlcache.RegionAttributesCreation)2 ProcessStreamReader (org.apache.geode.internal.process.ProcessStreamReader)2