You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2007/05/02 16:23:25 UTC
svn commit: r534478 - in /incubator/qpid/branches/M2/java:
broker/src/main/java/org/apache/qpid/server/filter/
client-java14/src/main/java/org/apache/qpid/sasl/
common/src/main/java/org/apache/qpid/util/
common/src/test/java/org/apache/qpid/util/ integ...
Author: rgreig
Date: Wed May 2 07:23:22 2007
New Revision: 534478
URL: http://svn.apache.org/viewvc?view=rev&rev=534478
Log:
Removed accidental inclusion of copyright notices.
Added:
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/testcases/
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/testcases/CoordinatingTestCase2BasicP2P.java
Modified:
incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java
incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java
incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java
incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java
incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java
incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java
incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java
incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java
incubator/qpid/branches/M2/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java
incubator/qpid/branches/M2/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/CoordinatingTestCase.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/Coordinator.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/InvitingTestDecorator.java
incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/util/ConversationHelper.java
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java
incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/requestreply/PingPongTestPerf.java
Modified: incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java (original)
+++ incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java Wed May 2 07:23:22 2007
@@ -1,4 +1,3 @@
-/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
Modified: incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java (original)
+++ incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java Wed May 2 07:23:22 2007
@@ -1,4 +1,3 @@
-/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
Modified: incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java (original)
+++ incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java Wed May 2 07:23:22 2007
@@ -1,4 +1,3 @@
-/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
Modified: incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java (original)
+++ incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java Wed May 2 07:23:22 2007
@@ -1,4 +1,3 @@
-/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
Modified: incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java (original)
+++ incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java Wed May 2 07:23:22 2007
@@ -1,4 +1,3 @@
-/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
Modified: incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java (original)
+++ incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java Wed May 2 07:23:22 2007
@@ -1,4 +1,3 @@
-/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
Modified: incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java (original)
+++ incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java Wed May 2 07:23:22 2007
@@ -35,8 +35,6 @@
* <tr><td> Concatenate the user id and password hashed by a challenge string as the challenge response.
* <tr><td> Ensure password is wiped once a challenge has been processed.
* </table>
- *
- * @author Rupert Smith
*/
public class CramMD5Client implements SaslClient
{
Modified: incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java (original)
+++ incubator/qpid/branches/M2/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java Wed May 2 07:23:22 2007
@@ -32,8 +32,6 @@
* <tr><td> Concatenate the user id and password in plain text as the challenge respose.
* <tr><td> Ensure password is wiped once a challenge has been processed.
* </table>
- *
- * @author Rupert Smith
*/
public class PlainClient implements SaslClient
{
@@ -124,7 +122,7 @@
// Create an array big enough to hold the results.
byte[] result =
new byte[password.length + authenticationBytes.length + 2
- + ((authorizationBytes == null) ? 0 : authorizationBytes.length)];
+ + ((authorizationBytes == null) ? 0 : authorizationBytes.length)];
// Copy the authorization id, authentication id and password into the results.
int pos = 0;
Modified: incubator/qpid/branches/M2/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java (original)
+++ incubator/qpid/branches/M2/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java Wed May 2 07:23:22 2007
@@ -81,8 +81,6 @@
* <tr><td> Provide a formatted options in force string for a command line.
* <tr><td> Allow errors on unknowns behaviour to be turned on or off.
* </table>
- *
- * @author Rupert Smith
*/
public class CommandLineParser
{
@@ -644,8 +642,6 @@
* <tr><th> Responsibilities <th> Collaborations
* <tr><td> Hold details of a command line option.
* </table>
- *
- * @author Rupert Smith
*/
protected class CommandLineOption
{
Modified: incubator/qpid/branches/M2/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java (original)
+++ incubator/qpid/branches/M2/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java Wed May 2 07:23:22 2007
@@ -1,4 +1,3 @@
-/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
package org.apache.qpid.util;
import java.util.Properties;
@@ -35,8 +34,6 @@
* <tr><td> Check that get options in force returns an empty string before parsing.
* <tr><td> Check that get options in force return a non-empty string after parsing.
* </table>
- *
- * @author Rupert Smith
*/
public class CommandLineParserTest extends TestCase
{
@@ -70,13 +67,15 @@
public void testGetErrorsReturnsEmptyStringOnNoErrors() throws Exception
{
// Create a command line parser for some flags and options.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
+ CommandLineParser parser =
+ new CommandLineParser(
+ new String[][]
+ {
+ { "t1", "Test Flag 1." },
+ { "t2", "Test Option 2.", "test" },
+ { "t3", "Test Option 3.", "test", "true" },
+ { "t4", "Test Option 4.", "test", null, "^test$" }
+ });
// Do some legal parsing.
parser.parseCommandLine(new String[] { "-t1", "-t2test", "-t3test", "-t4test" });
@@ -89,13 +88,15 @@
public void testGetErrorsReturnsStringOnErrors() throws Exception
{
// Create a command line parser for some flags and options.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
+ CommandLineParser parser =
+ new CommandLineParser(
+ new String[][]
+ {
+ { "t1", "Test Flag 1." },
+ { "t2", "Test Option 2.", "test" },
+ { "t3", "Test Option 3.", "test", "true" },
+ { "t4", "Test Option 4.", "test", null, "^test$" }
+ });
try
{
@@ -107,7 +108,7 @@
// Check that the get errors message returns a string.
assertTrue("The errors method returned an empty string.",
- !((parser.getErrors() == null) || "".equals(parser.getErrors())));
+ !((parser.getErrors() == null) || "".equals(parser.getErrors())));
}
@@ -115,13 +116,15 @@
public void testGetOptionsInForceReturnsEmptyStringBeforeParsing() throws Exception
{
// Create a command line parser for some flags and options.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
+ CommandLineParser parser =
+ new CommandLineParser(
+ new String[][]
+ {
+ { "t1", "Test Flag 1." },
+ { "t2", "Test Option 2.", "test" },
+ { "t3", "Test Option 3.", "test", "true" },
+ { "t4", "Test Option 4.", "test", null, "^test$" }
+ });
// Check that the options in force method returns an empty string.
assertTrue("The options in force method did not return an empty string.", "".equals(parser.getOptionsInForce()));
@@ -131,49 +134,55 @@
public void testGetOptionsInForceReturnsNonEmptyStringAfterParsing() throws Exception
{
// Create a command line parser for some flags and options.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
+ CommandLineParser parser =
+ new CommandLineParser(
+ new String[][]
+ {
+ { "t1", "Test Flag 1." },
+ { "t2", "Test Option 2.", "test" },
+ { "t3", "Test Option 3.", "test", "true" },
+ { "t4", "Test Option 4.", "test", null, "^test$" }
+ });
// Do some parsing.
parser.parseCommandLine(new String[] { "-t1", "-t2test", "-t3test", "-t4test" });
// Check that the options in force method returns a string.
assertTrue("The options in force method did not return a non empty string.",
- !((parser.getOptionsInForce() == null) || "".equals(parser.getOptionsInForce())));
+ !((parser.getOptionsInForce() == null) || "".equals(parser.getOptionsInForce())));
}
/** Check that get usage returns a string. */
public void testGetUsageReturnsString() throws Exception
{
// Create a command line parser for some flags and options.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
+ CommandLineParser parser =
+ new CommandLineParser(
+ new String[][]
+ {
+ { "t1", "Test Flag 1." },
+ { "t2", "Test Option 2.", "test" },
+ { "t3", "Test Option 3.", "test", "true" },
+ { "t4", "Test Option 4.", "test", null, "^test$" }
+ });
// Check that the usage method returns a string.
assertTrue("The usage method did not return a non empty string.",
- !((parser.getUsage() == null) || "".equals(parser.getUsage())));
+ !((parser.getUsage() == null) || "".equals(parser.getUsage())));
}
/** Check that parsing multiple flags condensed together works ok. */
public void testParseCondensedFlagsOk() throws Exception
{
// Create a command line parser for multiple flags.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Flag 2." },
- { "t3", "Test Flag 3." }
- });
+ CommandLineParser parser =
+ new CommandLineParser(
+ new String[][]
+ {
+ { "t1", "Test Flag 1." },
+ { "t2", "Test Flag 2." },
+ { "t3", "Test Flag 3." }
+ });
// Parse a command line with the flags set and condensed together.
Properties testProps = parser.parseCommandLine(new String[] { "-t1t2t3" });
@@ -188,11 +197,12 @@
public void testParseFlagCondensedWithOptionFails() throws Exception
{
// Create a command line parser for a flag and an option.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" }
- });
+ CommandLineParser parser =
+ new CommandLineParser(new String[][]
+ {
+ { "t1", "Test Flag 1." },
+ { "t2", "Test Option 2.", "test" }
+ });
// Check that the parser reports an error.
boolean testPassed = false;
@@ -214,10 +224,11 @@
public void testParseFormattedFreeArgumentFailsBadArgument() throws Exception
{
// Create a command line parser for a formatted free argument.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "1", "Test Free Argument.", "test", null, "^test$" }
- });
+ CommandLineParser parser =
+ new CommandLineParser(new String[][]
+ {
+ { "1", "Test Free Argument.", "test", null, "^test$" }
+ });
// Check that the parser signals an error for a badly formatted argument.
boolean testPassed = false;
@@ -239,17 +250,18 @@
public void testParseFormattedFreeArgumentOk() throws Exception
{
// Create a command line parser for a formatted free argument.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "1", "Test Free Argument.", "test", null, "^test$" }
- });
+ CommandLineParser parser =
+ new CommandLineParser(new String[][]
+ {
+ { "1", "Test Free Argument.", "test", null, "^test$" }
+ });
// Parse a command line with this argument set correctly.
Properties testProps = parser.parseCommandLine(new String[] { "test" });
// Check that the resultant properties contains the correctly parsed option.
assertTrue("The first free argument was not equal to \"test\" but was: " + testProps.get("1"),
- "test".equals(testProps.get("1")));
+ "test".equals(testProps.get("1")));
}
/** Check that parsing an option with specific argument format fails on bad argument. */
@@ -257,9 +269,9 @@
{
// Create a command line parser for a formatted option.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test", null, "^test$" }
- });
+ {
+ { "t", "Test Option.", "test", null, "^test$" }
+ });
// Check that the parser signals an error for a badly formatted argument.
boolean testPassed = false;
@@ -282,15 +294,16 @@
{
// Create a command line parser for a formatted option.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test", null, "^test$" }
- });
+ {
+ { "t", "Test Option.", "test", null, "^test$" }
+ });
// Parse a command line with this option set correctly.
Properties testProps = parser.parseCommandLine(new String[] { "-t", "test" });
// Check that the resultant properties contains the correctly parsed option.
- assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"), "test".equals(testProps.get("t")));
+ assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"),
+ "test".equals(testProps.get("t")));
}
/** Check that parsing a free argument works ok. */
@@ -298,16 +311,16 @@
{
// Create a command line parser for a free argument.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "1", "Test Free Argument.", "test" }
- });
+ {
+ { "1", "Test Free Argument.", "test" }
+ });
// Parse a command line with this argument set.
Properties testProps = parser.parseCommandLine(new String[] { "test" });
// Check that the resultant properties contains the correctly parsed option.
assertTrue("The first free argument was not equal to \"test\" but was: " + testProps.get("1"),
- "test".equals(testProps.get("1")));
+ "test".equals(testProps.get("1")));
}
/** Check that parsing a mandatory option works ok. */
@@ -315,15 +328,16 @@
{
// Create a command line parser for a mandatory option.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test", "true" }
- });
+ {
+ { "t", "Test Option.", "test", "true" }
+ });
// Parse a command line with this option set correctly.
Properties testProps = parser.parseCommandLine(new String[] { "-t", "test" });
// Check that the resultant properties contains the correctly parsed option.
- assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"), "test".equals(testProps.get("t")));
+ assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"),
+ "test".equals(testProps.get("t")));
}
/** Check that parsing a mandatory free argument works ok. */
@@ -331,16 +345,16 @@
{
// Create a command line parser for a mandatory free argument.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "1", "Test Option.", "test", "true" }
- });
+ {
+ { "1", "Test Option.", "test", "true" }
+ });
// Parse a command line with this argument set.
Properties testProps = parser.parseCommandLine(new String[] { "test" });
// Check that the resultant properties contains the correctly parsed option.
assertTrue("The first free argument was not equal to \"test\" but was: " + testProps.get("1"),
- "test".equals(testProps.get("1")));
+ "test".equals(testProps.get("1")));
}
/** Check that parsing a mandatory free argument fails when no argument is specified. */
@@ -348,9 +362,9 @@
{
// Create a command line parser for a mandatory free argument.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "1", "Test Option.", "test", "true" }
- });
+ {
+ { "1", "Test Option.", "test", "true" }
+ });
// Check that parsing fails when this mandatory free argument is missing.
boolean testPassed = false;
@@ -374,9 +388,9 @@
{
// Create a command line parser for a mandatory option.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test", "true" }
- });
+ {
+ { "t", "Test Option.", "test", "true" }
+ });
// Check that parsing fails when this mandatory option is missing.
boolean testPassed = false;
@@ -400,15 +414,16 @@
{
// Create a command line parser for an option.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test" }
- });
+ {
+ { "t", "Test Option.", "test" }
+ });
// Parse a command line with this option set with no space.
Properties testProps = parser.parseCommandLine(new String[] { "-ttest" });
// Check that the resultant properties contains the correctly parsed option.
- assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"), "test".equals(testProps.get("t")));
+ assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"),
+ "test".equals(testProps.get("t")));
}
/** Check that parsing an option with a space between it and its argument works ok. */
@@ -416,15 +431,16 @@
{
// Create a command line parser for an option.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test" }
- });
+ {
+ { "t", "Test Option.", "test" }
+ });
// Parse a command line with this option set with a space.
Properties testProps = parser.parseCommandLine(new String[] { "-t", "test" });
// Check that the resultant properties contains the correctly parsed option.
- assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"), "test".equals(testProps.get("t")));
+ assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"),
+ "test".equals(testProps.get("t")));
}
/** Check that parsing a single flag works ok. */
@@ -432,9 +448,9 @@
{
// Create a command line parser for a single flag.
CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Flag." }
- });
+ {
+ { "t", "Test Flag." }
+ });
// Parse a command line with the single flag set.
Properties testProps = parser.parseCommandLine(new String[] { "-t" });
@@ -490,7 +506,8 @@
testPassed = true;
}
- assertTrue("IllegalArgumentException not thrown for an unknown flag when errors on unknowns mode is on.", testPassed);
+ assertTrue("IllegalArgumentException not thrown for an unknown flag when errors on unknowns mode is on.",
+ testPassed);
}
/** Check that parsing an unknown option fails when unknowns are to be reported as errors. */
@@ -514,7 +531,8 @@
testPassed = true;
}
- assertTrue("IllegalArgumentException not thrown for an unknown option when errors on unknowns mode is on.", testPassed);
+ assertTrue("IllegalArgumentException not thrown for an unknown option when errors on unknowns mode is on.",
+ testPassed);
}
protected void tearDown() throws Exception
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/CoordinatingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/CoordinatingTestCase.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/CoordinatingTestCase.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/CoordinatingTestCase.java Wed May 2 07:23:22 2007
@@ -1,3 +1,4 @@
+/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -125,7 +126,7 @@
/**
* Holds a test coordinating conversation with the test clients. This is the basic implementation of the inner
- * loop of Use Case 5. It consists of assign the test roles, begining the test and gathering the test reports
+ * loop of Use Case 5. It consists of assigning the test roles, begining the test and gathering the test reports
* from the participants.
*
* @param testProperties The test case definition.
@@ -134,7 +135,7 @@
*
* @throws JMSException All underlying JMSExceptions are allowed to fall through.
*/
- protected Object[] sequenceTest(Properties testProperties) throws JMSException
+ protected Message[] sequenceTest(Properties testProperties) throws JMSException
{
// Assign the sender role to the sending test client.
Message assignSender = conversation.getSession().createMessage();
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/Coordinator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/Coordinator.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/Coordinator.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/Coordinator.java Wed May 2 07:23:22 2007
@@ -31,8 +31,11 @@
import org.apache.log4j.Logger;
+import org.apache.qpid.interop.coordinator.testcases.CoordinatingTestCase2BasicP2P;
import org.apache.qpid.interop.testclient.InteropClientTestCase;
import org.apache.qpid.interop.testclient.TestClient;
+import org.apache.qpid.interop.testclient.testcases.TestCase1DummyRun;
+import org.apache.qpid.interop.testclient.testcases.TestCase2BasicP2P;
import org.apache.qpid.util.ClasspathScanner;
import org.apache.qpid.util.CommandLineParser;
import org.apache.qpid.util.ConversationHelper;
@@ -69,6 +72,10 @@
/** Holds the list of all clients that enlisted, when the compulsory invite was issued. */
Set<TestClientDetails> enlistedClients = new HashSet<TestClientDetails>();
+ /** Holds the conversation helper for the control conversation. */
+ private ConversationHelper conversation;
+ private Connection connection;
+
/**
* Creates an interop test coordinator on the specified broker and virtual host.
*
@@ -99,39 +106,34 @@
{
try
{
- // Use the command line parser to evaluate the command line.
- CommandLineParser commandLine =
- new CommandLineParser(new String[][]
- {
- { "b", "The broker URL.", "broker", "false" },
- { "h", "The virtual host to use.", "virtual host", "false" }
- });
-
- // Capture the command line arguments or display errors and correct usage and then exit.
- Properties options = null;
-
- try
- {
- options = commandLine.parseCommandLine(args);
- }
- catch (IllegalArgumentException e)
- {
- System.out.println(commandLine.getErrors());
- System.out.println(commandLine.getUsage());
- System.exit(1);
- }
+ // Use the command line parser to evaluate the command line with standard handling behaviour (print errors
+ // and usage then exist if there are errors).
+ Properties options =
+ CommandLineParser.processCommandLine(args,
+ new CommandLineParser(
+ new String[][]
+ {
+ { "b", "The broker URL.", "broker", "false" },
+ { "h", "The virtual host to use.", "virtual host", "false" }
+ }));
// Extract the command line options.
String brokerUrl = options.getProperty("b");
String virtualHost = options.getProperty("h");
- // Add all the trailing command line options (name=value pairs) to system properties. Tests may pick up
- // overridden values from there.
- commandLine.addCommandLineToSysProperties();
-
// Scan for available test cases using a classpath scanner.
Collection<Class<? extends CoordinatingTestCase>> testCaseClasses =
- ClasspathScanner.getMatches(CoordinatingTestCase.class, "^Test.*", true);
+ new ArrayList<Class<? extends CoordinatingTestCase>>();
+ // ClasspathScanner.getMatches(CoordinatingTestCase.class, "^Test.*", true);
+ // Hard code the test classes till the classpath scanner is fixed.
+ Collections.addAll(testCaseClasses, new Class[] { CoordinatingTestCase2BasicP2P.class });
+
+ // Check that some test classes were actually found.
+ if ((testCaseClasses == null) || testCaseClasses.isEmpty())
+ {
+ throw new RuntimeException(
+ "No test classes implementing CoordinatingTestCase were found on the class path.");
+ }
int i = 0;
String[] testClassNames = new String[testCaseClasses.size()];
@@ -174,17 +176,16 @@
public TestResult start(String[] testClassNames) throws Exception
{
log.debug("public TestResult start(String[] testClassNames = " + PrettyPrintingUtils.printArray(testClassNames)
- + "): called");
+ + "): called");
// Connect to the broker.
- Connection connection = TestClient.createConnection(DEFAULT_CONNECTION_PROPS_RESOURCE, brokerUrl, virtualHost);
+ connection = TestClient.createConnection(DEFAULT_CONNECTION_PROPS_RESOURCE, brokerUrl, virtualHost);
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination controlTopic = session.createTopic("iop.control");
Destination responseQueue = session.createQueue("coordinator");
- ConversationHelper conversation =
- new ConversationHelper(connection, controlTopic, responseQueue, LinkedBlockingQueue.class);
+ conversation = new ConversationHelper(connection, controlTopic, responseQueue, LinkedBlockingQueue.class);
// Broadcast the compulsory invitation to find out what clients are available to test.
Message invite = session.createMessage();
@@ -222,7 +223,7 @@
public static Set<TestClientDetails> extractEnlists(Collection<Message> enlists) throws JMSException
{
log.debug("public static Set<TestClientDetails> extractEnlists(Collection<Message> enlists = " + enlists
- + "): called");
+ + "): called");
Set<TestClientDetails> enlistedClients = new HashSet<TestClientDetails>();
@@ -282,7 +283,7 @@
}
// Wrap the tests in an inviting test decorator, to perform the invite/test cycle.
- targetTest = new InvitingTestDecorator(targetTest, enlistedClients);
+ targetTest = new InvitingTestDecorator(targetTest, enlistedClients, conversation);
return super.doRun(targetTest, wait);
}
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/InvitingTestDecorator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/InvitingTestDecorator.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/InvitingTestDecorator.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/InvitingTestDecorator.java Wed May 2 07:23:22 2007
@@ -21,6 +21,7 @@
package org.apache.qpid.interop.coordinator;
import java.util.*;
+import java.util.concurrent.LinkedBlockingQueue;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -47,34 +48,33 @@
{
private static final Logger log = Logger.getLogger(InvitingTestDecorator.class);
+ /** Holds the contact information for all test clients that are available and that may take part in the test. */
Set<TestClientDetails> allClients;
+
+ /** Holds the conversation helper for the control level conversation for coordinating the test through. */
ConversationHelper conversation;
+ /** Holds the underlying {@link CoordinatingTestCase}s that this decorator wraps. */
WrappedSuiteTestDecorator testSuite;
/**
- * Creates a wrappred suite test decorator from a test suite.
- *
- * @param suite The test suite.
- * @param allClients The list of all clients that responded to the compulsory invite.
- */
- /*public InvitingTestDecorator(TestSuite suite, Collection<TestClientDetails> allClients, ConversationHelper conversation)
- {
- super(suite);
- }*/
-
- /**
* Creates a wrapped suite test decorator from another one.
*
- * @param suite The test suite.
- * @param allClients The list of all clients that responded to the compulsory invite.
+ * @param suite The test suite.
+ * @param availableClients The list of all clients that responded to the compulsory invite.
+ * @param controlConversation The conversation helper for the control level, test coordination conversation.
*/
- public InvitingTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> allClients)
+ public InvitingTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> availableClients,
+ ConversationHelper controlConversation)
{
super(suite);
log.debug("public InvitingTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> allClients = "
- + allClients + "): called");
+ + availableClients + ", ConversationHelper controlConversation = " + controlConversation + "): called");
+
+ testSuite = suite;
+ allClients = availableClients;
+ conversation = controlConversation;
}
/**
@@ -127,7 +127,7 @@
for (List<TestClientDetails> failPair : failPairs)
{
- CoordinatingTestCase failTest = new OptOutTestCase("");
+ CoordinatingTestCase failTest = new OptOutTestCase("testOptOut");
failTest.setSender(failPair.get(0));
failTest.setReceiver(failPair.get(1));
Added: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/testcases/CoordinatingTestCase2BasicP2P.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/testcases/CoordinatingTestCase2BasicP2P.java?view=auto&rev=534478
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/testcases/CoordinatingTestCase2BasicP2P.java (added)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/interop/coordinator/testcases/CoordinatingTestCase2BasicP2P.java Wed May 2 07:23:22 2007
@@ -0,0 +1,48 @@
+package org.apache.qpid.interop.coordinator.testcases;
+
+import java.util.Properties;
+
+import javax.jms.Message;
+
+import junit.framework.Assert;
+
+import org.apache.qpid.interop.coordinator.CoordinatingTestCase;
+
+/**
+ * <p><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Setup p2p test parameters and compare with test output. <td> {@link CoordinatingTestCase}
+ * </table>
+ */
+public class CoordinatingTestCase2BasicP2P extends CoordinatingTestCase
+{
+ /**
+ * Creates a new coordinating test case with the specified name.
+ *
+ * @param name The test case name.
+ */
+ public CoordinatingTestCase2BasicP2P(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Performs the basic P2P test case, "Test Case 2" in the specification.
+ */
+ public void testBasicP2P() throws Exception
+ {
+ Properties testConfig = new Properties();
+ testConfig.setProperty("TEST_CASE", "TC2_BasicP2P");
+ testConfig.setProperty("P2P_QUEUE_AND_KEY_NAME", "tc2queue");
+ testConfig.setProperty("P2P_NUM_MESSAGES", "50");
+
+ Message[] reports = sequenceTest(testConfig);
+
+ // Compare sender and receiver reports.
+ int messagesSent = reports[0].getIntProperty("MESSAGE_COUNT");
+ int messagesReceived = reports[1].getIntProperty("MESSAGE_COUNT");
+
+ Assert.assertEquals("The requested number of messages were not sent.", 50, messagesSent);
+ Assert.assertEquals("Sender and receiver messages sent did not match up.", messagesSent, messagesReceived);
+ }
+}
Modified: incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/util/ConversationHelper.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/util/ConversationHelper.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/util/ConversationHelper.java (original)
+++ incubator/qpid/branches/M2/java/integrationtests/src/main/java/org/apache/qpid/util/ConversationHelper.java Wed May 2 07:23:22 2007
@@ -31,19 +31,16 @@
* A conversation helper, uses a message correlation id pattern to match up sent and received messages as a conversation
* over JMS messaging. Incoming message traffic is divided up by correlation id. Each id has a queue (behaviour dependant
* on the queue implementation). Clients of this de-multiplexer can wait on messages, defined by message correlation ids.
- * The correlating listener is a message listener, and can therefore be attached to a MessageConsumer which is consuming
- * from a queue or topic.
*
- * <p/>One use of the correlating listener is to act as a conversation synchronizer where multiple threads are carrying
- * out conversations over a multiplexed messaging route. This can be usefull, as JMS sessions are not multi-threaded.
- * Setting up the correlating listener with synchronous queues will allow these threads to be written in a synchronous
- * style, but with their execution order governed by the asynchronous message flow. For example, something like the
- * following code could run a multi-threaded conversation (the conversation methods can be called many times in
- * parallel):
+ * <p/>One use of this is as a conversation synchronizer where multiple threads are carrying out conversations over a
+ * multiplexed messaging route. This can be usefull, as JMS sessions are not multi-threaded. Setting up the conversation
+ * with synchronous queues will allow these threads to be written in a synchronous style, but with their execution order
+ * governed by the asynchronous message flow. For example, something like the following code could run a multi-threaded
+ * conversation (the conversation methods can be called many times in parallel):
*
* <p/><pre>
- * MessageListener conversation = new ConversationHelper(java.util.concurrent.LinkedBlockingQueue.class),
- * sendDesitination, replyDestination);
+ * ConversationHelper conversation = new ConversationHelper(connection, sendDesitination, replyDestination,
+ * java.util.concurrent.LinkedBlockingQueue.class);
*
* initiateConversation()
* {
@@ -79,9 +76,9 @@
*
* <p/><table id="crc"><caption>CRC Card</caption>
* <tr><th> Responsibilities <th> Collaborations
- * <tr><th> Associate messages to a conversation using correlation ids.
+ * <tr><th> Associate messages to an ongoing conversation using correlation ids.
* <tr><td> Auto manage sessions for conversations.
- * <tr><td> Store messages not in conversation in dead letter box.
+ * <tr><td> Store messages not in a conversation in dead letter box.
* </table>
*
* @todo Non-transactional, can use shared session. Transactional, must have session per-thread. Session pool? In
@@ -91,9 +88,9 @@
* to restrict receives on that session to prevent it picking up messages bound for other conversations. Or use
* a temporary response queue, with only that session listening to it.
*
- * @todo Want something convenient that hides many details. Write out some example use cases to get the best feel for
+ * @todo Want something convenient that hides details. Write out some example use cases to get the best feel for
* it. Pass in connection, send destination, receive destination. Provide endConvo, send, receive
- * methods. Bind corrId, session etc. on thread locals. Clean on endConvo. Provide deadLetter box, that
+ * methods. Bind corrId, session etc. on thread locals? Clean on endConvo. Provide deadLetter box, that
* uncorrelated or late messages go in. Provide time-out on wait methods, and global time-out.
* PingPongProducer provides a good use-case example (sends messages, waits for replies).
*
@@ -139,7 +136,7 @@
* @throws JMSException All undelying JMSExceptions are allowed to fall through.
*/
public ConversationHelper(Connection connection, Destination sendDestination, Destination receiveDestination,
- Class<? extends BlockingQueue> queueClass) throws JMSException
+ Class<? extends BlockingQueue> queueClass) throws JMSException
{
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
producer = session.createProducer(sendDestination);
Modified: incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java (original)
+++ incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java Wed May 2 07:23:22 2007
@@ -1,4 +1,3 @@
-/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -303,8 +302,6 @@
System.out.println("Messages sent: " + messagesSent + ", Messages Committed = " + messagesCommitted
+ ", Messages not Committed = " + messagesNotCommitted);
-
-
return messagesSent;
}
Modified: incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java (original)
+++ incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java Wed May 2 07:23:22 2007
@@ -1,17 +1,16 @@
-/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
package org.apache.qpid.ping;
import java.util.Properties;
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.util.CommandLineParser;
-import org.apache.qpid.client.message.TestMessageFactory;
-
-import javax.jms.ObjectMessage;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
+import javax.jms.ObjectMessage;
+
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.client.message.TestMessageFactory;
+import org.apache.qpid.util.CommandLineParser;
/**
* <p><table id="crc"><caption>CRC Card</caption>
Modified: incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java (original)
+++ incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java Wed May 2 07:23:22 2007
@@ -55,8 +55,6 @@
* <p><table id="crc"><caption>CRC Card</caption>
* <tr><th> Responsibilities <th> Collaborations
* </table>
- *
- * @author Rupert Smith
*/
public class PingTestPerf extends AsymptoticTestCase implements TestThreadAware
{
Modified: incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/requestreply/PingPongTestPerf.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/requestreply/PingPongTestPerf.java?view=diff&rev=534478&r1=534477&r2=534478
==============================================================================
--- incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/requestreply/PingPongTestPerf.java (original)
+++ incubator/qpid/branches/M2/java/perftests/src/test/java/org/apache/qpid/requestreply/PingPongTestPerf.java Wed May 2 07:23:22 2007
@@ -55,8 +55,6 @@
* <p><table id="crc"><caption>CRC Card</caption>
* <tr><th> Responsibilities <th> Collaborations
* </table>
- *
- * @author Rupert Smith
*/
public class PingPongTestPerf extends AsymptoticTestCase
{