diff options
author | Marnie McCormack <marnie@apache.org> | 2006-12-14 11:23:24 +0000 |
---|---|---|
committer | Marnie McCormack <marnie@apache.org> | 2006-12-14 11:23:24 +0000 |
commit | 2ef4b6a3faf63dcfadcd4815c6e8db0e3bdb0742 (patch) | |
tree | 58d0d014fd8fa46e43c36b2de81ea74053151124 /java | |
parent | 1ed3df72cc4c1ab1bfe8e1e6125322329e15c396 (diff) | |
download | qpid-python-2ef4b6a3faf63dcfadcd4815c6e8db0e3bdb0742.tar.gz |
Removing CTS as no longer useful, since team have access to JMC TCK and no progress on CTS rendering it an obsolete task. See http://issues.apache.org/jira/browse/QPID-169
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@487177 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
9 files changed, 0 insertions, 713 deletions
diff --git a/java/client/src/old_test/java/org/apache/qpid/cts/bin/jmscts.sh b/java/client/src/old_test/java/org/apache/qpid/cts/bin/jmscts.sh deleted file mode 100755 index 37b8018aaf..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/cts/bin/jmscts.sh +++ /dev/null @@ -1,162 +0,0 @@ -#!/bin/sh -# -# 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. -# - -# ----------------------------------------------------------------------------- -# Start/Stop Script for the JMS compliance test suite -# -# Required Environment Variables -# -# JAVA_HOME Points to the Java Development Kit installation. -# -# Optional Environment Variables -# -# JMSCTS_HOME Points to the JMS CTS installation directory. -# -# JAVA_OPTS Java runtime options used when the command is executed. -# -# -# $Id: jmscts.sh,v 1.6 2003/09/27 09:50:49 tanderson Exp $ -# --------------------------------------------------------------------------- - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false -case "`uname`" in -CYGWIN*) cygwin=true;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -if [ -z "$JAVA_HOME" ]; then - echo "The JAVA_HOME environment variable is not set." - echo "This is required to run jmscts" - exit 1 -fi -if [ ! -r "$JAVA_HOME"/bin/java ]; then - echo "The JAVA_HOME environment variable is not set correctly." - echo "This is required to run jmscts" - exit 1 -fi -_RUNJAVA="$JAVA_HOME"/bin/java - - -# Guess JMSCTS_HOME if it is not set -if [ -z "$JMSCTS_HOME" ]; then -# resolve links - $0 may be a softlink - PRG="$0" - while [ -h "$PRG" ]; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi - done - - PRGDIR=`dirname "$PRG"` - JMSCTS_HOME=`cd "$PRGDIR/.." ; pwd` -elif [ ! -r "$JMSCTS_HOME"/bin/jmscts.sh ]; then - echo "The JMSCTS_HOME environment variable is not set correctly." - echo "This is required to run jmscts" - exit 1 -fi - -# Set CLASSPATH to empty by default. User jars can be added via the setenv.sh -# script -CLASSPATH= - -if [ -r "$JMSCTS_HOME"/bin/setenv.sh ]; then - . "$JMSCTS_HOME"/bin/setenv.sh -fi - -CLASSPATH="$CLASSPATH":"$JMSCTS_HOME"/lib/jmscts-0.5-b2.jar - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - JMSCTS_HOME=`cygpath --path --windows "$JMSCTS_HOME"` - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` -fi - -POLICY_FILE="$JMSCTS_HOME"/config/jmscts.policy - -# Configure TrAX -JAVAX_OPTS=-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl - - -# Execute the requested command - -echo "Using JMSCTS_HOME: $JMSCTS_HOME" -echo "Using JAVA_HOME: $JAVA_HOME" -echo "Using CLASSPATH: $CLASSPATH" - -if [ "$1" = "run" ]; then - - shift - exec "$_RUNJAVA" $JAVA_OPTS $JAVAX_OPTS -Djmscts.home="$JMSCTS_HOME" \ - -classpath "$CLASSPATH" \ - -Djava.security.manager -Djava.security.policy="$POLICY_FILE" \ - org.exolab.jmscts.test.ComplianceTestSuite "$@" - -elif [ "$1" = "stress" ]; then - - shift - exec "$_RUNJAVA" $JAVA_OPTS $JAVAX_OPTS -Djmscts.home="$JMSCTS_HOME" \ - -classpath "$CLASSPATH" \ - -Djava.security.manager -Djava.security.policy="$POLICY_FILE" \ - org.exolab.jmscts.stress.StressTestSuite "$@" - -elif [ "$1" = "stop" ] ; then - - shift - "$_RUNJAVA" $JAVA_OPTS $JAVAX_OPTS -Djmscts.home="$JMSCTS_HOME" \ - -classpath "$CLASSPATH" \ - -Djava.security.manager -Djava.security.policy="$POLICY_FILE" \ - org.exolab.jmscts.core.Admin -stop - -elif [ "$1" = "abort" ] ; then - - shift - exec "$_RUNJAVA" $JAVA_OPTS $JAVAX_OPTS -Djmscts.home="$JMSCTS_HOME" \ - -classpath "$CLASSPATH" \ - -Djava.security.manager -Djava.security.policy="$POLICY_FILE" \ - org.exolab.jmscts.core.Admin -abort - -elif [ "$1" = "snapshot" ] ; then - - shift - exec "$_RUNJAVA" $JAVA_OPTS $JAVAX_OPTS -Djmscts.home="$JMSCTS_HOME" \ - -classpath "$CLASSPATH" \ - -Djava.security.manager -Djava.security.policy="$POLICY_FILE" \ - org.exolab.jmscts.core.Admin -snapshot "$@" - -else - echo "usage: jmscts.sh (commands)" - echo "commands:" - echo " run Run compliance tests" - echo " stress Run stress tests" - echo " stop Stop the JMS CTS" - echo " abort Abort the JMS CTS" - echo " snapshot Take a snapshot" - exit 1 -fi diff --git a/java/client/src/old_test/java/org/apache/qpid/cts/bin/setenv.sh b/java/client/src/old_test/java/org/apache/qpid/cts/bin/setenv.sh deleted file mode 100755 index 9b9189d646..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/cts/bin/setenv.sh +++ /dev/null @@ -1,41 +0,0 @@ -# -# 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. -# - -# --------------------------------------------------------------------------- -# Sample environment script for JMS CTS -# -# This is invoked by jmscts.sh to configure: -# . the CLASSPATH, for JMS provider jars -# . JVM options -# -# The following configures the JMS CTS for OpenJMS 0.7.6 -# --------------------------------------------------------------------------- - -# Configure the CLASSPATH -# -DISTDIR="$IBASE/amqp/dist" -LIBDIR="$IBASE/amqp/lib" - -CLASSPATH="$LIBDIR/jakarta-commons/commons-collections-3.1.jar:$LIBDIR/util-concurrent/backport-util-concurrent.jar:$LIBDIR/mina/mina-0.7.3.jar:$LIBDIR/jms/jms.jar:$LIBDIR/logging-log4j/log4j-1.2.9.jar:$DISTDIR/amqp-common.jar:$DISTDIR/amqp-jms.jar" - -# Configure JVM options -# -JAVA_OPTS=-Xmx512m -Xms512m -JAVA_OPTS="$JAVA_OPTS \ - -Damqj.logging.level=WARN" diff --git a/java/client/src/old_test/java/org/apache/qpid/cts/config/jmscts.policy b/java/client/src/old_test/java/org/apache/qpid/cts/config/jmscts.policy deleted file mode 100644 index ff8b5db5ec..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/cts/config/jmscts.policy +++ /dev/null @@ -1,22 +0,0 @@ -// 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. -// -// grant all users all permissions. This is only for test cases -// and should be modified for deployment -grant { - permission java.security.AllPermission; -}; diff --git a/java/client/src/old_test/java/org/apache/qpid/cts/config/jmscts.properties b/java/client/src/old_test/java/org/apache/qpid/cts/config/jmscts.properties deleted file mode 100644 index 7177fed49d..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/cts/config/jmscts.properties +++ /dev/null @@ -1,71 +0,0 @@ -# -# 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. -# - -# ============================================================================= -# General properties -# ----------------------------------------------------------------------------- - -# -# Username & password -# A user name and password for creating Connection instances via -# TopicConnectionFactory.createTopicConnection(...) etc -# -valid.username=guest -valid.password=guest - -# -# Invalid user name and password -# As above, but guaranteed to fail. -# -invalid.username=guest -invalid.password=guest - -# -# Message receipt timeout -# The default time to wait for messages, in milliseconds -# -org.exolab.jmscts.core.MessagingBehaviour.timeout=2000 - - -# ============================================================================= -# Compliance test properties -# ----------------------------------------------------------------------------- - -# -# Expiration interval -# Time in milliseconds to wait for the JMS provider to collect expired -# messages. -# This can be set for providers which collect expired messages periodically, -# rather than at the moment they expire. -# NOTE: for OpenJMS 0.7.6, this should be set to 5000 -org.exolab.jmscts.test.producer.ttl.ExpirationTest.expirationInterval=0 - - -# ============================================================================= -# Stress test properties -# ----------------------------------------------------------------------------- - -# -# Each of the following properties determines the no. of messages that -# will be sent by stress tests -# -org.exolab.jmscts.stress.Send0KTest.count=1000 -org.exolab.jmscts.stress.ReceiveSize0KTest.count=1000 -org.exolab.jmscts.stress.SendReceive0KTest.count=1000 -org.exolab.jmscts.stress.SendReceive2Size0KTest.count=1000 diff --git a/java/client/src/old_test/java/org/apache/qpid/cts/config/providers.xml b/java/client/src/old_test/java/org/apache/qpid/cts/config/providers.xml deleted file mode 100644 index 30c4a39c5b..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/cts/config/providers.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0"?> -<!-- - - - - 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. - - - --> - -<!-- ====================================================================== --> -<!-- Sample provider configuration file --> -<!-- --> -<!-- This configures JMS CTS to test OpenJMS --> -<!-- ====================================================================== --> - -<configuration> - - <provider> - <name>AMQP</name> - <class>org.exolab.jmscts.amqp.AMQPProvider</class> - <paths> - <path>/home/guso/harness/jmscts-0.5-b2/lib/amqp-provider-0.0a1.jar</path> - </paths> - <config> - </config> - </provider> - -</configuration> diff --git a/java/client/src/old_test/java/org/apache/qpid/cts/readme.txt b/java/client/src/old_test/java/org/apache/qpid/cts/readme.txt deleted file mode 100644 index 117e7d4954..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/cts/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -The files present in the bin, config and src directories should be copied over a complete copy of jms-cts-0.5-b2. - -The path entries on the config/providers.xml and src/compile.sh files should be changed before attempting to run. - -The scripts expect a properly configured IBASE environment. Before attempting to run, the amqp provider classes must be packaged and installed. The src/compile.sh script will help to achieve that.
\ No newline at end of file diff --git a/java/client/src/old_test/java/org/apache/qpid/cts/src/compile.sh b/java/client/src/old_test/java/org/apache/qpid/cts/src/compile.sh deleted file mode 100755 index 7b8a9f03ec..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/cts/src/compile.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# 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. -# - - -JMSCTS_PATH=/home/guso/harness/jmscts-0.5-b2 - -distjms="$IBASE/amqp/dist" -lib="$IBASE/amqp/lib" -lib2="$JMSCTS_PATH/lib/" -libs="$lib/jakarta-commons/commons-collections-3.1.jar:$lib/util-concurrent/backport-util-concurrent.jar:$lib/mina/mina-0.7.3.jar:$lib/jms/jms.jar:$lib/logging-log4j/log4j-1.2.9.jar:$distjms/amqp-common.jar:$distjms/amqp-jms.jar" -libs2="$lib2/ant-1.5.3-1.jar:$lib2/junit-3.8.1.jar:$lib2/ant-optional-1.5.3-1.jar:$lib2/log4j-1.2.7.jar:$lib2/castor-0.9.5.jar:$lib2/openjms-provider-0.5-b2.jar:$lib2/commons-cli-1.0.jar:$lib2/oro-2.0.7.jar:$lib2/commons-collections-2.1.jar:$lib2/xalan-2.5.1.jar:$lib2/commons-logging-1.0.2.jar:$lib2/xdoclet-1.2b2.jar:$lib2/concurrent-1.3.2.jar:$lib2/xdoclet-xdoclet-module-1.2b2.jar:$lib2/exolabcore-0.3.7.jar:$lib2/xdoclet-xjavadoc-uc-1.2b2.jar:$lib2/jms-1.0.2a.jar:$lib2/xerces-2.3.0.jar:$lib2/jmscts-0.5-b2.jar:$lib2/xml-apis-1.0.b2.jar" - -javac -classpath $libs:$libs2 $JMSCTS_PATH/src/providers/amqp/org/exolab/jmscts/amqp/*.java -cd $JMSCTS_PATH/src/providers/amqp -jar cvf amqp-provider-0.0a1.jar org/exolab/jmscts/amqp/*.class -mv amqp-provider-0.0a1.jar $lib2 - diff --git a/java/client/src/old_test/java/org/apache/qpid/cts/src/providers/amqp/org/exolab/jmscts/amqp/AMQPAdministrator.java b/java/client/src/old_test/java/org/apache/qpid/cts/src/providers/amqp/org/exolab/jmscts/amqp/AMQPAdministrator.java deleted file mode 100644 index 006bda7e2e..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/cts/src/providers/amqp/org/exolab/jmscts/amqp/AMQPAdministrator.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * Redistribution and use of this software and associated documentation - * ("Software"), with or without modification, are permitted provided - * that the following conditions are met: - * - * 1. Redistributions of source code must retain copyright - * statements and notices. Redistributions must also contain a - * copy of this document. - * - * 2. Redistributions in binary form must reproduce the - * above copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. The name "Exolab" must not be used to endorse or promote - * products derived from this Software without prior written - * permission of Exoffice Technologies. For written permission, - * please contact jima@intalio.com. - * - * 4. Products derived from this Software may not be called "Exolab" - * nor may "Exolab" appear in their names without prior written - * permission of Exoffice Technologies. Exolab is a registered - * trademark of Exoffice Technologies. - * - * 5. Due credit should be given to the Exolab Project - * (http://www.exolab.org/). - * - * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT - * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Copyright 2001, 2003 (C) Exoffice Technologies Inc. All Rights Reserved. - * - */ -package org.apache.qpid.cts.src.providers.amqp.org.exolab.jmscts.amqp; - -import org.apache.qpid.client.*; -import org.exolab.jmscts.provider.Administrator; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.MessageConsumer; -import javax.jms.Session; -import javax.naming.NameNotFoundException; -import javax.naming.NamingException; -import java.net.InetAddress; -import java.util.HashMap; - -/** - * This class provides methods for obtaining and manipulating administered - * objects managed by the Sonicmq implementation of JMS - * - */ -class AMQPAdministrator implements Administrator { - // AMQ Connection configuration - private int port = 5672; - private String host = "localhost"; - private String user = "guest"; - private String pass = "guest"; - private String vhost = "/test"; - - // The cached broker connection & session - private AMQConnection _connection = null; - private Session _session = null; - - // Factory request names - private static final String QUEUE_CONNECTION_FACTORY = "QueueConnectionFactory"; - private static final String TOPIC_CONNECTION_FACTORY = "TopicConnectionFactory"; - - /** - * The cache of known administered objects - */ - private HashMap<String, Object> _directory = new HashMap<String, Object>(); - - /** - * Returns the name of the QueueConnectionFactory bound in JNDI - * - * @return the default QueueConnectionFactory name - */ - public String getQueueConnectionFactory() { - return QUEUE_CONNECTION_FACTORY; - } - - /** - * Returns the name of the TopicConnectionFactory bound in JNDI - * - * @return the default TopicConnectionFactory name - */ - public String getTopicConnectionFactory() { - return TOPIC_CONNECTION_FACTORY; - } - - /** - * Returns the name of the XAQueueConnectionFactory bound in JNDI - * - * @return the default XAQueueConnectionFactory name - */ - public String getXAQueueConnectionFactory() { - return null; - } - - /** - * Returns the name of the XATopicConnectionFactory bound in JNDI - * - * @return the default XATopicConnectionFactory name - */ - public String getXATopicConnectionFactory() { - return null; - } - - /** - * Look up the named administered object - * - * @param name the name that the administered object is bound to - * @return the administered object bound to name - * @throws NamingException if the object is not bound, or the lookup fails - */ - public Object lookup(String name) throws NamingException { - Object result = _directory.get(name); - if (result == null) { - if (name.equals(QUEUE_CONNECTION_FACTORY)) { - _directory.put(QUEUE_CONNECTION_FACTORY, new AMQConnectionFactory(host, port, user, pass, vhost)); - } else if (name.equals(TOPIC_CONNECTION_FACTORY)) { - _directory.put(TOPIC_CONNECTION_FACTORY, new AMQConnectionFactory(host, port, user, pass, vhost)); - } else { - throw new NameNotFoundException("Name not found: " + name); - } - } - return result; - } - - /** - * Create an administered destination - * - * @param name the destination name - * @param queue if true, create a queue, else create a topic - * @throws JMSException if the destination cannot be created - */ - public void createDestination(String name, boolean queue) - throws JMSException { - AMQDestination destination = null; - - try { - if (queue) { - destination = new AMQQueue(name); - createConsumer(destination); - } else { - destination = new AMQTopic(name); - createConsumer(destination); - } - - _directory.put(name, destination); - } catch (Exception exception) { - JMSException error = new JMSException(exception.getMessage()); - error.setLinkedException(exception); - throw error; - } - } - - /** - * Destroy an administered destination - * - * @param name the destination name - * @throws JMSException if the destination cannot be destroyed - */ - public void destroyDestination(String name) - throws JMSException { - - try { - Destination destination = (Destination) lookup(name); - _directory.remove(name); - } catch (NamingException exception) { - JMSException error = new JMSException(exception.getMessage()); - error.setLinkedException(exception); - throw error; - } catch (Exception exception) { - JMSException error = new JMSException(exception.getMessage()); - error.setLinkedException(exception); - throw error; - } - } - - /** - * Returns true if an administered destination exists - * - * @param name the destination name - * @throws JMSException for any internal JMS provider error - */ - public boolean destinationExists(String name) - throws JMSException { - - boolean exists = false; - try { - lookup(name); - exists = true; - } catch (NameNotFoundException ignore) { - } catch (Exception exception) { - JMSException error = new JMSException(exception.getMessage()); - error.setLinkedException(exception); - throw error; - } - return exists; - } - - public void initialise() throws JMSException { - try { - InetAddress address = InetAddress.getLocalHost(); - _connection = new AMQConnection(host, port, user, pass, - address.getHostName(), vhost); - _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - } catch (Exception exception) { - JMSException error = new JMSException(exception.getMessage()); - error.setLinkedException(exception); - throw error; - } - } - - public synchronized void cleanup() { - try { - _connection.close(); - } catch (JMSException e) { - e.printStackTrace(); - } - _connection = null; - _session = null; - _directory.clear(); - } - - MessageConsumer createConsumer(AMQDestination destination) throws JMSException - { - return ((AMQSession)_session).createConsumer(destination, /*pre-fetch*/0, false, /*exclusive*/false, null); - } -} //-- AMQPAdministrator diff --git a/java/client/src/old_test/java/org/apache/qpid/cts/src/providers/amqp/org/exolab/jmscts/amqp/AMQPProvider.java b/java/client/src/old_test/java/org/apache/qpid/cts/src/providers/amqp/org/exolab/jmscts/amqp/AMQPProvider.java deleted file mode 100644 index aafa415d1e..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/cts/src/providers/amqp/org/exolab/jmscts/amqp/AMQPProvider.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Redistribution and use of this software and associated documentation - * ("Software"), with or without modification, are permitted provided - * that the following conditions are met: - * - * 1. Redistributions of source code must retain copyright - * statements and notices. Redistributions must also contain a - * copy of this document. - * - * 2. Redistributions in binary form must reproduce the - * above copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. The name "Exolab" must not be used to endorse or promote - * products derived from this Software without prior written - * permission of Exoffice Technologies. For written permission, - * please contact jima@intalio.com. - * - * 4. Products derived from this Software may not be called "Exolab" - * nor may "Exolab" appear in their names without prior written - * permission of Exoffice Technologies. Exolab is a registered - * trademark of Exoffice Technologies. - * - * 5. Due credit should be given to the Exolab Project - * (http://www.exolab.org/). - * - * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT - * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Copyright 2001, 2003 (C) Exoffice Technologies Inc. All Rights Reserved. - * - */ -package org.apache.qpid.cts.src.providers.amqp.org.exolab.jmscts.amqp; - -import javax.jms.JMSException; - -import org.exolab.jmscts.provider.Administrator; -import org.exolab.jmscts.provider.Provider; - - -/** - * This class enables test cases to be run against the SonicMQ provider - * - * @see AMQPAdministrator - */ -public class AMQPProvider implements Provider { - - /** - * The administration interface - */ - private AMQPAdministrator _admin = new AMQPAdministrator(); - - /** - * Construct an instance of the interface to the AMQP provider - */ - public AMQPProvider() { - } - - /** - * Initialises the administation interface - * - * @throws JMSException if the administration interface can't be - * initialised - */ - public void initialise(boolean start) throws JMSException { - _admin.initialise(); - } - - /** - * Returns the administration interface - */ - public Administrator getAdministrator() { - return _admin; - } - - /** - * This method cleans up the administrator - */ - public void cleanup(boolean stop) { - _admin.cleanup(); - _admin = null; - } - -} //-- AMQPProvider |