summaryrefslogtreecommitdiff
path: root/qpid/java/broker/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/broker/src/test')
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/MainTest.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/MainTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/MainTest.java
index bdb25a484f..31d5028536 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/MainTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/MainTest.java
@@ -20,6 +20,7 @@
*/
package org.apache.qpid.server;
+import org.apache.commons.cli.CommandLine;
import org.apache.qpid.test.utils.QpidTestCase;
import java.util.EnumSet;
@@ -145,6 +146,22 @@ public class MainTest extends QpidTestCase
assertEquals(9, options.getLogWatchFrequency());
}
+ public void testVersion()
+ {
+ final TestMain main = new TestMain("-v".split("\\s"));
+
+ assertNotNull("Command line not parsed correctly", main.getCommandLine());
+ assertTrue("Parsed command line didnt pick up version option", main.getCommandLine().hasOption("v"));
+ }
+
+ public void testHelp()
+ {
+ final TestMain main = new TestMain("-h".split("\\s"));
+
+ assertNotNull("Command line not parsed correctly", main.getCommandLine());
+ assertTrue("Parsed command line didnt pick up help option", main.getCommandLine().hasOption("h"));
+ }
+
private BrokerOptions startDummyMain(String commandLine)
{
return (new TestMain(commandLine.split("\\s"))).getOptions();
@@ -174,5 +191,10 @@ public class MainTest extends QpidTestCase
{
return _options;
}
+
+ public CommandLine getCommandLine()
+ {
+ return _commandLine;
+ }
}
}