From 6d6b33149a156052d6d768ec839b60f3afb62c9e Mon Sep 17 00:00:00 2001 From: Rupert Smith Date: Wed, 25 Jul 2007 12:17:59 +0000 Subject: Refactored interop tests into general distributed test framework. Moved framework under systests from integrationtests. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@559419 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/qpid/util/CommandLineParser.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'java/common/src') diff --git a/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java b/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java index 61955160be..dc73bce28f 100644 --- a/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java +++ b/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java @@ -483,9 +483,9 @@ public class CommandLineParser } /** - * If a command line has been parsed, calling this method sets all of its parsed options as system properties. + * If a command line has been parsed, calling this method sets all of its parsed options into the specified properties. */ - public void addCommandLineToSysProperties() + public void addCommandLineToProperties(Properties properties) { if (parsedProperties != null) { @@ -494,7 +494,7 @@ public class CommandLineParser String name = (String) propKey; String value = parsedProperties.getProperty(name); - System.setProperty(name, value); + properties.setProperty(name, value); } } } @@ -606,11 +606,13 @@ public class CommandLineParser * Extracts all name=value pairs from the command line, sets them all as system properties and also returns * a map of properties containing them. * - * @param args The command line. + * @param args The command line. + * @param commandLine The command line parser. + * @param properties The properties object to inject all parsed properties into (optional may be null). * * @return A set of properties containing all name=value pairs from the command line. */ - public static Properties processCommandLine(String[] args, CommandLineParser commandLine) + public static Properties processCommandLine(String[] args, CommandLineParser commandLine, Properties properties) { // Capture the command line arguments or display errors and correct usage and then exit. Properties options = null; @@ -621,7 +623,7 @@ public class CommandLineParser // Add all the trailing command line options (name=value pairs) to system properties. They may be picked up // from there. - commandLine.addCommandLineToSysProperties(); + commandLine.addCommandLineToProperties(properties); } catch (IllegalArgumentException e) { -- cgit v1.2.1