You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2018/01/18 20:10:18 UTC

[geode] branch develop updated: GEODE-4316: Additional function deploy tests (#1303)

This is an automated email from the ASF dual-hosted git repository.

jensdeppe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 893f5a6  GEODE-4316: Additional function deploy tests (#1303)
893f5a6 is described below

commit 893f5a637627cbb450069db76b8368fcfca87ee7
Author: Jens Deppe <jd...@pivotal.io>
AuthorDate: Thu Jan 18 12:10:15 2018 -0800

    GEODE-4316: Additional function deploy tests (#1303)
    
    - Ensure that undeployed functions remain gone after server restart.
---
 .../cli/commands/DeployWithGroupsDUnitTest.java    | 63 +++++++++++++++++++++-
 1 file changed, 61 insertions(+), 2 deletions(-)

diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DeployWithGroupsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DeployWithGroupsDUnitTest.java
index 6441df7..a1bd2c4 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DeployWithGroupsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DeployWithGroupsDUnitTest.java
@@ -180,7 +180,6 @@ public class DeployWithGroupsDUnitTest implements Serializable {
     });
   }
 
-
   @Test
   public void deployJarToAllServers() throws Exception {
     // Deploy a jar to all servers
@@ -201,6 +200,67 @@ public class DeployWithGroupsDUnitTest implements Serializable {
   }
 
   @Test
+  public void deployJarToAllServersWithRestart() throws Exception {
+    // Deploy a jar to all servers
+    gfshConnector.executeAndAssertThat("deploy --jar=" + jar1).statusIsSuccess();
+    String resultString = gfshConnector.getGfshOutput();
+
+    assertThat(resultString).contains(server1.getName());
+    assertThat(resultString).contains(server2.getName());
+    assertThat(resultString).contains(jarName1);
+
+    server1.invoke(() -> assertThatCanLoad(jarName1, class1));
+    server2.invoke(() -> assertThatCanLoad(jarName1, class1));
+
+    server1.getVM().bounce();
+    server2.getVM().bounce();
+
+    // Restart the actual cache
+    Properties props = new Properties();
+    props.setProperty(GROUPS, GROUP1);
+    server1 = lsRule.startServerVM(1, props, locator.getPort());
+
+    props.setProperty(GROUPS, GROUP2);
+    server2 = lsRule.startServerVM(2, props, locator.getPort());
+
+    server1.invoke(() -> assertThatCanLoad(jarName1, class1));
+    server2.invoke(() -> assertThatCanLoad(jarName1, class1));
+  }
+
+  @Test
+  public void undeployJarFromAllServersWithRestart() throws Exception {
+    // Deploy a jar to all servers
+    gfshConnector.executeAndAssertThat("deploy --jar=" + jar1).statusIsSuccess();
+    String resultString = gfshConnector.getGfshOutput();
+
+    assertThat(resultString).contains(server1.getName());
+    assertThat(resultString).contains(server2.getName());
+    assertThat(resultString).contains(jarName1);
+
+    server1.invoke(() -> assertThatCanLoad(jarName1, class1));
+    server2.invoke(() -> assertThatCanLoad(jarName1, class1));
+
+    gfshConnector.executeAndAssertThat("undeploy --jar=" + jar1.getName()).statusIsSuccess();
+    // Although the jar is undeployed, we can still access the class
+    server1.invoke(() -> assertThatCannotLoad(jarName1, class1));
+    server2.invoke(() -> assertThatCannotLoad(jarName1, class1));
+
+    server1.getVM().bounce();
+    server2.getVM().bounce();
+
+    // Restart the actual cache
+    Properties props = new Properties();
+    props.setProperty(GROUPS, GROUP1);
+    server1 = lsRule.startServerVM(1, props, locator.getPort());
+
+    props.setProperty(GROUPS, GROUP2);
+    server2 = lsRule.startServerVM(2, props, locator.getPort());
+
+    server1.invoke(() -> assertThatCannotLoad(jarName1, class1));
+    server2.invoke(() -> assertThatCannotLoad(jarName1, class1));
+  }
+
+  @Test
   public void deployMultipleJarsToAllServers() throws Exception {
     gfshConnector.executeAndAssertThat("deploy --dir=" + subdirWithJars3and4.getCanonicalPath())
         .statusIsSuccess();
@@ -263,7 +323,6 @@ public class DeployWithGroupsDUnitTest implements Serializable {
         .isExactlyInstanceOf(ClassNotFoundException.class);
   }
 
-
   @Test
   public void testListDeployed() throws Exception {
     // Deploy a couple of JAR files which can be listed

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].