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 2015/12/11 22:45:40 UTC
[1/2] incubator-geode git commit: GEODE-647: fix GfshParserJUnitTest
Repository: incubator-geode
Updated Branches:
refs/heads/develop 412f2415e -> 80c61f4fd
GEODE-647: fix GfshParserJUnitTest
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/80c61f4f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/80c61f4f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/80c61f4f
Branch: refs/heads/develop
Commit: 80c61f4fd38114591cadc3fa28209206f66a2c3f
Parents: b0419b1
Author: Jens Deppe <jd...@pivotal.io>
Authored: Fri Dec 11 13:33:18 2015 -0800
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Fri Dec 11 13:45:01 2015 -0800
----------------------------------------------------------------------
.../internal/cli/GfshParserJUnitTest.java | 50 ++++++++------------
.../internal/cli/HeadlessGfshJUnitTest.java | 7 ++-
2 files changed, 24 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/80c61f4f/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java
index 68fe251..f28b5cc 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java
@@ -25,7 +25,7 @@ import java.util.ArrayList;
import java.util.List;
import org.junit.After;
-import org.junit.Ignore;
+import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.springframework.shell.core.CommandMarker;
@@ -134,6 +134,26 @@ public class GfshParserJUnitTest {
private static final Completion[] OPTION3_COMPLETIONS = {
new Completion("option3"), new Completion("option3Alternate") };
+ private CommandManager commandManager;
+
+ private GfshParser parser;
+
+ @Before
+ public void setUp() throws Exception {
+ // Make sure no prior tests leave the CommandManager in a funky state
+ CommandManager.clearInstance();
+
+ commandManager = CommandManager.getInstance(false);
+ commandManager.add(Commands.class.newInstance());
+ commandManager.add(SimpleConverter.class.newInstance());
+ commandManager.add(StringArrayConverter.class.newInstance());
+ commandManager.add(StringListConverter.class.newInstance());
+ // Set up the parser
+ parser = new GfshParser(commandManager);
+
+ CliUtil.isGfshVM = false;
+ }
+
@After
public void tearDown() {
CommandManager.clearInstance();
@@ -150,14 +170,6 @@ public class GfshParserJUnitTest {
*/
@Test
public void testComplete() throws Exception {
- // get a CommandManager, add sample commands
- CommandManager commandManager = CommandManager.getInstance(false);
- assertNotNull("CommandManager should not be null.", commandManager);
- commandManager.add(Commands.class.newInstance());
- commandManager.add(SimpleConverter.class.newInstance());
- // Set up the parser
- GfshParser parser = new GfshParser(commandManager);
-
// Get the names of the command
String[] command1Names = ((CliCommand) METHOD_command1
.getAnnotation(CliCommand.class)).value();
@@ -454,14 +466,6 @@ public class GfshParserJUnitTest {
*/
@Test
public void testCompleteAdvanced() throws Exception {
- // get a CommandManager, add sample commands
- CommandManager commandManager = CommandManager.getInstance(false);
- assertNotNull("CommandManager should not be null.", commandManager);
- commandManager.add(Commands.class.newInstance());
- commandManager.add(SimpleConverter.class.newInstance());
- // Set up the parser
- GfshParser parser = new GfshParser(commandManager);
-
// Get the names of the command
String[] command1Names = ((CliCommand) METHOD_command1
.getAnnotation(CliCommand.class)).value();
@@ -778,19 +782,7 @@ public class GfshParserJUnitTest {
* @throws SecurityException
*/
@Test
- @Ignore("GEODE-647")
public void testParse() throws Exception {
- // get a CommandManager, add sample commands
- CommandManager commandManager = CommandManager.getInstance(false);
- assertNotNull("CommandManager should not be null.", commandManager);
- commandManager.add(StringArrayConverter.class.newInstance());
- commandManager.add(StringListConverter.class.newInstance());
- commandManager.add(SimpleConverter.class.newInstance());
- commandManager.add(Commands.class.newInstance());
-
- // Set up the parser
- GfshParser parser = new GfshParser(commandManager);
-
// Get the names of the command
String[] command1Names = ((CliCommand) METHOD_command1
.getAnnotation(CliCommand.class)).value();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/80c61f4f/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/HeadlessGfshJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/HeadlessGfshJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/HeadlessGfshJUnitTest.java
index 0807898..6053494 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/HeadlessGfshJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/HeadlessGfshJUnitTest.java
@@ -22,7 +22,7 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -38,10 +38,10 @@ import static org.junit.Assert.assertTrue;
*
* @author tushark
*/
-@Category(UnitTest.class)
+@Category(IntegrationTest.class)
public class HeadlessGfshJUnitTest {
- @SuppressWarnings({"unused", "deprecation", "unused"})
+ @SuppressWarnings({"deprecation"})
@Test
public void testHeadlessGfshTest() throws ClassNotFoundException, IOException, InterruptedException {
GemFireCacheImpl cache = null;
@@ -57,7 +57,6 @@ public class HeadlessGfshJUnitTest {
ds = DistributedSystem.connect(pr);
cache = (GemFireCacheImpl) CacheFactory.create(ds);
- ObjectName name = MBeanJMXAdapter.getDistributedSystemName();
HeadlessGfsh gfsh = new HeadlessGfsh("Test", 25);
for (int i = 0; i < 5; i++) {
[2/2] incubator-geode git commit: Revert "GEODE-647: Adding some test
debugging output"
Posted by je...@apache.org.
Revert "GEODE-647: Adding some test debugging output"
This reverts commit 9d047b4df4af8d60161cab95fc9a1af5e6d956ae.
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b0419b18
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b0419b18
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b0419b18
Branch: refs/heads/develop
Commit: b0419b1884e5c12e6998f88357e1b41de21f9856
Parents: 412f241
Author: Jens Deppe <jd...@pivotal.io>
Authored: Fri Dec 11 12:32:19 2015 -0800
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Fri Dec 11 13:45:01 2015 -0800
----------------------------------------------------------------------
.../management/internal/cli/GfshParserJUnitTest.java | 13 -------------
1 file changed, 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b0419b18/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java
index c536147..68fe251 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserJUnitTest.java
@@ -150,11 +150,8 @@ public class GfshParserJUnitTest {
*/
@Test
public void testComplete() throws Exception {
- StringBuilder debugger = new StringBuilder();
-
// get a CommandManager, add sample commands
CommandManager commandManager = CommandManager.getInstance(false);
- debugger.append("cm1:").append(String.format("0x%x", commandManager.hashCode()));
assertNotNull("CommandManager should not be null.", commandManager);
commandManager.add(Commands.class.newInstance());
commandManager.add(SimpleConverter.class.newInstance());
@@ -170,16 +167,6 @@ public class GfshParserJUnitTest {
List<String> completionCandidates = new ArrayList<String>();
List<String> completionValues = new ArrayList<String>();
parser.complete(input, input.length(), completionCandidates);
- debugger.append(" cm2:").append(String.format("0x%x", CommandManager.getExisting().hashCode()));
- if (completionValues.size() != completionCandidates.size()) {
- if (completionCandidates.size() > 0) {
- for (String s : completionCandidates) {
- debugger.append(" ").append(s);
- }
- }
- assertEquals(debugger.toString(), completionValues.size(), completionCandidates.size());
- }
-
assertSimpleCompletionValues(completionValues, completionCandidates);
// Input contains a string which is prefix