You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gr...@apache.org on 2010/10/13 17:06:27 UTC
svn commit: r1022127 [11/15] - in
/qpid/branches/grkvlt-network-20101013/qpid/java: ./
broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/
broker-plugins/access-control/src/test/java/org/apache/qpid/server/securi...
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/capabilities/RmdBuilderTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/capabilities/RmdBuilderTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/capabilities/RmdBuilderTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/capabilities/RmdBuilderTest.java Wed Oct 13 15:05:29 2010
@@ -29,16 +29,15 @@ import javax.management.ObjectName;
import org.apache.qpid.management.Names;
import org.apache.qpid.management.domain.handler.impl.QpidDomainObject;
+import org.apache.qpid.test.utils.QpidTestCase;
import org.w3c.dom.Element;
-import junit.framework.TestCase;
-
/**
* Test case for Resource Metadata Descriptor Builder.
*
* @author Andrea Gazzarini
*/
-public class RmdBuilderTest extends TestCase
+public class RmdBuilderTest extends QpidTestCase
{
private MBeanInfo _metadata;
private RmdBuilder _builder;
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/common/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/common/build.xml?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/common/build.xml (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/common/build.xml Wed Oct 13 15:05:29 2010
@@ -20,6 +20,8 @@
-->
<project name="Management Common" default="build">
+ <property name="module.test.depends" value="common/test" />
+
<import file="../../module.xml"/>
<target name="bundle" depends="bundle-tasks"/>
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java Wed Oct 13 15:05:29 2010
@@ -79,21 +79,6 @@ public interface ManagedConnection
Date getLastIoTime();
/**
- * Tells the total number of bytes written till now.
- * @return number of bytes written.
- *
- @MBeanAttribute(name="WrittenBytes", description="The total number of bytes written till now")
- Long getWrittenBytes();
- */
- /**
- * Tells the total number of bytes read till now.
- * @return number of bytes read.
- *
- @MBeanAttribute(name="ReadBytes", description="The total number of bytes read till now")
- Long getReadBytes();
- */
-
- /**
* Threshold high value for no of channels. This is useful in setting notifications or
* taking required action is there are more channels being created.
* @return threshold limit for no of channels
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/sasl/CRAMMD5HashedSaslClientFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/sasl/CRAMMD5HashedSaslClientFactory.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/sasl/CRAMMD5HashedSaslClientFactory.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/sasl/CRAMMD5HashedSaslClientFactory.java Wed Oct 13 15:05:29 2010
@@ -34,7 +34,7 @@ public class CRAMMD5HashedSaslClientFact
public static final String MECHANISM = "CRAM-MD5-HASHED";
public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol,
- String serverName, Map<String, ?> props, CallbackHandler cbh)
+ String serverName, Map props, CallbackHandler cbh)
throws SaslException
{
for (int i = 0; i < mechanisms.length; i++)
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/test/java/org/apache/qpid/management/common/mbeans/ManagedQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/test/java/org/apache/qpid/management/common/mbeans/ManagedQueueTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/test/java/org/apache/qpid/management/common/mbeans/ManagedQueueTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/common/src/test/java/org/apache/qpid/management/common/mbeans/ManagedQueueTest.java Wed Oct 13 15:05:29 2010
@@ -30,9 +30,9 @@ import javax.management.MBeanAttributeIn
import javax.management.NotCompliantMBeanException;
import javax.management.StandardMBean;
-import junit.framework.TestCase;
+import org.apache.qpid.test.utils.QpidTestCase;
-public class ManagedQueueTest extends TestCase
+public class ManagedQueueTest extends QpidTestCase
{
public void testAttributesContants()
{
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/console/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/console/build.xml?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/console/build.xml (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/console/build.xml Wed Oct 13 15:05:29 2010
@@ -20,6 +20,8 @@
-->
<project name="QMF Console" default="build">
+ <property name="module.test.depends" value="common/test" />
+
<property name="module.depends" value="common client"/>
<import file="../../module.xml"/>
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/console/src/main/java/org/apache/qpid/console/QMFObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/console/src/main/java/org/apache/qpid/console/QMFObject.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/console/src/main/java/org/apache/qpid/console/QMFObject.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/console/src/main/java/org/apache/qpid/console/QMFObject.java Wed Oct 13 15:05:29 2010
@@ -21,6 +21,7 @@
package org.apache.qpid.console;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map.Entry;
@@ -30,8 +31,6 @@ import org.apache.qpid.transport.codec.E
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import edu.emory.mathcs.backport.java.util.Arrays;
-
public class QMFObject
{
private static Logger log = LoggerFactory.getLogger(QMFObject.class);
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/console/src/test/java/org/apache/qpid/console/ClassKeyTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/console/src/test/java/org/apache/qpid/console/ClassKeyTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/console/src/test/java/org/apache/qpid/console/ClassKeyTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/console/src/test/java/org/apache/qpid/console/ClassKeyTest.java Wed Oct 13 15:05:29 2010
@@ -20,9 +20,9 @@
*/
package org.apache.qpid.console;
-import junit.framework.TestCase;
+import org.apache.qpid.test.utils.QpidTestCase;
-public class ClassKeyTest extends TestCase
+public class ClassKeyTest extends QpidTestCase
{
public void testCreation()
{
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ApiVersionTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ApiVersionTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ApiVersionTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ApiVersionTest.java Wed Oct 13 15:05:29 2010
@@ -20,9 +20,9 @@
*/
package org.apache.qpid.management.ui;
-import junit.framework.TestCase;
+import org.apache.qpid.test.utils.QpidTestCase;
-public class ApiVersionTest extends TestCase
+public class ApiVersionTest extends QpidTestCase
{
public void testGetMajor()
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ApplicationRegistryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ApplicationRegistryTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ApplicationRegistryTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ApplicationRegistryTest.java Wed Oct 13 15:05:29 2010
@@ -21,10 +21,9 @@
package org.apache.qpid.management.ui;
import org.apache.qpid.management.common.mbeans.ServerInformation;
+import org.apache.qpid.test.utils.QpidTestCase;
-import junit.framework.TestCase;
-
-public class ApplicationRegistryTest extends TestCase
+public class ApplicationRegistryTest extends QpidTestCase
{
public void testSupportedManagementApiVersion()
{
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java Wed Oct 13 15:05:29 2010
@@ -36,6 +36,7 @@ import org.apache.qpid.server.virtualhos
import javax.management.MBeanFeatureInfo;
import javax.management.MBeanInfo;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
@@ -87,7 +88,7 @@ public class ManagementConsoleTest exten
// If this test fails due to changes in the broker code,
// then the constants in the Constants.java shoule be updated accordingly
DirectExchange exchange = new DirectExchange();
- exchange.initialise(_virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, false, 0, true);
+ exchange.initialise(_virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, false, 0, true, Collections.EMPTY_MAP);
AMQManagedObject mbean = (AMQManagedObject)exchange.getManagedObject();
MBeanInfo mbeanInfo = mbean.getMBeanInfo();
Added: qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractAll.sh
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractAll.sh?rev=1022127&view=auto
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractAll.sh (added)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractAll.sh Wed Oct 13 15:05:29 2010
@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# 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.
+#
+
+# Extract all results from the current set of results directories as plain text.
+# Runs from any directory with no arguments, output to standard out.
+
+pushd . > /dev/null 2>&1
+cd $(dirname "$0")
+
+echo
+for r in results-*
+do
+ t=$(echo "${r}" | cut -d\- -f2)
+ T=$(echo "${t}" | tr '[a-z]' '[A-Z]')
+ echo "${T}"
+ echo "${T}" | tr '[A-Z]' '\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-'
+ echo
+ ./extractResults.sh "${r}"
+ echo
+done
+
+popd > /dev/null 2>&1
Propchange: qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractAll.sh
------------------------------------------------------------------------------
svn:executable = *
Added: qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractWiki.sh
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractWiki.sh?rev=1022127&view=auto
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractWiki.sh (added)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractWiki.sh Wed Oct 13 15:05:29 2010
@@ -0,0 +1,88 @@
+#!/bin/bash
+#
+# 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.
+#
+
+# Extract all results from the current set of results directories in wiki
+# format. Output is compatible with Atlassian Confluence only. Runs from
+# any directory with no arguments, output to standard out.
+
+if [ $# -eq 0 ]
+then
+ dirs=$(echo results-*)
+else
+ dirs=$(echo $*)
+fi
+
+pushd . > /dev/null
+cd $(dirname "$0")
+
+ver=$(basename $(dirname $(pwd)))
+node=$(uname -n)
+
+echo "h1. Qpid ${ver} Test Results"
+echo
+echo "{toc:type=flat|separator=pipe|minLevel=2|maxLevel=3}"
+echo
+for r in ${dirs}
+do
+ if [ -d "${r}" ]
+ then
+ t=$(echo "${r}" | cut -d\- -f2)
+ f=$(echo "${t}" | sed -e "s/^\(.\).*$/\1/")
+ l=$(echo "${t}" | sed -e "s/^.\(.*\)$/\1/")
+ T=$(echo "${f}" | tr '[a-z]' '[A-Z]')
+ echo "h2. ${T}${l}"
+ echo
+ echo "Generated on _$(ls -ld ${r} | cut -d\ -f7-9)_."
+ echo
+ echo "{table:cellpadding=3|cellspacing=0|border=1}"
+ echo "{tr}{td:bgcolor=#eeeeff}*Test*{td}"
+ echo "{td:bgcolor=#eeeeff}*Total*{td}{td:bgcolor=#eeeeff}*Passed*{td}"
+ echo "{td:bgcolor=#eeeeff}*Failed*{td}{td:bgcolor=#eeeeff}*Errors*{td}{tr}"
+ ./extractResults.sh "${r}" |
+ sed -e "s/,/{td}{td}/g" |
+ sed -e "s/{td}\s*Error:\s*\([1-9][0-9]*\)/{td:bgcolor=#ffeeee}*\1*/" |
+ sed -e "s/{td}\s*Failed:\s*\([1-9][0-9]*\)/{td:bgcolor=#ffeeee}*\1*/" |
+ sed -e "s/^/{tr}{td}/" |
+ sed -e "s/$/{td}{tr}/" |
+ sed -e "s/[A-Z][a-z]*:\s*//g" |
+ sed -e "s/\s*//g"
+ echo "{table}"
+ echo
+ fi
+done
+
+if echo ${dirs} | grep results-throughput > /dev/null && test -d results-throughput
+then
+ echo "h2. Throughput Numbers"
+ echo
+ echo "Generated on _$(ls -ld results-throughput | cut -d\ -f7-9)_."
+ echo
+ echo "{table:cellpadding=3|cellspacing=0|border=1}"
+ echo "{tr}{td:bgcolor=#eeeeff}*Test*{td}{td:bgcolor=#eeeeff}*Thoughput*{td}{tr}"
+ ./extractThroughputResults.sh results-throughput |
+ sed -e "s/,/{td}{td}/g" |
+ sed -e "s/^/{tr}{td}/" |
+ sed -e "s/$/{td}{tr}/" |
+ sed -e "s/\s*//g"
+ echo "{table}"
+ echo
+fi
+
+popd > /dev/null 2>&1
Propchange: qpid/branches/grkvlt-network-20101013/qpid/java/perftests/etc/scripts/extractWiki.sh
------------------------------------------------------------------------------
svn:executable = *
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java Wed Oct 13 15:05:29 2010
@@ -20,17 +20,25 @@
*/
package org.apache.qpid.client;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorCompletionService;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.ThreadPoolExecutor;
+
import javax.jms.Connection;
-import javax.jms.Session;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
+import javax.jms.Session;
import javax.jms.TextMessage;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.client.transport.TransportConnection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,43 +47,45 @@ public class AMQQueueDeferredOrderingTes
private static final int NUM_MESSAGES = 1000;
- private Connection con;
- private Session session;
- private AMQQueue queue;
- private MessageConsumer consumer;
+ private Connection _con;
+ private Session _session;
+ private AMQQueue _queue;
+ private MessageConsumer _consumer;
private static final Logger _logger = LoggerFactory.getLogger(AMQQueueDeferredOrderingTest.class);
- private ASyncProducer producerThread;
+ private ExecutorService _exec = Executors.newCachedThreadPool();
- private class ASyncProducer extends Thread
+ private class ASyncProducer implements Callable<Void>
{
private MessageProducer producer;
- private final Logger _logger = LoggerFactory.getLogger(ASyncProducer.class);
+ private final Logger logger = LoggerFactory.getLogger(ASyncProducer.class);
private Session session;
private int start;
private int end;
public ASyncProducer(AMQQueue q, int start, int end) throws Exception
{
- this.session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- this._logger.info("Create Consumer of Q1");
+ this.logger.info("Create Producer for " + q.getQueueName());
+ this.session = _con.createSession(false, Session.AUTO_ACKNOWLEDGE);
this.producer = this.session.createProducer(q);
this.start = start;
this.end = end;
}
- public void run()
+ public Void call() throws Exception
{
try
{
- this._logger.info("Starting to send messages");
- for (int i = start; i < end && !interrupted(); i++)
+ this.logger.info("Starting to send messages");
+ for (int i = start; i < end && !Thread.currentThread().isInterrupted(); i++)
{
producer.send(session.createTextMessage(Integer.toString(i)));
}
- this._logger.info("Sent " + (end - start) + " messages");
+ this.logger.info("Sent " + (end - start) + " messages");
+
+ return null;
}
catch (JMSException e)
{
@@ -89,38 +99,43 @@ public class AMQQueueDeferredOrderingTes
super.setUp();
_logger.info("Create Connection");
- con = getConnection();
+ _con = getConnection();
+
_logger.info("Create Session");
- session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ _session = _con.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
_logger.info("Create Q");
- queue = new AMQQueue(new AMQShortString("amq.direct"), new AMQShortString("Q"), new AMQShortString("Q"),
- false, true);
+ _queue = new AMQQueue(new AMQShortString("amq.direct"), new AMQShortString("Q"), new AMQShortString("Q"), false, true);
+
_logger.info("Create Consumer of Q");
- consumer = session.createConsumer(queue);
+ _consumer = _session.createConsumer(_queue);
+
_logger.info("Start Connection");
- con.start();
+ _con.start();
}
public void testPausedOrder() throws Exception
{
+ ASyncProducer producer;
// Setup initial messages
_logger.info("Creating first producer thread");
- producerThread = new ASyncProducer(queue, 0, NUM_MESSAGES / 2);
- producerThread.start();
+ producer = new ASyncProducer(_queue, 0, NUM_MESSAGES / 2);
+ Future<Void> initial = _exec.submit(producer);
+
// Wait for them to be done
- producerThread.join();
+ initial.get();
// Setup second set of messages to produce while we consume
_logger.info("Creating second producer thread");
- producerThread = new ASyncProducer(queue, NUM_MESSAGES / 2, NUM_MESSAGES);
- producerThread.start();
+ producer = new ASyncProducer(_queue, NUM_MESSAGES / 2, NUM_MESSAGES);
+ _exec.submit(producer);
// Start consuming and checking they're in order
_logger.info("Consuming messages");
for (int i = 0; i < NUM_MESSAGES; i++)
{
- Message msg = consumer.receive(3000);
+ Message msg = _consumer.receive(3000);
assertNotNull("Message should not be null", msg);
assertTrue("Message should be a text message", msg instanceof TextMessage);
assertEquals("Message content does not match expected", Integer.toString(i), ((TextMessage) msg).getText());
@@ -130,16 +145,12 @@ public class AMQQueueDeferredOrderingTes
protected void tearDown() throws Exception
{
_logger.info("Interuptting producer thread");
- producerThread.interrupt();
+ _exec.shutdownNow();
+
_logger.info("Closing connection");
- con.close();
+ _con.close();
super.tearDown();
}
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(AMQQueueDeferredOrderingTest.class);
- }
-
}
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java Wed Oct 13 15:05:29 2010
@@ -25,7 +25,6 @@ import java.util.concurrent.CountDownLat
import java.util.concurrent.TimeUnit;
import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
@@ -36,7 +35,6 @@ import javax.jms.Session;
import javax.naming.Context;
import javax.naming.spi.InitialContextFactory;
-import org.apache.qpid.client.transport.TransportConnection;
import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
import org.apache.qpid.test.utils.QpidBrokerTestCase;
import org.slf4j.Logger;
@@ -100,15 +98,6 @@ public class DispatcherTest extends Qpid
}
}
- protected void tearDown() throws Exception
- {
-
- _clientConnection.close();
-
- _producerConnection.close();
- super.tearDown();
- }
-
public void testAsynchronousRecieve()
{
_logger.info("Test Start");
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java Wed Oct 13 15:05:29 2010
@@ -20,16 +20,12 @@
*/
package org.apache.qpid.client;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.client.transport.TransportConnection;
-
-import java.io.File;
import java.security.Provider;
import java.security.Security;
-import java.util.List;
import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
/**
* QPID-1394 : Test to ensure that the client can register their custom JCAProviders after the broker to ensure that
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java Wed Oct 13 15:05:29 2010
@@ -20,58 +20,47 @@
*/
package org.apache.qpid.server.failover;
-import junit.framework.TestCase;
+import java.util.concurrent.CountDownLatch;
+
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
import org.apache.qpid.AMQDisconnectedException;
import org.apache.qpid.AMQException;
import org.apache.qpid.client.AMQConnection;
import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.server.util.InternalBrokerBaseCase;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.transport.vm.VMBrokerCreationException;
+import org.apache.qpid.transport.vm.VmBroker;
import org.apache.qpid.url.URLSyntaxException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import java.util.concurrent.CountDownLatch;
-
-public class FailoverMethodTest extends InternalBrokerBaseCase implements ExceptionListener
+public class FailoverMethodTest extends QpidBrokerTestCase implements ExceptionListener
{
private CountDownLatch _failoverComplete = new CountDownLatch(1);
protected static final Logger _logger = LoggerFactory.getLogger(FailoverMethodTest.class);
@Override
- public void createBroker() throws Exception
+ public void setUp() throws Exception
{
- super.createBroker();
- TransportConnection.createVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
- }
-
- @Override
- public void stopBroker()
- {
- TransportConnection.killVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
- super.stopBroker();
+ _broker = VM;
+ super.setUp();
}
/**
* Test that the round robin method has the correct delays.
* The first connection to vm://:1 will work but the localhost connection should fail but the duration it takes
* to report the failure is what is being tested.
- *
- * @throws URLSyntaxException
- * @throws InterruptedException
- * @throws JMSException
*/
- public void testFailoverRoundRobinDelay() throws URLSyntaxException, InterruptedException, JMSException
+ public void testFailoverRoundRobinDelay() throws Exception
{
//note: The VM broker has no connect delay and the default 1 retry
// while the tcp:localhost broker has 3 retries with a 2s connect delay
String connectionString = "amqp://guest:guest@/test?brokerlist=" +
- "'vm://:" + ApplicationRegistry.DEFAULT_INSTANCE +
+ "'vm://:1" +
";tcp://localhost:5670?connectdelay='2000',retries='3''";
AMQConnectionURL url = new AMQConnectionURL(connectionString);
@@ -112,8 +101,7 @@ public class FailoverMethodTest extends
}
}
- public void testFailoverSingleDelay() throws URLSyntaxException, AMQVMBrokerCreationException,
- InterruptedException, JMSException
+ public void testFailoverSingleDelay() throws Exception
{
String connectionString = "amqp://guest:guest@/test?brokerlist='vm://:1?connectdelay='2000',retries='3''";
@@ -168,14 +156,8 @@ public class FailoverMethodTest extends
*
* Test validates that there is a connection delay as required on initial
* connection.
- *
- * @throws URLSyntaxException
- * @throws AMQVMBrokerCreationException
- * @throws InterruptedException
- * @throws JMSException
*/
- public void testNoFailover() throws URLSyntaxException, AMQVMBrokerCreationException,
- InterruptedException, JMSException
+ public void testNoFailover() throws Exception
{
int CONNECT_DELAY = 2000;
String connectionString = "amqp://guest:guest@/test?brokerlist='vm://:1?connectdelay='" + CONNECT_DELAY + "'," +
@@ -198,7 +180,7 @@ public class FailoverMethodTest extends
//Wait before starting broker
// The wait should allow atleast 1 retries to fail before broker is ready
Thread.sleep(750);
- createBroker();
+ startBroker();
}
catch (Exception e)
{
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java Wed Oct 13 15:05:29 2010
@@ -20,16 +20,16 @@
*/
package org.apache.qpid.server.logging;
-import junit.framework.AssertionFailedError;
-import org.apache.qpid.server.Main;
-import org.apache.qpid.transport.ConnectionException;
-import org.apache.qpid.util.LogMonitor;
-
-import java.io.File;
import java.io.IOException;
import java.net.Socket;
import java.util.List;
+import junit.framework.AssertionFailedError;
+
+import org.apache.qpid.BrokerOptions;
+import org.apache.qpid.transport.ConnectionException;
+import org.apache.qpid.util.LogMonitor;
+
/**
* Broker Test Suite
*
@@ -203,7 +203,7 @@ public class BrokerLoggingTest extends A
1, findMatches(TESTID).size());
//3
- String defaultLog4j = _configFile.getParent() + "/" + Main.DEFAULT_LOG_CONFIG_FILENAME;
+ String defaultLog4j = _configFile.getParent() + "/" + BrokerOptions.DEFAULT_LOG_CONFIG_FILENAME;
assertTrue("Log4j file(" + defaultLog4j + ") details not correctly logged:" + getMessageString(log),
getMessageString(log).endsWith(defaultLog4j));
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java Wed Oct 13 15:05:29 2010
@@ -77,7 +77,7 @@ public class ChannelLoggingTest extends
validateMessageID("CHN-1001", log);
assertEquals("Incorrect Channel in actor:"+fromActor(log), 1, getChannelID(fromActor(log)));
- if (isBroker08())
+ if (isBroker08() || isBroker09())
{
// Wait to ensure that the CHN-1004 message is logged
waitForMessage("CHN-1004");
@@ -249,9 +249,9 @@ public class ChannelLoggingTest extends
assertTrue("No CHN messages logged", results.size() > 0);
- // The last two channel messages should be:
+ // The last channel message should be:
//
- // INFO - MESSAGE [con:0(guest@anonymous(4205299)/test)/ch:1] [con:0(guest@anonymous(4205299)/test)/ch:1] CHN-1002 : Flow On
+ // INFO - MESSAGE [con:0(guest@anonymous(4205299)/test)] [con:0(guest@anonymous(4205299)/test)/ch:1] CHN-1002 : Flow On
// Verify
validateChannelClose(results);
@@ -310,4 +310,4 @@ public class ChannelLoggingTest extends
assertEquals("Channel IDs should be the same", getChannelID(fromActor(open)), getChannelID(fromSubject(close)));
assertEquals("Connection IDs should be the same", getConnectionID(fromActor(open)), getConnectionID(fromSubject(close)));
}
-}
\ No newline at end of file
+}
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java Wed Oct 13 15:05:29 2010
@@ -20,28 +20,24 @@
*/
package org.apache.qpid.server.queue;
-import junit.framework.TestCase;
-import junit.framework.Assert;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.naming.NamingException;
+
import org.apache.log4j.Logger;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.url.URLSyntaxException;
import org.apache.qpid.AMQException;
+import org.apache.qpid.client.AMQDestination;
+import org.apache.qpid.client.AMQSession;
import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-
-import javax.jms.*;
-import javax.naming.NamingException;
-import javax.naming.Context;
-import javax.naming.spi.InitialContextFactory;
-import java.util.Hashtable;
-import java.util.HashMap;
-import java.util.Map;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
public class PriorityTest extends QpidBrokerTestCase
{
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java Wed Oct 13 15:05:29 2010
@@ -21,30 +21,19 @@
package org.apache.qpid.server.queue;
-import junit.framework.TestCase;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.util.InternalBrokerBaseCase;
-
import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.spi.InitialContextFactory;
-import java.util.Hashtable;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.client.AMQDestination;
+import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
/**
* Test Case to ensure that messages are correctly returned.
@@ -52,19 +41,13 @@ import java.util.Hashtable;
* - The message is returned.
* - The broker doesn't leak memory.
* - The broker's state is correct after test.
- *
- * Why is this hardcoded to InVM testing, should be converted to QTC.
*/
-public class QueueDepthWithSelectorTest extends InternalBrokerBaseCase
+public class QueueDepthWithSelectorTest extends QpidBrokerTestCase
{
protected static final Logger _logger = Logger.getLogger(QueueDepthWithSelectorTest.class);
- protected final String BROKER = "vm://:"+ApplicationRegistry.DEFAULT_INSTANCE;
- protected final String VHOST = "test";
protected final String QUEUE = this.getClass().getName();
- protected Context _context;
-
protected Connection _clientConnection;
protected Connection _producerConnection;
private Session _clientSession;
@@ -82,30 +65,19 @@ public class QueueDepthWithSelectorTest
public void setUp() throws Exception
{
super.setUp();
- TransportConnection.createVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
-
- System.err.println("amqj.logging.level:" + System.getProperty("amqj.logging.level"));
- System.err.println("_logger.level:" + _logger.getLevel());
- System.err.println("_logger.isE-Error:" + _logger.isEnabledFor(Level.ERROR));
- System.err.println("_logger.isE-Warn:" + _logger.isEnabledFor(Level.WARN));
- System.err.println("_logger.isInfo:" + _logger.isInfoEnabled() + ":" + _logger.isEnabledFor(Level.INFO));
- System.err.println("_logger.isDebug:" + _logger.isDebugEnabled() + ":" + _logger.isEnabledFor(Level.DEBUG));
- System.err.println("_logger.isTrace:" + _logger.isTraceEnabled() + ":" + _logger.isEnabledFor(Level.TRACE));
-
- System.err.println(Logger.getRootLogger().getLoggerRepository());
-
- InitialContextFactory factory = new PropertiesFileInitialContextFactory();
-
- Hashtable<String, String> env = new Hashtable<String, String>();
-
- env.put("connectionfactory.connection", "amqp://guest:guest@TTL_TEST_ID/" + VHOST + "?brokerlist='" + BROKER + "'");
- env.put("queue.queue", QUEUE);
-
- _context = factory.getInitialContext(env);
+
+ //Create Producer
+ _producerConnection = getConnection();
+ _producerConnection.start();
+ _producerSession = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ _queue = _producerSession.createQueue(QUEUE);
+ _producer = _producerSession.createProducer(_queue);
- _messages = new Message[MSG_COUNT];
- _queue = (Queue) _context.lookup("queue");
- init();
+ // Create consumer
+ _clientConnection = getConnection();
+ _clientConnection.start();
+ _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ _consumer = _clientSession.createConsumer(_queue, "key = 23");
}
@Override
@@ -121,7 +93,6 @@ public class QueueDepthWithSelectorTest
_clientConnection.close();
}
- TransportConnection.killVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
super.tearDown();
}
@@ -149,26 +120,11 @@ public class QueueDepthWithSelectorTest
verifyBrokerState(0);
}
- protected void init() throws NamingException, JMSException, AMQException
- {
- //Create Producer
- _producerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
- _producerConnection.start();
- _producerSession = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _producer = _producerSession.createProducer(_queue);
-
- // Create consumer
- _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
- _clientConnection.start();
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _consumer = _clientSession.createConsumer(_queue, "key = 23");
- }
-
protected void verifyBrokerState(int expectedDepth)
{
try
{
- _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
+ _clientConnection = getConnection();
_clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
}
@@ -215,9 +171,9 @@ public class QueueDepthWithSelectorTest
_messages[i] = _consumer.receive(1000);
assertNotNull("should have received a message but didn't", _messages[i]);
}
-
- long queueDepth = ((AMQSession) _clientSession).getQueueDepth((AMQDestination) _queue);
- assertEquals("Session reports Queue depth not as expected", expectedDepth, queueDepth);
+
+// long queueDepth = ((AMQSession) _clientSession).getQueueDepth((AMQDestination) _queue);
+// assertEquals("Session reports Queue depth not as expected", expectedDepth, queueDepth);
//Check received messages
int msgId = 0;
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java Wed Oct 13 15:05:29 2010
@@ -275,7 +275,7 @@ public abstract class AbstractACLTestCas
public void check403Exception(Throwable t) throws Exception
{
assertNotNull("There was no linked exception", t);
- assertTrue("Wrong linked exception type", t instanceof AMQException);
+ assertTrue("Wrong linked exception type: " + t.getClass().getName(), t instanceof AMQException);
assertEquals("Incorrect error code received", 403, ((AMQException) t).getErrorCode().getCode());
//use the latch to ensure the control thread waits long enough for the exception thread
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java Wed Oct 13 15:05:29 2010
@@ -131,7 +131,7 @@ public class SimpleACLTest extends Abstr
}
catch (JMSException e)
{
- // JMSException -> linkedException -> cause = AMQException (403 or 320)
+ // JMSException -> linkedException -> cause = AMQException (320 or 403)
Exception linkedException = e.getLinkedException();
assertNotNull("There was no linked exception", linkedException);
Throwable cause = linkedException.getCause();
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/server/store/PersistentStoreTest.java Wed Oct 13 15:05:29 2010
@@ -99,6 +99,8 @@ public class PersistentStoreTest extends
*/
public void testForcibleStartStop() throws Exception
{
+ ((AMQSession) _session).sync();
+ _con.close();
restartBroker();
checkMessages();
}
@@ -128,6 +130,7 @@ public class PersistentStoreTest extends
sendMessage(_session, _destination, 5);
//sync to ensure that the above messages have reached the broker
((AMQSession) _session).sync();
+ _con.close();
restartBroker();
checkMessages();
}
@@ -144,6 +147,8 @@ public class PersistentStoreTest extends
public void testClientDeathMidTransaction() throws Exception
{
sendMessage(_session, _destination, 5);
+ //sync to ensure that the above messages have reached the broker
+ ((AMQSession) _session).sync();
_con.close();
checkMessages();
}
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/GlobalQueuesTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/GlobalQueuesTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/GlobalQueuesTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/GlobalQueuesTest.java Wed Oct 13 15:05:29 2010
@@ -20,11 +20,12 @@
*/
package org.apache.qpid.systest;
-import org.apache.commons.configuration.ConfigurationException;
+import java.io.IOException;
import javax.jms.Session;
import javax.naming.NamingException;
-import java.io.IOException;
+
+import org.apache.commons.configuration.ConfigurationException;
/**
* QPID-1447 : Add slow consumer detection and disconnection.
@@ -133,14 +134,14 @@ public class GlobalQueuesTest extends Te
* Test that setting messageAge has an effect on topics
*
* Sets the messageAge to be half the disconnection wait timeout
- * Send 10 messages and then ensure that we get disconnected as we will
+ * Send a message and then ensure that we get disconnected as we will
* wait for the full timeout.
*
* @throws Exception
*/
public void testTopicConsumerMessageAge() throws Exception
{
- MAX_QUEUE_MESSAGE_COUNT = 10;
+ MAX_QUEUE_MESSAGE_COUNT = 1;
setConfig("messageAge", String.valueOf(DISCONNECTION_WAIT / 2), false);
@@ -203,14 +204,14 @@ public class GlobalQueuesTest extends Te
* Ensure we set the delete-persistent option
*
* Sets the messageAge to be 1/5 the disconnection wait timeout (or 1sec)
- * Send 10 messages and then ensure that we get disconnected as we will
+ * Send a message and then ensure that we get disconnected as we will
* wait for the full timeout.
*
* @throws Exception
*/
public void testTopicDurableConsumerMessageAge() throws Exception
{
- MAX_QUEUE_MESSAGE_COUNT = 10;
+ MAX_QUEUE_MESSAGE_COUNT = 1;
setConfig("messageAge", String.valueOf(DISCONNECTION_WAIT / 5), true);
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/GlobalTopicsTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/GlobalTopicsTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/GlobalTopicsTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/GlobalTopicsTest.java Wed Oct 13 15:05:29 2010
@@ -20,11 +20,6 @@
*/
package org.apache.qpid.systest;
-import org.apache.commons.configuration.ConfigurationException;
-
-import javax.naming.NamingException;
-import java.io.IOException;
-
public class GlobalTopicsTest extends GlobalQueuesTest
{
@Override
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/MergeConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/MergeConfigurationTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/MergeConfigurationTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/MergeConfigurationTest.java Wed Oct 13 15:05:29 2010
@@ -20,26 +20,12 @@
*/
package org.apache.qpid.systest;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.qpid.AMQChannelClosedException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQSession_0_10;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
+import java.io.IOException;
+
import javax.jms.Session;
-import javax.jms.Topic;
import javax.naming.NamingException;
-import java.io.IOException;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
+
+import org.apache.commons.configuration.ConfigurationException;
public class MergeConfigurationTest extends TestingBaseCase
{
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/SubscriptionTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/SubscriptionTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/SubscriptionTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/SubscriptionTest.java Wed Oct 13 15:05:29 2010
@@ -20,11 +20,12 @@
*/
package org.apache.qpid.systest;
-import org.apache.commons.configuration.ConfigurationException;
+import java.io.IOException;
import javax.jms.Session;
import javax.naming.NamingException;
-import java.io.IOException;
+
+import org.apache.commons.configuration.ConfigurationException;
/**
* Test SCD when configured with Subscription details.
@@ -126,14 +127,14 @@ public class SubscriptionTest extends Te
* Ensure we set the delete-persistent option
*
* Sets the messageAge to be 1/5 the disconnection wait timeout (or 1sec)
- * Send 10 messages and then ensure that we get disconnected as we will
+ * Send a message and then ensure that we get disconnected as we will
* wait for the full timeout.
*
* @throws Exception
*/
public void testTopicDurableConsumerMessageAge() throws Exception
{
- MAX_QUEUE_MESSAGE_COUNT = 10;
+ MAX_QUEUE_MESSAGE_COUNT = 1;
setConfig("messageAge", String.valueOf(DISCONNECTION_WAIT / 5), true);
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/TestingBaseCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/TestingBaseCase.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/TestingBaseCase.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/TestingBaseCase.java Wed Oct 13 15:05:29 2010
@@ -20,13 +20,9 @@
*/
package org.apache.qpid.systest;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.qpid.AMQChannelClosedException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQSession_0_10;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import java.io.IOException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import javax.jms.Connection;
import javax.jms.Destination;
@@ -37,9 +33,12 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.Topic;
import javax.naming.NamingException;
-import java.io.IOException;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.jms.ConnectionListener;
+import org.apache.qpid.protocol.AMQConstant;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
public class TestingBaseCase extends QpidBrokerTestCase implements ExceptionListener, ConnectionListener
{
@@ -69,7 +68,6 @@ public class TestingBaseCase extends Qpi
}
-
protected void setProperty(String property, String value) throws NamingException, IOException, ConfigurationException
{
setConfigurationProperty("virtualhosts.virtualhost." +
@@ -123,22 +121,14 @@ public class TestingBaseCase extends Qpi
*
* Test creates a new connection and sets up the connection to prevent
* failover
- *
+ * <p>
* A new consumer is connected and started so that it will prefetch msgs.
- *
+ * <p>
* An asynchrounous publisher is started to fill the broker with messages.
- *
+ * <p>
* We then wait to be notified of the disconnection via the ExceptionListener
*
- * 0-10 does not have the same notification paths but sync() apparently should
- * give us the exception, currently it doesn't, so the test is excluded from 0-10
- *
- * We should ensure that this test has the same path for all protocol versions.
- *
- * Clients should not have to modify their code based on the protocol in use.
- *
- * @param ackMode @see javax.jms.Session
- *
+ * @param ackMode see {@link javax.jms.Session} for modes
* @throws Exception
*/
protected void topicConsumer(int ackMode, boolean durable) throws Exception
@@ -174,7 +164,8 @@ public class TestingBaseCase extends Qpi
boolean disconnected = _disconnectionLatch.await(DISCONNECTION_WAIT, TimeUnit.SECONDS);
assertTrue("Client was not disconnected", disconnected);
- assertTrue("Client was not disconnected.", _connectionException != null);
+
+ assertNotNull("No error received onException listener.", _connectionException);
Exception linked = _connectionException.getLinkedException();
@@ -188,11 +179,6 @@ public class TestingBaseCase extends Qpi
throw _publisherError;
}
- // NOTE these exceptions will need to be modeled so that they are not
- // 0-8 specific. e.g. JMSSessionClosedException
-
- assertNotNull("No error received onException listener.", _connectionException);
-
assertNotNull("No linked exception set on:" + _connectionException.getMessage(), linked);
assertTrue("Incorrect linked exception received.", linked instanceof AMQException);
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/TopicTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/TopicTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/TopicTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/systest/TopicTest.java Wed Oct 13 15:05:29 2010
@@ -20,10 +20,11 @@
*/
package org.apache.qpid.systest;
-import org.apache.commons.configuration.ConfigurationException;
+import java.io.IOException;
import javax.naming.NamingException;
-import java.io.IOException;
+
+import org.apache.commons.configuration.ConfigurationException;
/**
* This Topic test extends the Global queue test so it will run all the topic
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java Wed Oct 13 15:05:29 2010
@@ -21,6 +21,7 @@
package org.apache.qpid.test.client;
import org.apache.log4j.Logger;
+import org.apache.mina.common.support.IoServiceListenerSupport;
import org.apache.qpid.AMQException;
import org.apache.qpid.client.AMQDestination;
import org.apache.qpid.client.AMQSession;
@@ -53,7 +54,6 @@ public class QueueBrowserAutoAckTest ext
{
super.setUp();
-
//Create Client
_clientConnection = getConnection();
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java Wed Oct 13 15:05:29 2010
@@ -20,16 +20,16 @@
*/
package org.apache.qpid.test.framework.qpid;
-import org.apache.qpid.client.transport.TransportConnection;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.test.framework.CauseFailure;
import org.apache.qpid.test.framework.BrokerLifecycleAware;
+import org.apache.qpid.transport.vm.VmBroker;
/**
* <p/><table id="crc"><caption>CRC Card</caption>
* <tr><th> Responsibilities <th> Collaborations
* <tr><td> Cause messaging broker failure on the active in-vm broker.
- * <td> {@link TransportConnection}, {@link ApplicationRegistry}
+ * <td> {@link VmBroker}, {@link ApplicationRegistry}
* </table>
*/
public class CauseFailureInVM implements CauseFailure
@@ -62,9 +62,10 @@ public class CauseFailureInVM implements
*/
public void causeFailure()
{
+ // FIXMW
+
int liveBroker = inVMTest.getLiveBroker();
- TransportConnection.killVMBroker(liveBroker);
- ApplicationRegistry.remove(liveBroker);
+ VmBroker.killVMBroker();
}
}
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java Wed Oct 13 15:05:29 2010
@@ -23,11 +23,11 @@ package org.apache.qpid.test.framework.q
import junit.framework.Test;
import junit.framework.TestResult;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.test.framework.BrokerLifecycleAware;
import org.apache.qpid.test.framework.FrameworkBaseCase;
+import org.apache.qpid.transport.vm.VMBrokerCreationException;
+import org.apache.qpid.transport.vm.VmBroker;
import org.apache.qpid.junit.extensions.SetupTaskAware;
import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
@@ -88,10 +88,9 @@ public class InVMBrokerDecorator extends
// Ensure that the in-vm broker is created.
try
{
- ApplicationRegistry.getInstance(1);
- TransportConnection.createVMBroker(1);
+ VmBroker.createVMBroker();
}
- catch (AMQVMBrokerCreationException e)
+ catch (VMBrokerCreationException e)
{
throw new RuntimeException("In-VM broker creation failed: " + e.getMessage(), e);
}
@@ -103,8 +102,7 @@ public class InVMBrokerDecorator extends
public void run()
{
// Ensure that the in-vm broker is cleaned up so that the next test starts afresh.
- TransportConnection.killVMBroker(1);
- ApplicationRegistry.remove(1);
+ VmBroker.killVMBroker();
}
});
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/QuickAcking.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/QuickAcking.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/QuickAcking.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/QuickAcking.java Wed Oct 13 15:05:29 2010
@@ -20,7 +20,8 @@
*/
package org.apache.qpid.test.unit.ack;
-import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
+import java.util.concurrent.CountDownLatch;
+
import org.apache.qpid.client.AMQConnection;
import org.apache.qpid.jms.ConnectionListener;
import org.apache.qpid.test.utils.QpidBrokerTestCase;
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java Wed Oct 13 15:05:29 2010
@@ -19,23 +19,21 @@
*/
package org.apache.qpid.test.unit.basic;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+
import org.apache.qpid.client.AMQConnection;
import org.apache.qpid.client.AMQDestination;
import org.apache.qpid.client.AMQSession;
import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
import org.apache.qpid.exchange.ExchangeDefaults;
import org.apache.qpid.test.utils.QpidBrokerTestCase;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
public class MultipleConnectionTest extends QpidBrokerTestCase
{
private static final Logger _logger = LoggerFactory.getLogger(MultipleConnectionTest.class);
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/TextMessageTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/TextMessageTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/TextMessageTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/TextMessageTest.java Wed Oct 13 15:05:29 2010
@@ -228,8 +228,16 @@ public class TextMessageTest extends Qpi
{
synchronized (received)
{
- _logger.info("===== received one message");
- received.add((JMSTextMessage) message);
+ JMSTextMessage txt = (JMSTextMessage) message;
+ try
+ {
+ _logger.info("===== received message " + txt.getText());
+ }
+ catch (JMSException e)
+ {
+ // ignore
+ }
+ received.add(txt);
_waitForCompletion.countDown();
}
}
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java Wed Oct 13 15:05:29 2010
@@ -231,7 +231,7 @@ public class AMQConnectionTest extends Q
}
MessageConsumer consumerB = null;
- if (isBroker08())
+ if (isBroker08() || isBroker09())
{
Session consSessB = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
consumerB = consSessB.createConsumer(_queue);
@@ -246,7 +246,7 @@ public class AMQConnectionTest extends Q
for (int i = 0; i < 2; i++)
{
msg = consumerA.receive(1500);
- assertNotNull("Consumer A should receive 2 messages",msg);
+ assertNotNull("Consumer A should receive 2 messages: " + i, msg);
}
msg = consumerA.receive(1500);
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java Wed Oct 13 15:05:29 2010
@@ -20,15 +20,8 @@
*/
package org.apache.qpid.test.unit.client.channelclose;
-import junit.textui.TestRunner;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.ArrayList;
+import java.util.List;
import javax.jms.Destination;
import javax.jms.ExceptionListener;
@@ -39,8 +32,13 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.List;
+import junit.textui.TestRunner;
+
+import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.client.AMQQueue;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Due to bizarre exception handling all sessions are closed if you get
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java Wed Oct 13 15:05:29 2010
@@ -20,20 +20,6 @@
*/
package org.apache.qpid.test.unit.client.channelclose;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.url.URLSyntaxException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import javax.jms.Connection;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
@@ -44,6 +30,24 @@ import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.client.failover.FailoverException;
+import org.apache.qpid.client.protocol.AMQProtocolHandler;
+import org.apache.qpid.framing.AMQFrame;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.ChannelCloseOkBody;
+import org.apache.qpid.framing.ChannelOpenBody;
+import org.apache.qpid.framing.ChannelOpenOkBody;
+import org.apache.qpid.framing.ExchangeDeclareBody;
+import org.apache.qpid.framing.ExchangeDeclareOkBody;
+import org.apache.qpid.jms.ConnectionListener;
+import org.apache.qpid.protocol.AMQConstant;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.url.URLSyntaxException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class ChannelCloseTest extends QpidBrokerTestCase implements ExceptionListener, ConnectionListener
{
private static final Logger _logger = LoggerFactory.getLogger(ChannelCloseTest.class);
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java Wed Oct 13 15:05:29 2010
@@ -92,7 +92,7 @@ public class ConnectionCloseTest extends
assertTrue("Spurious thread creation exceeded threshold, " +
delta.size() + " threads created.",
- delta.size() < 10);
+ delta.size() < 50);
}
private void dumpStacks(Map<Thread,StackTraceElement[]> map)
Modified: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java?rev=1022127&r1=1022126&r2=1022127&view=diff
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java (original)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java Wed Oct 13 15:05:29 2010
@@ -23,9 +23,8 @@ package org.apache.qpid.test.unit.client
import org.apache.qpid.AMQConnectionFailureException;
import org.apache.qpid.AMQException;
import org.apache.qpid.AMQUnresolvedAddressException;
-import org.apache.qpid.server.exchange.Exchange;
+import org.apache.qpid.protocol.AMQConstant;
import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.client.AMQAuthenticationException;
import org.apache.qpid.client.AMQConnection;
import org.apache.qpid.client.AMQQueue;
import org.apache.qpid.client.AMQSession;
@@ -40,7 +39,6 @@ import org.apache.qpid.jms.BrokerDetails
import javax.jms.Connection;
import javax.jms.QueueSession;
import javax.jms.TopicSession;
-import javax.naming.NamingException;
public class ConnectionTest extends QpidBrokerTestCase
{
@@ -149,6 +147,9 @@ public class ConnectionTest extends Qpid
{
assertNotNull("No cause set:" + amqe.getMessage(), amqe.getCause());
assertTrue("Exception was wrong type", amqe.getCause() instanceof AMQException);
+ AMQException cause = (AMQException) amqe.getCause();
+ assertNotNull("No error code set", cause.getErrorCode());
+ assertEquals("Wrong error code set", isBroker010() ? AMQConstant.CONTEXT_IN_USE : AMQConstant.NOT_ALLOWED, cause.getErrorCode());
}
finally
{
Added: qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueNameTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueNameTest.java?rev=1022127&view=auto
==============================================================================
--- qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueNameTest.java (added)
+++ qpid/branches/grkvlt-network-20101013/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueNameTest.java Wed Oct 13 15:05:29 2010
@@ -0,0 +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.
+ *
+ */
+package org.apache.qpid.test.unit.client.temporaryqueue;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+
+import org.apache.mina.transport.vmpipe.VmPipeAddress;
+import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.client.protocol.AMQProtocolHandler;
+import org.apache.qpid.client.protocol.AMQProtocolSession;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.transport.TestNetworkConnection;
+import org.apache.qpid.transport.TestNetworkTransport;
+
+public class TemporaryQueueNameTest extends QpidBrokerTestCase
+{
+ private class QueueNameSession extends AMQProtocolSession
+ {
+ public QueueNameSession(AMQProtocolHandler protocolHandler, AMQConnection connection)
+ {
+ super(protocolHandler,connection);
+ }
+
+ public AMQShortString genQueueName()
+ {
+ return generateQueueName();
+ }
+ }
+
+ private QueueNameSession _queueNameSession;
+ private TestNetworkTransport _transport = new TestNetworkTransport();
+ private TestNetworkConnection _network = new TestNetworkConnection();
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ AMQConnection con = (AMQConnection) getConnection("guest", "guest");
+
+ AMQProtocolHandler protocolHandler = new AMQProtocolHandler(con);
+ protocolHandler.connect(_transport, _network);
+ _queueNameSession = new QueueNameSession(protocolHandler , con);
+ }
+
+ public void testTemporaryQueueWildcard() throws UnknownHostException
+ {
+ checkTempQueueName(new InetSocketAddress(1234), "tmp_0_0_0_0_0_0_0_0_1234_");
+ }
+
+ public void testTemporaryQueueLocalhostAddr() throws UnknownHostException
+ {
+ checkTempQueueName(new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 1234), "tmp_127_0_0_1_1234_");
+ }
+
+ public void testTemporaryQueueLocalhostName() throws UnknownHostException
+ {
+ checkTempQueueName(new InetSocketAddress(InetAddress.getByName("localhost"), 1234), "tmp_localhost_127_0_0_1_1234_");
+ }
+
+ public void testTemporaryQueueInet4() throws UnknownHostException
+ {
+ checkTempQueueName(new InetSocketAddress(InetAddress.getByName("192.168.1.2"), 1234), "tmp_192_168_1_2_1234_");
+ }
+
+ public void testTemporaryQueueInet6() throws UnknownHostException
+ {
+ checkTempQueueName(new InetSocketAddress(InetAddress.getByName("1080:0:0:0:8:800:200C:417A"), 1234), "tmp_1080_0_0_0_8_800_200c_417a_1234_");
+ }
+
+ public void testTemporaryQueuePipe() throws UnknownHostException
+ {
+ checkTempQueueName(new VmPipeAddress(1), "tmp_vm_1_");
+ }
+
+ private void checkTempQueueName(SocketAddress address, String expectedQueueName)
+ {
+ _transport.setAddress(address);
+ String queueName = _queueNameSession.genQueueName().asString();
+ assertTrue("Wrong queue name: " + queueName, queueName.startsWith(expectedQueueName));
+ }
+}
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org