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 2019/02/07 02:21:48 UTC
[geode] branch develop updated: Revert "GEODE-6364: Deploy of
invalid jar file does not write file contents to config on locator (#3164)"
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 2d7a830 Revert "GEODE-6364: Deploy of invalid jar file does not write file contents to config on locator (#3164)"
2d7a830 is described below
commit 2d7a830adead944ebf60f11ff19634cea5291f13
Author: Jens Deppe <jd...@pivotal.io>
AuthorDate: Wed Feb 6 18:21:26 2019 -0800
Revert "GEODE-6364: Deploy of invalid jar file does not write file contents to config on locator (#3164)"
This reverts commit 7f10f3a297eeeb473c3f16fff9465df9b404a21c.
---
.../ClusterConfigDeployJarDUnitTest.java | 32 ----------------------
.../internal/cli/commands/DeployCommand.java | 13 ---------
2 files changed, 45 deletions(-)
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigDeployJarDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigDeployJarDUnitTest.java
index 3d3e225..185cf14 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigDeployJarDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/configuration/ClusterConfigDeployJarDUnitTest.java
@@ -18,14 +18,10 @@ import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
import static org.assertj.core.api.Assertions.assertThat;
-import java.io.File;
-import java.io.FileWriter;
-
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.rules.GfshCommandRule;
@@ -137,34 +133,6 @@ public class ClusterConfigDeployJarDUnitTest extends ClusterConfigTestBase {
}
@Test
- public void testInvalidJarDeploy() throws Exception {
- IgnoredException.addIgnoredException(IllegalArgumentException.class);
-
- // set up the locator/servers
- MemberVM locator = lsRule.startLocatorVM(0, locatorProps);
- // server1 in no group
- MemberVM server1 = lsRule.startServerVM(1, serverProps, locator.getPort());
-
- gfshConnector.connect(locator);
- assertThat(gfshConnector.isConnected()).isTrue();
-
- File junkFile = temporaryFolder.newFile("junk");
- FileWriter writer = new FileWriter(junkFile);
- writer.write("this is not a real jar");
- writer.close();
-
- // We want to ensure that a mix of good and bad jars does not produce a 'partial' deploy.
- gfshConnector.executeAndAssertThat("deploy --jar=" + clusterJar + ","
- + junkFile.getAbsolutePath()).statusIsError();
- gfshConnector.executeAndAssertThat("list deployed").statusIsSuccess()
- .containsOutput("No JAR Files Found");
-
- ConfigGroup cluster = new ConfigGroup("cluster").jars();
- ClusterConfig expectedClusterConfig = new ClusterConfig(cluster);
- expectedClusterConfig.verify(locator);
- }
-
- @Test
public void testUndeploy() throws Exception {
// set up the locator/servers
MemberVM locator = lsRule.startLocatorVM(0, locatorProps);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommand.java
index 090f73a..39efca0 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommand.java
@@ -37,7 +37,6 @@ import org.springframework.shell.core.annotation.CliOption;
import org.apache.geode.cache.execute.ResultCollector;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.InternalConfigurationPersistenceService;
-import org.apache.geode.internal.DeployedJar;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.ConverterHint;
import org.apache.geode.management.cli.Result;
@@ -85,8 +84,6 @@ public class DeployCommand extends InternalGfshCommand {
List<String> jarFullPaths = CommandExecutionContext.getFilePathFromShell();
- verifyJarContent(jarFullPaths);
-
Set<DistributedMember> targetMembers;
targetMembers = findMembers(groups, null);
@@ -151,16 +148,6 @@ public class DeployCommand extends InternalGfshCommand {
return result;
}
- private void verifyJarContent(List<String> jarNames) {
- for (String jarName : jarNames) {
- File jar = new File(jarName);
- if (!DeployedJar.hasValidJarContent(jar)) {
- throw new IllegalArgumentException(
- "File does not contain valid JAR content: " + jar.getName());
- }
- }
- }
-
/**
* Interceptor used by gfsh to intercept execution of deploy command at "shell".
*/