From 20006b6e9df5f5689d2275ead6283c9174703e40 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 8 Sep 2015 11:05:19 -0400 Subject: [PATCH] test fixes on windows --- .../apache/activemq/cli/test/ArtemisTest.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java index 1ec7601ef9..df2ec38e27 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java @@ -64,12 +64,17 @@ public class ArtemisTest { @Test public void invalidCliDoesntThrowException() { - testCli("create"); + testCli("--silent", "create"); } @Test public void invalidPathDoesntThrowException() { - testCli("create", "/rawr"); + if (isWindows()) { + testCli("create", "zzzzz:/rawr", "--silent"); + } + else { + testCli("create", "/rawr", "--silent"); + } } @Test @@ -90,7 +95,7 @@ public class ArtemisTest { String queues = "q1,t2"; String topics = "t1,t2"; Run.setEmbedded(true); - Artemis.main("create", temporaryFolder.getRoot().getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--topics", topics); + Artemis.main("create", temporaryFolder.getRoot().getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--topics", topics, "--no-autotune"); System.setProperty("artemis.instance", temporaryFolder.getRoot().getAbsolutePath()); // Some exceptions may happen on the initialization, but they should be ok on start the basic core protocol Artemis.internalExecute("run"); @@ -108,8 +113,8 @@ public class ArtemisTest { } } - Assert.assertEquals(Integer.valueOf(1000), Artemis.internalExecute("producer", "--message-count", "1000", "--verbose")); - Assert.assertEquals(Integer.valueOf(1000), Artemis.internalExecute("consumer", "--verbose", "--break-on-null", "--receive-timeout", "100")); + Assert.assertEquals(Integer.valueOf(100), Artemis.internalExecute("producer", "--message-count", "100", "--verbose")); + Assert.assertEquals(Integer.valueOf(100), Artemis.internalExecute("consumer", "--verbose", "--break-on-null", "--receive-timeout", "100")); ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616"); Connection connection = cf.createConnection(); @@ -160,4 +165,10 @@ public class ArtemisTest { Assert.fail("Exception caught " + e.getMessage()); } } + + + public boolean isWindows() { + return System.getProperty("os.name", "null").toLowerCase().indexOf("win") >= 0; + + } }