Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31EE618C0A for ; Mon, 14 Dec 2015 18:06:51 +0000 (UTC) Received: (qmail 65388 invoked by uid 500); 14 Dec 2015 18:06:51 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 65356 invoked by uid 500); 14 Dec 2015 18:06:51 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 65347 invoked by uid 99); 14 Dec 2015 18:06:51 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Dec 2015 18:06:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A15711A037A for ; Mon, 14 Dec 2015 18:06:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.227 X-Spam-Level: * X-Spam-Status: No, score=1.227 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id yjI3-6l84VHb for ; Mon, 14 Dec 2015 18:06:46 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 1D010439D5 for ; Mon, 14 Dec 2015 18:06:36 +0000 (UTC) Received: (qmail 63912 invoked by uid 99); 14 Dec 2015 18:06:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Dec 2015 18:06:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8EA85E097A; Mon, 14 Dec 2015 18:06:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Mon, 14 Dec 2015 18:06:57 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [24/48] incubator-geode git commit: GEODE-647: fix GfshParserJUnitTest 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/feature/GEODE-217 Commit: 80c61f4fd38114591cadc3fa28209206f66a2c3f Parents: b0419b1 Author: Jens Deppe Authored: Fri Dec 11 13:33:18 2015 -0800 Committer: Jens Deppe 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++) {