use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.
the class ServerLauncherTest method testSetAndGetEvictionHeapPercentage.
@Test
public void testSetAndGetEvictionHeapPercentage() {
Builder builder = new Builder();
assertNull(builder.getEvictionHeapPercentage());
assertSame(builder, builder.setEvictionHeapPercentage(55.55f));
assertEquals(55.55f, builder.getEvictionHeapPercentage().floatValue(), 0.0f);
assertSame(builder, builder.setEvictionHeapPercentage(null));
assertNull(builder.getEvictionHeapPercentage());
}
use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.
the class ServerLauncherTest method testStartCacheServerWithExistingCacheServer.
@Test
public void testStartCacheServerWithExistingCacheServer() throws IOException {
final Cache mockCache = mockContext.mock(Cache.class, "Cache");
final CacheServer mockCacheServer = mockContext.mock(CacheServer.class, "CacheServer");
mockContext.checking(new Expectations() {
{
oneOf(mockCache).getCacheServers();
will(returnValue(Collections.singletonList(mockCacheServer)));
}
});
final ServerLauncher serverLauncher = new Builder().setMemberName("serverOne").setDisableDefaultServer(false).build();
assertNotNull(serverLauncher);
assertEquals("serverOne", serverLauncher.getMemberName());
assertFalse(serverLauncher.isDisableDefaultServer());
serverLauncher.startCacheServer(mockCache);
}
use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.
the class ServerLauncherTest method testSetAndGetMemberName.
@Test
public void testSetAndGetMemberName() {
Builder builder = new Builder();
assertNull(builder.getMemberName());
assertSame(builder, builder.setMemberName("serverOne"));
assertEquals("serverOne", builder.getMemberName());
}
use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.
the class ServerLauncherTest method testStartCacheServerWhenDefaultServerDisabled.
@Test
public void testStartCacheServerWhenDefaultServerDisabled() throws IOException {
final Cache mockCache = mockContext.mock(Cache.class, "Cache");
mockContext.checking(new Expectations() {
{
oneOf(mockCache).getCacheServers();
will(returnValue(Collections.emptyList()));
}
});
final ServerLauncher serverLauncher = new Builder().setMemberName("serverOne").setDisableDefaultServer(true).build();
assertNotNull(serverLauncher);
assertEquals("serverOne", serverLauncher.getMemberName());
assertTrue(serverLauncher.isDisableDefaultServer());
serverLauncher.startCacheServer(mockCache);
}
use of org.apache.geode.distributed.ServerLauncher.Builder in project geode by apache.
the class ServerLauncherTest method testSetAndGetMaxMessageCount.
@Test
public void testSetAndGetMaxMessageCount() {
Builder builder = new Builder();
assertNull(builder.getMaxMessageCount());
assertSame(builder, builder.setMaxMessageCount(50));
assertEquals(50, builder.getMaxMessageCount().intValue());
assertSame(builder, builder.setMaxMessageCount(null));
assertNull(builder.getMaxMessageCount());
}
Aggregations