geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject incubator-geode git commit: Remove index from container start - now just auto-incremented
Date Tue, 11 Oct 2016 21:03:34 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/e2e-testing aa9b675fb -> e4313d2e9


Remove index from container start - now just auto-incremented


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e4313d2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e4313d2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e4313d2e

Branch: refs/heads/feature/e2e-testing
Commit: e4313d2e96cbdfc9b1b82aed15f4f6b1a70384c2
Parents: aa9b675
Author: Jens Deppe <jdeppe@pivotal.io>
Authored: Tue Oct 11 14:03:29 2016 -0700
Committer: Jens Deppe <jdeppe@pivotal.io>
Committed: Tue Oct 11 14:03:29 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/geode/e2e/DockerTest.java     |  2 +-
 .../apache/geode/e2e/container/DockerCluster.java | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4313d2e/geode-core/src/test/java/org/apache/geode/e2e/DockerTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/e2e/DockerTest.java b/geode-core/src/test/java/org/apache/geode/e2e/DockerTest.java
index d8581f4..13d1807 100644
--- a/geode-core/src/test/java/org/apache/geode/e2e/DockerTest.java
+++ b/geode-core/src/test/java/org/apache/geode/e2e/DockerTest.java
@@ -32,7 +32,7 @@ public class DockerTest {
 
   @Test
   public void testInvalidGfshCommandReturnsNonZero() throws Exception {
-    String id = cluster.startContainer(0);
+    String id = cluster.startContainer();
     int r = cluster.execCommand(id, false, null, new String[] { "/tmp/work/bin/gfsh", "startx"
});
     assertEquals(1, r);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4313d2e/geode-core/src/test/java/org/apache/geode/e2e/container/DockerCluster.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/e2e/container/DockerCluster.java b/geode-core/src/test/java/org/apache/geode/e2e/container/DockerCluster.java
index f1cd4e9..3ccc343 100644
--- a/geode-core/src/test/java/org/apache/geode/e2e/container/DockerCluster.java
+++ b/geode-core/src/test/java/org/apache/geode/e2e/container/DockerCluster.java
@@ -32,10 +32,10 @@ public class DockerCluster {
   private int serverCount;
   private String name;
   private List<String> nodeIds;
-  private String locatorHost;
   private int locatorPort;
   private final String geodeHome;
   private final String scratchDir;
+  private int containerCount = 0;
 
   private static final String SCRATCH_DIR_BASENAME = "scratch";
 
@@ -88,13 +88,13 @@ public class DockerCluster {
     startServers();
   }
 
-  public String startContainer(int index) throws DockerException, InterruptedException {
-    return startContainer(index, new HashMap<>());
+  public String startContainer() throws DockerException, InterruptedException {
+    return startContainer(new HashMap<>());
   }
 
-  public String startContainer(int index, Map<String, List<PortBinding>> portBindings)
throws DockerException, InterruptedException {
+  public String startContainer(Map<String, List<PortBinding>> portBindings) throws
DockerException, InterruptedException {
     String vol = String.format("%s:/tmp/work", geodeHome);
-    String hostname = String.format("%s-%d", name, index);
+    String hostname = String.format("%s-%d", name, containerCount++);
 
     HostConfig hostConfig = HostConfig.
       builder().
@@ -113,7 +113,7 @@ public class DockerCluster {
 
     ContainerCreation creation = docker.createContainer(config);
     String id = creation.id();
-//    docker.renameContainer(id, hostname);
+    docker.renameContainer(id, hostname);
     docker.startContainer(id);
     docker.inspectContainer(id);
 
@@ -140,7 +140,7 @@ public class DockerCluster {
       debugBinding.add(PortBinding.of("HostPort", (5005 + i) + ""));
       ports.put("5005/tcp", debugBinding);
 
-      String id = startContainer(i, ports);
+      String id = startContainer(ports);
       execCommand(id, true, null, command);
 
       while (gfshCommand(null, null) != 0) {
@@ -176,7 +176,7 @@ public class DockerCluster {
       debugBinding.add(PortBinding.of("HostPort", (5005 + i + locatorCount) + ""));
       ports.put("5005/tcp", debugBinding);
 
-      String id = startContainer(i, ports);
+      String id = startContainer(ports);
       execCommand(id, true, null, command);
     }
 
@@ -272,7 +272,7 @@ public class DockerCluster {
   }
 
   public String getLocatorHost() {
-    return locatorHost;
+    return "localhost";
   }
 
   public int getLocatorPort() {


Mime
View raw message