You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/05/20 17:11:09 UTC
[44/50] [abbrv] incubator-geode git commit: GEODE-1397: Rename
HelpCommandsJUnitTest to ...IntegrationTest
GEODE-1397: Rename HelpCommandsJUnitTest to ...IntegrationTest
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/dd8ea42a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/dd8ea42a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/dd8ea42a
Branch: refs/heads/feature/GEODE-835
Commit: dd8ea42aa4fa00eda4f8812d8fdb108ceec3687a
Parents: 3a1c1a9
Author: Jens Deppe <jd...@pivotal.io>
Authored: Wed May 18 14:24:39 2016 -0700
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Thu May 19 19:34:51 2016 -0700
----------------------------------------------------------------------
.../commands/HelpCommandsIntegrationTest.java | 130 +++++++++++++++++++
.../cli/commands/HelpCommandsJUnitTest.java | 130 -------------------
2 files changed, 130 insertions(+), 130 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dd8ea42a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsIntegrationTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsIntegrationTest.java
new file mode 100644
index 0000000..5d43a0e
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsIntegrationTest.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.management.internal.cli.commands;
+
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.management.internal.cli.CommandManager;
+import com.gemstone.gemfire.management.internal.cli.parser.CommandTarget;
+import com.gemstone.gemfire.management.internal.cli.result.CommandResult;
+import com.gemstone.gemfire.management.internal.cli.shell.Gfsh;
+import com.gemstone.gemfire.management.internal.cli.shell.GfshConfig;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.util.Map;
+import java.util.Properties;
+
+import static com.gemstone.gemfire.management.internal.cli.commands.CliCommandTestBase.commandResultToString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@Category(IntegrationTest.class)
+public class HelpCommandsIntegrationTest extends JUnit4DistributedTestCase {
+
+ private int jmxPort;
+
+ private Gfsh gfsh;
+
+ @Before
+ public void setup() throws Exception {
+ jmxPort = AvailablePortHelper.getRandomAvailableTCPPort();
+
+ Properties localProps = new Properties();
+ localProps.setProperty(DistributionConfig.JMX_MANAGER_NAME, "true");
+ localProps.setProperty(DistributionConfig.JMX_MANAGER_START_NAME, "true");
+ localProps.setProperty(DistributionConfig.JMX_MANAGER_PORT_NAME, String.valueOf(jmxPort));
+ getSystem(localProps);
+
+ gfsh = Gfsh.getInstance(false, new String[0], new GfshConfig());
+ }
+
+ @After
+ public void teardown() {
+ disconnectAllFromDS();
+
+ gfsh.executeCommand("disconnect");
+ }
+
+ @Ignore("Disconnect command doesn't appear to be working")
+ @Test
+ public void testOfflineHelp() throws Exception {
+ Properties helpProps = new Properties();
+ helpProps.load(HelpCommandsIntegrationTest.class.getResourceAsStream("golden-help-offline.properties"));
+
+ CommandManager cm = CommandManager.getInstance();
+ for (Map.Entry<String, CommandTarget> e : cm.getCommands().entrySet()) {
+ // Mock commands may have been produced in the VM by other tests
+ // 'quit' is an alias for 'exit' and doesn't produce help
+ if (e.getKey().contains("mock") || e.getKey().contains("quit")) {
+ continue;
+ }
+
+ CommandResult cr = (CommandResult) gfsh.executeCommand("help " + e.getKey()).getResult();
+ String gfshResult = commandResultToString(cr);
+
+ String goldParam = e.getKey().replace(" ", "-") + ".help";
+ String goldResult = helpProps.getProperty(goldParam);
+ assertNotNull("No golden text for: " + goldParam, goldResult);
+ assertEquals(goldResult.trim(), gfshResult.trim());
+
+ helpProps.remove(goldParam);
+ }
+
+ // No help should remain unchecked
+ assertEquals(0, helpProps.size());
+ }
+
+ @Test
+ public void testOnlineHelp() throws Exception {
+ Properties helpProps = new Properties();
+ helpProps.load(HelpCommandsIntegrationTest.class.getResourceAsStream("golden-help-online.properties"));
+
+ gfsh.executeCommand("connect --jmx-manager=localhost[" + jmxPort + "]");
+
+ CommandManager cm = CommandManager.getInstance();
+ for (Map.Entry<String, CommandTarget> e : cm.getCommands().entrySet()) {
+ // Mock commands may have been produced in the VM by other tests
+ // 'quit' is an alias for 'exit' and doesn't produce help
+ if (e.getKey().contains("mock") || e.getKey().contains("quit")) {
+ continue;
+ }
+
+ CommandResult cr = (CommandResult) gfsh.executeCommand("help " + e.getKey()).getResult();
+ String gfshResult = commandResultToString(cr);
+
+ String goldParam = e.getKey().replace(" ", "-") + ".help";
+ String goldResult = helpProps.getProperty(goldParam);
+ assertNotNull("No golden text for: " + goldParam, goldResult);
+
+ String[] lines = gfshResult.split("\n");
+ gfshResult = String.join("\n", lines[0], lines[1], lines[2], lines[3]);
+
+ assertEquals(goldResult.trim(), gfshResult.trim());
+
+ helpProps.remove(goldParam);
+ }
+
+ // No help should remain unchecked
+ assertEquals(0, helpProps.size());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dd8ea42a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsJUnitTest.java
deleted file mode 100644
index 1d81d2e..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsJUnitTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.management.internal.cli.commands;
-
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.management.internal.cli.CommandManager;
-import com.gemstone.gemfire.management.internal.cli.parser.CommandTarget;
-import com.gemstone.gemfire.management.internal.cli.result.CommandResult;
-import com.gemstone.gemfire.management.internal.cli.shell.Gfsh;
-import com.gemstone.gemfire.management.internal.cli.shell.GfshConfig;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.management.internal.cli.commands.CliCommandTestBase.commandResultToString;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@Category(IntegrationTest.class)
-public class HelpCommandsJUnitTest extends JUnit4DistributedTestCase {
-
- private int jmxPort;
-
- private Gfsh gfsh;
-
- @Before
- public void setup() throws Exception {
- jmxPort = AvailablePortHelper.getRandomAvailableTCPPort();
-
- Properties localProps = new Properties();
- localProps.setProperty(DistributionConfig.JMX_MANAGER_NAME, "true");
- localProps.setProperty(DistributionConfig.JMX_MANAGER_START_NAME, "true");
- localProps.setProperty(DistributionConfig.JMX_MANAGER_PORT_NAME, String.valueOf(jmxPort));
- getSystem(localProps);
-
- gfsh = Gfsh.getInstance(false, new String[0], new GfshConfig());
- }
-
- @After
- public void teardown() {
- disconnectAllFromDS();
-
- gfsh.executeCommand("disconnect");
- }
-
- @Ignore("Disconnect command doesn't appear to be working")
- @Test
- public void testOfflineHelp() throws Exception {
- Properties helpProps = new Properties();
- helpProps.load(HelpCommandsJUnitTest.class.getResourceAsStream("golden-help-offline.properties"));
-
- CommandManager cm = CommandManager.getInstance();
- for (Map.Entry<String, CommandTarget> e : cm.getCommands().entrySet()) {
- // Mock commands may have been produced in the VM by other tests
- // 'quit' is an alias for 'exit' and doesn't produce help
- if (e.getKey().contains("mock") || e.getKey().contains("quit")) {
- continue;
- }
-
- CommandResult cr = (CommandResult) gfsh.executeCommand("help " + e.getKey()).getResult();
- String gfshResult = commandResultToString(cr);
-
- String goldParam = e.getKey().replace(" ", "-") + ".help";
- String goldResult = helpProps.getProperty(goldParam);
- assertNotNull("No golden text for: " + goldParam, goldResult);
- assertEquals(goldResult.trim(), gfshResult.trim());
-
- helpProps.remove(goldParam);
- }
-
- // No help should remain unchecked
- assertEquals(0, helpProps.size());
- }
-
- @Test
- public void testOnlineHelp() throws Exception {
- Properties helpProps = new Properties();
- helpProps.load(HelpCommandsJUnitTest.class.getResourceAsStream("golden-help-online.properties"));
-
- gfsh.executeCommand("connect --jmx-manager=localhost[" + jmxPort + "]");
-
- CommandManager cm = CommandManager.getInstance();
- for (Map.Entry<String, CommandTarget> e : cm.getCommands().entrySet()) {
- // Mock commands may have been produced in the VM by other tests
- // 'quit' is an alias for 'exit' and doesn't produce help
- if (e.getKey().contains("mock") || e.getKey().contains("quit")) {
- continue;
- }
-
- CommandResult cr = (CommandResult) gfsh.executeCommand("help " + e.getKey()).getResult();
- String gfshResult = commandResultToString(cr);
-
- String goldParam = e.getKey().replace(" ", "-") + ".help";
- String goldResult = helpProps.getProperty(goldParam);
- assertNotNull("No golden text for: " + goldParam, goldResult);
-
- String[] lines = gfshResult.split("\n");
- gfshResult = String.join("\n", lines[0], lines[1], lines[2], lines[3]);
-
- assertEquals(goldResult.trim(), gfshResult.trim());
-
- helpProps.remove(goldParam);
- }
-
- // No help should remain unchecked
- assertEquals(0, helpProps.size());
- }
-}