You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2007/08/01 00:34:22 UTC
svn commit: r561578 [5/6] - in /incubator/qpid/trunk/qpid/java: ./ broker/
broker/bin/ broker/distribution/src/main/assembly/ broker/etc/
broker/src/main/java/org/apache/log4j/
broker/src/main/java/org/apache/qpid/configuration/
broker/src/main/java/or...
Modified: incubator/qpid/trunk/qpid/java/release-docs/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/release-docs/RELEASE_NOTES.txt?view=diff&rev=561578&r1=561577&r2=561578
==============================================================================
--- incubator/qpid/trunk/qpid/java/release-docs/RELEASE_NOTES.txt (original)
+++ incubator/qpid/trunk/qpid/java/release-docs/RELEASE_NOTES.txt Tue Jul 31 15:34:12 2007
@@ -1,9 +1,8 @@
-Apache Incubator Qpid Java M2 Release Notes
+Apache Incubator Qpid Java M1 Release Notes
-------------------------------------------
-The Qpid M2 release contains support the for AMQP 0-8 specification.
-You can access the 0-8 specification using the following link.
-http://www.amqp.org/tikiwiki/tiki-index.php?page=Download
+The Qpid M1 release is intended to serve as a useful baseline release
+for the project, allowing interested users to use the current featureset.
For full details of Qpid capabilities, as they currently stand, see our
detailed project documentation at:
@@ -18,88 +17,58 @@
-----------------------------
You can view the outstanding task list for Qpid by visiting our JIRA:
+
http://issues.apache.org/jira/browse/QPID
-These issues are moved to M3 release.
-Here is a filtered list for your convinience
----------------------------------------
-New Feature QPID-274 add connection configuratble timeout on waituntilStateHasChanged
-New Feature QPID-156 Implement persistence to disk for Qpid
-New Feature QPID-155 Add ability to configure (on/off) queue creation on demand
-New Feature QPID-43 Multiple-AMQP version support in the broker
-New Feature QPID-28 Allow user to select policy for undeliverable message handling
-New Feature QPID-27 Introduce user configurable redlivery delay
-New Feature QPID-22 Provide run scripts for clustered broker
-
-Improvement QPID-430 Message Age Alerting should not depend upon queue activity
-Improvement QPID-19 Add protocol logging capability to client and broker
-Improvement QPID-11 Move protocol literals from code to AMQConstant
-
-Bug QPID-539 HeadersExchange doesnot correctly implement isBound
-Bug QPID-517 Broker doesn't return NO_CONSUMERS code for an immediate message, when the consumer is disconnected.
-Bug QPID-469 Redelivered information is currently recorded per message it should be per message per queue.
-Bug QPID-463 Java client doesn't close connection gracefully when faced with broker with unsuported protocol version
-Bug QPID-462 Exclusive queues and with subscription that 'filtersMessages' will build up messages it doesn't hasInterest() in.
-
-Bug QPID-397 Client closeure can be processed before final message ack.
-Bug QPID-396 Broker OutOfMemory Error handling
-Bug QPID-377 NumberFormatException thrown by broker when running one performance test
-Bug QPID-293 setting MessageListener after connection has started can cause messages to be "lost" on a internal delivery queue.
+M1 Tasks Completed
+-------------------
+
+The set of JIRA tasks completed as part of the M1 effort is available at:
+
+http://cwiki.apache.org/confluence/display/qpid/Qpid+Java+M1+Release+Notes
+
+This list is copied below for convenience:
+
+Bugs
+----
+http://issues.apache.org/jira/browse/QPID-4 - Remove '/' and ':' from generated queue names
+http://issues.apache.org/jira/browse/QPID-7 - Occasionally messages are ack'd more than once
+http://issues.apache.org/jira/browse/QPID-10- Broker throughput falls off with transactions
+http://issues.apache.org/jira/browse/QPID-56 - AMQQueueMBean - MessageCount on the management interface is not correct.
+http://issues.apache.org/jira/browse/QPID-58 - Creating a QueueReceiver results in ClassCastException
+http://issues.apache.org/jira/browse/QPID-66 - AMQSession implementation of TopicSession and QueueSession interfaces not JMS compliant
+http://issues.apache.org/jira/browse/QPID-68 - Ant build system fails if the project path contains a space
+http://issues.apache.org/jira/browse/QPID-69 - Race condition in Delivery Manager
+
+Improvements
+------------
+http://issues.apache.org/jira/browse/QPID-36 - Add high and low watermark to flow control
+http://issues.apache.org/jira/browse/QPID-44 - Add high and low watermark to flow control
+http://issues.apache.org/jira/browse/QPID-57 - AMQQueueMBean - Message header attributes should be sent along with message content.
+
+
+New Features
+------------
+http://issues.apache.org/jira/browse/QPID-13 - Add option to include prefix and suffix in log file name for broker
+http://issues.apache.org/jira/browse/QPID-23 - Extend JNDI support provided to include initial context factory
+http://issues.apache.org/jira/browse/QPID-29 - Provide support for using Qpid JMX with Tivoli for application monitoring
+http://issues.apache.org/jira/browse/QPID-30 - Allow configuration of working/log directories written to by broker
+http://issues.apache.org/jira/browse/QPID-40 - Implement tx.select, tx.commit & tx.rollback from AMQP
+
+
+Tasks
+-----
+http://issues.apache.org/jira/browse/QPID-18 - Update Java client and broker to MINA 1.0 release
+http://issues.apache.org/jira/browse/QPID-73 - Create Build Artifacts for release process using ant/maven
+http://issues.apache.org/jira/browse/QPID-74 - Create source distribtuion using build system
+http://issues.apache.org/jira/browse/QPID-75 - Create Standard Binary distribution using build system
+
+
-Bug QPID-185 Amend Java Broker handling of ifUnused & ifEmpty flags
-Bug QPID-168 qpid-server.bat needs updated to support same arguments/features as qpid-server (via qpid-run) bash script
-M2 Tasks Completed
--------------------
-The set of JIRA tasks completed as part of the M2 effort is available at:
-https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310520&styleName=Html&version=12312116
-Here is a filtered (by Java components) version of the JIRA items
-Task QPID-190 refactoring the java broker mbean classes
-Task QPID-125 Moving eclipse plugin for broker management to Maven
-Task QPID-93 Delete the old management modules (trunk\qpid\java\management)
-
-New Feature QPID-428 Add login functionality for a qpid server from the management console
-New Feature QPID-418 Add ability to save user preferences to Java Management Console
-New Feature QPID-170 Enhance Management features to support moving a message from one queue to another
-
-Improvement QPID-482 [Java] Small performance tweaks
-Improvement QPID-466 Create STRICT_AMQP System property to disable JMS extensions in Java client
-Improvement QPID-453 AMQShortString should implement Comparable
-Improvement QPID-422 Consolidate notification view to display all user configured notifications on one view
-Improvement QPID-421 Provide enumerated description for static constants including delivery mode
-Improvement QPID-420 Add client id to information displayed about connections on management console
-Improvement QPID-419 Introduce read-only and modify authorisation for all objects in a virtual host
-Improvement QPID-129 improving Broker MBeans
-
-Bug QPID-540 Transient Broker throws NullPointerException and locks up.
-Bug QPID-538 [Memory Leak] Connecting lots of consumers causes the broker memory to leak
-Bug QPID-537 Make AMQMessage.incrementReference public
-Bug QPID-531 [Memory Leak] Broker retains messages that are consumed with NO_ACK
-Bug QPID-527 encoding issue
-Bug QPID-508 [Memory Leak] Broker does not return mandatory messages sent outside of a transaction.
-Bug QPID-476 AMQProtocolSession channelId2SessionMap does not have sessions removed
-Bug QPID-472 Creation of TemporaryQueues will not guarantee unqiue queue names if created rapidly.
-Bug QPID-471 UserManagement panel lists all users but only after a View Users has been executed and is not updated on Create/Delete User
-
-Bug QPID-467 Complete Interop Testing
-Bug QPID-465 Incorrect Exception thrown from send() method.
-Bug QPID-459 Broker doesn't correctly handle noLocal consumers when messages are pre-exisiting on queues.
-Bug QPID-458 Queue Browsing Broken
-Bug QPID-454 Message 'taken' notion is per message. But should be per message per queue
-Bug QPID-443 Abruptly disconnecting client on transaction publish causes error
-Bug QPID-440 Can create dangling transactions on unroutable messages.
-Bug QPID-436 topic exchange doesn't obey the mandatory flag
-Bug QPID-414 Authentication requires plain text passwords in password file
-Bug QPID-408 Queue Depth data incorrect
-Bug QPID-290 Java broker does not honor maximum number of channels threshold
-Bug QPID-276 Potential race condition in AMQChannel
-Bug QPID-200 set/get Destination not implemented in JMSMessage impl
-Bug QPID-166 Check for pre conditions to satisfy JMS spec requirments
-Bug QPID-162 over 600 warnings when building under Eclipse
-Bug QPID-159 The following Interface implementations do not throw Exceptions as required by the spec
Modified: incubator/qpid/trunk/qpid/java/systests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/pom.xml?view=diff&rev=561578&r1=561577&r2=561578
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/systests/pom.xml Tue Jul 31 15:34:12 2007
@@ -79,9 +79,6 @@
<configuration>
<testSourceDirectory>${basedir}/src/main</testSourceDirectory>
<testClassesDirectory>target/classes</testClassesDirectory>
- <includes>
- <include>**/*Test.class</include>
- </includes>
</configuration>
</plugin>
Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java?view=diff&rev=561578&r1=561577&r2=561578
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java Tue Jul 31 15:34:12 2007
@@ -1,34 +1,30 @@
/*
*
- * 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
+ * Copyright (c) 2006 The Apache Software Foundation
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
package org.apache.qpid.server;
import junit.framework.TestCase;
-
-import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.exchange.ExchangeRegistry;
import org.apache.qpid.server.management.ManagedBroker;
import org.apache.qpid.server.queue.QueueRegistry;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.server.registry.IApplicationRegistry;
import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.framing.AMQShortString;
public class AMQBrokerManagerMBeanTest extends TestCase
{
@@ -37,9 +33,9 @@
public void testExchangeOperations() throws Exception
{
- String exchange1 = "testExchange1_" + System.currentTimeMillis();
- String exchange2 = "testExchange2_" + System.currentTimeMillis();
- String exchange3 = "testExchange3_" + System.currentTimeMillis();
+ String exchange1 = "testExchange1_" + System.currentTimeMillis();
+ String exchange2 = "testExchange2_" + System.currentTimeMillis();
+ String exchange3 = "testExchange3_" + System.currentTimeMillis();
assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange1)) == null);
assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange2)) == null);
@@ -47,10 +43,10 @@
VirtualHost vHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
- ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean) vHost.getManagedObject());
- mbean.createNewExchange(exchange1, "direct", false);
- mbean.createNewExchange(exchange2, "topic", false);
- mbean.createNewExchange(exchange3, "headers", false);
+ ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean)vHost.getManagedObject());
+ mbean.createNewExchange(exchange1,"direct",false);
+ mbean.createNewExchange(exchange2,"topic",false);
+ mbean.createNewExchange(exchange3,"headers",false);
assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange1)) != null);
assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange2)) != null);
@@ -70,10 +66,10 @@
String queueName = "testQueue_" + System.currentTimeMillis();
VirtualHost vHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
- ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean) vHost.getManagedObject());
+ ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean)vHost.getManagedObject());
assertTrue(_queueRegistry.getQueue(new AMQShortString(queueName)) == null);
-
+
mbean.createNewQueue(queueName, "test", false);
assertTrue(_queueRegistry.getQueue(new AMQShortString(queueName)) != null);
@@ -86,7 +82,7 @@
{
super.setUp();
IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
- _queueRegistry = appRegistry.getVirtualHostRegistry().getVirtualHost("test").getQueueRegistry();
+ _queueRegistry = appRegistry.getVirtualHostRegistry().getVirtualHost("test").getQueueRegistry();
_exchangeRegistry = appRegistry.getVirtualHostRegistry().getVirtualHost("test").getExchangeRegistry();
}
}
Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java?view=diff&rev=561578&r1=561577&r2=561578
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java Tue Jul 31 15:34:12 2007
@@ -20,15 +20,34 @@
*/
package org.apache.qpid.server.exchange;
-import org.apache.qpid.test.framework.sequencers.TestCaseSequencer;
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.MessagingTestConfigProperties;
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
+import junit.framework.TestCase;
+
+import org.apache.log4j.NDC;
+
+import org.apache.qpid.client.AMQNoConsumersException;
+import org.apache.qpid.client.AMQNoRouteException;
+import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.client.transport.TransportConnection;
+import static org.apache.qpid.server.exchange.MessagingTestConfigProperties.*;
+import org.apache.qpid.server.registry.ApplicationRegistry;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
import uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
+import javax.jms.*;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicLong;
+
/**
* ImmediateMessageTest tests for the desired behaviour of immediate messages. Immediate messages are a non-JMS
* feature. A message may be marked with an immediate delivery flag, which means that a consumer must be connected
@@ -39,68 +58,60 @@
* <tr><th> Responsibilities <th> Collaborations
* <tr><td> Check that an immediate message is sent succesfully not using transactions when a consumer is connected.
* <tr><td> Check that an immediate message is committed succesfully in a transaction when a consumer is connected.
- * <tr><td> Check that an immediate message results in no consumers code, not using transactions, when a consumer is
- * disconnected.
- * <tr><td> Check that an immediate message results in no consumers code, in a transaction, when a consumer is
- * disconnected.
- * <tr><td> Check that an immediate message results in no route code, not using transactions, when no outgoing route is
+ * <tr><td> Check that an immediate message results in no consumers code, not using transactions, when no consumer is
* connected.
- * <tr><td> Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is
+ * <tr><td> Check that an immediate message results in no consumers code, upon transaction commit, when a consumer is
* connected.
- * <tr><td> Check that an immediate message is sent succesfully not using transactions when a consumer is connected.
- * <tr><td> Check that an immediate message is committed succesfully in a transaction when a consumer is connected.
* <tr><td> Check that an immediate message results in no consumers code, not using transactions, when a consumer is
* disconnected.
- * <tr><td> Check that an immediate message results in no consumers code, in a transaction, when a consumer is
+ * <tr><dt> Check that an immediate message results in no consumers code, in a transaction, when a consumer is
* disconnected.
- * <tr><td> Check that an immediate message results in no route code, not using transactions, when no outgoing route is
- * connected.
- * <tr><td> Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is
- * connected.
* </table>
*
- * @todo All of these test cases will be generated by a test generator that thoroughly tests all combinations of test
- * circuits.
+ * @todo Write a test decorator, the sole function of which is to populate test context properties, from sys properties,
+ * from trailing prop=value pairs on the command line, from test properties files or other sources. This should
+ * run through stanard JUnit without the JUnit toolkit extensions, and through Maven surefire, and also through
+ * the JUnit toolkit extended test runners.
+ *
+ * @todo Veto test topologies using bounce back. Or else the bounce back client will act as an immediate consumer.
*/
-public class ImmediateMessageTest extends FrameworkBaseCase
+public class ImmediateMessageTest extends TestCase
{
+ /** Used for debugging. */
+ private static final Logger log = LoggerFactory.getLogger(ImmediateMessageTest.class);
+
/** Used to read the tests configurable properties through. */
ParsedProperties testProps;
- /**
- * Creates a new test case with the specified name.
- *
- * @param name The test case name.
+ /** Used to create unique destination names for each test.
+ * @todo Move into the test framework.
*/
- public ImmediateMessageTest(String name)
- {
- super(name);
- }
+ private static AtomicLong uniqueDestsId = new AtomicLong();
/** Check that an immediate message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_517_ImmediateOkNoTxP2P()
+ public void test_QPID_517_ImmediateOkNoTxP2P() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, false);
- // Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message with no errors.
+ testClients.testNoExceptions(testProps);
}
/** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_517_ImmediateOkTxP2P()
+ public void test_QPID_517_ImmediateOkTxP2P() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, false);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
+
// Send one message with no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ testClients.testNoExceptions(testProps);
}
/** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
@@ -110,14 +121,13 @@
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, false);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testClients.getReceiver().getConsumer().close();
// Send one message and get a linked no consumers exception.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noConsumersAssertion()), testProps);
+ testClients.testWithAssertions(testProps, AMQNoConsumersException.class);
}
/** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
@@ -127,74 +137,73 @@
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, false);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testClients.getReceiver().getConsumer().close();
// Send one message and get a linked no consumers exception.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noConsumersAssertion()), testProps);
+ testClients.testWithAssertions(testProps, AMQNoConsumersException.class);
}
- /** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */
- public void test_QPID_517_ImmediateFailsNoRouteNoTxP2P()
+ /** Check that an immediate message results in no consumers code, not using transactions, when no consumer is connected. */
+ public void test_QPID_517_ImmediateFailsNoRouteNoTxP2P() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, false);
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
+ // Set up the messaging topology so that only the publishers producer is bound (do not set up the receiver to
// collect its messages).
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
- // Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message and get a linked no consumers exception.
+ testClients.testWithAssertions(testProps, AMQNoRouteException.class);
}
- /** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */
- public void test_QPID_517_ImmediateFailsNoRouteTxP2P()
+ /** Check that an immediate message results in no consumers code, upon transaction commit, when a consumer is connected. */
+ public void test_QPID_517_ImmediateFailsNoRouteTxP2P() throws Exception
{
// Ensure transactional sessions are on.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, false);
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
+ // Set up the messaging topology so that only the publishers producer is bound (do not set up the receiver to
// collect its messages).
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
- // Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message and get a linked no consumers exception.
+ testClients.testWithAssertions(testProps, AMQNoRouteException.class);
}
/** Check that an immediate message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_517_ImmediateOkNoTxPubSub()
+ public void test_QPID_517_ImmediateOkNoTxPubSub() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, true);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
+
// Send one message with no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ testClients.testNoExceptions(testProps);
}
/** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_517_ImmediateOkTxPubSub()
+ public void test_QPID_517_ImmediateOkTxPubSub() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, true);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
+
// Send one message with no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ testClients.testNoExceptions(testProps);
}
/** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
@@ -207,14 +216,13 @@
// Use durable subscriptions, so that the route remains open with no subscribers.
testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testClients.getReceiver().getConsumer().close();
// Send one message and get a linked no consumers exception.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noConsumersAssertion()), testProps);
+ testClients.testWithAssertions(testProps, AMQNoConsumersException.class);
}
/** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
@@ -227,61 +235,696 @@
// Use durable subscriptions, so that the route remains open with no subscribers.
testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testClients.getReceiver().getConsumer().close();
// Send one message and get a linked no consumers exception.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noConsumersAssertion()), testProps);
+ testClients.testWithAssertions(testProps, AMQNoConsumersException.class);
}
- /** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */
- public void test_QPID_517_ImmediateFailsNoRouteNoTxPubSub()
+ /** Check that an immediate message results in no consumers code, not using transactions, when no consumer is connected. */
+ public void test_QPID_517_ImmediateFailsNoRouteNoTxPubSub() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, true);
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
+ // Set up the messaging topology so that only the publishers producer is bound (do not set up the receiver to
// collect its messages).
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
- // Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message and get a linked no consumers exception.
+ testClients.testWithAssertions(testProps, AMQNoRouteException.class);
}
- /** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */
- public void test_QPID_517_ImmediateFailsNoRouteTxPubSub()
+ /** Check that an immediate message results in no consumers code, upon transaction commit, when a consumer is connected. */
+ public void test_QPID_517_ImmediateFailsNoRouteTxPubSub() throws Exception
{
// Ensure transactional sessions are on.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, true);
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
+ // Set up the messaging topology so that only the publishers producer is bound (do not set up the receiver to
// collect its messages).
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
- // Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ PublisherReceiver testClients = PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message and get a linked no consumers exception.
+ testClients.testWithAssertions(testProps, AMQNoRouteException.class);
}
protected void setUp() throws Exception
{
- super.setUp();
+ NDC.push(getName());
testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
/** All these tests should have the immediate flag on. */
testProps.setProperty(IMMEDIATE_PROPNAME, true);
- testProps.setProperty(MANDATORY_PROPNAME, false);
/** Bind the receivers consumer by default. */
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true);
+
+ // Ensure that the in-vm broker is created.
+ TransportConnection.createVMBroker(1);
+ }
+
+ protected void tearDown() throws Exception
+ {
+ try
+ {
+ // Ensure that the in-vm broker is cleaned up so that the next test starts afresh.
+ TransportConnection.killVMBroker(1);
+ ApplicationRegistry.remove(1);
+ }
+ finally
+ {
+ NDC.pop();
+ }
+ }
+
+ /*
+ * Stuff below:
+ *
+ * This will get tidied into some sort on JMS convenience framework, through which practically any usefull test
+ * topology can be created. This will become a replacement for PingPongProducer.
+ *
+ * Base everything on standard connection properties defined in PingPongProducer. Split JMS and AMQP-only properties.
+ *
+ * Integrate with ConversationFactory, so that it will work with prod/con pairs.
+ *
+ * Support pub/rec pairs.
+ * Support m*n pub/rec setups. All pubs/recs on one machine.
+ *
+ * Support bounce back clients, with configurable bounce back behavior. All, one in X, round robin one in m, etc.
+ *
+ * Support pairing of m*n pub/rec setups with bounce back clients. JVM running a test, can simulate m publishers,
+ * will receive (a known subset of) all messages sent, bounced back to n receivers. Co-location of pub/rec will be
+ * the normal model to allow accurate timings to be taken.
+ *
+ * Support creation of pub or rec only.
+ * Support clock synching of pub/rec on different JVMs, by calculating clock offsets. Must also provide an accuracy
+ * estimate to +- the results.
+ *
+ * Augment the interop Coordinator, to become a full distributed test coordinator. Capable of querying available
+ * tests machines, looking at test parameters and farming out tests onto the test machines, passing all test
+ * parameters, standard naming of pub/rec config parameters used to set up m*n test topologies, run test cases,
+ * report results, tear down m*n topologies. Need to split the re-usable general purpose distributed test coordinator
+ * from the Qpid specific test framework for creating test-topoloigies and passing Qpid specific parameters.
+ *
+ * Write all tests against pub/rec pairs, without coding to the fact that the topology may be anything from 1:1 in
+ * JVM to m*n with bounce back clients accross many machines. That is, make the test topology orthogonal to the test
+ * case.
+ */
+
+ private static class ExceptionMonitor implements ExceptionListener
+ {
+ List<JMSException> exceptions = new ArrayList<JMSException>();
+
+ public void onException(JMSException e)
+ {
+ log.debug("ExceptionMonitor got JMSException: ", e);
+
+ exceptions.add(e);
+ }
+
+ public boolean assertNoExceptions()
+ {
+ return exceptions.isEmpty();
+ }
+
+ public boolean assertOneJMSException()
+ {
+ return exceptions.size() == 1;
+ }
+
+ public boolean assertOneJMSExceptionWithLinkedCause(Class aClass)
+ {
+ if (exceptions.size() == 1)
+ {
+ JMSException e = exceptions.get(0);
+
+ Exception linkedCause = e.getLinkedException();
+
+ if ((linkedCause != null) && aClass.isInstance(linkedCause))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Reports the number of exceptions held by this monitor.
+ *
+ * @return The number of exceptions held by this monitor.
+ */
+ public int size()
+ {
+ return exceptions.size();
+ }
+
+ public void reset()
+ {
+ exceptions = new ArrayList();
+ }
+
+ /**
+ * Provides a dump of the stack traces of all exceptions that this exception monitor was notified of. Mainly
+ * use for debugging/test failure reporting purposes.
+ *
+ * @return A string containing a dump of the stack traces of all exceptions.
+ */
+ public String toString()
+ {
+ String result = "ExceptionMonitor: holds " + exceptions.size() + " exceptions.\n\n";
+
+ for (JMSException ex : exceptions)
+ {
+ result += getStackTrace(ex) + "\n";
+ }
+
+ return result;
+ }
+
+ /**
+ * Prints an exception stack trace into a string.
+ *
+ * @param t The throwable to get the stack trace from.
+ *
+ * @return A string containing the throwables stack trace.
+ */
+ public static String getStackTrace(Throwable t)
+ {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw, true);
+ t.printStackTrace(pw);
+ pw.flush();
+ sw.flush();
+
+ return sw.toString();
+ }
+ }
+
+ public static class MessageMonitor implements MessageListener
+ {
+ public void onMessage(Message message)
+ {
+ log.debug("public void onMessage(Message message): called");
+ }
+ }
+
+ /**
+ * Establishes a JMS connection using a properties file and qpids built in JNDI implementation. This is a simple
+ * convenience method for code that does anticipate handling connection failures. All exceptions that indicate
+ * that the connection has failed, are wrapped as rutime exceptions, preumably handled by a top level failure
+ * handler.
+ *
+ * @param messagingProps Any additional connection properties.
+ *
+ * @return A JMS conneciton.
+ *
+ * @todo Move this to a Utils library class or base test class. Also move the copy in interop.TestClient too.
+ *
+ * @todo Make in VM broker creation step optional on whether one is to be used or not.
+ */
+ public static Connection createConnection(ParsedProperties messagingProps)
+ {
+ log.debug("public static Connection createConnection(Properties messagingProps = " + messagingProps + "): called");
+
+ try
+ {
+ // Extract the configured connection properties from the test configuration.
+ String conUsername = messagingProps.getProperty(USERNAME_PROPNAME);
+ String conPassword = messagingProps.getProperty(PASSWORD_PROPNAME);
+ String virtualHost = messagingProps.getProperty(VIRTUAL_HOST_PROPNAME);
+ String brokerUrl = messagingProps.getProperty(BROKER_PROPNAME);
+
+ // Set up the broker connection url.
+ String connectionString =
+ "amqp://" + conUsername + ":" + conPassword + "/" + ((virtualHost != null) ? virtualHost : "")
+ + "?brokerlist='" + brokerUrl + "'";
+
+ // messagingProps.setProperty(CONNECTION_PROPNAME, connectionString);
+
+ Context ctx = new InitialContext(messagingProps);
+
+ ConnectionFactory cf = (ConnectionFactory) ctx.lookup(CONNECTION_NAME);
+ Connection connection = cf.createConnection();
+
+ return connection;
+ }
+ catch (NamingException e)
+ {
+ log.debug("Got NamingException: ", e);
+ throw new RuntimeException("Got JNDI NamingException whilst looking up the connection factory.", e);
+ }
+ catch (JMSException e)
+ {
+ log.debug("Got JMSException: ", e);
+ throw new RuntimeException("Could not establish connection due to JMSException.", e);
+ }
+ }
+
+ /**
+ * Creates a publisher and a receiver on the same connection, configured according the to specified standard
+ * properties.
+ *
+ * @param messagingProps The connection properties.
+ *
+ * @return A publisher/receiver client pair.
+ */
+ public static PublisherReceiver createPublisherReceiverPairSharedConnection(ParsedProperties messagingProps)
+ {
+ try
+ {
+ // Get a unique offset to append to destination names to make them unique to the connection.
+ long uniqueId = uniqueDestsId.incrementAndGet();
+
+ // Extract the standard test configuration parameters relevant to the connection.
+ String destinationSendRoot = messagingProps.getProperty(SEND_DESTINATION_NAME_ROOT_PROPNAME) + "_" + uniqueId;
+ String destinationReceiveRoot =
+ messagingProps.getProperty(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME) + "_" + uniqueId;
+ boolean createPublisherProducer = messagingProps.getPropertyAsBoolean(PUBLISHER_PRODUCER_BIND_PROPNAME);
+ boolean createPublisherConsumer = messagingProps.getPropertyAsBoolean(PUBLISHER_CONSUMER_BIND_PROPNAME);
+ boolean createReceiverProducer = messagingProps.getPropertyAsBoolean(RECEIVER_PRODUCER_BIND_PROPNAME);
+ boolean createReceiverConsumer = messagingProps.getPropertyAsBoolean(RECEIVER_CONSUMER_BIND_PROPNAME);
+
+ // Check which JMS flags and options are to be set.
+ int ackMode = messagingProps.getPropertyAsInteger(ACK_MODE_PROPNAME);
+ boolean useTopics = messagingProps.getPropertyAsBoolean(PUBSUB_PROPNAME);
+ boolean transactional = messagingProps.getPropertyAsBoolean(TRANSACTED_PROPNAME);
+ boolean durableSubscription = messagingProps.getPropertyAsBoolean(DURABLE_SUBSCRIPTION_PROPNAME);
+
+ // Check if any Qpid/AMQP specific flags or options need to be set.
+ boolean immediate = messagingProps.getPropertyAsBoolean(IMMEDIATE_PROPNAME);
+ boolean mandatory = messagingProps.getPropertyAsBoolean(MANDATORY_PROPNAME);
+ boolean needsQpidOptions = immediate | mandatory;
+
+ /*log.debug("ackMode = " + ackMode);
+ log.debug("useTopics = " + useTopics);
+ log.debug("destinationSendRoot = " + destinationSendRoot);
+ log.debug("destinationReceiveRoot = " + destinationReceiveRoot);
+ log.debug("createPublisherProducer = " + createPublisherProducer);
+ log.debug("createPublisherConsumer = " + createPublisherConsumer);
+ log.debug("createReceiverProducer = " + createReceiverProducer);
+ log.debug("createReceiverConsumer = " + createReceiverConsumer);
+ log.debug("transactional = " + transactional);
+ log.debug("immediate = " + immediate);
+ log.debug("mandatory = " + mandatory);
+ log.debug("needsQpidOptions = " + needsQpidOptions);*/
+
+ // Create connection, sessions and producer/consumer pairs on each session.
+ Connection connection = createConnection(messagingProps);
+
+ // Add the connection exception listener to assert on exception conditions with.
+ ExceptionMonitor exceptionMonitor = new ExceptionMonitor();
+ connection.setExceptionListener(exceptionMonitor);
+
+ Session publisherSession = connection.createSession(transactional, ackMode);
+ Session receiverSession = connection.createSession(transactional, ackMode);
+
+ Destination publisherProducerDestination =
+ useTopics ? (Destination) publisherSession.createTopic(destinationSendRoot)
+ : publisherSession.createQueue(destinationSendRoot);
+
+ MessageProducer publisherProducer =
+ createPublisherProducer
+ ? (needsQpidOptions
+ ? ((AMQSession) publisherSession).createProducer(publisherProducerDestination, mandatory, immediate)
+ : publisherSession.createProducer(publisherProducerDestination)) : null;
+
+ MessageConsumer publisherConsumer =
+ createPublisherConsumer
+ ? publisherSession.createConsumer(publisherSession.createQueue(destinationReceiveRoot)) : null;
+
+ if (publisherConsumer != null)
+ {
+ publisherConsumer.setMessageListener(new MessageMonitor());
+ }
+
+ MessageProducer receiverProducer =
+ createReceiverProducer ? receiverSession.createProducer(receiverSession.createQueue(destinationReceiveRoot))
+ : null;
+
+ Destination receiverConsumerDestination =
+ useTopics ? (Destination) receiverSession.createTopic(destinationSendRoot)
+ : receiverSession.createQueue(destinationSendRoot);
+
+ MessageConsumer receiverConsumer =
+ createReceiverConsumer
+ ? ((durableSubscription && useTopics)
+ ? receiverSession.createDurableSubscriber((Topic) receiverConsumerDestination, "testsub")
+ : receiverSession.createConsumer(receiverConsumerDestination)) : null;
+
+ if (receiverConsumer != null)
+ {
+ receiverConsumer.setMessageListener(new MessageMonitor());
+ }
+
+ // Start listening for incoming messages.
+ connection.start();
+
+ // Package everything up.
+ ProducerConsumerPair publisher =
+ new ProducerConsumerPairImpl(publisherProducer, publisherConsumer, publisherSession);
+ ProducerConsumerPair receiver =
+ new ProducerConsumerPairImpl(receiverProducer, receiverConsumer, receiverSession);
+
+ PublisherReceiver result = new PublisherReceiverImpl(publisher, receiver, connection, exceptionMonitor);
+
+ return result;
+ }
+ catch (JMSException e)
+ {
+ log.debug("Got JMSException: ", e);
+ throw new RuntimeException("Could not create publisher/receiver pair due to a JMSException.", e);
+ }
+ }
+
+ public static Message createTestMessage(ProducerConsumerPair client, ParsedProperties testProps) throws JMSException
+ {
+ return client.getSession().createTextMessage("Hello");
+ // return client.getSession().createMessage();
+ }
+
+ /**
+ * A ProducerConsumerPair is a pair consisting of one message producer and one message consumer. It is a standard
+ * unit of connectivity allowing a full-duplex conversation to be held, provided both the consumer and producer
+ * are instantiated and configured.
+ *
+ * In some situations a test, or piece of application code will be written with differing numbers of publishers
+ * and receivers in different roles, where one role produces only and one consumes only. This messaging topology
+ * can still make use of producer/consumer pairs as standard building blocks, combined into publisher/receiver
+ * units to fulfill the different messaging roles, with the publishers consumer uninstantiated and the receivers
+ * producer uninstantiated. Use a {@link PublisherReceiver} for this.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities
+ * <tr><td> Provide a message producer for sending messages.
+ * <tr><td> Provide a message consumer for receiving messages.
+ * </table>
+ *
+ * @todo Update the {@link org.apache.qpid.util.ConversationFactory} so that it accepts these as the basic
+ * conversation connection units.
+ */
+ public static interface ProducerConsumerPair
+ {
+ public MessageProducer getProducer();
+
+ public MessageConsumer getConsumer();
+
+ public void send(Message message) throws JMSException;
+
+ public Session getSession();
+
+ public void close() throws JMSException;
+ }
+
+ /**
+ * A single producer and consumer.
+ */
+ public static class ProducerConsumerPairImpl implements ProducerConsumerPair
+ {
+ MessageProducer producer;
+
+ MessageConsumer consumer;
+
+ Session session;
+
+ public ProducerConsumerPairImpl(MessageProducer producer, MessageConsumer consumer, Session session)
+ {
+ this.producer = producer;
+ this.consumer = consumer;
+ this.session = session;
+ }
+
+ public MessageProducer getProducer()
+ {
+ return producer;
+ }
+
+ public MessageConsumer getConsumer()
+ {
+ return consumer;
+ }
+
+ public void send(Message message) throws JMSException
+ {
+ producer.send(message);
+ }
+
+ public Session getSession()
+ {
+ return session;
+ }
+
+ public void close() throws JMSException
+ {
+ if (producer != null)
+ {
+ producer.close();
+ }
+
+ if (consumer != null)
+ {
+ consumer.close();
+ }
+ }
+ }
+
+ /**
+ * Multiple producers and consumers made to look like a single producer and consumer. All methods repeated accross
+ * all producers and consumers.
+ */
+ public static class MultiProducerConsumerPairImpl implements ProducerConsumerPair
+ {
+ public MessageProducer getProducer()
+ {
+ throw new RuntimeException("Not implemented.");
+ }
+
+ public MessageConsumer getConsumer()
+ {
+ throw new RuntimeException("Not implemented.");
+ }
+
+ public void send(Message message) throws JMSException
+ {
+ throw new RuntimeException("Not implemented.");
+ }
+
+ public Session getSession()
+ {
+ throw new RuntimeException("Not implemented.");
+ }
+
+ public void close()
+ {
+ throw new RuntimeException("Not implemented.");
+ }
+ }
+
+ /**
+ * A PublisherReceiver consists of two sets of producer/consumer pairs, one for an 'instigating' publisher
+ * role, and one for a more 'passive' receiver role.
+ *
+ * <p/>A set of publishers and receivers forms a typical test configuration where both roles are to be controlled
+ * from within a single JVM. This is not a particularly usefull arrangement for applications which want to place
+ * these roles on physically seperate machines and pass messages between them. It is a faily normal arrangement for
+ * test code though, either to publish and receive messages through an in-VM message broker in order to test its
+ * expected behaviour, or to publish and receive (possibly bounced back) messages through a seperate broker instance
+ * in order to take performance timings. In the case of performance timings, the co-location of the publisher and
+ * receiver means that the timings are taken on the same machine for accurate timing without the need for clock
+ * synchronization.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities
+ * <tr><td> Manage an m*n array of publisher and recievers.
+ * </table>
+ */
+ public static interface PublisherReceiver
+ {
+ public ProducerConsumerPair getPublisher();
+
+ public ProducerConsumerPair getReceiver();
+
+ public void start();
+
+ public void send(ParsedProperties testProps, int numMessages);
+
+ public ExceptionMonitor getConnectionExceptionMonitor();
+
+ public ExceptionMonitor getExceptionMonitor();
+
+ public void testWithAssertions(ParsedProperties testProps, Class aClass /*, assertions */);
+
+ public void testNoExceptions(ParsedProperties testProps);
+
+ public void close();
+ }
+
+ public static class PublisherReceiverImpl implements PublisherReceiver
+ {
+ private ProducerConsumerPair publisher;
+ private ProducerConsumerPair receiver;
+ private Connection connection;
+ private ExceptionMonitor connectionExceptionMonitor;
+ private ExceptionMonitor exceptionMonitor;
+
+ public PublisherReceiverImpl(ProducerConsumerPair publisher, ProducerConsumerPair receiver, Connection connection,
+ ExceptionMonitor connectionExceptionMonitor)
+ {
+ this.publisher = publisher;
+ this.receiver = receiver;
+ this.connection = connection;
+ this.connectionExceptionMonitor = connectionExceptionMonitor;
+ this.exceptionMonitor = new ExceptionMonitor();
+ }
+
+ public ProducerConsumerPair getPublisher()
+ {
+ return publisher;
+ }
+
+ public ProducerConsumerPair getReceiver()
+ {
+ return receiver;
+ }
+
+ public void start()
+ { }
+
+ public void close()
+ {
+ try
+ {
+ publisher.close();
+ receiver.close();
+ connection.close();
+ }
+ catch (JMSException e)
+ {
+ throw new RuntimeException("Got JMSException during close.", e);
+ }
+ }
+
+ public ExceptionMonitor getConnectionExceptionMonitor()
+ {
+ return connectionExceptionMonitor;
+ }
+
+ public ExceptionMonitor getExceptionMonitor()
+ {
+ return exceptionMonitor;
+ }
+
+ public void send(ParsedProperties testProps, int numMessages)
+ {
+ boolean transactional = testProps.getPropertyAsBoolean(TRANSACTED_PROPNAME);
+
+ // Send an immediate message through the publisher and ensure that it results in a JMSException.
+ try
+ {
+ getPublisher().send(createTestMessage(getPublisher(), testProps));
+
+ if (transactional)
+ {
+ getPublisher().getSession().commit();
+ }
+ }
+ catch (JMSException e)
+ {
+ log.debug("Got JMSException: ", e);
+ exceptionMonitor.onException(e);
+ }
+ }
+
+ public void testWithAssertions(ParsedProperties testProps, Class aClass /*, assertions */)
+ {
+ start();
+ send(testProps, 1);
+ pause(1000L);
+
+ String errors = "";
+
+ ExceptionMonitor connectionExceptionMonitor = getConnectionExceptionMonitor();
+ if (!connectionExceptionMonitor.assertOneJMSExceptionWithLinkedCause(aClass))
+ {
+ errors += "Was expecting linked exception type " + aClass.getName() + " on the connection.\n";
+ errors +=
+ (connectionExceptionMonitor.size() > 0)
+ ? ("Actually got the following exceptions on the connection, " + connectionExceptionMonitor)
+ : "Got no exceptions on the connection.";
+ }
+
+ // Clean up the publisher/receiver client pair.
+ close();
+
+ assertEquals(errors, "", errors);
+ }
+
+ /**
+ */
+ public void testNoExceptions(ParsedProperties testProps)
+ {
+ start();
+ send(testProps, 1);
+ pause(1000L);
+
+ String errors = "";
+
+ if (!getConnectionExceptionMonitor().assertNoExceptions())
+ {
+ errors += "Was expecting no exceptions.\n";
+ errors += "Got the following exceptions on the connection, " + getConnectionExceptionMonitor();
+ }
+
+ if (!getExceptionMonitor().assertNoExceptions())
+ {
+ errors += "Was expecting no exceptions.\n";
+ errors += "Got the following exceptions on the producer, " + getExceptionMonitor();
+ }
+
+ // Clean up the publisher/receiver client pair.
+ close();
+
+ assertEquals(errors, "", errors);
+ }
+
+ public static PublisherReceiver connectClients(ParsedProperties testProps)
+ {
+ // Create a standard publisher/receiver test client pair on a shared connection, individual sessions.
+ return createPublisherReceiverPairSharedConnection(testProps);
+ }
+ }
+
+ /**
+ * Pauses for the specified length of time. In the event of failing to pause for at least that length of time
+ * due to interuption of the thread, a RutimeException is raised to indicate the failure. The interupted status
+ * of the thread is restores in that case. This method should only be used when it is expected that the pause
+ * will be succesfull, for example in test code that relies on inejecting a pause.
+ *
+ * @param t The minimum time to pause for in milliseconds.
+ */
+ public static void pause(long t)
+ {
+ try
+ {
+ Thread.sleep(t);
+ }
+ catch (InterruptedException e)
+ {
+ // Restore the interrupted status
+ Thread.currentThread().interrupt();
+
+ throw new RuntimeException("Failed to generate the requested pause length.", e);
+ }
}
}
Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java?view=diff&rev=561578&r1=561577&r2=561578
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java Tue Jul 31 15:34:12 2007
@@ -20,11 +20,17 @@
*/
package org.apache.qpid.server.exchange;
-import org.apache.qpid.test.framework.sequencers.TestCaseSequencer;
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.MessagingTestConfigProperties;
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
+import junit.framework.TestCase;
+
+import org.apache.log4j.NDC;
+
+import org.apache.qpid.client.AMQNoRouteException;
+import org.apache.qpid.client.transport.TransportConnection;
+import static org.apache.qpid.server.exchange.MessagingTestConfigProperties.*;
+import org.apache.qpid.server.registry.ApplicationRegistry;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
import uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
@@ -37,70 +43,52 @@
*
* <p><table id="crc"><caption>CRC Card</caption>
* <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Check that an mandatory message is sent succesfully not using transactions when a consumer is connected.
- * <tr><td> Check that an mandatory message is committed succesfully in a transaction when a consumer is connected.
- * <tr><td> Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected
- * but the route exists.
- * <tr><td> Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but
- * the route exists.
- * <tr><td> Check that an mandatory message results in no route code, not using transactions, when no consumer is
- * connected.
- * <tr><td> Check that an mandatory message results in no route code, upon transaction commit, when a consumer is
+ * <tr><td> Check that a mandatory message is sent succesfully not using transactions when a consumer is connected.
+ * <tr><td> Check that a mandatory message is committed succesfully in a transaction when a consumer is connected.
+ * <tr><td> Check that a mandatory message results in no route code, not using transactions, when no consumer is
* connected.
- * <tr><td> Check that an mandatory message is sent succesfully not using transactions when a consumer is connected.
- * <tr><td> Check that an mandatory message is committed succesfully in a transaction when a consumer is connected.
- * <tr><td> Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected
- * but the route exists.
- * <tr><td> Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but
- * the route exists.
- * <tr><td> Check that an mandatory message results in no route code, not using transactions, when no consumer is
- * connected.
- * <tr><td> Check that an mandatory message results in no route code, upon transaction commit, when a consumer is
+ * <tr><td> Check that a mandatory message results in no route code, upon transaction commit, when a consumer is
* connected.
+ * <tr><td> Check that a mandatory message is sent succesfully, not using transactions, when a consumer is
+ * disconnected but the route exists.
+ * <tr><dt> Check that a mandatory message is send successfully, in a transactions, when a consumer is
+ * disconnected but when the route exists.
* </table>
- *
- * @todo All of these test cases will be generated by a test generator that thoroughly tests all combinations of test
- * circuits.
*/
-public class MandatoryMessageTest extends FrameworkBaseCase
+public class MandatoryMessageTest extends TestCase
{
+ /** Used for debugging. */
+ private static final Logger log = LoggerFactory.getLogger(MandatoryMessageTest.class);
+
/** Used to read the tests configurable properties through. */
ParsedProperties testProps;
- /**
- * Creates a new test case with the specified name.
- *
- * @param name The test case name.
- */
- public MandatoryMessageTest(String name)
- {
- super(name);
- }
-
/** Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_508_MandatoryOkNoTxP2P()
+ public void test_QPID_508_MandatoryOkNoTxP2P() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, false);
- // Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message with no errors.
+ testClients.testNoExceptions(testProps);
}
/** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_508_MandatoryOkTxP2P()
+ public void test_QPID_508_MandatoryOkTxP2P() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, false);
- // Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message with no errors.
+ testClients.testNoExceptions(testProps);
}
/**
@@ -113,14 +101,14 @@
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, false);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testClients.getReceiver().getConsumer().close();
// Send one message with no errors.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ testClients.testNoExceptions(testProps);
}
/**
@@ -133,74 +121,78 @@
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, false);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testClients.getReceiver().getConsumer().close();
// Send one message with no errors.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ testClients.testNoExceptions(testProps);
}
/** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteNoTxP2P()
+ public void test_QPID_508_MandatoryFailsNoRouteNoTxP2P() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, false);
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
+ // Set up the messaging topology so that only the publishers producer is bound (do not set up the receiver to
// collect its messages).
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
- // Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message and get a linked no consumers exception.
+ testClients.testWithAssertions(testProps, AMQNoRouteException.class);
}
/** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteTxP2P()
+ public void test_QPID_508_MandatoryFailsNoRouteTxP2P() throws Exception
{
// Ensure transactional sessions are on.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, false);
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
+ // Set up the messaging topology so that only the publishers producer is bound (do not set up the receiver to
// collect its messages).
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
- // Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message and get a linked no consumers exception.
+ testClients.testWithAssertions(testProps, AMQNoRouteException.class);
}
/** Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_508_MandatoryOkNoTxPubSub()
+ public void test_QPID_508_MandatoryOkNoTxPubSub() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, true);
- // Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message with no errors.
+ testClients.testNoExceptions(testProps);
}
/** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_508_MandatoryOkTxPubSub()
+ public void test_QPID_508_MandatoryOkTxPubSub() throws Exception
{
- // Ensure transactional sessions are on.
+ // Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, true);
- // Run the default test sequence over the test circuit checking for no errors.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message with no errors.
+ testClients.testNoExceptions(testProps);
}
/**
@@ -216,14 +208,14 @@
// Use durable subscriptions, so that the route remains open with no subscribers.
testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testClients.getReceiver().getConsumer().close();
// Send one message with no errors.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ testClients.testNoExceptions(testProps);
}
/**
@@ -239,61 +231,79 @@
// Use durable subscriptions, so that the route remains open with no subscribers.
testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
// Disconnect the consumer.
- testCircuit.getReceiver().getConsumer().close();
+ testClients.getReceiver().getConsumer().close();
// Send one message with no errors.
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noExceptionsAssertion()), testProps);
+ testClients.testNoExceptions(testProps);
}
/** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteNoTxPubSub()
+ public void test_QPID_508_MandatoryFailsNoRouteNoTxPubSub() throws Exception
{
// Ensure transactional sessions are off.
testProps.setProperty(TRANSACTED_PROPNAME, false);
testProps.setProperty(PUBSUB_PROPNAME, true);
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
+ // Set up the messaging topology so that only the publishers producer is bound (do not set up the receiver to
// collect its messages).
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
- // Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message and get a linked no consumers exception.
+ testClients.testWithAssertions(testProps, AMQNoRouteException.class);
}
/** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteTxPubSub()
+ public void test_QPID_508_MandatoryFailsNoRouteTxPubSub() throws Exception
{
// Ensure transactional sessions are on.
testProps.setProperty(TRANSACTED_PROPNAME, true);
testProps.setProperty(PUBSUB_PROPNAME, true);
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
+ // Set up the messaging topology so that only the publishers producer is bound (do not set up the receiver to
// collect its messages).
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
- // Send one message and get a linked no route exception.
- TestCaseSequencer sequencer = getTestSequencer();
- Circuit testCircuit = sequencer.createCircuit(testProps);
- sequencer.sequenceTest(testCircuit, assertionList(testCircuit.getPublisher().noRouteAssertion()), testProps);
+ ImmediateMessageTest.PublisherReceiver testClients =
+ ImmediateMessageTest.PublisherReceiverImpl.connectClients(testProps);
+
+ // Send one message and get a linked no consumers exception.
+ testClients.testWithAssertions(testProps, AMQNoRouteException.class);
}
protected void setUp() throws Exception
{
- super.setUp();
+ NDC.push(getName());
testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
/** All these tests should have the mandatory flag on. */
- testProps.setProperty(IMMEDIATE_PROPNAME, false);
testProps.setProperty(MANDATORY_PROPNAME, true);
/** Bind the receivers consumer by default. */
testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true);
+
+ // Ensure that the in-vm broker is created.
+ TransportConnection.createVMBroker(1);
+ }
+
+ protected void tearDown() throws Exception
+ {
+ try
+ {
+ // Ensure that the in-vm broker is cleaned up so that the next test starts afresh.
+ TransportConnection.killVMBroker(1);
+ ApplicationRegistry.remove(1);
+ }
+ finally
+ {
+ NDC.pop();
+ }
}
}
Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java?view=diff&rev=561578&r1=561577&r2=561578
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java Tue Jul 31 15:34:12 2007
@@ -126,8 +126,8 @@
con.start();
TextMessage tm = (TextMessage) consumer.receive(1000L);
- assertTrue("No message routed to receivers", tm != null);
- assertTrue("Wrong message routed to receivers: " + tm.getText(), "msg3".equals(tm.getText()));
+ assertTrue("No message routed to receiver", tm != null);
+ assertTrue("Wrong message routed to receiver: " + tm.getText(), "msg3".equals(tm.getText()));
try
{
@@ -193,8 +193,8 @@
con.start();
TextMessage tm = (TextMessage) consumer.receive(1000L);
- assertTrue("No message routed to receivers", tm != null);
- assertTrue("Wrong message routed to receivers: " + tm.getText(), "msg1".equals(tm.getText()));
+ assertTrue("No message routed to receiver", tm != null);
+ assertTrue("Wrong message routed to receiver: " + tm.getText(), "msg1".equals(tm.getText()));
try
{
@@ -259,8 +259,8 @@
con.start();
TextMessage tm = (TextMessage) consumer.receive(1000L);
- assertTrue("No message routed to receivers", tm != null);
- assertTrue("Wrong message routed to receivers: " + tm.getText(), "msg1".equals(tm.getText()));
+ assertTrue("No message routed to receiver", tm != null);
+ assertTrue("Wrong message routed to receiver: " + tm.getText(), "msg1".equals(tm.getText()));
try
{
Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java?view=diff&rev=561578&r1=561577&r2=561578
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java Tue Jul 31 15:34:12 2007
@@ -1,21 +1,18 @@
/*
*
- * 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
+ * Copyright (c) 2006 The Apache Software Foundation
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
package org.apache.qpid.server.protocol;
Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java?view=diff&rev=561578&r1=561577&r2=561578
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java Tue Jul 31 15:34:12 2007
@@ -1,21 +1,18 @@
/*
*
- * 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
+ * Copyright (c) 2006 The Apache Software Foundation
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
package org.apache.qpid.server.protocol;