geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstew...@apache.org
Subject [2/3] geode git commit: GEODE-2730: Refactor ServerStarterRule and LocatorStarterRule
Date Thu, 30 Mar 2017 23:00:50 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
index 0940ea6..0fffb13 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
@@ -555,7 +555,7 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase {
 
   private CacheSerializableRunnable invokeCreateRegion(final String regionName,
       final String shortcutName) {
-    return new CacheSerializableRunnable("execute: createRegion") {
+    return new CacheSerializableRunnable("execute: withRegion") {
       public void run2() {
         try {
           createRegion(RollingUpgradeDUnitTest.cache, regionName, shortcutName);

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/Bug36829DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/Bug36829DUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/Bug36829DUnitTest.java
index 69b8a79..d90d41d 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/Bug36829DUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/Bug36829DUnitTest.java
@@ -87,7 +87,7 @@ public class Bug36829DUnitTest extends JUnit4DistributedTestCase {
 
     // creating Region on the Server
     /*
-     * this.serverVM.invoke(() -> CacheServerTestUtil.createRegion( REGION_NAME )); // should be
+     * this.serverVM.invoke(() -> CacheServerTestUtil.withRegion( REGION_NAME )); // should be
      * successful. this.ClientVM.invoke(() -> Bug36829DUnitTest.registerKeyAfterRegionCreation(
      * "Key1" ));
      */

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
index f86b39f..4a67e38 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
@@ -366,7 +366,7 @@ public class DataSerializerPropogationDUnitTest extends JUnit4DistributedTestCas
       assertNotNull(bs);
       bs.start();
     } catch (Exception ex) {
-      fail("while startServer()  " + ex);
+      fail("while buildInThisVM()  " + ex);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
index 98cb309..6aea509 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
@@ -361,7 +361,7 @@ public class HAStartupAndFailoverDUnitTest extends JUnit4DistributedTestCase {
   }
 
   // public static void processException() {
-  // assertIndexDetailsEquals(conn.getServer().getPort(), PORT1.intValue());
+  // assertIndexDetailsEquals(conn.getServer().getServerPort(), PORT1.intValue());
   // try {
   // pool.processException(new Exception("dummy"), conn);
   // //Thread.sleep(10000); // why sleep?
@@ -402,7 +402,7 @@ public class HAStartupAndFailoverDUnitTest extends JUnit4DistributedTestCase {
       assertNotNull(bs);
       bs.start();
     } catch (Exception ex) {
-      fail("while startServer()  " + ex);
+      fail("while buildInThisVM()  " + ex);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
index 1fcb06a..698f795 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
@@ -408,7 +408,7 @@ public class InstantiatorPropagationDUnitTest extends JUnit4DistributedTestCase
       assertNotNull(bs);
       bs.start();
     } catch (Exception ex) {
-      fail("while startServer()  " + ex);
+      fail("while buildInThisVM()  " + ex);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
index 52a041b..4a98298 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
@@ -478,7 +478,7 @@ public class RedundancyLevelTestBase extends JUnit4DistributedTestCase {
       assertNotNull(bs);
       bs.start();
     } catch (Exception ex) {
-      Assert.fail("while startServer()", ex);
+      Assert.fail("while buildInThisVM()", ex);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsIntegrationTest.java
index 268fa39..9a39298 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsIntegrationTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsIntegrationTest.java
@@ -15,10 +15,12 @@
 
 package org.apache.geode.management.internal.cli.commands;
 
+import static org.apache.geode.test.dunit.rules.GfshShellConnectionRule.*;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.geode.test.dunit.rules.GfshShellConnectionRule;
-import org.apache.geode.test.dunit.rules.LocatorStarterRule;
+import org.apache.geode.test.dunit.rules.LocatorStarterBuilder;
+import org.apache.geode.test.dunit.rules.LocalLocatorStarterRule;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -29,14 +31,13 @@ import org.junit.experimental.categories.Category;
 public class ExportLogsIntegrationTest {
 
   @ClassRule
-  public static LocatorStarterRule locator =
-      new LocatorStarterRule().withJMXManager().startLocator();
+  public static LocalLocatorStarterRule locator = new LocatorStarterBuilder().buildInThisVM();
 
   @Rule
   public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();
 
   protected void connect() throws Exception {
-    gfsh.connectAndVerify(locator);
+    gfsh.connectAndVerify(locator.getLocatorPort(), PortType.locator);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunctionIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunctionIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunctionIntegrationTest.java
index d980318..af9a1e6 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunctionIntegrationTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunctionIntegrationTest.java
@@ -25,6 +25,8 @@ import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.cache.execute.ResultSender;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.execute.FunctionContextImpl;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.dunit.rules.ServerStarterRule;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.logging.log4j.Level;
@@ -40,7 +42,7 @@ import java.io.IOException;
 public class ExportLogsFunctionIntegrationTest {
 
   @Rule
-  public ServerStarterRule serverStarterRule = new ServerStarterRule().startServer();
+  public LocalServerStarterRule serverStarterRule = new ServerStarterBuilder().buildInThisVM();
   private File serverWorkingDir;
 
   @Before

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/cli/shell/GfshMultilineCommandTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/shell/GfshMultilineCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/shell/GfshMultilineCommandTest.java
index fb4776e..0d33058 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/shell/GfshMultilineCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/shell/GfshMultilineCommandTest.java
@@ -21,7 +21,8 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
 import org.apache.geode.test.dunit.rules.GfshShellConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.Rule;
 import org.junit.Test;
@@ -32,7 +33,8 @@ import org.junit.experimental.categories.Category;
 public class GfshMultilineCommandTest {
 
   @Rule
-  public ServerStarterRule server = new ServerStarterRule().withJMXManager().startServer();
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withJMXManager().buildInThisVM();
 
 
   @Rule

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/LogExporterIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/LogExporterIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/LogExporterIntegrationTest.java
index 5ef93de..a831ac1 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/LogExporterIntegrationTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/util/LogExporterIntegrationTest.java
@@ -22,10 +22,13 @@ import static org.assertj.core.api.Assertions.assertThat;
 import com.google.common.collect.Sets;
 
 import org.apache.geode.management.internal.cli.functions.ExportLogsFunctionIntegrationTest;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.Server;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.dunit.rules.ServerStarterRule;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.logging.log4j.Level;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Rule;
@@ -41,27 +44,34 @@ import java.util.Set;
 
 @Category(IntegrationTest.class)
 public class LogExporterIntegrationTest {
-
-  @Rule
-  public ServerStarterRule serverStarterRule = new ServerStarterRule();
-
   private LogExporter logExporter;
 
   private Properties properties;
 
   private LogFilter filter = new LogFilter(Level.INFO, null, null);
 
+  LocalServerStarterRule serverStarterRule;
+
   @Before
   public void before() throws Exception {
     properties = new Properties();
   }
 
+  @After
+  public void after() {
+    if (serverStarterRule != null) {
+      serverStarterRule.after();
+    }
+  }
+
   @Test
-  public void serverStartedWithWrongSuffix() throws Exception {
-    properties.setProperty(LOG_FILE, new File("test.txt").getAbsolutePath());
-    properties.setProperty(STATISTIC_ARCHIVE_FILE, "archive.archive");
-    Server server = serverStarterRule.withProperties(properties).startServer();
-    File serverWorkingDir = server.getWorkingDir();
+  public void serverStartedWithWrongSuffix() throws Throwable {
+    serverStarterRule =
+        new ServerStarterBuilder().withProperty(LOG_FILE, new File("test.txt").getAbsolutePath())
+            .withProperty(STATISTIC_ARCHIVE_FILE, "archive.archive").buildInThisVM();
+    serverStarterRule.before();
+
+    File serverWorkingDir = serverStarterRule.getWorkingDir();
 
     logExporter = new LogExporter(filter, new File(serverWorkingDir, "test.log"),
         new File(serverWorkingDir, "stats.gfs"));
@@ -73,15 +83,18 @@ public class LogExporterIntegrationTest {
   }
 
   @Test
-  public void serverStartedWithCorrectSuffix() throws Exception {
+  @Ignore // This test assume that new File() ends up in the workingDir, which is not true
+  public void serverStartedWithCorrectSuffix() throws Throwable {
+
+    serverStarterRule =
+        new ServerStarterBuilder().withProperty(LOG_FILE, new File("test.log").getAbsolutePath())
+            .withProperty(STATISTIC_ARCHIVE_FILE, "archive.gfs").buildInThisVM();
+    serverStarterRule.before();
+
     // ("relative log file is problematic in the test environment")
-    properties.setProperty(LOG_FILE, new File("test.log").getAbsolutePath());
-    properties.setProperty(STATISTIC_ARCHIVE_FILE, "archive.gfs");
-    Server server = serverStarterRule.withProperties(properties).startServer();
-    File serverWorkingDir = server.getWorkingDir();
+    File serverWorkingDir = serverStarterRule.getWorkingDir();
 
-    logExporter = new LogExporter(filter, new File(serverWorkingDir, "test.log"),
-        new File(serverWorkingDir, "archive.gfs"));
+    logExporter = new LogExporter(filter, new File("test.log"), new File("archive.gfs"));
     List<Path> logFiles = logExporter.findLogFiles(serverWorkingDir.toPath());
     assertThat(logFiles).hasSize(1);
     assertThat(logFiles.get(0)).hasFileName("test.log");
@@ -93,11 +106,12 @@ public class LogExporterIntegrationTest {
 
   @Test
   @Ignore("fix .gz suffix")
-  public void serverStartedWithGZSuffix() throws Exception {
-    properties.setProperty(LOG_FILE, "test.log.gz");
-    properties.setProperty(STATISTIC_ARCHIVE_FILE, "archive.gfs.gz");
-    Server server = serverStarterRule.withProperties(properties).startServer();
-    File serverWorkingDir = server.getWorkingDir();
+  public void serverStartedWithGZSuffix() throws Throwable {
+    serverStarterRule = new ServerStarterBuilder().withProperty(LOG_FILE, "test.log.gz")
+        .withProperty(STATISTIC_ARCHIVE_FILE, "archive.gfs.gz").buildInThisVM();
+    serverStarterRule.before();
+
+    File serverWorkingDir = serverStarterRule.getWorkingDir();
 
     logExporter = new LogExporter(filter, new File(serverWorkingDir, "test.log"),
         new File(serverWorkingDir, "stats.gfs"));
@@ -111,8 +125,10 @@ public class LogExporterIntegrationTest {
   @Test
   public void testNoStatsFile() throws Throwable {
     Path logsFile = Files.createTempFile("server", ".log");
-    properties.setProperty(LOG_FILE, logsFile.toString());
-    serverStarterRule.withProperties(properties).startServer();
+
+    serverStarterRule =
+        new ServerStarterBuilder().withProperty(LOG_FILE, logsFile.toString()).buildInThisVM();
+    serverStarterRule.before();
 
     ExportLogsFunctionIntegrationTest.verifyExportLogsFunctionDoesNotBlowUp();
   }
@@ -120,10 +136,10 @@ public class LogExporterIntegrationTest {
   @Test
   public void testWithRelativeStatsFile() throws Throwable {
     Path logsFile = Files.createTempFile("server", ".log");
-    // Path statsFile = Files.createTempFile("stats", ".gfs");
-    properties.setProperty(LOG_FILE, logsFile.toString());
-    properties.setProperty(STATISTIC_ARCHIVE_FILE, "stats.gfs");
-    serverStarterRule.withProperties(properties).startServer();
+
+    serverStarterRule = new ServerStarterBuilder().withProperty(LOG_FILE, logsFile.toString())
+        .withProperty(STATISTIC_ARCHIVE_FILE, "stats.gfs").buildInThisVM();
+    serverStarterRule.before();
 
     ExportLogsFunctionIntegrationTest.verifyExportLogsFunctionDoesNotBlowUp();
   }
@@ -131,25 +147,25 @@ public class LogExporterIntegrationTest {
   @Test
   public void testWithRelativeLogsFile() throws Throwable {
     Path statsFile = Files.createTempFile("stats", ".gfs");
-    properties.setProperty(LOG_FILE, "sever.log");
-    properties.setProperty(STATISTIC_ARCHIVE_FILE, statsFile.toString());
-    Server server = serverStarterRule.withProperties(properties).startServer();
+
+    serverStarterRule = new ServerStarterBuilder().withProperty(LOG_FILE, "sever.log")
+        .withProperty(STATISTIC_ARCHIVE_FILE, statsFile.toString()).buildInThisVM();
+    serverStarterRule.before();
 
     ExportLogsFunctionIntegrationTest.verifyExportLogsFunctionDoesNotBlowUp();
   }
 
   @Test
-  public void testWithAbsoluteLogsStatsFile() throws Exception {
+  public void testWithAbsoluteLogsStatsFile() throws Throwable {
     File logsDir = Files.createTempDirectory("logs").toFile();
     File statsDir = Files.createTempDirectory("stats").toFile();
 
     File logFile = new File(logsDir, "server.log");
     File statsFile = new File(statsDir, "stats.gfs");
 
-    properties.setProperty(LOG_FILE, logFile.getAbsolutePath());
-    properties.setProperty(STATISTIC_ARCHIVE_FILE, statsFile.getAbsolutePath());
-
-    serverStarterRule.withProperties(properties).startServer();
+    serverStarterRule = new ServerStarterBuilder().withProperty(LOG_FILE, logFile.getAbsolutePath())
+        .withProperty(STATISTIC_ARCHIVE_FILE, statsFile.getAbsolutePath()).buildInThisVM();
+    serverStarterRule.before();
 
     logExporter = new LogExporter(filter, logFile, statsFile);
     Path exportedZip = logExporter.export();

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/AccessControlMBeanJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/AccessControlMBeanJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/AccessControlMBeanJUnitTest.java
index 614d90c..d992e93 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/AccessControlMBeanJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/AccessControlMBeanJUnitTest.java
@@ -19,7 +19,9 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.dunit.rules.ServerStarterRule;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
@@ -34,11 +36,11 @@ public class AccessControlMBeanJUnitTest {
   private AccessControlMXBean bean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthenticationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthenticationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthenticationJUnitTest.java
index 14781d5..97436e0 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthenticationJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthenticationJUnitTest.java
@@ -19,7 +19,9 @@ import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANA
 import org.apache.geode.management.CacheServerMXBean;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.dunit.rules.ServerStarterRule;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.Before;
@@ -33,11 +35,11 @@ public class CacheServerMBeanAuthenticationJUnitTest {
   private CacheServerMXBean bean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthorizationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthorizationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthorizationJUnitTest.java
index 1e899e0..c9e3553 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthorizationJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanAuthorizationJUnitTest.java
@@ -20,7 +20,9 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import org.apache.geode.management.CacheServerMXBean;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.dunit.rules.ServerStarterRule;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
@@ -35,11 +37,11 @@ public class CacheServerMBeanAuthorizationJUnitTest {
   private CacheServerMXBean bean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanShiroJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanShiroJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanShiroJUnitTest.java
index 34ac46c..91efeac 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanShiroJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanShiroJUnitTest.java
@@ -19,7 +19,9 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 import org.apache.geode.management.CacheServerMXBean;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.dunit.rules.ServerStarterRule;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
@@ -34,8 +36,8 @@ public class CacheServerMBeanShiroJUnitTest {
   private CacheServerMXBean bean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule()
-      .withProperty(SECURITY_SHIRO_INIT, "shiro.ini").withJMXManager().startServer();
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
+      .withProperty(SECURITY_SHIRO_INIT, "shiro.ini").withJMXManager().buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/CliCommandsSecurityTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/CliCommandsSecurityTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/CliCommandsSecurityTest.java
index eab5517..f132163 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/CliCommandsSecurityTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/CliCommandsSecurityTest.java
@@ -23,8 +23,9 @@ import org.apache.geode.management.MemberMXBean;
 import org.apache.geode.security.NotAuthorizedException;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Before;
@@ -42,11 +43,11 @@ public class CliCommandsSecurityTest {
   private List<TestCommand> commands = TestCommand.getCommands();
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/DataCommandsSecurityTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/DataCommandsSecurityTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/DataCommandsSecurityTest.java
index d4910af..f6b5a2e 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/DataCommandsSecurityTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/DataCommandsSecurityTest.java
@@ -22,8 +22,9 @@ import org.apache.geode.management.MemberMXBean;
 import org.apache.geode.security.GemFireSecurityException;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Before;
@@ -38,11 +39,11 @@ public class DataCommandsSecurityTest {
   private MemberMXBean bean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @BeforeClass
   public static void beforeClass() throws Exception {

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/DeployCommandsSecurityTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/DeployCommandsSecurityTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/DeployCommandsSecurityTest.java
index 01c3a45..b619032 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/DeployCommandsSecurityTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/DeployCommandsSecurityTest.java
@@ -22,8 +22,9 @@ import org.apache.geode.management.MemberMXBean;
 import org.apache.geode.security.NotAuthorizedException;
 import org.apache.geode.security.SimpleTestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Before;
@@ -42,9 +43,9 @@ public class DeployCommandsSecurityTest {
   private MemberMXBean bean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName()).withJMXManager()
-      .startServer();
+      .buildInThisVM();
 
   @ClassRule
   public static TemporaryFolder temporaryFolder = new TemporaryFolder();

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/DiskStoreMXBeanSecurityJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/DiskStoreMXBeanSecurityJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/DiskStoreMXBeanSecurityJUnitTest.java
index 8fcaaa0..feb00d4 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/DiskStoreMXBeanSecurityJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/DiskStoreMXBeanSecurityJUnitTest.java
@@ -20,8 +20,9 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import org.apache.geode.management.DiskStoreMXBean;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Before;
@@ -36,11 +37,11 @@ public class DiskStoreMXBeanSecurityJUnitTest {
   private DiskStoreMXBean bean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @BeforeClass
   public static void beforeClass() throws Exception {

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewayReceiverMBeanSecurityTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewayReceiverMBeanSecurityTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewayReceiverMBeanSecurityTest.java
index 3bd2266..e7fe1d6 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewayReceiverMBeanSecurityTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewayReceiverMBeanSecurityTest.java
@@ -22,8 +22,9 @@ import org.apache.geode.management.GatewayReceiverMXBean;
 import org.apache.geode.management.ManagementService;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.AfterClass;
@@ -46,11 +47,11 @@ public class GatewayReceiverMBeanSecurityTest {
   private GatewayReceiverMXBean bean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewaySenderMBeanSecurityTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewaySenderMBeanSecurityTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewaySenderMBeanSecurityTest.java
index 9829e27..67cb1cc 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewaySenderMBeanSecurityTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/GatewaySenderMBeanSecurityTest.java
@@ -23,8 +23,9 @@ import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.internal.beans.GatewaySenderMBean;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.AfterClass;
@@ -46,11 +47,11 @@ public class GatewaySenderMBeanSecurityTest {
   private GatewaySenderMXBean bean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsPostProcessorTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsPostProcessorTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsPostProcessorTest.java
index e84cb56..6f2754f 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsPostProcessorTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsPostProcessorTest.java
@@ -23,7 +23,8 @@ import org.apache.geode.security.TestPostProcessor;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
 import org.apache.geode.test.dunit.rules.GfshShellConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.BeforeClass;
@@ -36,20 +37,20 @@ import org.junit.experimental.categories.Category;
 public class GfshCommandsPostProcessorTest {
 
   @ClassRule
-  public static ServerStarterRule serverStarter = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_POST_PROCESSOR, TestPostProcessor.class.getName())
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty("security-json",
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
-  public GfshShellConnectionRule gfshConnection = new GfshShellConnectionRule(
-      serverStarter.getJmxPort(), GfshShellConnectionRule.PortType.jmxManger);
+  public GfshShellConnectionRule gfshConnection =
+      new GfshShellConnectionRule(server.getJmxPort(), GfshShellConnectionRule.PortType.jmxManger);
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    serverStarter.getCache().createRegionFactory(RegionShortcut.REPLICATE).create("region1");
+    server.getCache().createRegionFactory(RegionShortcut.REPLICATE).create("region1");
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTest.java
index 348e2ea..3fe8314 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTest.java
@@ -30,7 +30,8 @@ import org.apache.geode.management.internal.cli.result.ResultBuilder;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
 import org.apache.geode.test.dunit.rules.GfshShellConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.apache.shiro.authz.permission.WildcardPermission;
@@ -45,11 +46,11 @@ import java.util.List;
 @Category({IntegrationTest.class, SecurityTest.class})
 public class GfshCommandsSecurityTest {
   @ClassRule
-  public static ServerStarterRule serverStarter = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule serverStarter = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty("security-json",
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public GfshShellConnectionRule gfshConnection = new GfshShellConnectionRule(

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/JavaRmiServerNameTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/JavaRmiServerNameTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/JavaRmiServerNameTest.java
index 6334e7e..66e2702 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/JavaRmiServerNameTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/JavaRmiServerNameTest.java
@@ -18,7 +18,8 @@ package org.apache.geode.management.internal.security;
 
 import static org.junit.Assert.assertEquals;
 
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.After;
 import org.junit.ClassRule;
@@ -31,8 +32,8 @@ public class JavaRmiServerNameTest {
   private static final String JMX_HOST = "myHostname";
 
   @ClassRule
-  public static ServerStarterRule serverStarter = new ServerStarterRule()
-      .withProperty("jmx-manager-hostname-for-clients", JMX_HOST).withJMXManager().startServer();
+  public static LocalServerStarterRule server = new ServerStarterBuilder()
+      .withProperty("jmx-manager-hostname-for-clients", JMX_HOST).withJMXManager().buildInThisVM();
 
   /**
    * this is for GEODE-1548

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/LockServiceMBeanAuthorizationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/LockServiceMBeanAuthorizationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/LockServiceMBeanAuthorizationJUnitTest.java
index a5a88c2..d2f0cae 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/LockServiceMBeanAuthorizationJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/LockServiceMBeanAuthorizationJUnitTest.java
@@ -23,8 +23,9 @@ import org.apache.geode.distributed.internal.locks.DLockService;
 import org.apache.geode.management.LockServiceMXBean;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.AfterClass;
@@ -40,11 +41,11 @@ public class LockServiceMBeanAuthorizationJUnitTest {
   private LockServiceMXBean lockServiceMBean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/MBeanSecurityJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/MBeanSecurityJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/MBeanSecurityJUnitTest.java
index f97cf2b..9dcba94 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/MBeanSecurityJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/MBeanSecurityJUnitTest.java
@@ -25,8 +25,9 @@ import org.apache.geode.management.MemberMXBean;
 import org.apache.geode.management.internal.MBeanJMXAdapter;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.ClassRule;
@@ -47,11 +48,11 @@ import javax.management.ReflectionException;
 @Category({IntegrationTest.class, SecurityTest.class})
 public class MBeanSecurityJUnitTest {
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/ManagerMBeanAuthorizationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/ManagerMBeanAuthorizationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/ManagerMBeanAuthorizationJUnitTest.java
index 9be9e02..b7447c9 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/ManagerMBeanAuthorizationJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/ManagerMBeanAuthorizationJUnitTest.java
@@ -22,8 +22,9 @@ import org.apache.geode.management.ManagerMXBean;
 import org.apache.geode.management.internal.beans.ManagerMBean;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Before;
@@ -41,11 +42,11 @@ public class ManagerMBeanAuthorizationJUnitTest {
   private ManagerMXBean managerMXBean;
 
   @ClassRule
-  public static ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public static LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/management/internal/security/MemberMBeanSecurityJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/MemberMBeanSecurityJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/MemberMBeanSecurityJUnitTest.java
index 2ee03e3..11e2026 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/MemberMBeanSecurityJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/MemberMBeanSecurityJUnitTest.java
@@ -20,8 +20,9 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import org.apache.geode.management.MemberMXBean;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.rules.ConnectionConfiguration;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
 import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Before;
@@ -34,11 +35,11 @@ public class MemberMBeanSecurityJUnitTest {
   private MemberMXBean bean;
 
   @Rule // do not use a ClassRule since some test will do a shutdownMember
-  public ServerStarterRule server = new ServerStarterRule().withJMXManager()
+  public LocalServerStarterRule server = new ServerStarterBuilder().withJMXManager()
       .withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
       .withProperty(TestSecurityManager.SECURITY_JSON,
           "org/apache/geode/management/internal/security/cacheServer.json")
-      .startServer();
+      .buildInThisVM();
 
   @Rule
   public MBeanServerConnectionRule connectionRule =

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientAuthDUnitTest.java
index 27b002b..76efae5 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientAuthDUnitTest.java
@@ -21,9 +21,11 @@ import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -35,14 +37,21 @@ public class ClientAuthDUnitTest extends JUnit4DistributedTestCase {
   final VM client1 = host.getVM(1);
   final VM client2 = host.getVM(2);
 
+  int serverPort;
+
+  @Before
+  public void setup() {
+    serverPort = server.getServerPort();
+  }
+
   @Rule
-  public ServerStarterRule server = new ServerStarterRule()
-      .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName()).startServer();
+  public transient LocalServerStarterRule server = new ServerStarterBuilder()
+      .withProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName()).buildInThisVM();
 
   @Test
   public void authWithCorrectPasswordShouldPass() {
     client1.invoke("logging in super-user with correct password", () -> {
-      SecurityTestUtil.createClientCache("test", "test", server.getPort());
+      SecurityTestUtil.createClientCache("test", "test", serverPort);
     });
   }
 
@@ -50,9 +59,8 @@ public class ClientAuthDUnitTest extends JUnit4DistributedTestCase {
   public void authWithIncorrectPasswordShouldFail() {
     IgnoredException.addIgnoredException(AuthenticationFailedException.class.getName());
     client2.invoke("logging in super-user with wrong password", () -> {
-      assertThatThrownBy(
-          () -> SecurityTestUtil.createClientCache("test", "wrong", server.getPort()))
-              .isInstanceOf(AuthenticationFailedException.class);
+      assertThatThrownBy(() -> SecurityTestUtil.createClientCache("test", "wrong", serverPort))
+          .isInstanceOf(AuthenticationFailedException.class);
     });
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientContainsKeyAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientContainsKeyAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientContainsKeyAuthDUnitTest.java
index f2398bf..0366673 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientContainsKeyAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientContainsKeyAuthDUnitTest.java
@@ -26,7 +26,8 @@ import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Before;
@@ -43,11 +44,11 @@ public class ClientContainsKeyAuthDUnitTest extends JUnit4DistributedTestCase {
   final VM client2 = host.getVM(2);
 
   @Rule
-  public ServerStarterRule server =
-      new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
           .withProperty(TestSecurityManager.SECURITY_JSON,
               "org/apache/geode/management/internal/security/clientServer.json")
-          .startServer();
+          .buildInThisVM();
 
   @Before
   public void before() throws Exception {
@@ -61,7 +62,7 @@ public class ClientContainsKeyAuthDUnitTest extends JUnit4DistributedTestCase {
   @Test
   public void testContainsKey() throws Exception {
     AsyncInvocation ai1 = client1.invokeAsync(() -> {
-      ClientCache cache = createClientCache("key1User", "1234567", server.getPort());
+      ClientCache cache = createClientCache("key1User", "1234567", server.getServerPort());
       final Region region = createProxyRegion(cache, REGION_NAME);
       assertTrue(region.containsKeyOnServer("key1"));
       SecurityTestUtil.assertNotAuthorized(() -> region.containsKeyOnServer("key3"),
@@ -69,7 +70,7 @@ public class ClientContainsKeyAuthDUnitTest extends JUnit4DistributedTestCase {
     });
 
     AsyncInvocation ai2 = client2.invokeAsync(() -> {
-      ClientCache cache = createClientCache("authRegionReader", "1234567", server.getPort());
+      ClientCache cache = createClientCache("authRegionReader", "1234567", server.getServerPort());
       final Region region = createProxyRegion(cache, REGION_NAME);
       region.containsKeyOnServer("key3");
       assertTrue(region.containsKeyOnServer("key1"));

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientDestroyInvalidateAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientDestroyInvalidateAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientDestroyInvalidateAuthDUnitTest.java
index a25900e..841d98e 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientDestroyInvalidateAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientDestroyInvalidateAuthDUnitTest.java
@@ -21,7 +21,8 @@ import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -43,11 +44,11 @@ public class ClientDestroyInvalidateAuthDUnitTest extends JUnit4DistributedTestC
   final VM client2 = host.getVM(2);
 
   @Rule
-  public ServerStarterRule server =
-      new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
           .withProperty(TestSecurityManager.SECURITY_JSON,
               "org/apache/geode/management/internal/security/clientServer.json")
-          .startServer();
+          .buildInThisVM();
 
   @Before
   public void before() throws Exception {
@@ -64,7 +65,7 @@ public class ClientDestroyInvalidateAuthDUnitTest extends JUnit4DistributedTestC
     // Delete one key and invalidate another key with an authorized user.
     AsyncInvocation ai1 = client1.invokeAsync(() -> {
       ClientCache cache =
-          SecurityTestUtil.createClientCache("dataUser", "1234567", server.getPort());
+          SecurityTestUtil.createClientCache("dataUser", "1234567", server.getServerPort());
 
       Region region =
           cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
@@ -84,7 +85,7 @@ public class ClientDestroyInvalidateAuthDUnitTest extends JUnit4DistributedTestC
     // Delete one key and invalidate another key with an unauthorized user.
     AsyncInvocation ai2 = client2.invokeAsync(() -> {
       ClientCache cache =
-          SecurityTestUtil.createClientCache("authRegionReader", "1234567", server.getPort());
+          SecurityTestUtil.createClientCache("authRegionReader", "1234567", server.getServerPort());
 
       Region region =
           cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientDestroyRegionAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientDestroyRegionAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientDestroyRegionAuthDUnitTest.java
index 33c8d62..5ea65d8 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientDestroyRegionAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientDestroyRegionAuthDUnitTest.java
@@ -24,9 +24,11 @@ import org.apache.geode.cache.client.ClientRegionShortcut;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -34,6 +36,7 @@ import org.junit.experimental.categories.Category;
 @Category({DistributedTest.class, SecurityTest.class})
 public class ClientDestroyRegionAuthDUnitTest extends JUnit4DistributedTestCase {
   private static String REGION_NAME = "testRegion";
+  private int serverPort;
 
   final Host host = Host.getHost(0);
   final VM client1 = host.getVM(1);
@@ -41,17 +44,22 @@ public class ClientDestroyRegionAuthDUnitTest extends JUnit4DistributedTestCase
   final VM client3 = host.getVM(3);
 
   @Rule
-  public ServerStarterRule server =
-      new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
           .withProperty(TestSecurityManager.SECURITY_JSON,
               "org/apache/geode/management/internal/security/clientServer.json")
-          .startServer().createRegion(RegionShortcut.REPLICATE, REGION_NAME);
+          .withRegion(RegionShortcut.REPLICATE, REGION_NAME).buildInThisVM();
+
+  @Before
+  public void setup() {
+    serverPort = server.getServerPort();
+  }
 
   @Test
   public void testDestroyRegion() throws InterruptedException {
     client1.invoke(() -> {
       ClientCache cache =
-          SecurityTestUtil.createClientCache("dataWriter", "1234567", server.getPort());
+          SecurityTestUtil.createClientCache("dataWriter", "1234567", server.getServerPort());
 
       Region region =
           cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
@@ -59,8 +67,8 @@ public class ClientDestroyRegionAuthDUnitTest extends JUnit4DistributedTestCase
     });
 
     client2.invoke(() -> {
-      ClientCache cache =
-          SecurityTestUtil.createClientCache("authRegionManager", "1234567", server.getPort());
+      ClientCache cache = SecurityTestUtil.createClientCache("authRegionManager", "1234567",
+          server.getServerPort());
 
       Region region =
           cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
@@ -69,7 +77,7 @@ public class ClientDestroyRegionAuthDUnitTest extends JUnit4DistributedTestCase
 
     client3.invoke(() -> {
       ClientCache cache =
-          SecurityTestUtil.createClientCache("super-user", "1234567", server.getPort());
+          SecurityTestUtil.createClientCache("super-user", "1234567", server.getServerPort());
 
       Region region =
           cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientExecuteFunctionAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientExecuteFunctionAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientExecuteFunctionAuthDUnitTest.java
index adc66d0..2b4c27c 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientExecuteFunctionAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientExecuteFunctionAuthDUnitTest.java
@@ -22,7 +22,9 @@ import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -47,18 +49,23 @@ public class ClientExecuteFunctionAuthDUnitTest extends JUnit4DistributedTestCas
   private final static Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
 
   @Rule
-  public ServerStarterRule server =
-      new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
           .withProperty(TestSecurityManager.SECURITY_JSON,
               "org/apache/geode/management/internal/security/clientServer.json")
-          .startServer().createRegion(RegionShortcut.REPLICATE, REGION_NAME);
+          .withRegion(RegionShortcut.REPLICATE, REGION_NAME).buildInThisVM();
+
+  @Before
+  public void setup() {
+
+  }
 
   @Test
   public void testExecuteRegionFunctionWithClientRegistration() {
 
     FunctionService.registerFunction(function);
     client1.invoke("logging in with dataReader", () -> {
-      ClientCache cache = createClientCache("dataReader", "1234567", server.getPort());
+      ClientCache cache = createClientCache("dataReader", "1234567", server.getServerPort());
 
       FunctionService.registerFunction(function);
 
@@ -67,7 +74,7 @@ public class ClientExecuteFunctionAuthDUnitTest extends JUnit4DistributedTestCas
     });
 
     client2.invoke("logging in with super-user", () -> {
-      ClientCache cache = createClientCache("super-user", "1234567", server.getPort());
+      ClientCache cache = createClientCache("super-user", "1234567", server.getServerPort());
 
       FunctionService.registerFunction(function);
       ResultCollector rc = FunctionService.onServer(cache.getDefaultPool()).withArgs(Boolean.TRUE)
@@ -81,7 +88,7 @@ public class ClientExecuteFunctionAuthDUnitTest extends JUnit4DistributedTestCas
   public void testExecuteRegionFunctionWithOutClientRegistration() {
     FunctionService.registerFunction(function);
     client1.invoke("logging in with dataReader", () -> {
-      ClientCache cache = createClientCache("dataReader", "1234567", server.getPort());
+      ClientCache cache = createClientCache("dataReader", "1234567", server.getServerPort());
       assertNotAuthorized(() -> FunctionService.onServer(cache.getDefaultPool())
           .withArgs(Boolean.TRUE).execute(function.getId()), "DATA:WRITE");
     });

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientExecuteRegionFunctionAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientExecuteRegionFunctionAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientExecuteRegionFunctionAuthDUnitTest.java
index 1f88161..a018f4c 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientExecuteRegionFunctionAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientExecuteRegionFunctionAuthDUnitTest.java
@@ -29,7 +29,8 @@ import org.apache.geode.internal.cache.functions.TestFunction;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Rule;
@@ -48,11 +49,11 @@ public class ClientExecuteRegionFunctionAuthDUnitTest extends JUnit4DistributedT
   private final static Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
 
   @Rule
-  public ServerStarterRule server =
-      new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
           .withProperty(TestSecurityManager.SECURITY_JSON,
               "org/apache/geode/management/internal/security/clientServer.json")
-          .startServer().createRegion(RegionShortcut.REPLICATE, REGION_NAME);
+          .withRegion(RegionShortcut.REPLICATE, REGION_NAME).buildInThisVM();
 
   @Test
   public void testExecuteRegionFunction() {
@@ -60,7 +61,7 @@ public class ClientExecuteRegionFunctionAuthDUnitTest extends JUnit4DistributedT
     FunctionService.registerFunction(function);
 
     client1.invoke("logging in with dataReader", () -> {
-      ClientCache cache = createClientCache("dataReader", "1234567", server.getPort());
+      ClientCache cache = createClientCache("dataReader", "1234567", server.getServerPort());
 
       Region region = createProxyRegion(cache, REGION_NAME);
       FunctionService.registerFunction(function);
@@ -70,7 +71,7 @@ public class ClientExecuteRegionFunctionAuthDUnitTest extends JUnit4DistributedT
     });
 
     client2.invoke("logging in with super-user", () -> {
-      ClientCache cache = createClientCache("super-user", "1234567", server.getPort());
+      ClientCache cache = createClientCache("super-user", "1234567", server.getServerPort());
 
       Region region = createProxyRegion(cache, REGION_NAME);
       FunctionService.registerFunction(function);

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientGetAllAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientGetAllAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientGetAllAuthDUnitTest.java
index 8963ee2..92eda18 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientGetAllAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientGetAllAuthDUnitTest.java
@@ -26,7 +26,8 @@ import org.apache.geode.cache.client.ClientCache;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Rule;
@@ -46,16 +47,16 @@ public class ClientGetAllAuthDUnitTest extends JUnit4DistributedTestCase {
   final VM client2 = host.getVM(2);
 
   @Rule
-  public ServerStarterRule server =
-      new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
           .withProperty(TestSecurityManager.SECURITY_JSON,
               "org/apache/geode/management/internal/security/clientServer.json")
-          .startServer().createRegion(RegionShortcut.REPLICATE, REGION_NAME);
+          .withRegion(RegionShortcut.REPLICATE, REGION_NAME).buildInThisVM();
 
   @Test
   public void testGetAll() {
     client1.invoke("logging in Stranger", () -> {
-      ClientCache cache = createClientCache("stranger", "1234567", server.getPort());
+      ClientCache cache = createClientCache("stranger", "1234567", server.getServerPort());
 
       Region region = createProxyRegion(cache, REGION_NAME);
       Map emptyMap = region.getAll(Arrays.asList("key1", "key2", "key3", "key4"));
@@ -63,7 +64,7 @@ public class ClientGetAllAuthDUnitTest extends JUnit4DistributedTestCase {
     });
 
     client2.invoke("logging in authRegionReader", () -> {
-      ClientCache cache = createClientCache("authRegionReader", "1234567", server.getPort());
+      ClientCache cache = createClientCache("authRegionReader", "1234567", server.getServerPort());
 
       Region region = createProxyRegion(cache, REGION_NAME);
       Map filledMap = region.getAll(Arrays.asList("key1", "key2", "key3", "key4"));

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientGetEntryAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientGetEntryAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientGetEntryAuthDUnitTest.java
index 0f41cc6..fad77f5 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientGetEntryAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientGetEntryAuthDUnitTest.java
@@ -21,13 +21,13 @@ import static org.apache.geode.security.SecurityTestUtil.createProxyRegion;
 
 import org.apache.geode.cache.CacheTransactionManager;
 import org.apache.geode.cache.Region;
-import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.cache.client.ClientCache;
 import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Before;
@@ -45,16 +45,15 @@ public class ClientGetEntryAuthDUnitTest extends JUnit4DistributedTestCase {
   final VM client2 = host.getVM(2);
 
   @Rule
-  public ServerStarterRule server =
-      new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
           .withProperty(TestSecurityManager.SECURITY_JSON,
               "org/apache/geode/management/internal/security/clientServer.json")
-          .startServer();
+          .buildInThisVM();
 
   @Before
   public void before() throws Exception {
-    Region region =
-        server.getCache().createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+    Region region = server.getCache().createRegionFactory().create(REGION_NAME);
     for (int i = 0; i < 5; i++) {
       region.put("key" + i, "value" + i);
     }
@@ -64,7 +63,7 @@ public class ClientGetEntryAuthDUnitTest extends JUnit4DistributedTestCase {
   public void testGetEntry() throws Exception {
     // client1 connects to server as a user not authorized to do any operations
     AsyncInvocation ai1 = client1.invokeAsync(() -> {
-      ClientCache cache = createClientCache("stranger", "1234567", server.getPort());
+      ClientCache cache = createClientCache("stranger", "1234567", server.getServerPort());
 
       CacheTransactionManager transactionManager = cache.getCacheTransactionManager();
       transactionManager.begin();
@@ -78,7 +77,7 @@ public class ClientGetEntryAuthDUnitTest extends JUnit4DistributedTestCase {
     });
 
     AsyncInvocation ai2 = client2.invokeAsync(() -> {
-      ClientCache cache = createClientCache("authRegionReader", "1234567", server.getPort());
+      ClientCache cache = createClientCache("authRegionReader", "1234567", server.getServerPort());
 
       CacheTransactionManager transactionManager = cache.getCacheTransactionManager();
       transactionManager.begin();

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientGetPutAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientGetPutAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientGetPutAuthDUnitTest.java
index 8f63301..a816a12 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientGetPutAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientGetPutAuthDUnitTest.java
@@ -27,7 +27,8 @@ import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Before;
@@ -52,11 +53,11 @@ public class ClientGetPutAuthDUnitTest extends JUnit4DistributedTestCase {
   final VM client3 = host.getVM(3);
 
   @Rule
-  public ServerStarterRule server =
-      new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
           .withProperty(TestSecurityManager.SECURITY_JSON,
               "org/apache/geode/management/internal/security/clientServer.json")
-          .startServer();
+          .buildInThisVM();
 
   @Before
   public void before() throws Exception {
@@ -79,7 +80,7 @@ public class ClientGetPutAuthDUnitTest extends JUnit4DistributedTestCase {
 
     // client1 connects to server as a user not authorized to do any operations
     AsyncInvocation ai1 = client1.invokeAsync(() -> {
-      ClientCache cache = createClientCache("stranger", "1234567", server.getPort());
+      ClientCache cache = createClientCache("stranger", "1234567", server.getServerPort());
       Region region = createProxyRegion(cache, REGION_NAME);
 
       assertNotAuthorized(() -> region.put("key3", "value3"), "DATA:WRITE:AuthRegion:key3");
@@ -98,7 +99,7 @@ public class ClientGetPutAuthDUnitTest extends JUnit4DistributedTestCase {
 
     // client2 connects to user as a user authorized to use AuthRegion region
     AsyncInvocation ai2 = client2.invokeAsync(() -> {
-      ClientCache cache = createClientCache("authRegionUser", "1234567", server.getPort());
+      ClientCache cache = createClientCache("authRegionUser", "1234567", server.getServerPort());
       Region region = createProxyRegion(cache, REGION_NAME);
 
       region.put("key3", "value3");
@@ -118,7 +119,7 @@ public class ClientGetPutAuthDUnitTest extends JUnit4DistributedTestCase {
 
     // client3 connects to user as a user authorized to use key1 in AuthRegion region
     AsyncInvocation ai3 = client3.invokeAsync(() -> {
-      ClientCache cache = createClientCache("key1User", "1234567", server.getPort());
+      ClientCache cache = createClientCache("key1User", "1234567", server.getServerPort());
       Region region = createProxyRegion(cache, REGION_NAME);
 
       assertNotAuthorized(() -> region.put("key2", "value1"), "DATA:WRITE:AuthRegion:key2");

http://git-wip-us.apache.org/repos/asf/geode/blob/50f6d1e3/geode-core/src/test/java/org/apache/geode/security/ClientRegionClearAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientRegionClearAuthDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/ClientRegionClearAuthDUnitTest.java
index 7eae441..99a77b6 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientRegionClearAuthDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientRegionClearAuthDUnitTest.java
@@ -26,7 +26,8 @@ import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.SerializableRunnable;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.rules.ServerStarterRule;
+import org.apache.geode.test.dunit.rules.LocalServerStarterRule;
+import org.apache.geode.test.dunit.rules.ServerStarterBuilder;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.SecurityTest;
 import org.junit.Rule;
@@ -43,11 +44,11 @@ public class ClientRegionClearAuthDUnitTest extends JUnit4DistributedTestCase {
   final VM client2 = host.getVM(2);
 
   @Rule
-  public ServerStarterRule server =
-      new ServerStarterRule().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
+  public LocalServerStarterRule server =
+      new ServerStarterBuilder().withProperty(SECURITY_MANAGER, TestSecurityManager.class.getName())
           .withProperty(TestSecurityManager.SECURITY_JSON,
               "org/apache/geode/management/internal/security/clientServer.json")
-          .startServer().createRegion(RegionShortcut.REPLICATE, REGION_NAME);
+          .withRegion(RegionShortcut.REPLICATE, REGION_NAME).buildInThisVM();
 
   @Test
   public void testRegionClear() throws InterruptedException {
@@ -55,7 +56,7 @@ public class ClientRegionClearAuthDUnitTest extends JUnit4DistributedTestCase {
     SerializableRunnable clearUnauthorized = new SerializableRunnable() {
       @Override
       public void run() {
-        ClientCache cache = createClientCache("stranger", "1234567", server.getPort());
+        ClientCache cache = createClientCache("stranger", "1234567", server.getServerPort());
         Region region = createProxyRegion(cache, REGION_NAME);
         assertNotAuthorized(() -> region.clear(), "DATA:WRITE:AuthRegion");
       }
@@ -66,7 +67,7 @@ public class ClientRegionClearAuthDUnitTest extends JUnit4DistributedTestCase {
     SerializableRunnable clearAuthorized = new SerializableRunnable() {
       @Override
       public void run() {
-        ClientCache cache = createClientCache("authRegionUser", "1234567", server.getPort());
+        ClientCache cache = createClientCache("authRegionUser", "1234567", server.getServerPort());
         Region region = createProxyRegion(cache, REGION_NAME);
         region.clear();
       }


Mime
View raw message