From de0e81996d63d8a8b7f92d835d2bbdeaf5cccae0 Mon Sep 17 00:00:00 2001 From: Aidan Skinner Date: Thu, 3 Dec 2009 23:55:48 +0000 Subject: Fix eol style property git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@886998 13f79535-47bb-0310-9956-ffa450edef68 --- .../Qpid.Integration.Tests/framework/Assertion.cs | 76 +- .../Qpid.Integration.Tests/framework/Circuit.cs | 202 +-- .../framework/FrameworkBaseCase.cs | 562 ++++----- .../Qpid.Integration.Tests/framework/Publisher.cs | 128 +- .../Qpid.Integration.Tests/framework/Receiver.cs | 158 +-- .../framework/TestClientDetails.cs | 168 +-- .../Qpid.Integration.Tests/framework/TestModel.cs | 1312 ++++++++++---------- .../framework/sequencers/CircuitFactory.cs | 168 +-- 8 files changed, 1387 insertions(+), 1387 deletions(-) (limited to 'qpid/dotnet/Qpid.Integration.Tests/framework') diff --git a/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.cs b/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.cs index fba8253251..de12de6522 100644 --- a/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.cs +++ b/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.cs @@ -1,39 +1,39 @@ -/* - * - * 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. - * - */ -namespace Apache.Qpid.Integration.Tests.framework -{ - /// - /// Assertion models an assertion on a test . - /// - ///

- ///
CRC Card
Responsibilities - ///
Indicate whether or not the assertion passes when applied. - ///
- ///

- public interface Assertion - { - /// - /// Applies the assertion. - /// - /// true if the assertion passes, false if it fails. - bool apply(); - } +/* + * + * 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. + * + */ +namespace Apache.Qpid.Integration.Tests.framework +{ + /// + /// Assertion models an assertion on a test . + /// + ///

+ ///
CRC Card
Responsibilities + ///
Indicate whether or not the assertion passes when applied. + ///
+ ///

+ public interface Assertion + { + /// + /// Applies the assertion. + /// + /// true if the assertion passes, false if it fails. + bool apply(); + } } \ No newline at end of file diff --git a/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.cs b/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.cs index d5f0ed15e2..aae9ca0496 100644 --- a/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.cs +++ b/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.cs @@ -1,102 +1,102 @@ -/* - * - * 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. - * - */ -using System.Collections.Generic;//.IList; - -namespace Apache.Qpid.Integration.Tests.framework -{ - /// - /// A Circuit is the basic test unit against which test cases are to be written. A circuit consists of two 'ends', an - /// instigating 'publisher' end and a more passive 'receivers' end. - /// - ///

Once created, the life-cycle of a circuit may be controlled by ing it, or ing it. - /// Once started, the circuit is ready to send messages over. Once closed the circuit can no longer be used. - /// - ///

The state of the circuit may be taken with the method, and asserted against by the - /// method. - /// - ///

There is a default test procedure which may be performed against the circuit. The outline of this procedure is: - /// - ///

-    /// Start the circuit.
-    /// Send test messages.
-    /// Request a status report.
-    /// Assert conditions on the publishing end of the circuit.
-    /// Assert conditions on the receiving end of the circuit.
-    /// Close the circuit.
-    /// Pass with no failed assertions or fail with a list of failed assertions.
-    /// 
- /// - ///

- ///
CRC Card
Responsibilities - ///
Supply the publishing and receiving ends of a test messaging circuit. - ///
Start the circuit running. - ///
Close the circuit down. - ///
Take a reading of the circuits state. - ///
Apply assertions against the circuits state. - ///
Send test messages over the circuit. - ///
Perform the default test procedue on the circuit. - ///
- ///

- public interface Circuit - { - /// Gets the interface on the publishing end of the circuit. - /// - /// The publishing end of the circuit. - Publisher GetPublisher(); - - /// Gets the interface on the receiving end of the circuit. - /// - /// The receiving end of the circuit. - Receiver GetReceiver(); - - /// Connects and starts the circuit. After this method is called the circuit is ready to send messages. - void Start(); - - /// - /// Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit, - /// into a report, against which assertions may be checked. - /// - void Check(); - - /// Closes the circuit. All associated resources are closed. - void Close(); - - /// - /// Applied a list of assertions against the test circuit. The method should be called before doing - /// this, to ensure that the circuit has gathered its state into a report to assert against. - /// - /// - /// The list of assertions to apply to the circuit. - /// - /// Any assertions that failed. - IList ApplyAssertions(IList assertions); - - /// - /// Runs the default test procedure against the circuit, and checks that all of the specified assertions hold. - /// - /// - /// The number of messages to send using the default test procedure. - /// The list of assertions to apply. - /// - /// Any assertions that failed. - IList Test(int numMessages, IList assertions); - } +/* + * + * 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. + * + */ +using System.Collections.Generic;//.IList; + +namespace Apache.Qpid.Integration.Tests.framework +{ + /// + /// A Circuit is the basic test unit against which test cases are to be written. A circuit consists of two 'ends', an + /// instigating 'publisher' end and a more passive 'receivers' end. + /// + ///

Once created, the life-cycle of a circuit may be controlled by ing it, or ing it. + /// Once started, the circuit is ready to send messages over. Once closed the circuit can no longer be used. + /// + ///

The state of the circuit may be taken with the method, and asserted against by the + /// method. + /// + ///

There is a default test procedure which may be performed against the circuit. The outline of this procedure is: + /// + ///

+    /// Start the circuit.
+    /// Send test messages.
+    /// Request a status report.
+    /// Assert conditions on the publishing end of the circuit.
+    /// Assert conditions on the receiving end of the circuit.
+    /// Close the circuit.
+    /// Pass with no failed assertions or fail with a list of failed assertions.
+    /// 
+ /// + ///

+ ///
CRC Card
Responsibilities + ///
Supply the publishing and receiving ends of a test messaging circuit. + ///
Start the circuit running. + ///
Close the circuit down. + ///
Take a reading of the circuits state. + ///
Apply assertions against the circuits state. + ///
Send test messages over the circuit. + ///
Perform the default test procedue on the circuit. + ///
+ ///

+ public interface Circuit + { + /// Gets the interface on the publishing end of the circuit. + /// + /// The publishing end of the circuit. + Publisher GetPublisher(); + + /// Gets the interface on the receiving end of the circuit. + /// + /// The receiving end of the circuit. + Receiver GetReceiver(); + + /// Connects and starts the circuit. After this method is called the circuit is ready to send messages. + void Start(); + + /// + /// Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit, + /// into a report, against which assertions may be checked. + /// + void Check(); + + /// Closes the circuit. All associated resources are closed. + void Close(); + + /// + /// Applied a list of assertions against the test circuit. The method should be called before doing + /// this, to ensure that the circuit has gathered its state into a report to assert against. + /// + /// + /// The list of assertions to apply to the circuit. + /// + /// Any assertions that failed. + IList ApplyAssertions(IList assertions); + + /// + /// Runs the default test procedure against the circuit, and checks that all of the specified assertions hold. + /// + /// + /// The number of messages to send using the default test procedure. + /// The list of assertions to apply. + /// + /// Any assertions that failed. + IList Test(int numMessages, IList assertions); + } } \ No newline at end of file diff --git a/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.cs b/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.cs index a7a663e531..77c1cae0ad 100644 --- a/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.cs +++ b/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.cs @@ -1,282 +1,282 @@ -/* - * - * 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. - * - */ -using log4net; -using NUnit.Framework; -//using org.apache.log4j.NDC; - -using Apache.Qpid.Integration.Tests.framework.sequencers;//.CircuitFactory; - -//using uk.co.thebadgerset.junit.extensions.AsymptoticTestCase; -//using uk.co.thebadgerset.junit.extensions.SetupTaskAware; -//using uk.co.thebadgerset.junit.extensions.SetupTaskHandler; -//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; -//using uk.co.thebadgerset.junit.extensions.util.TestContextProperties; - -//using java.util.ArrayList; -using System.Collections.Generic;//.IList; - -namespace Apache.Qpid.Integration.Tests.framework -{ - /// - /// FrameworkBaseCase provides a starting point for writing test cases against the test framework. Its main purpose is - /// to provide some convenience methods for testing. - /// - ///

- ///
CRC Card
Responsibilities Collaborations - ///
Create and clean up in-vm brokers on every test case. - ///
Produce lists of assertions from assertion creation calls. - ///
Produce JUnit failures from assertion failures. - ///
Convert failed assertions to error messages. - ///
- ///

- public class FrameworkBaseCase //extends AsymptoticTestCase : FrameworkTestContext, SetupTaskAware, BrokerLifecycleAware - { - /// Used for debugging purposes. - private static ILog log = LogManager.GetLogger(typeof(FrameworkBaseCase)); - - /// Holds the test sequencer to create and run test circuits with. - protected CircuitFactory circuitFactory;// = new LocalCircuitFactory(); - - /// Used to read the tests configurable properties through. - protected TestModel testProps; - - /// A default setup task processor to delegate setup tasks to. - //protected SetupTaskHandler taskHandler = new SetupTaskHandler(); - - /// Flag used to track whether the test is in-vm or not. - //protected bool isUsingInVM; - - /// Holds the failure mechanism. - //protected CauseFailure failureMechanism = new CauseFailureUserPrompt(); - - /* - /// - /// Creates a new test case with the specified name. - /// - /// The test case name. - public FrameworkBaseCase(string name) : base(name) - { - } - */ - - /// - /// Returns the test case sequencer that provides test circuit, and test sequence implementations. The sequencer - /// that this base case returns by default is suitable for running a test circuit with both circuit ends colocated - /// on the same JVM. - /// - /// The test case sequencer. - protected CircuitFactory GetCircuitFactory() - { - return circuitFactory; - } - - /// - /// Overrides the default test circuit factory. Test decorators can use this to supply distributed test sequencers or - /// other test circuit factory specializations. - /// - /// The new test circuit factory. - public void SetCircuitFactory(CircuitFactory circuitFactory) - { - this.circuitFactory = circuitFactory; - } - - /* - /// - /// Reports the current test case name. - /// - /// The current test case name. - public TestCaseVector GetTestCaseVector() - { - return new TestCaseVector(this.getName(), 0); - } - */ - - /// - /// Reports the current test case parameters. - /// - /// The current test case parameters. - public TestModel getTestParameters() - { - return testProps; - } - - /// - /// Creates a list of assertions. - /// - /// The assertions to compile in a list. - /// - /// A list of assertions. - protected IList AssertionList(params Assertion[] asserts) - { - IList result = new List(); - - foreach (Assertion assertion in asserts) - { - result.Add(assertion); - } - - return result; - } - - /// - /// Generates a JUnit assertion exception (failure) if any assertions are passed into this method, also concatenating - /// all of the error messages in the assertions together to form an error message to diagnose the test failure with. - /// - /// The list of failed assertions. - protected static void AssertNoFailures(List asserts) - { - log.Debug("protected void assertNoFailures(List asserts = " + asserts + "): called"); - - // Check if there are no assertion failures, and return without doing anything if so. - if ((asserts == null) || (asserts.Count == 0)) - { - return; - } - - // Compile all of the assertion failure messages together. - string errorMessage = AssertionsToString(asserts); - - // Fail with the error message from all of the assertions. - Assert.Fail(errorMessage); - } - - /// - /// Converts a list of failed assertions into an error message. - /// - /// The failed assertions. - /// - /// The error message. - protected static string AssertionsToString(List asserts) - { - string errorMessage = ""; - - foreach (Assertion assertion in asserts) - { - errorMessage += assertion.ToString() + "\n"; - } - - return errorMessage; - } - - /// - /// Ensures that the in-vm broker is created and initialized. - /// - /// - /// Any exceptions allowed to fall through and fail the test. - [SetUp] - protected void SetUp() - { - //NDC.Push(Name); - - //testProps = TestContextProperties.getInstance(TestModel.defaults); - - // Process all optional setup tasks. This may include in-vm broker creation, if a decorator has added it. - //taskHandler.runSetupTasks(); - } - - /// Ensures that the in-vm broker is cleaned up after each test run. - [TearDown] - protected void TearDown() - { - //NDC.Pop(); - - // Process all optional tear down tasks. This may include in-vm broker clean up, if a decorator has added it. - //taskHandler.runTearDownTasks(); - } - - /* - /// - /// Adds the specified task to the tests setup. - /// - /// The task to add to the tests setup. - public void chainSetupTask(Runnable task) - { - taskHandler.chainSetupTask(task); - } - */ - - /* - /// - /// Adds the specified task to the tests tear down. - /// - /// The task to add to the tests tear down. - public void chainTearDownTask(Runnable task) - { - taskHandler.chainTearDownTask(task); - } - */ - - /* - /// - /// Should provide a translation from the junit method name of a test to its test case name as known to the test - /// clients that will run the test. The purpose of this is to convert the JUnit method name into the correct test - /// case name to place into the test invite. For example the method "testP2P" might map onto the interop test case - /// name "TC2_BasicP2P". - /// - /// The name of the JUnit test method. - /// - /// The name of the corresponding interop test case. - public string getTestCaseNameForTestMethod(string methodName) - { - return methodName; - } - - public void setInVmBrokers() - { - isUsingInVM = true; - } - - /// - /// Indicates whether or not a test case is using in-vm brokers. - /// - /// true if the test is using in-vm brokers, false otherwise. - public bool usingInVmBroker() - { - return isUsingInVM; - } - - /// - /// Sets the currently live in-vm broker. - /// - /// The currently live in-vm broker. - public void setLiveBroker(int i) - { } - - /// - /// Reports the currently live in-vm broker. - /// - /// The currently live in-vm broker. - public int getLiveBroker() - { - return 0; - } - - /// - /// Accepts a failure mechanism. - /// - /// The failure mechanism. - public void setFailureMechanism(CauseFailure failureMechanism) - { - this.failureMechanism = failureMechanism; - } - */ - } +/* + * + * 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. + * + */ +using log4net; +using NUnit.Framework; +//using org.apache.log4j.NDC; + +using Apache.Qpid.Integration.Tests.framework.sequencers;//.CircuitFactory; + +//using uk.co.thebadgerset.junit.extensions.AsymptoticTestCase; +//using uk.co.thebadgerset.junit.extensions.SetupTaskAware; +//using uk.co.thebadgerset.junit.extensions.SetupTaskHandler; +//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; +//using uk.co.thebadgerset.junit.extensions.util.TestContextProperties; + +//using java.util.ArrayList; +using System.Collections.Generic;//.IList; + +namespace Apache.Qpid.Integration.Tests.framework +{ + /// + /// FrameworkBaseCase provides a starting point for writing test cases against the test framework. Its main purpose is + /// to provide some convenience methods for testing. + /// + ///

+ ///
CRC Card
Responsibilities Collaborations + ///
Create and clean up in-vm brokers on every test case. + ///
Produce lists of assertions from assertion creation calls. + ///
Produce JUnit failures from assertion failures. + ///
Convert failed assertions to error messages. + ///
+ ///

+ public class FrameworkBaseCase //extends AsymptoticTestCase : FrameworkTestContext, SetupTaskAware, BrokerLifecycleAware + { + /// Used for debugging purposes. + private static ILog log = LogManager.GetLogger(typeof(FrameworkBaseCase)); + + /// Holds the test sequencer to create and run test circuits with. + protected CircuitFactory circuitFactory;// = new LocalCircuitFactory(); + + /// Used to read the tests configurable properties through. + protected TestModel testProps; + + /// A default setup task processor to delegate setup tasks to. + //protected SetupTaskHandler taskHandler = new SetupTaskHandler(); + + /// Flag used to track whether the test is in-vm or not. + //protected bool isUsingInVM; + + /// Holds the failure mechanism. + //protected CauseFailure failureMechanism = new CauseFailureUserPrompt(); + + /* + /// + /// Creates a new test case with the specified name. + /// + /// The test case name. + public FrameworkBaseCase(string name) : base(name) + { + } + */ + + /// + /// Returns the test case sequencer that provides test circuit, and test sequence implementations. The sequencer + /// that this base case returns by default is suitable for running a test circuit with both circuit ends colocated + /// on the same JVM. + /// + /// The test case sequencer. + protected CircuitFactory GetCircuitFactory() + { + return circuitFactory; + } + + /// + /// Overrides the default test circuit factory. Test decorators can use this to supply distributed test sequencers or + /// other test circuit factory specializations. + /// + /// The new test circuit factory. + public void SetCircuitFactory(CircuitFactory circuitFactory) + { + this.circuitFactory = circuitFactory; + } + + /* + /// + /// Reports the current test case name. + /// + /// The current test case name. + public TestCaseVector GetTestCaseVector() + { + return new TestCaseVector(this.getName(), 0); + } + */ + + /// + /// Reports the current test case parameters. + /// + /// The current test case parameters. + public TestModel getTestParameters() + { + return testProps; + } + + /// + /// Creates a list of assertions. + /// + /// The assertions to compile in a list. + /// + /// A list of assertions. + protected IList AssertionList(params Assertion[] asserts) + { + IList result = new List(); + + foreach (Assertion assertion in asserts) + { + result.Add(assertion); + } + + return result; + } + + /// + /// Generates a JUnit assertion exception (failure) if any assertions are passed into this method, also concatenating + /// all of the error messages in the assertions together to form an error message to diagnose the test failure with. + /// + /// The list of failed assertions. + protected static void AssertNoFailures(List asserts) + { + log.Debug("protected void assertNoFailures(List asserts = " + asserts + "): called"); + + // Check if there are no assertion failures, and return without doing anything if so. + if ((asserts == null) || (asserts.Count == 0)) + { + return; + } + + // Compile all of the assertion failure messages together. + string errorMessage = AssertionsToString(asserts); + + // Fail with the error message from all of the assertions. + Assert.Fail(errorMessage); + } + + /// + /// Converts a list of failed assertions into an error message. + /// + /// The failed assertions. + /// + /// The error message. + protected static string AssertionsToString(List asserts) + { + string errorMessage = ""; + + foreach (Assertion assertion in asserts) + { + errorMessage += assertion.ToString() + "\n"; + } + + return errorMessage; + } + + /// + /// Ensures that the in-vm broker is created and initialized. + /// + /// + /// Any exceptions allowed to fall through and fail the test. + [SetUp] + protected void SetUp() + { + //NDC.Push(Name); + + //testProps = TestContextProperties.getInstance(TestModel.defaults); + + // Process all optional setup tasks. This may include in-vm broker creation, if a decorator has added it. + //taskHandler.runSetupTasks(); + } + + /// Ensures that the in-vm broker is cleaned up after each test run. + [TearDown] + protected void TearDown() + { + //NDC.Pop(); + + // Process all optional tear down tasks. This may include in-vm broker clean up, if a decorator has added it. + //taskHandler.runTearDownTasks(); + } + + /* + /// + /// Adds the specified task to the tests setup. + /// + /// The task to add to the tests setup. + public void chainSetupTask(Runnable task) + { + taskHandler.chainSetupTask(task); + } + */ + + /* + /// + /// Adds the specified task to the tests tear down. + /// + /// The task to add to the tests tear down. + public void chainTearDownTask(Runnable task) + { + taskHandler.chainTearDownTask(task); + } + */ + + /* + /// + /// Should provide a translation from the junit method name of a test to its test case name as known to the test + /// clients that will run the test. The purpose of this is to convert the JUnit method name into the correct test + /// case name to place into the test invite. For example the method "testP2P" might map onto the interop test case + /// name "TC2_BasicP2P". + /// + /// The name of the JUnit test method. + /// + /// The name of the corresponding interop test case. + public string getTestCaseNameForTestMethod(string methodName) + { + return methodName; + } + + public void setInVmBrokers() + { + isUsingInVM = true; + } + + /// + /// Indicates whether or not a test case is using in-vm brokers. + /// + /// true if the test is using in-vm brokers, false otherwise. + public bool usingInVmBroker() + { + return isUsingInVM; + } + + /// + /// Sets the currently live in-vm broker. + /// + /// The currently live in-vm broker. + public void setLiveBroker(int i) + { } + + /// + /// Reports the currently live in-vm broker. + /// + /// The currently live in-vm broker. + public int getLiveBroker() + { + return 0; + } + + /// + /// Accepts a failure mechanism. + /// + /// The failure mechanism. + public void setFailureMechanism(CauseFailure failureMechanism) + { + this.failureMechanism = failureMechanism; + } + */ + } } \ No newline at end of file diff --git a/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.cs b/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.cs index 72bd079277..5fbdc7a907 100644 --- a/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.cs +++ b/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.cs @@ -1,65 +1,65 @@ -/* - * - * 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. - * - */ -//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; -using System; - -namespace Apache.Qpid.Integration.Tests.framework -{ - /// - /// A Publisher represents the status of the publishing side of a test circuit. Its main purpose is to provide assertions - /// that can be applied to test the behaviour of the publishers. - /// - ///

- ///
CRC Card
Responsibilities - ///
Provide assertion that the publishers received no exceptions. - ///
- ///

- public interface Publisher - { - /// - /// Provides an assertion that the publisher encountered no exceptions. - /// - /// - /// The test configuration properties. - /// - /// An assertion that the publisher encountered no exceptions. - Assertion NoExceptionsAssertion(TestModel testProps); - - /// - /// Provides an assertion that the AMQP channel was forcibly closed by an error condition. - /// - /// - /// The test configuration properties. - /// - /// An assertion that the AMQP channel was forcibly closed by an error condition. - Assertion ChannelClosedAssertion(TestModel testProps); - - /// - /// Provides an assertion that the publisher got a given exception during the test. - /// - /// - /// The test configuration properties. - /// The exception class to check for. - /// - /// An assertion that the publisher got a given exception during the test. - Assertion ExceptionAssertion(TestModel testProps, Type exceptionClass); - } +/* + * + * 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. + * + */ +//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; +using System; + +namespace Apache.Qpid.Integration.Tests.framework +{ + /// + /// A Publisher represents the status of the publishing side of a test circuit. Its main purpose is to provide assertions + /// that can be applied to test the behaviour of the publishers. + /// + ///

+ ///
CRC Card
Responsibilities + ///
Provide assertion that the publishers received no exceptions. + ///
+ ///

+ public interface Publisher + { + /// + /// Provides an assertion that the publisher encountered no exceptions. + /// + /// + /// The test configuration properties. + /// + /// An assertion that the publisher encountered no exceptions. + Assertion NoExceptionsAssertion(TestModel testProps); + + /// + /// Provides an assertion that the AMQP channel was forcibly closed by an error condition. + /// + /// + /// The test configuration properties. + /// + /// An assertion that the AMQP channel was forcibly closed by an error condition. + Assertion ChannelClosedAssertion(TestModel testProps); + + /// + /// Provides an assertion that the publisher got a given exception during the test. + /// + /// + /// The test configuration properties. + /// The exception class to check for. + /// + /// An assertion that the publisher got a given exception during the test. + Assertion ExceptionAssertion(TestModel testProps, Type exceptionClass); + } } \ No newline at end of file diff --git a/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.cs b/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.cs index 80320c68b6..96820b5980 100644 --- a/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.cs +++ b/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.cs @@ -1,80 +1,80 @@ -/* - * - * 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. - * - */ -//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; -using System; - -namespace Apache.Qpid.Integration.Tests.framework -{ - /// - /// A Receiver is a that represents the status of the receiving side of a test circuit. Its main - /// purpose is to provide assertions that can be applied to check the behaviour of the receivers. - /// - ///

- ///
CRC Card
Responsibilities - ///
Provide assertion that the receivers received no exceptions. - ///
Provide assertion that the receivers received all test messages sent to it. - ///
- ///

- public interface Receiver - { - /// - /// Provides an assertion that the receivers encountered no exceptions. - /// - /// - /// The test configuration properties. - /// - /// An assertion that the receivers encountered no exceptions. - Assertion NoExceptionsAssertion(TestModel testProps); - - /// - /// Provides an assertion that the receivers got all messages that were sent to it. - /// - /// The test configuration properties. - /// - /// An assertion that the receivers got all messages that were sent to it. - Assertion AllMessagesReceivedAssertion(TestModel testProps); - - /// - /// Provides an assertion that the receivers got none of the messages that were sent to it. - /// - /// The test configuration properties. - /// - /// An assertion that the receivers got none of the messages that were sent to it. - Assertion NoMessagesReceivedAssertion(TestModel testProps); - - /// - /// Provides an assertion that the AMQP channel was forcibly closed by an error condition. - /// - /// The test configuration properties. - /// - /// An assertion that the AMQP channel was forcibly closed by an error condition. - Assertion ChannelClosedAssertion(TestModel testProps); - - /// - /// Provides an assertion that the receiver got a given exception during the test. - /// - /// The test configuration properties. - /// The exception class to check for. - /// - /// An assertion that the receiver got a given exception during the test. - Assertion ExceptionAssertion(TestModel testProps, Type exceptionClass); - } +/* + * + * 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. + * + */ +//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; +using System; + +namespace Apache.Qpid.Integration.Tests.framework +{ + /// + /// A Receiver is a that represents the status of the receiving side of a test circuit. Its main + /// purpose is to provide assertions that can be applied to check the behaviour of the receivers. + /// + ///

+ ///
CRC Card
Responsibilities + ///
Provide assertion that the receivers received no exceptions. + ///
Provide assertion that the receivers received all test messages sent to it. + ///
+ ///

+ public interface Receiver + { + /// + /// Provides an assertion that the receivers encountered no exceptions. + /// + /// + /// The test configuration properties. + /// + /// An assertion that the receivers encountered no exceptions. + Assertion NoExceptionsAssertion(TestModel testProps); + + /// + /// Provides an assertion that the receivers got all messages that were sent to it. + /// + /// The test configuration properties. + /// + /// An assertion that the receivers got all messages that were sent to it. + Assertion AllMessagesReceivedAssertion(TestModel testProps); + + /// + /// Provides an assertion that the receivers got none of the messages that were sent to it. + /// + /// The test configuration properties. + /// + /// An assertion that the receivers got none of the messages that were sent to it. + Assertion NoMessagesReceivedAssertion(TestModel testProps); + + /// + /// Provides an assertion that the AMQP channel was forcibly closed by an error condition. + /// + /// The test configuration properties. + /// + /// An assertion that the AMQP channel was forcibly closed by an error condition. + Assertion ChannelClosedAssertion(TestModel testProps); + + /// + /// Provides an assertion that the receiver got a given exception during the test. + /// + /// The test configuration properties. + /// The exception class to check for. + /// + /// An assertion that the receiver got a given exception during the test. + Assertion ExceptionAssertion(TestModel testProps, Type exceptionClass); + } } \ No newline at end of file diff --git a/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.cs b/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.cs index 401e183fd0..8be8de3d96 100644 --- a/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.cs +++ b/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.cs @@ -1,84 +1,84 @@ -/* - * - * 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. - * - */ -using System; - -namespace Apache.Qpid.Integration.Tests.framework -{ - /// - /// TestClientDetails is used to encapsulate information about an interop test client. It pairs together the unique - /// name of the client, and the route on which it listens to its control messages. - /// - ///

- ///
CRC Card
Responsibilities Collaborations - ///
Record test clients control addresses together with their names. - ///
- ///

- public class TestClientDetails - { - /// The test clients name. - public string clientName; - - /// The routing key of the test clients control topic. - public string privateControlKey; - - /// - /// Two TestClientDetails are considered to be equal, iff they have the same client name. - /// - /// The object to compare to. - /// - /// If the object to compare to is a TestClientDetails equal to this one, false otherwise. - public override bool Equals(Object o) - { - if (this == o) - { - return true; - } - - if (!(o is TestClientDetails)) - { - return false; - } - - TestClientDetails testClientDetails = (TestClientDetails) o; - - return !((clientName != null) ? (!clientName.Equals(testClientDetails.clientName)) - : (testClientDetails.clientName != null)); - } - - /// - /// Computes a hash code compatible with the equals method; based on the client name alone. - /// - /// A hash code for this. - public override int GetHashCode() - { - return ((clientName != null) ? clientName.GetHashCode() : 0); - } - - /// - /// Outputs the client name and address details. Mostly used for debugging purposes. - /// - /// The client name and address. - public override string ToString() - { - return "TestClientDetails: [ clientName = " + clientName + ", privateControlKey = " + privateControlKey + " ]"; - } - } -} +/* + * + * 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. + * + */ +using System; + +namespace Apache.Qpid.Integration.Tests.framework +{ + /// + /// TestClientDetails is used to encapsulate information about an interop test client. It pairs together the unique + /// name of the client, and the route on which it listens to its control messages. + /// + ///

+ ///
CRC Card
Responsibilities Collaborations + ///
Record test clients control addresses together with their names. + ///
+ ///

+ public class TestClientDetails + { + /// The test clients name. + public string clientName; + + /// The routing key of the test clients control topic. + public string privateControlKey; + + /// + /// Two TestClientDetails are considered to be equal, iff they have the same client name. + /// + /// The object to compare to. + /// + /// If the object to compare to is a TestClientDetails equal to this one, false otherwise. + public override bool Equals(Object o) + { + if (this == o) + { + return true; + } + + if (!(o is TestClientDetails)) + { + return false; + } + + TestClientDetails testClientDetails = (TestClientDetails) o; + + return !((clientName != null) ? (!clientName.Equals(testClientDetails.clientName)) + : (testClientDetails.clientName != null)); + } + + /// + /// Computes a hash code compatible with the equals method; based on the client name alone. + /// + /// A hash code for this. + public override int GetHashCode() + { + return ((clientName != null) ? clientName.GetHashCode() : 0); + } + + /// + /// Outputs the client name and address details. Mostly used for debugging purposes. + /// + /// The client name and address. + public override string ToString() + { + return "TestClientDetails: [ clientName = " + clientName + ", privateControlKey = " + privateControlKey + " ]"; + } + } +} diff --git a/qpid/dotnet/Qpid.Integration.Tests/framework/TestModel.cs b/qpid/dotnet/Qpid.Integration.Tests/framework/TestModel.cs index a4a1d7db9b..88bea1e5ad 100644 --- a/qpid/dotnet/Qpid.Integration.Tests/framework/TestModel.cs +++ b/qpid/dotnet/Qpid.Integration.Tests/framework/TestModel.cs @@ -1,657 +1,657 @@ -/* - * - * 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. - * - */ -//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; - -//using javax.jms.Session; - -//using java.util.Properties; - -namespace Apache.Qpid.Integration.Tests.framework -{ - public class TestModel //extends ParsedProperties - {} - - /* - /// - /// MessagingTestConfigProperties defines a set of property names and default values for specifying a messaging topology, - /// and test parameters for running a messaging test over that topology. A Properties object holding some of these - /// properties, superimposed onto the defaults, is used to establish test topologies and control test behaviour. - /// - ///

A complete list of the parameters, default values and comments on their usage is provided here: - /// - ///

- ///
Parameters
Parameter Default Comments - ///
messageSize 0 Message size in bytes. Not including any headers. - ///
destinationName ping The root name to use to generate destination names to ping. - ///
persistent false Determines whether peristent delivery is used. - ///
transacted false Determines whether messages are sent/received in transactions. - ///
broker tcp://localhost:5672 Determines the broker to connect to. - ///
virtualHost test Determines the virtual host to send all ping over. - ///
rate 0 The maximum rate (in hertz) to send messages at. 0 means no limit. - ///
verbose false The verbose flag for debugging. Prints to console on every message. - ///
pubsub false Whether to ping topics or queues. Uses p2p by default. - ///
username guest The username to access the broker with. - ///
password guest The password to access the broker with. - ///
selector null Not used. Defines a message selector to filter pings with. - ///
destinationCount 1 The number of receivers listening to the pings. - ///
timeout 30000 In milliseconds. The timeout to stop waiting for replies. - ///
commitBatchSize 1 The number of messages per transaction in transactional mode. - ///
uniqueDests true Whether each receivers only listens to one ping destination or all. - ///
durableDests false Whether or not durable destinations are used. - ///
ackMode AUTO_ACK The message acknowledgement mode. Possible values are: - /// 0 - SESSION_TRANSACTED - /// 1 - AUTO_ACKNOWLEDGE - /// 2 - CLIENT_ACKNOWLEDGE - /// 3 - DUPS_OK_ACKNOWLEDGE - /// 257 - NO_ACKNOWLEDGE - /// 258 - PRE_ACKNOWLEDGE - ///
maxPending 0 The maximum size in bytes, of messages sent but not yet received. - /// Limits the volume of messages currently buffered on the client - /// or broker. Can help scale test clients by limiting amount of buffered - /// data to avoid out of memory errors. - ///
- /// - ///

- ///
CRC Card
Responsibilities Collaborations - ///
Provide the names and defaults of all test parameters. - ///
- ///

- /// - /// Put a type-safe wrapper around these properties, but continue to store the parameters as properties. This is - /// simply to ensure that it is a simple matter to serialize/deserialize string/string pairs onto messages. - public class MessagingTestConfigProperties extends ParsedProperties - { - // ====================== Connection Properties ================================== - - /// Holds the name of the default connection configuration. - public static final string CONNECTION_NAME = "broker"; - - /// Holds the name of the property to get the initial context factory name from. - public static final string INITIAL_CONTEXT_FACTORY_PROPNAME = "java.naming.factory.initial"; - - /// Defines the class to use as the initial context factory by default. - public static final string INITIAL_CONTEXT_FACTORY_DEFAULT = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory"; - - /// Holds the name of the property to get the test broker url from. - public static final string BROKER_PROPNAME = "qpid.test.broker"; - - /// Holds the default broker url for the test. - public static final string BROKER_DEFAULT = "vm://:1"; - - /// Holds the name of the property to get the test broker virtual path. - public static final string VIRTUAL_HOST_PROPNAME = "virtualHost"; - - /// Holds the default virtual path for the test. - public static final string VIRTUAL_HOST_DEFAULT = ""; - - /// Holds the name of the property to get the broker access username from. - public static final string USERNAME_PROPNAME = "username"; - - /// Holds the default broker log on username. - public static final string USERNAME_DEFAULT = "guest"; - - /// Holds the name of the property to get the broker access password from. - public static final string PASSWORD_PROPNAME = "password"; - - /// Holds the default broker log on password. - public static final string PASSWORD_DEFAULT = "guest"; - - // ====================== Messaging Topology Properties ========================== - - /// Holds the name of the property to get the bind publisher procuder flag from. - public static final string PUBLISHER_PRODUCER_BIND_PROPNAME = "publisherProducerBind"; - - /// Holds the default value of the publisher producer flag. - public static final bool PUBLISHER_PRODUCER_BIND_DEFAULT = true; - - /// Holds the name of the property to get the bind publisher procuder flag from. - public static final string PUBLISHER_CONSUMER_BIND_PROPNAME = "publisherConsumerBind"; - - /// Holds the default value of the publisher consumer flag. - public static final bool PUBLISHER_CONSUMER_BIND_DEFAULT = false; - - /// Holds the name of the property to get the bind receivers procuder flag from. - public static final string RECEIVER_PRODUCER_BIND_PROPNAME = "receiverProducerBind"; - - /// Holds the default value of the receivers producer flag. - public static final bool RECEIVER_PRODUCER_BIND_DEFAULT = false; - - /// Holds the name of the property to get the bind receivers procuder flag from. - public static final string RECEIVER_CONSUMER_BIND_PROPNAME = "receiverConsumerBind"; - - /// Holds the default value of the receivers consumer flag. - public static final bool RECEIVER_CONSUMER_BIND_DEFAULT = true; - - /// Holds the name of the property to get the publishers consumer active flag from. - public static final string PUBLISHER_CONSUMER_ACTIVE_PROPNAME = "publisherConsumerActive"; - - /// Holds the default value of the publishers consumer active flag. - public static final bool PUBLISHER_CONSUMER_ACTIVE_DEFAULT = true; - - /// Holds the name of the property to get the receivers consumer active flag from. - public static final string RECEIVER_CONSUMER_ACTIVE_PROPNAME = "receiverConsumerActive"; - - /// Holds the default value of the receivers consumer active flag. - public static final bool RECEIVER_CONSUMER_ACTIVE_DEFAULT = true; - - /// Holds the name of the property to get the destination name root from. - public static final string SEND_DESTINATION_NAME_ROOT_PROPNAME = "sendDestinationRoot"; - - /// Holds the root of the name of the default destination to send to. - public static final string SEND_DESTINATION_NAME_ROOT_DEFAULT = "sendTo"; - - /// Holds the name of the property to get the destination name root from. - public static final string RECEIVE_DESTINATION_NAME_ROOT_PROPNAME = "receiveDestinationRoot"; - - /// Holds the root of the name of the default destination to send to. - public static final string RECEIVE_DESTINATION_NAME_ROOT_DEFAULT = "receiveFrom"; - - /// Holds the name of the proeprty to get the destination count from. - public static final string DESTINATION_COUNT_PROPNAME = "destinationCount"; - - /// Defines the default number of destinations to ping. - public static final int DESTINATION_COUNT_DEFAULT = 1; - - /// Holds the name of the property to get the p2p or pub/sub messaging mode from. - public static final string PUBSUB_PROPNAME = "pubsub"; - - /// Holds the pub/sub mode default, true means ping a topic, false means ping a queue. - public static final bool PUBSUB_DEFAULT = false; - - // ====================== JMS Options and Flags ================================= - - /// Holds the name of the property to get the test delivery mode from. - public static final string PERSISTENT_MODE_PROPNAME = "persistent"; - - /// Holds the message delivery mode to use for the test. - public static final bool PERSISTENT_MODE_DEFAULT = false; - - /// Holds the name of the property to get the test transactional mode from. - public static final string TRANSACTED_PUBLISHER_PROPNAME = "transactedPublisher"; - - /// Holds the transactional mode to use for the test. - public static final bool TRANSACTED_PUBLISHER_DEFAULT = false; - - /// Holds the name of the property to get the test transactional mode from. - public static final string TRANSACTED_RECEIVER_PROPNAME = "transactedReceiver"; - - /// Holds the transactional mode to use for the test. - public static final bool TRANSACTED_RECEIVER_DEFAULT = false; - - /// Holds the name of the property to set the no local flag from. - public static final string NO_LOCAL_PROPNAME = "noLocal"; - - /// Defines the default value of the no local flag to use when consuming messages. - public static final bool NO_LOCAL_DEFAULT = false; - - /// Holds the name of the property to get the message acknowledgement mode from. - public static final string ACK_MODE_PROPNAME = "ackMode"; - - /// Defines the default message acknowledgement mode. - public static final int ACK_MODE_DEFAULT = Session.AUTO_ACKNOWLEDGE; - - /// Holds the name of the property to get the durable subscriptions flag from, when doing pub/sub messaging. - public static final string DURABLE_SUBSCRIPTION_PROPNAME = "durableSubscription"; - - /// Defines the default value of the durable subscriptions flag. - public static final bool DURABLE_SUBSCRIPTION_DEFAULT = false; - - // ====================== Qpid/AMQP Options and Flags ================================ - - /// Holds the name of the property to set the exclusive flag from. - public static final string EXCLUSIVE_PROPNAME = "exclusive"; - - /// Defines the default value of the exclusive flag to use when consuming messages. - public static final bool EXCLUSIVE_DEFAULT = false; - - /// Holds the name of the property to set the immediate flag from. - public static final string IMMEDIATE_PROPNAME = "immediate"; - - /// Defines the default value of the immediate flag to use when sending messages. - public static final bool IMMEDIATE_DEFAULT = false; - - /// Holds the name of the property to set the mandatory flag from. - public static final string MANDATORY_PROPNAME = "mandatory"; - - /// Defines the default value of the mandatory flag to use when sending messages. - public static final bool MANDATORY_DEFAULT = false; - - /// Holds the name of the property to get the durable destinations flag from. - public static final string DURABLE_DESTS_PROPNAME = "durableDests"; - - /// Default value for the durable destinations flag. - public static final bool DURABLE_DESTS_DEFAULT = false; - - /// Holds the name of the property to set the prefetch size from. - public static final string PREFETCH_PROPNAME = "prefetch"; - - /// Defines the default prefetch size to use when consuming messages. - public static final int PREFETCH_DEFAULT = 100; - - // ====================== Common Test Parameters ================================ - - /// Holds the name of the property to get the test message size from. - public static final string MESSAGE_SIZE_PROPNAME = "messageSize"; - - /// Used to set up a default message size. - public static final int MESSAGE_SIZE_DEAFULT = 0; - - /// Holds the name of the property to get the message rate from. - public static final string RATE_PROPNAME = "rate"; - - /// Defines the default rate (in pings per second) to send pings at. 0 means as fast as possible, no restriction. - public static final int RATE_DEFAULT = 0; - - /// Holds the name of the proeprty to get the. - public static final string SELECTOR_PROPNAME = "selector"; - - /// Holds the default message selector. - public static final string SELECTOR_DEFAULT = ""; - - /// Holds the name of the property to get the waiting timeout for response messages. - public static final string TIMEOUT_PROPNAME = "timeout"; - - /// Default time to wait before assuming that a ping has timed out. - public static final long TIMEOUT_DEFAULT = 30000; - - /// Holds the name of the property to get the commit batch size from. - public static final string TX_BATCH_SIZE_PROPNAME = "commitBatchSize"; - - /// Defines the default number of pings to send in each transaction when running transactionally. - public static final int TX_BATCH_SIZE_DEFAULT = 1; - - /// Holds the name of the property to set the maximum amount of pending message data for a producer to hold. - public static final string MAX_PENDING_PROPNAME = "maxPending"; - - /// Defines the default maximum quantity of pending message data to allow producers to hold. - public static final int MAX_PENDING_DEFAULT = 0; - - /// Holds the name of the property to get the publisher rollback flag from. - public static final string ROLLBACK_PUBLISHER_PROPNAME = "rollbackPublisher"; - - /// Holds the default publisher roll back setting. - public static final bool ROLLBACK_PUBLISHER_DEFAULT = false; - - /// Holds the name of the property to get the publisher rollback flag from. - public static final string ROLLBACK_RECEIVER_PROPNAME = "rollbackReceiver"; - - /// Holds the default publisher roll back setting. - public static final bool ROLLBACK_RECEIVER_DEFAULT = false; - - // ====================== Options that control the bahviour of the test framework. ========================= - - /// Holds the name of the property to get the behavioural mode of not applicable assertions. - public static final string NOT_APPLICABLE_ASSERTION_PROPNAME = "notApplicableAssertion"; - - /// Holds the default behavioral mode of not applicable assertions, which is logging them as a warning. - public static final string NOT_APPLICABLE_ASSERTION_DEFAULT = "warn"; - - /// Holds the name of the property to get the verbose mode proeprty from. - public static final string VERBOSE_PROPNAME = "verbose"; - - /// Holds the default verbose mode. - public static final bool VERBOSE_DEFAULT = false; - - /// Holds the default configuration properties. - public static ParsedProperties defaults = new ParsedProperties(); - - static - { - defaults.setPropertyIfNull(INITIAL_CONTEXT_FACTORY_PROPNAME, INITIAL_CONTEXT_FACTORY_DEFAULT); - defaults.setPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT); - defaults.setPropertyIfNull(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT); - defaults.setPropertyIfNull(USERNAME_PROPNAME, USERNAME_DEFAULT); - defaults.setPropertyIfNull(PASSWORD_PROPNAME, PASSWORD_DEFAULT); - - defaults.setPropertyIfNull(PUBLISHER_PRODUCER_BIND_PROPNAME, PUBLISHER_PRODUCER_BIND_DEFAULT); - defaults.setPropertyIfNull(PUBLISHER_CONSUMER_BIND_PROPNAME, PUBLISHER_CONSUMER_BIND_DEFAULT); - defaults.setPropertyIfNull(RECEIVER_PRODUCER_BIND_PROPNAME, RECEIVER_PRODUCER_BIND_DEFAULT); - defaults.setPropertyIfNull(RECEIVER_CONSUMER_BIND_PROPNAME, RECEIVER_CONSUMER_BIND_DEFAULT); - defaults.setPropertyIfNull(PUBLISHER_CONSUMER_ACTIVE_PROPNAME, PUBLISHER_CONSUMER_ACTIVE_DEFAULT); - defaults.setPropertyIfNull(RECEIVER_CONSUMER_ACTIVE_PROPNAME, RECEIVER_CONSUMER_ACTIVE_DEFAULT); - defaults.setPropertyIfNull(SEND_DESTINATION_NAME_ROOT_PROPNAME, SEND_DESTINATION_NAME_ROOT_DEFAULT); - defaults.setPropertyIfNull(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME, RECEIVE_DESTINATION_NAME_ROOT_DEFAULT); - defaults.setPropertyIfNull(DESTINATION_COUNT_PROPNAME, DESTINATION_COUNT_DEFAULT); - defaults.setPropertyIfNull(PUBSUB_PROPNAME, PUBSUB_DEFAULT); - - defaults.setPropertyIfNull(PERSISTENT_MODE_PROPNAME, PERSISTENT_MODE_DEFAULT); - defaults.setPropertyIfNull(TRANSACTED_PUBLISHER_PROPNAME, TRANSACTED_PUBLISHER_DEFAULT); - defaults.setPropertyIfNull(TRANSACTED_RECEIVER_PROPNAME, TRANSACTED_RECEIVER_DEFAULT); - defaults.setPropertyIfNull(NO_LOCAL_PROPNAME, NO_LOCAL_DEFAULT); - defaults.setPropertyIfNull(ACK_MODE_PROPNAME, ACK_MODE_DEFAULT); - defaults.setPropertyIfNull(DURABLE_SUBSCRIPTION_PROPNAME, DURABLE_SUBSCRIPTION_DEFAULT); - - defaults.setPropertyIfNull(EXCLUSIVE_PROPNAME, EXCLUSIVE_DEFAULT); - defaults.setPropertyIfNull(IMMEDIATE_PROPNAME, IMMEDIATE_DEFAULT); - defaults.setPropertyIfNull(MANDATORY_PROPNAME, MANDATORY_DEFAULT); - defaults.setPropertyIfNull(DURABLE_DESTS_PROPNAME, DURABLE_DESTS_DEFAULT); - defaults.setPropertyIfNull(PREFETCH_PROPNAME, PREFETCH_DEFAULT); - - defaults.setPropertyIfNull(MESSAGE_SIZE_PROPNAME, MESSAGE_SIZE_DEAFULT); - defaults.setPropertyIfNull(RATE_PROPNAME, RATE_DEFAULT); - defaults.setPropertyIfNull(SELECTOR_PROPNAME, SELECTOR_DEFAULT); - defaults.setPropertyIfNull(TIMEOUT_PROPNAME, TIMEOUT_DEFAULT); - defaults.setPropertyIfNull(TX_BATCH_SIZE_PROPNAME, TX_BATCH_SIZE_DEFAULT); - defaults.setPropertyIfNull(MAX_PENDING_PROPNAME, MAX_PENDING_DEFAULT); - defaults.setPropertyIfNull(ROLLBACK_PUBLISHER_PROPNAME, ROLLBACK_PUBLISHER_DEFAULT); - defaults.setPropertyIfNull(ROLLBACK_RECEIVER_PROPNAME, ROLLBACK_RECEIVER_DEFAULT); - - defaults.setPropertyIfNull(NOT_APPLICABLE_ASSERTION_PROPNAME, NOT_APPLICABLE_ASSERTION_DEFAULT); - defaults.setPropertyIfNull(VERBOSE_PROPNAME, VERBOSE_DEFAULT); - } - - /// Creates a test configuration based on the defaults. - public MessagingTestConfigProperties() - { - super(defaults); - } - - /// - /// Creates a test configuration based on the supplied properties. - /// - /// The test configuration. - public MessagingTestConfigProperties(Properties properties) - { - super(properties); - } - - /// - /// The size of test messages to send. - /// - /// The size of test messages to send. - public int getMessageSize() - { - return getPropertyAsInteger(MESSAGE_SIZE_PROPNAME); - } - - /// - /// Flag to indicate that the publishing producer should be set up to publish to a destination. - /// - /// Flag to indicate that the publishing producer should be set up to publish to a destination. - public bool getPublisherProducerBind() - { - return getPropertyAsBoolean(PUBLISHER_PRODUCER_BIND_PROPNAME); - } - - /// - /// Flag to indicate that the publishing consumer should be set up to receive from a destination. - /// - /// Flag to indicate that the publishing consumer should be set up to receive from a destination. - public bool getPublisherConsumerBind() - { - return getPropertyAsBoolean(PUBLISHER_CONSUMER_BIND_PROPNAME); - } - - /// - /// Flag to indicate that the receiving producer should be set up to publish to a destination. - /// - /// Flag to indicate that the receiving producer should be set up to publish to a destination. - public bool getReceiverProducerBind() - { - return getPropertyAsBoolean(RECEIVER_PRODUCER_BIND_PROPNAME); - } - - /// - /// Flag to indicate that the receiving consumer should be set up to receive from a destination. - /// - /// Flag to indicate that the receiving consumer should be set up to receive from a destination. - public bool getReceiverConsumerBind() - { - return getPropertyAsBoolean(RECEIVER_CONSUMER_BIND_PROPNAME); - } - - /// - /// Flag to indicate that the publishing consumer should be created and actively listening. - /// - /// Flag to indicate that the publishing consumer should be created. - public bool getPublisherConsumerActive() - { - return getPropertyAsBoolean(PUBLISHER_CONSUMER_ACTIVE_PROPNAME); - } - - /// - /// Flag to indicate that the receiving consumers should be created and actively listening. - /// - /// Flag to indicate that the receiving consumers should be created and actively listening. - public bool getReceiverConsumerActive() - { - return getPropertyAsBoolean(RECEIVER_CONSUMER_ACTIVE_PROPNAME); - } - - /// - /// A root to create all test destination names from. - /// - /// A root to create all test destination names from. - public string getSendDestinationNameRoot() - { - return getProperty(SEND_DESTINATION_NAME_ROOT_PROPNAME); - } - - /// - /// A root to create all receiving destination names from. - /// - /// A root to create all receiving destination names from. - public string getReceiveDestinationNameRoot() - { - return getProperty(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME); - } - - /// - /// Flag to indicate that persistent messages should be used. - /// - /// Flag to indicate that persistent messages should be used. - public bool getPersistentMode() - { - return getPropertyAsBoolean(PERSISTENT_MODE_PROPNAME); - } - - /// - /// Flag to indicate that transactional messages should be sent by the publisher. - /// - /// Flag to indicate that transactional messages should be sent by the publisher. - public bool getPublisherTransacted() - { - return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME); - } - - /// - /// Flag to indicate that transactional receives should be used by the receiver. - /// - /// Flag to indicate that transactional receives should be used by the receiver. - public bool getReceiverTransacted() - { - return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME); - } - - /// - /// The name of the virtual host to run all tests over. - /// - /// The name of the virtual host to run all tests over. - public string getVirtualHost() - { - return getProperty(VIRTUAL_HOST_PROPNAME); - } - - /// - /// Limiting rate for each sender in messages per second, or zero for unlimited. - /// - /// Limiting rate for each sender in messages per second, or zero for unlimited. - public string getRate() - { - return getProperty(RATE_PROPNAME); - } - - /// - /// Flag to indicate that test messages should be received publish/subscribe style by all receivers. - /// - /// Flag to indicate that test messages should be received publish/subscribe style by all receivers. - public bool getPubsub() - { - return getPropertyAsBoolean(PUBSUB_PROPNAME); - } - - /// - /// The username credentials to run tests with. - /// - /// The username credentials to run tests with. - public string getUsername() - { - return getProperty(USERNAME_PROPNAME); - } - - /// - /// The password credentials to run tests with. - /// - /// The password credentials to run tests with. - public string getPassword() - { - return getProperty(PASSWORD_PROPNAME); - } - - /// - /// The timeout duration to fail tests on, should they receive no messages within it. - /// - /// The timeout duration to fail tests on, should they receive no messages within it. - public long getTimeout() - { - return getPropertyAsLong(TIMEOUT_PROPNAME); - } - - /// - /// The number of messages to batch into each transaction in transational tests. - /// - /// The number of messages to batch into each transaction in transational tests. - public int getTxBatchSize() - { - return getPropertyAsInteger(TX_BATCH_SIZE_PROPNAME); - } - - /// - /// Flag to indicate that tests should use durable destinations. - /// - /// Flag to indicate that tests should use durable destinations. - public bool getDurableDests() - { - return getPropertyAsBoolean(DURABLE_DESTS_PROPNAME); - } - - /// - /// The ack mode for message receivers to use. - /// - /// The ack mode for message receivers to use. - public int getAckMode() - { - return getPropertyAsInteger(ACK_MODE_PROPNAME); - } - - /// - /// Flag to indicate that tests should use durable subscriptions. - /// - /// Flag to indicate that tests should use durable subscriptions. - public bool getDurableSubscription() - { - return getPropertyAsBoolean(DURABLE_SUBSCRIPTION_PROPNAME); - } - - /// - /// The maximum amount of in-flight data, in bytes, that tests should send at any time. - /// - /// The maximum amount of in-flight data, in bytes, that tests should send at any time. - public int getMaxPending() - { - return getPropertyAsInteger(MAX_PENDING_PROPNAME); - } - - /// - /// The size of the prefetch queue to use. - /// - /// The size of the prefetch queue to use. - public int getPrefetch() - { - return getPropertyAsInteger(PREFETCH_PROPNAME); - } - - /// - /// Flag to indicate that subscriptions should be no-local. - /// - /// Flag to indicate that subscriptions should be no-local. - public bool getNoLocal() - { - return getPropertyAsBoolean(NO_LOCAL_PROPNAME); - } - - /// - /// Flag to indicate that subscriptions should be exclusive. - /// - /// Flag to indicate that subscriptions should be exclusive. - public bool getExclusive() - { - return getPropertyAsBoolean(EXCLUSIVE_PROPNAME); - } - - /// - /// Flag to indicate that messages must be delivered immediately. - /// - /// Flag to indicate that messages must be delivered immediately. - public bool getImmediate() - { - return getPropertyAsBoolean(IMMEDIATE_PROPNAME); - } - - /// - /// Flag to indicate that messages must be routable. - /// - /// Flag to indicate that messages must be routable. - public bool getMandatory() - { - return getPropertyAsBoolean(MANDATORY_PROPNAME); - } - - /// - /// Gets the value of a flag to indicate that the publisher should rollback all messages sent. - /// - /// A flag to indicate that the publisher should rollback all messages sent. - public bool getRollbackPublisher() - { - return getPropertyAsBoolean(ROLLBACK_PUBLISHER_PROPNAME); - } - - /// - /// Gets the value of a flag to indicate that the receiver should rollback all messages received, then receive them - /// again. - /// - /// A flag to indicate that the publisher should rollback all messages received. - public bool getRollbackReceiver() - { - return getPropertyAsBoolean(ROLLBACK_RECEIVER_PROPNAME); - } - - /// - /// Gets the behavioural mode of not applicable assertions. Should be one of 'quiet', 'warn' or 'fail'. - /// - /// The behavioural mode of not applicable assertions. - public string getNotApplicableAssertionMode() - { - return getProperty(NOT_APPLICABLE_ASSERTION_PROPNAME); - } - } - */ +/* + * + * 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. + * + */ +//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; + +//using javax.jms.Session; + +//using java.util.Properties; + +namespace Apache.Qpid.Integration.Tests.framework +{ + public class TestModel //extends ParsedProperties + {} + + /* + /// + /// MessagingTestConfigProperties defines a set of property names and default values for specifying a messaging topology, + /// and test parameters for running a messaging test over that topology. A Properties object holding some of these + /// properties, superimposed onto the defaults, is used to establish test topologies and control test behaviour. + /// + ///

A complete list of the parameters, default values and comments on their usage is provided here: + /// + ///

+ ///
Parameters
Parameter Default Comments + ///
messageSize 0 Message size in bytes. Not including any headers. + ///
destinationName ping The root name to use to generate destination names to ping. + ///
persistent false Determines whether peristent delivery is used. + ///
transacted false Determines whether messages are sent/received in transactions. + ///
broker tcp://localhost:5672 Determines the broker to connect to. + ///
virtualHost test Determines the virtual host to send all ping over. + ///
rate 0 The maximum rate (in hertz) to send messages at. 0 means no limit. + ///
verbose false The verbose flag for debugging. Prints to console on every message. + ///
pubsub false Whether to ping topics or queues. Uses p2p by default. + ///
username guest The username to access the broker with. + ///
password guest The password to access the broker with. + ///
selector null Not used. Defines a message selector to filter pings with. + ///
destinationCount 1 The number of receivers listening to the pings. + ///
timeout 30000 In milliseconds. The timeout to stop waiting for replies. + ///
commitBatchSize 1 The number of messages per transaction in transactional mode. + ///
uniqueDests true Whether each receivers only listens to one ping destination or all. + ///
durableDests false Whether or not durable destinations are used. + ///
ackMode AUTO_ACK The message acknowledgement mode. Possible values are: + /// 0 - SESSION_TRANSACTED + /// 1 - AUTO_ACKNOWLEDGE + /// 2 - CLIENT_ACKNOWLEDGE + /// 3 - DUPS_OK_ACKNOWLEDGE + /// 257 - NO_ACKNOWLEDGE + /// 258 - PRE_ACKNOWLEDGE + ///
maxPending 0 The maximum size in bytes, of messages sent but not yet received. + /// Limits the volume of messages currently buffered on the client + /// or broker. Can help scale test clients by limiting amount of buffered + /// data to avoid out of memory errors. + ///
+ /// + ///

+ ///
CRC Card
Responsibilities Collaborations + ///
Provide the names and defaults of all test parameters. + ///
+ ///

+ /// + /// Put a type-safe wrapper around these properties, but continue to store the parameters as properties. This is + /// simply to ensure that it is a simple matter to serialize/deserialize string/string pairs onto messages. + public class MessagingTestConfigProperties extends ParsedProperties + { + // ====================== Connection Properties ================================== + + /// Holds the name of the default connection configuration. + public static final string CONNECTION_NAME = "broker"; + + /// Holds the name of the property to get the initial context factory name from. + public static final string INITIAL_CONTEXT_FACTORY_PROPNAME = "java.naming.factory.initial"; + + /// Defines the class to use as the initial context factory by default. + public static final string INITIAL_CONTEXT_FACTORY_DEFAULT = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory"; + + /// Holds the name of the property to get the test broker url from. + public static final string BROKER_PROPNAME = "qpid.test.broker"; + + /// Holds the default broker url for the test. + public static final string BROKER_DEFAULT = "vm://:1"; + + /// Holds the name of the property to get the test broker virtual path. + public static final string VIRTUAL_HOST_PROPNAME = "virtualHost"; + + /// Holds the default virtual path for the test. + public static final string VIRTUAL_HOST_DEFAULT = ""; + + /// Holds the name of the property to get the broker access username from. + public static final string USERNAME_PROPNAME = "username"; + + /// Holds the default broker log on username. + public static final string USERNAME_DEFAULT = "guest"; + + /// Holds the name of the property to get the broker access password from. + public static final string PASSWORD_PROPNAME = "password"; + + /// Holds the default broker log on password. + public static final string PASSWORD_DEFAULT = "guest"; + + // ====================== Messaging Topology Properties ========================== + + /// Holds the name of the property to get the bind publisher procuder flag from. + public static final string PUBLISHER_PRODUCER_BIND_PROPNAME = "publisherProducerBind"; + + /// Holds the default value of the publisher producer flag. + public static final bool PUBLISHER_PRODUCER_BIND_DEFAULT = true; + + /// Holds the name of the property to get the bind publisher procuder flag from. + public static final string PUBLISHER_CONSUMER_BIND_PROPNAME = "publisherConsumerBind"; + + /// Holds the default value of the publisher consumer flag. + public static final bool PUBLISHER_CONSUMER_BIND_DEFAULT = false; + + /// Holds the name of the property to get the bind receivers procuder flag from. + public static final string RECEIVER_PRODUCER_BIND_PROPNAME = "receiverProducerBind"; + + /// Holds the default value of the receivers producer flag. + public static final bool RECEIVER_PRODUCER_BIND_DEFAULT = false; + + /// Holds the name of the property to get the bind receivers procuder flag from. + public static final string RECEIVER_CONSUMER_BIND_PROPNAME = "receiverConsumerBind"; + + /// Holds the default value of the receivers consumer flag. + public static final bool RECEIVER_CONSUMER_BIND_DEFAULT = true; + + /// Holds the name of the property to get the publishers consumer active flag from. + public static final string PUBLISHER_CONSUMER_ACTIVE_PROPNAME = "publisherConsumerActive"; + + /// Holds the default value of the publishers consumer active flag. + public static final bool PUBLISHER_CONSUMER_ACTIVE_DEFAULT = true; + + /// Holds the name of the property to get the receivers consumer active flag from. + public static final string RECEIVER_CONSUMER_ACTIVE_PROPNAME = "receiverConsumerActive"; + + /// Holds the default value of the receivers consumer active flag. + public static final bool RECEIVER_CONSUMER_ACTIVE_DEFAULT = true; + + /// Holds the name of the property to get the destination name root from. + public static final string SEND_DESTINATION_NAME_ROOT_PROPNAME = "sendDestinationRoot"; + + /// Holds the root of the name of the default destination to send to. + public static final string SEND_DESTINATION_NAME_ROOT_DEFAULT = "sendTo"; + + /// Holds the name of the property to get the destination name root from. + public static final string RECEIVE_DESTINATION_NAME_ROOT_PROPNAME = "receiveDestinationRoot"; + + /// Holds the root of the name of the default destination to send to. + public static final string RECEIVE_DESTINATION_NAME_ROOT_DEFAULT = "receiveFrom"; + + /// Holds the name of the proeprty to get the destination count from. + public static final string DESTINATION_COUNT_PROPNAME = "destinationCount"; + + /// Defines the default number of destinations to ping. + public static final int DESTINATION_COUNT_DEFAULT = 1; + + /// Holds the name of the property to get the p2p or pub/sub messaging mode from. + public static final string PUBSUB_PROPNAME = "pubsub"; + + /// Holds the pub/sub mode default, true means ping a topic, false means ping a queue. + public static final bool PUBSUB_DEFAULT = false; + + // ====================== JMS Options and Flags ================================= + + /// Holds the name of the property to get the test delivery mode from. + public static final string PERSISTENT_MODE_PROPNAME = "persistent"; + + /// Holds the message delivery mode to use for the test. + public static final bool PERSISTENT_MODE_DEFAULT = false; + + /// Holds the name of the property to get the test transactional mode from. + public static final string TRANSACTED_PUBLISHER_PROPNAME = "transactedPublisher"; + + /// Holds the transactional mode to use for the test. + public static final bool TRANSACTED_PUBLISHER_DEFAULT = false; + + /// Holds the name of the property to get the test transactional mode from. + public static final string TRANSACTED_RECEIVER_PROPNAME = "transactedReceiver"; + + /// Holds the transactional mode to use for the test. + public static final bool TRANSACTED_RECEIVER_DEFAULT = false; + + /// Holds the name of the property to set the no local flag from. + public static final string NO_LOCAL_PROPNAME = "noLocal"; + + /// Defines the default value of the no local flag to use when consuming messages. + public static final bool NO_LOCAL_DEFAULT = false; + + /// Holds the name of the property to get the message acknowledgement mode from. + public static final string ACK_MODE_PROPNAME = "ackMode"; + + /// Defines the default message acknowledgement mode. + public static final int ACK_MODE_DEFAULT = Session.AUTO_ACKNOWLEDGE; + + /// Holds the name of the property to get the durable subscriptions flag from, when doing pub/sub messaging. + public static final string DURABLE_SUBSCRIPTION_PROPNAME = "durableSubscription"; + + /// Defines the default value of the durable subscriptions flag. + public static final bool DURABLE_SUBSCRIPTION_DEFAULT = false; + + // ====================== Qpid/AMQP Options and Flags ================================ + + /// Holds the name of the property to set the exclusive flag from. + public static final string EXCLUSIVE_PROPNAME = "exclusive"; + + /// Defines the default value of the exclusive flag to use when consuming messages. + public static final bool EXCLUSIVE_DEFAULT = false; + + /// Holds the name of the property to set the immediate flag from. + public static final string IMMEDIATE_PROPNAME = "immediate"; + + /// Defines the default value of the immediate flag to use when sending messages. + public static final bool IMMEDIATE_DEFAULT = false; + + /// Holds the name of the property to set the mandatory flag from. + public static final string MANDATORY_PROPNAME = "mandatory"; + + /// Defines the default value of the mandatory flag to use when sending messages. + public static final bool MANDATORY_DEFAULT = false; + + /// Holds the name of the property to get the durable destinations flag from. + public static final string DURABLE_DESTS_PROPNAME = "durableDests"; + + /// Default value for the durable destinations flag. + public static final bool DURABLE_DESTS_DEFAULT = false; + + /// Holds the name of the property to set the prefetch size from. + public static final string PREFETCH_PROPNAME = "prefetch"; + + /// Defines the default prefetch size to use when consuming messages. + public static final int PREFETCH_DEFAULT = 100; + + // ====================== Common Test Parameters ================================ + + /// Holds the name of the property to get the test message size from. + public static final string MESSAGE_SIZE_PROPNAME = "messageSize"; + + /// Used to set up a default message size. + public static final int MESSAGE_SIZE_DEAFULT = 0; + + /// Holds the name of the property to get the message rate from. + public static final string RATE_PROPNAME = "rate"; + + /// Defines the default rate (in pings per second) to send pings at. 0 means as fast as possible, no restriction. + public static final int RATE_DEFAULT = 0; + + /// Holds the name of the proeprty to get the. + public static final string SELECTOR_PROPNAME = "selector"; + + /// Holds the default message selector. + public static final string SELECTOR_DEFAULT = ""; + + /// Holds the name of the property to get the waiting timeout for response messages. + public static final string TIMEOUT_PROPNAME = "timeout"; + + /// Default time to wait before assuming that a ping has timed out. + public static final long TIMEOUT_DEFAULT = 30000; + + /// Holds the name of the property to get the commit batch size from. + public static final string TX_BATCH_SIZE_PROPNAME = "commitBatchSize"; + + /// Defines the default number of pings to send in each transaction when running transactionally. + public static final int TX_BATCH_SIZE_DEFAULT = 1; + + /// Holds the name of the property to set the maximum amount of pending message data for a producer to hold. + public static final string MAX_PENDING_PROPNAME = "maxPending"; + + /// Defines the default maximum quantity of pending message data to allow producers to hold. + public static final int MAX_PENDING_DEFAULT = 0; + + /// Holds the name of the property to get the publisher rollback flag from. + public static final string ROLLBACK_PUBLISHER_PROPNAME = "rollbackPublisher"; + + /// Holds the default publisher roll back setting. + public static final bool ROLLBACK_PUBLISHER_DEFAULT = false; + + /// Holds the name of the property to get the publisher rollback flag from. + public static final string ROLLBACK_RECEIVER_PROPNAME = "rollbackReceiver"; + + /// Holds the default publisher roll back setting. + public static final bool ROLLBACK_RECEIVER_DEFAULT = false; + + // ====================== Options that control the bahviour of the test framework. ========================= + + /// Holds the name of the property to get the behavioural mode of not applicable assertions. + public static final string NOT_APPLICABLE_ASSERTION_PROPNAME = "notApplicableAssertion"; + + /// Holds the default behavioral mode of not applicable assertions, which is logging them as a warning. + public static final string NOT_APPLICABLE_ASSERTION_DEFAULT = "warn"; + + /// Holds the name of the property to get the verbose mode proeprty from. + public static final string VERBOSE_PROPNAME = "verbose"; + + /// Holds the default verbose mode. + public static final bool VERBOSE_DEFAULT = false; + + /// Holds the default configuration properties. + public static ParsedProperties defaults = new ParsedProperties(); + + static + { + defaults.setPropertyIfNull(INITIAL_CONTEXT_FACTORY_PROPNAME, INITIAL_CONTEXT_FACTORY_DEFAULT); + defaults.setPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT); + defaults.setPropertyIfNull(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT); + defaults.setPropertyIfNull(USERNAME_PROPNAME, USERNAME_DEFAULT); + defaults.setPropertyIfNull(PASSWORD_PROPNAME, PASSWORD_DEFAULT); + + defaults.setPropertyIfNull(PUBLISHER_PRODUCER_BIND_PROPNAME, PUBLISHER_PRODUCER_BIND_DEFAULT); + defaults.setPropertyIfNull(PUBLISHER_CONSUMER_BIND_PROPNAME, PUBLISHER_CONSUMER_BIND_DEFAULT); + defaults.setPropertyIfNull(RECEIVER_PRODUCER_BIND_PROPNAME, RECEIVER_PRODUCER_BIND_DEFAULT); + defaults.setPropertyIfNull(RECEIVER_CONSUMER_BIND_PROPNAME, RECEIVER_CONSUMER_BIND_DEFAULT); + defaults.setPropertyIfNull(PUBLISHER_CONSUMER_ACTIVE_PROPNAME, PUBLISHER_CONSUMER_ACTIVE_DEFAULT); + defaults.setPropertyIfNull(RECEIVER_CONSUMER_ACTIVE_PROPNAME, RECEIVER_CONSUMER_ACTIVE_DEFAULT); + defaults.setPropertyIfNull(SEND_DESTINATION_NAME_ROOT_PROPNAME, SEND_DESTINATION_NAME_ROOT_DEFAULT); + defaults.setPropertyIfNull(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME, RECEIVE_DESTINATION_NAME_ROOT_DEFAULT); + defaults.setPropertyIfNull(DESTINATION_COUNT_PROPNAME, DESTINATION_COUNT_DEFAULT); + defaults.setPropertyIfNull(PUBSUB_PROPNAME, PUBSUB_DEFAULT); + + defaults.setPropertyIfNull(PERSISTENT_MODE_PROPNAME, PERSISTENT_MODE_DEFAULT); + defaults.setPropertyIfNull(TRANSACTED_PUBLISHER_PROPNAME, TRANSACTED_PUBLISHER_DEFAULT); + defaults.setPropertyIfNull(TRANSACTED_RECEIVER_PROPNAME, TRANSACTED_RECEIVER_DEFAULT); + defaults.setPropertyIfNull(NO_LOCAL_PROPNAME, NO_LOCAL_DEFAULT); + defaults.setPropertyIfNull(ACK_MODE_PROPNAME, ACK_MODE_DEFAULT); + defaults.setPropertyIfNull(DURABLE_SUBSCRIPTION_PROPNAME, DURABLE_SUBSCRIPTION_DEFAULT); + + defaults.setPropertyIfNull(EXCLUSIVE_PROPNAME, EXCLUSIVE_DEFAULT); + defaults.setPropertyIfNull(IMMEDIATE_PROPNAME, IMMEDIATE_DEFAULT); + defaults.setPropertyIfNull(MANDATORY_PROPNAME, MANDATORY_DEFAULT); + defaults.setPropertyIfNull(DURABLE_DESTS_PROPNAME, DURABLE_DESTS_DEFAULT); + defaults.setPropertyIfNull(PREFETCH_PROPNAME, PREFETCH_DEFAULT); + + defaults.setPropertyIfNull(MESSAGE_SIZE_PROPNAME, MESSAGE_SIZE_DEAFULT); + defaults.setPropertyIfNull(RATE_PROPNAME, RATE_DEFAULT); + defaults.setPropertyIfNull(SELECTOR_PROPNAME, SELECTOR_DEFAULT); + defaults.setPropertyIfNull(TIMEOUT_PROPNAME, TIMEOUT_DEFAULT); + defaults.setPropertyIfNull(TX_BATCH_SIZE_PROPNAME, TX_BATCH_SIZE_DEFAULT); + defaults.setPropertyIfNull(MAX_PENDING_PROPNAME, MAX_PENDING_DEFAULT); + defaults.setPropertyIfNull(ROLLBACK_PUBLISHER_PROPNAME, ROLLBACK_PUBLISHER_DEFAULT); + defaults.setPropertyIfNull(ROLLBACK_RECEIVER_PROPNAME, ROLLBACK_RECEIVER_DEFAULT); + + defaults.setPropertyIfNull(NOT_APPLICABLE_ASSERTION_PROPNAME, NOT_APPLICABLE_ASSERTION_DEFAULT); + defaults.setPropertyIfNull(VERBOSE_PROPNAME, VERBOSE_DEFAULT); + } + + /// Creates a test configuration based on the defaults. + public MessagingTestConfigProperties() + { + super(defaults); + } + + /// + /// Creates a test configuration based on the supplied properties. + /// + /// The test configuration. + public MessagingTestConfigProperties(Properties properties) + { + super(properties); + } + + /// + /// The size of test messages to send. + /// + /// The size of test messages to send. + public int getMessageSize() + { + return getPropertyAsInteger(MESSAGE_SIZE_PROPNAME); + } + + /// + /// Flag to indicate that the publishing producer should be set up to publish to a destination. + /// + /// Flag to indicate that the publishing producer should be set up to publish to a destination. + public bool getPublisherProducerBind() + { + return getPropertyAsBoolean(PUBLISHER_PRODUCER_BIND_PROPNAME); + } + + /// + /// Flag to indicate that the publishing consumer should be set up to receive from a destination. + /// + /// Flag to indicate that the publishing consumer should be set up to receive from a destination. + public bool getPublisherConsumerBind() + { + return getPropertyAsBoolean(PUBLISHER_CONSUMER_BIND_PROPNAME); + } + + /// + /// Flag to indicate that the receiving producer should be set up to publish to a destination. + /// + /// Flag to indicate that the receiving producer should be set up to publish to a destination. + public bool getReceiverProducerBind() + { + return getPropertyAsBoolean(RECEIVER_PRODUCER_BIND_PROPNAME); + } + + /// + /// Flag to indicate that the receiving consumer should be set up to receive from a destination. + /// + /// Flag to indicate that the receiving consumer should be set up to receive from a destination. + public bool getReceiverConsumerBind() + { + return getPropertyAsBoolean(RECEIVER_CONSUMER_BIND_PROPNAME); + } + + /// + /// Flag to indicate that the publishing consumer should be created and actively listening. + /// + /// Flag to indicate that the publishing consumer should be created. + public bool getPublisherConsumerActive() + { + return getPropertyAsBoolean(PUBLISHER_CONSUMER_ACTIVE_PROPNAME); + } + + /// + /// Flag to indicate that the receiving consumers should be created and actively listening. + /// + /// Flag to indicate that the receiving consumers should be created and actively listening. + public bool getReceiverConsumerActive() + { + return getPropertyAsBoolean(RECEIVER_CONSUMER_ACTIVE_PROPNAME); + } + + /// + /// A root to create all test destination names from. + /// + /// A root to create all test destination names from. + public string getSendDestinationNameRoot() + { + return getProperty(SEND_DESTINATION_NAME_ROOT_PROPNAME); + } + + /// + /// A root to create all receiving destination names from. + /// + /// A root to create all receiving destination names from. + public string getReceiveDestinationNameRoot() + { + return getProperty(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME); + } + + /// + /// Flag to indicate that persistent messages should be used. + /// + /// Flag to indicate that persistent messages should be used. + public bool getPersistentMode() + { + return getPropertyAsBoolean(PERSISTENT_MODE_PROPNAME); + } + + /// + /// Flag to indicate that transactional messages should be sent by the publisher. + /// + /// Flag to indicate that transactional messages should be sent by the publisher. + public bool getPublisherTransacted() + { + return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME); + } + + /// + /// Flag to indicate that transactional receives should be used by the receiver. + /// + /// Flag to indicate that transactional receives should be used by the receiver. + public bool getReceiverTransacted() + { + return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME); + } + + /// + /// The name of the virtual host to run all tests over. + /// + /// The name of the virtual host to run all tests over. + public string getVirtualHost() + { + return getProperty(VIRTUAL_HOST_PROPNAME); + } + + /// + /// Limiting rate for each sender in messages per second, or zero for unlimited. + /// + /// Limiting rate for each sender in messages per second, or zero for unlimited. + public string getRate() + { + return getProperty(RATE_PROPNAME); + } + + /// + /// Flag to indicate that test messages should be received publish/subscribe style by all receivers. + /// + /// Flag to indicate that test messages should be received publish/subscribe style by all receivers. + public bool getPubsub() + { + return getPropertyAsBoolean(PUBSUB_PROPNAME); + } + + /// + /// The username credentials to run tests with. + /// + /// The username credentials to run tests with. + public string getUsername() + { + return getProperty(USERNAME_PROPNAME); + } + + /// + /// The password credentials to run tests with. + /// + /// The password credentials to run tests with. + public string getPassword() + { + return getProperty(PASSWORD_PROPNAME); + } + + /// + /// The timeout duration to fail tests on, should they receive no messages within it. + /// + /// The timeout duration to fail tests on, should they receive no messages within it. + public long getTimeout() + { + return getPropertyAsLong(TIMEOUT_PROPNAME); + } + + /// + /// The number of messages to batch into each transaction in transational tests. + /// + /// The number of messages to batch into each transaction in transational tests. + public int getTxBatchSize() + { + return getPropertyAsInteger(TX_BATCH_SIZE_PROPNAME); + } + + /// + /// Flag to indicate that tests should use durable destinations. + /// + /// Flag to indicate that tests should use durable destinations. + public bool getDurableDests() + { + return getPropertyAsBoolean(DURABLE_DESTS_PROPNAME); + } + + /// + /// The ack mode for message receivers to use. + /// + /// The ack mode for message receivers to use. + public int getAckMode() + { + return getPropertyAsInteger(ACK_MODE_PROPNAME); + } + + /// + /// Flag to indicate that tests should use durable subscriptions. + /// + /// Flag to indicate that tests should use durable subscriptions. + public bool getDurableSubscription() + { + return getPropertyAsBoolean(DURABLE_SUBSCRIPTION_PROPNAME); + } + + /// + /// The maximum amount of in-flight data, in bytes, that tests should send at any time. + /// + /// The maximum amount of in-flight data, in bytes, that tests should send at any time. + public int getMaxPending() + { + return getPropertyAsInteger(MAX_PENDING_PROPNAME); + } + + /// + /// The size of the prefetch queue to use. + /// + /// The size of the prefetch queue to use. + public int getPrefetch() + { + return getPropertyAsInteger(PREFETCH_PROPNAME); + } + + /// + /// Flag to indicate that subscriptions should be no-local. + /// + /// Flag to indicate that subscriptions should be no-local. + public bool getNoLocal() + { + return getPropertyAsBoolean(NO_LOCAL_PROPNAME); + } + + /// + /// Flag to indicate that subscriptions should be exclusive. + /// + /// Flag to indicate that subscriptions should be exclusive. + public bool getExclusive() + { + return getPropertyAsBoolean(EXCLUSIVE_PROPNAME); + } + + /// + /// Flag to indicate that messages must be delivered immediately. + /// + /// Flag to indicate that messages must be delivered immediately. + public bool getImmediate() + { + return getPropertyAsBoolean(IMMEDIATE_PROPNAME); + } + + /// + /// Flag to indicate that messages must be routable. + /// + /// Flag to indicate that messages must be routable. + public bool getMandatory() + { + return getPropertyAsBoolean(MANDATORY_PROPNAME); + } + + /// + /// Gets the value of a flag to indicate that the publisher should rollback all messages sent. + /// + /// A flag to indicate that the publisher should rollback all messages sent. + public bool getRollbackPublisher() + { + return getPropertyAsBoolean(ROLLBACK_PUBLISHER_PROPNAME); + } + + /// + /// Gets the value of a flag to indicate that the receiver should rollback all messages received, then receive them + /// again. + /// + /// A flag to indicate that the publisher should rollback all messages received. + public bool getRollbackReceiver() + { + return getPropertyAsBoolean(ROLLBACK_RECEIVER_PROPNAME); + } + + /// + /// Gets the behavioural mode of not applicable assertions. Should be one of 'quiet', 'warn' or 'fail'. + /// + /// The behavioural mode of not applicable assertions. + public string getNotApplicableAssertionMode() + { + return getProperty(NOT_APPLICABLE_ASSERTION_PROPNAME); + } + } + */ } \ No newline at end of file diff --git a/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.cs b/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.cs index 463cf06dfb..4be08c3f38 100644 --- a/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.cs +++ b/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.cs @@ -1,85 +1,85 @@ -/* - * - * 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. - * - */ -using Apache.Qpid.Integration.Tests.framework; -//using org.apache.qpid.util.ConversationFactory; - -//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; - -//using javax.jms.JMSException; -//using javax.jms.Message; - -using System.Collections.Generic;//.IList; -//using System.Collections.Generic.IDictionary; -//using java.util.Properties; - -namespace Apache.Qpid.Integration.Tests.framework.sequencers -{ - /// - /// A CircuitFactory is responsibile for creating test circuits appropriate to the context that a test case is - /// running in, and providing an implementation of a standard test procedure over a test circuit. - /// - ///

- ///
CRC Card
Responsibilities - ///
Provide a standard test procedure over a test circuit. - ///
Construct test circuits appropriate to a tests context. - ///
- ///

- public interface CircuitFactory - { - /// - /// Creates a test circuit for the test, configered by the test parameters specified. - /// - /// The test parameters. - /// - /// A test circuit. - Circuit CreateCircuit(TestModel testProperties); - - /// - /// Sets the sender test client to coordinate the test with. - /// - /// The contact details of the sending client in the test. - void SetSender(TestClientDetails sender); - - /// - /// Sets the receiving test client to coordinate the test with. - /// - /// The contact details of the sending client in the test. - void SetReceiver(TestClientDetails receiver); - - /// - /// Supplies the sending test client. - /// - /// The sending test client. - TestClientDetails GetSender(); - - /// - /// Supplies the receiving test client. - /// - /// The receiving test client. - IList GetReceivers(); - - /// - /// Accepts the conversation factory over which to hold the test coordinating conversation. - /// - /// The conversation factory to coordinate the test over. - //void setConversationFactory(ConversationFactory conversationFactory); - } +/* + * + * 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. + * + */ +using Apache.Qpid.Integration.Tests.framework; +//using org.apache.qpid.util.ConversationFactory; + +//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties; + +//using javax.jms.JMSException; +//using javax.jms.Message; + +using System.Collections.Generic;//.IList; +//using System.Collections.Generic.IDictionary; +//using java.util.Properties; + +namespace Apache.Qpid.Integration.Tests.framework.sequencers +{ + /// + /// A CircuitFactory is responsibile for creating test circuits appropriate to the context that a test case is + /// running in, and providing an implementation of a standard test procedure over a test circuit. + /// + ///

+ ///
CRC Card
Responsibilities + ///
Provide a standard test procedure over a test circuit. + ///
Construct test circuits appropriate to a tests context. + ///
+ ///

+ public interface CircuitFactory + { + /// + /// Creates a test circuit for the test, configered by the test parameters specified. + /// + /// The test parameters. + /// + /// A test circuit. + Circuit CreateCircuit(TestModel testProperties); + + /// + /// Sets the sender test client to coordinate the test with. + /// + /// The contact details of the sending client in the test. + void SetSender(TestClientDetails sender); + + /// + /// Sets the receiving test client to coordinate the test with. + /// + /// The contact details of the sending client in the test. + void SetReceiver(TestClientDetails receiver); + + /// + /// Supplies the sending test client. + /// + /// The sending test client. + TestClientDetails GetSender(); + + /// + /// Supplies the receiving test client. + /// + /// The receiving test client. + IList GetReceivers(); + + /// + /// Accepts the conversation factory over which to hold the test coordinating conversation. + /// + /// The conversation factory to coordinate the test over. + //void setConversationFactory(ConversationFactory conversationFactory); + } } \ No newline at end of file -- cgit v1.2.1