[
https://issues.apache.org/jira/browse/GEODE-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16331119#comment-16331119
]
ASF GitHub Bot commented on GEODE-4316:
---------------------------------------
jdeppe-pivotal closed pull request #1303: GEODE-4316: Additional function
deploy tests
URL: https://github.com/apache/geode/pull/1303
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
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 6441df7ce6..a1bd2c4a58 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 void deployMultipleJarsToOneGroup() throws Exception
{
});
}
-
@Test
public void deployJarToAllServers() throws Exception {
// Deploy a jar to all servers
@@ -200,6 +199,67 @@ public void deployJarToAllServers() throws Exception {
server2.invoke(() -> assertThatCanLoad(jarName1, class1));
}
+ @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())
@@ -263,7 +323,6 @@ private void assertThatCannotLoad(String jarName, String
className) {
.isExactlyInstanceOf(ClassNotFoundException.class);
}
-
@Test
public void testListDeployed() throws Exception {
// Deploy a couple of JAR files which can be listed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Add tests for jar deployment to check for server restarting
> -----------------------------------------------------------
>
> Key: GEODE-4316
> URL: https://issues.apache.org/jira/browse/GEODE-4316
> Project: Geode
> Issue Type: Improvement
> Components: gfsh
> Reporter: Jens Deppe
> Assignee: Jens Deppe
> Priority: Major
> Labels: pull-request-available
>
> Check whether a function undeploy works correctly when a server is restarted
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)