From a707cad8e7bf0e7e5dc9725d2d08e63456dcb82d Mon Sep 17 00:00:00 2001 From: Robert Greig Date: Wed, 28 Feb 2007 11:05:20 +0000 Subject: (Patch submitted by Rupert Smith). java_iop.diff This adds some interop tests (which are just copies of the existing topic tests) in a new integrationtests module. The java 1.4. client build has been updated to be able to run these tests. They succesfully talk to each other and the .net code. This is intended to be a starting point of a more in depth interop test as per the spec, but does not implement what is in the draft spec yet. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@512699 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/util/CommandLineParser.java | 659 +++++++++++++++++++++ .../apache/qpid/util/CommandLineParserTest.java | 524 ++++++++++++++++ 2 files changed, 1183 insertions(+) create mode 100644 java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java create mode 100644 java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java (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 new file mode 100644 index 0000000000..6173780aa7 --- /dev/null +++ b/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java @@ -0,0 +1,659 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.qpid.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.regex.*; + +/** + * CommandLineParser provides a utility for specifying the format of a command line and parsing command lines to ensure + * that they fit their specified format. A command line is made up of flags and options, both may be refered to as + * options. A flag is an option that does not take an argument (specifying it means it has the value 'true' and not + * specifying it means it has the value 'false'). Options must take arguments but they can be set up with defaults so + * that they take a default value when not set. Options may be mandatory in wich case it is an error not to specify + * them on the command line. Flags are never mandatory because they are implicitly set to false when not specified. + * + *

Some examples command line are: + * + *