You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2014/02/14 20:23:18 UTC
svn commit: r1568495 [5/8] - in
/qpid/branches/java-broker-amqp-1-0-management/java: ./
amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/
bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/
bdbstore/jmx/src/test/java...
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java Fri Feb 14 19:23:14 2014
@@ -27,10 +27,8 @@ import org.apache.qpid.server.store.Tran
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.message.ServerMessage;
import org.apache.qpid.server.queue.BaseQueue;
-import org.apache.qpid.server.queue.QueueEntry;
import org.apache.qpid.server.store.MessageStore;
import org.apache.qpid.server.store.Transaction;
@@ -110,11 +108,9 @@ public class LocalTransaction implements
beginTranIfNecessary();
_transaction.dequeueMessage(queue, message);
-
}
- catch(AMQException e)
+ catch(RuntimeException e)
{
- _logger.error("Error during message dequeues", e);
tidyUpOnError(e);
}
}
@@ -143,17 +139,16 @@ public class LocalTransaction implements
beginTranIfNecessary();
_transaction.dequeueMessage(queue, message);
}
-
}
+
}
- catch(AMQException e)
+ catch(RuntimeException e)
{
- _logger.error("Error during message dequeues", e);
tidyUpOnError(e);
}
}
- private void tidyUpOnError(Exception e)
+ private void tidyUpOnError(RuntimeException e)
{
try
{
@@ -168,32 +163,20 @@ public class LocalTransaction implements
_transaction.abortTran();
}
}
- catch (Exception abortException)
- {
- _logger.error("Abort transaction failed while trying to handle previous error", abortException);
- }
finally
{
- resetDetails();
+ resetDetails();
}
}
- throw new RuntimeException(e);
+ throw e;
}
-
private void beginTranIfNecessary()
{
if(_transaction == null)
{
- try
- {
- _transaction = _transactionLog.newTransaction();
- }
- catch (Exception e)
- {
- tidyUpOnError(e);
- }
+ _transaction = _transactionLog.newTransaction();
}
}
@@ -215,10 +198,8 @@ public class LocalTransaction implements
beginTranIfNecessary();
_transaction.enqueueMessage(queue, message);
}
- catch (Exception e)
+ catch(RuntimeException e)
{
- _logger.error("Error during message enqueue", e);
-
tidyUpOnError(e);
}
}
@@ -245,14 +226,12 @@ public class LocalTransaction implements
beginTranIfNecessary();
_transaction.enqueueMessage(queue, message);
+
}
}
-
}
- catch (Exception e)
+ catch(RuntimeException e)
{
- _logger.error("Error during message enqueue", e);
-
tidyUpOnError(e);
}
}
@@ -281,12 +260,10 @@ public class LocalTransaction implements
doPostTransactionActions();
}
- catch (Exception e)
+ catch(RuntimeException e)
{
- _logger.error("Failed to commit transaction", e);
-
doRollbackActions();
- throw new RuntimeException("Failed to commit transaction", e);
+ throw e;
}
finally
{
@@ -348,14 +325,11 @@ public class LocalTransaction implements
{
doPostTransactionActions();
deferred.run();
-
}
- catch (Exception e)
+ catch (RuntimeException e)
{
- _logger.error("Failed to commit transaction", e);
-
doRollbackActions();
- throw new RuntimeException("Failed to commit transaction", e);
+ throw e;
}
finally
{
@@ -371,7 +345,6 @@ public class LocalTransaction implements
try
{
doPostTransactionActions();
-
deferred.run();
}
finally
@@ -382,9 +355,8 @@ public class LocalTransaction implements
return future;
}
- catch (Exception e)
+ catch (RuntimeException e)
{
- _logger.error("Failed to commit transaction", e);
try
{
doRollbackActions();
@@ -393,8 +365,9 @@ public class LocalTransaction implements
{
resetDetails();
}
- throw new RuntimeException("Failed to commit transaction", e);
+ throw e;
}
+
}
private void doPostTransactionActions()
@@ -425,11 +398,6 @@ public class LocalTransaction implements
_transaction.abortTran();
}
}
- catch (AMQException e)
- {
- _logger.error("Failed to rollback transaction", e);
- throw new RuntimeException("Failed to rollback transaction", e);
- }
finally
{
try
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/util/MapJsonSerializer.java Fri Feb 14 19:23:14 2014
@@ -48,7 +48,7 @@ public class MapJsonSerializer
}
catch (Exception e)
{
- throw new RuntimeException("Failure to serialize map:" + attributeMap, e);
+ throw new ConnectionScopedRuntimeException("Failure to serialize map:" + attributeMap, e);
}
return stringWriter.toString();
}
@@ -62,7 +62,7 @@ public class MapJsonSerializer
}
catch (Exception e)
{
- throw new RuntimeException("Failure to deserialize json:" + json, e);
+ throw new ConnectionScopedRuntimeException("Failure to deserialize json:" + json, e);
}
return attributesMap;
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java Fri Feb 14 19:23:14 2014
@@ -33,8 +33,8 @@ import java.util.concurrent.TimeUnit;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.exchange.AMQUnknownExchangeType;
+import org.apache.qpid.server.security.QpidSecurityException;
import org.apache.qpid.server.configuration.ExchangeConfiguration;
import org.apache.qpid.server.configuration.QueueConfiguration;
import org.apache.qpid.server.configuration.VirtualHostConfiguration;
@@ -70,7 +70,7 @@ import org.apache.qpid.server.store.Dura
import org.apache.qpid.server.store.Event;
import org.apache.qpid.server.store.EventListener;
import org.apache.qpid.server.txn.DtxRegistry;
-import org.apache.qpid.server.virtualhost.plugins.QueueExistsException;
+import org.apache.qpid.server.util.ServerScopedRuntimeException;
public abstract class AbstractVirtualHost implements VirtualHost, IConnectionRegistry.RegistryChangeListener, EventListener
{
@@ -125,7 +125,7 @@ public abstract class AbstractVirtualHos
StatisticsGatherer brokerStatisticsGatherer,
SecurityManager parentSecurityManager,
VirtualHostConfiguration hostConfig,
- org.apache.qpid.server.model.VirtualHost virtualHost) throws Exception
+ org.apache.qpid.server.model.VirtualHost virtualHost)
{
if (hostConfig == null)
{
@@ -185,7 +185,7 @@ public abstract class AbstractVirtualHos
}
abstract protected void initialiseStorage(VirtualHostConfiguration hostConfig,
- org.apache.qpid.server.model.VirtualHost virtualHost) throws Exception;
+ org.apache.qpid.server.model.VirtualHost virtualHost);
public IConnectionRegistry getConnectionRegistry()
{
@@ -292,17 +292,37 @@ public abstract class AbstractVirtualHos
}
- protected void initialiseModel(VirtualHostConfiguration config) throws ConfigurationException, AMQException
+ protected void initialiseModel(VirtualHostConfiguration config)
{
_logger.debug("Loading configuration for virtualhost: " + config.getName());
+
_exchangeRegistry.initialise(_exchangeFactory);
List<String> exchangeNames = config.getExchanges();
for (String exchangeName : exchangeNames)
{
- configureExchange(config.getExchangeConfiguration(exchangeName));
+ try
+ {
+ configureExchange(config.getExchangeConfiguration(exchangeName));
+ }
+ catch (QpidSecurityException e)
+ {
+ throw new ServerScopedRuntimeException("Could not configure exchange " + exchangeName, e);
+ }
+ catch (UnknownExchangeException e)
+ {
+ throw new ServerScopedRuntimeException("Could not configure exchange " + exchangeName, e);
+ }
+ catch (ReservedExchangeNameException e)
+ {
+ throw new ServerScopedRuntimeException("Could not configure exchange " + exchangeName, e);
+ }
+ catch (AMQUnknownExchangeType e)
+ {
+ throw new ServerScopedRuntimeException("Could not configure exchange " + exchangeName, e);
+ }
}
String[] queueNames = config.getQueueNames();
@@ -310,18 +330,31 @@ public abstract class AbstractVirtualHos
for (Object queueNameObj : queueNames)
{
String queueName = String.valueOf(queueNameObj);
- configureQueue(config.getQueueConfiguration(queueName));
+ try
+ {
+ configureQueue(config.getQueueConfiguration(queueName));
+ }
+ catch (ConfigurationException e)
+ {
+ throw new ServerScopedRuntimeException("Could not configure queue " + queueName, e);
+ }
+ catch (QpidSecurityException e)
+ {
+ throw new ServerScopedRuntimeException("Could not configure queue " + queueName, e);
+ }
}
}
- private void configureExchange(ExchangeConfiguration exchangeConfiguration) throws AMQException
+ private void configureExchange(ExchangeConfiguration exchangeConfiguration)
+ throws QpidSecurityException, UnknownExchangeException, ReservedExchangeNameException,
+ AMQUnknownExchangeType
{
boolean durable = exchangeConfiguration.getDurable();
boolean autodelete = exchangeConfiguration.getAutoDelete();
try
{
- Exchange newExchange = createExchange(null, exchangeConfiguration.getName(), exchangeConfiguration.getType(), durable, autodelete,
- null);
+ Exchange newExchange = createExchange(null, exchangeConfiguration.getName(),
+ exchangeConfiguration.getType(), durable, autodelete, null);
}
catch(ExchangeExistsException e)
{
@@ -330,7 +363,8 @@ public abstract class AbstractVirtualHos
}
- private void configureQueue(QueueConfiguration queueConfiguration) throws AMQException, ConfigurationException
+ private void configureQueue(QueueConfiguration queueConfiguration)
+ throws ConfigurationException, QpidSecurityException
{
AMQQueue queue = _queueFactory.createAMQQueueImpl(queueConfiguration);
String queueName = queue.getName();
@@ -380,7 +414,8 @@ public abstract class AbstractVirtualHos
}
- private void configureBinding(AMQQueue queue, Exchange exchange, String routingKey, Map<String,Object> arguments) throws AMQException
+ private void configureBinding(AMQQueue queue, Exchange exchange, String routingKey, Map<String,Object> arguments)
+ throws QpidSecurityException
{
if (_logger.isInfoEnabled())
{
@@ -487,7 +522,7 @@ public abstract class AbstractVirtualHos
}
@Override
- public int removeQueue(AMQQueue queue) throws AMQException
+ public int removeQueue(AMQQueue queue) throws QpidSecurityException
{
synchronized (getQueueRegistry())
{
@@ -511,7 +546,7 @@ public abstract class AbstractVirtualHos
boolean autoDelete,
boolean exclusive,
boolean deleteOnNoConsumer,
- Map<String, Object> arguments) throws AMQException
+ Map<String, Object> arguments) throws QpidSecurityException, QueueExistsException
{
if (queueName == null)
@@ -529,7 +564,7 @@ public abstract class AbstractVirtualHos
owner))
{
String description = "Permission denied: queue-name '" + queueName + "'";
- throw new AMQSecurityException(description);
+ throw new QpidSecurityException(description);
}
synchronized (_queueRegistry)
@@ -603,7 +638,8 @@ public abstract class AbstractVirtualHos
boolean durable,
boolean autoDelete,
String alternateExchangeName)
- throws AMQException
+ throws QpidSecurityException, ExchangeExistsException, ReservedExchangeNameException,
+ UnknownExchangeException, AMQUnknownExchangeType
{
synchronized (_exchangeRegistry)
{
@@ -649,7 +685,8 @@ public abstract class AbstractVirtualHos
}
@Override
- public void removeExchange(Exchange exchange, boolean force) throws AMQException
+ public void removeExchange(Exchange exchange, boolean force)
+ throws QpidSecurityException, ExchangeIsAlternateException, RequiredExchangeException
{
if(exchange.hasReferrers())
{
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/BindingRecoverer.java Fri Feb 14 19:23:14 2014
@@ -25,15 +25,16 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.binding.Binding;
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.exchange.ExchangeRegistry;
import org.apache.qpid.server.model.Queue;
import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.security.QpidSecurityException;
import org.apache.qpid.server.store.AbstractDurableConfiguredObjectRecoverer;
import org.apache.qpid.server.store.UnresolvedDependency;
import org.apache.qpid.server.store.UnresolvedObject;
+import org.apache.qpid.server.util.ServerScopedRuntimeException;
public class BindingRecoverer extends AbstractDurableConfiguredObjectRecoverer<Binding>
{
@@ -118,9 +119,11 @@ public class BindingRecoverer extends Ab
}
return _exchange.getBinding(_bindingName, _queue, _bindingArgumentsMap);
}
- catch (AMQException e)
+ catch (QpidSecurityException e)
{
- throw new RuntimeException(e);
+ throw new ServerScopedRuntimeException("Security Exception thrown when recovering. The recovery " +
+ "thread should not be bound by permissions, this is likely " +
+ "a programming error.",e);
}
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeExistsException.java Fri Feb 14 19:23:14 2014
@@ -19,10 +19,9 @@ package org.apache.qpid.server.virtualho
*
*/
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.exchange.Exchange;
-public class ExchangeExistsException extends AMQException
+public class ExchangeExistsException extends Exception
{
private final Exchange _existing;
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeIsAlternateException.java Fri Feb 14 19:23:14 2014
@@ -1,4 +1,4 @@
-package org.apache.qpid.server.virtualhost;/*
+/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,10 +18,9 @@ package org.apache.qpid.server.virtualho
* under the License.
*
*/
+package org.apache.qpid.server.virtualhost;
-import org.apache.qpid.AMQException;
-
-public class ExchangeIsAlternateException extends AMQException
+public class ExchangeIsAlternateException extends Exception
{
public ExchangeIsAlternateException(String name)
{
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ExchangeRecoverer.java Fri Feb 14 19:23:14 2014
@@ -22,14 +22,16 @@ package org.apache.qpid.server.virtualho
import java.util.Map;
import java.util.UUID;
-import org.apache.qpid.AMQException;
+import org.apache.qpid.server.exchange.AMQUnknownExchangeType;
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.exchange.ExchangeFactory;
import org.apache.qpid.server.exchange.ExchangeRegistry;
import org.apache.qpid.server.model.LifetimePolicy;
+import org.apache.qpid.server.security.QpidSecurityException;
import org.apache.qpid.server.store.AbstractDurableConfiguredObjectRecoverer;
import org.apache.qpid.server.store.UnresolvedDependency;
import org.apache.qpid.server.store.UnresolvedObject;
+import org.apache.qpid.server.util.ServerScopedRuntimeException;
public class ExchangeRecoverer extends AbstractDurableConfiguredObjectRecoverer<Exchange>
{
@@ -80,10 +82,21 @@ public class ExchangeRecoverer extends A
_exchange = _exchangeFactory.restoreExchange(id, exchangeName, exchangeType, autoDelete);
_exchangeRegistry.registerExchange(_exchange);
}
- }
+ }/*
catch (AMQException e)
{
throw new RuntimeException("Error recovering exchange uuid " + id + " name " + exchangeName, e);
+ }*/
+ catch (QpidSecurityException e)
+ {
+ throw new ServerScopedRuntimeException("Security Exception thrown when recovering. The recovery " +
+ "thread should not be bound by permissions, this is likely " +
+ "a programming error.",e);
+ }
+ catch (AMQUnknownExchangeType e)
+ {
+ throw new ServerScopedRuntimeException("Unknown exchange type found when attempting to restore " +
+ "exchanges, check classpath", e);
}
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueRecoverer.java Fri Feb 14 19:23:14 2014
@@ -26,15 +26,16 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.exchange.ExchangeRegistry;
import org.apache.qpid.server.model.Queue;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.queue.QueueFactory;
+import org.apache.qpid.server.security.QpidSecurityException;
import org.apache.qpid.server.store.AbstractDurableConfiguredObjectRecoverer;
import org.apache.qpid.server.store.UnresolvedDependency;
import org.apache.qpid.server.store.UnresolvedObject;
+import org.apache.qpid.server.util.ServerScopedRuntimeException;
public class QueueRecoverer extends AbstractDurableConfiguredObjectRecoverer<AMQQueue>
{
@@ -125,9 +126,11 @@ public class QueueRecoverer extends Abst
false, queueArgumentsMap);
}
}
- catch (AMQException e)
+ catch (QpidSecurityException e)
{
- throw new RuntimeException("Error recovering queue uuid " + _id + " name " + queueName, e);
+ throw new ServerScopedRuntimeException("Security Exception thrown when recovering. The recovery " +
+ "thread should not be bound by permissions, this is likely " +
+ "a programming error.",e);
}
return _queue;
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/RequiredExchangeException.java Fri Feb 14 19:23:14 2014
@@ -1,4 +1,4 @@
-package org.apache.qpid.server.virtualhost;/*
+/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,10 +18,9 @@ package org.apache.qpid.server.virtualho
* under the License.
*
*/
+package org.apache.qpid.server.virtualhost;
-import org.apache.qpid.AMQException;
-
-public class RequiredExchangeException extends AMQException
+public class RequiredExchangeException extends Exception
{
public RequiredExchangeException(String name)
{
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ReservedExchangeNameException.java Fri Feb 14 19:23:14 2014
@@ -19,9 +19,7 @@ package org.apache.qpid.server.virtualho
*
*/
-import org.apache.qpid.AMQException;
-
-public class ReservedExchangeNameException extends AMQException
+public class ReservedExchangeNameException extends Exception
{
private final String _name;
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java Fri Feb 14 19:23:14 2014
@@ -29,6 +29,7 @@ import org.apache.qpid.server.store.Dura
import org.apache.qpid.server.store.MessageStore;
import org.apache.qpid.server.store.MessageStoreCreator;
import org.apache.qpid.server.store.OperationalLoggingListener;
+import org.apache.qpid.server.util.ServerScopedRuntimeException;
public class StandardVirtualHost extends AbstractVirtualHost
{
@@ -39,29 +40,47 @@ public class StandardVirtualHost extends
StandardVirtualHost(VirtualHostRegistry virtualHostRegistry,
StatisticsGatherer brokerStatisticsGatherer,
org.apache.qpid.server.security.SecurityManager parentSecurityManager,
- VirtualHostConfiguration hostConfig, VirtualHost virtualHost) throws Exception
+ VirtualHostConfiguration hostConfig, VirtualHost virtualHost)
{
super(virtualHostRegistry, brokerStatisticsGatherer, parentSecurityManager, hostConfig, virtualHost);
}
- private MessageStore initialiseMessageStore(VirtualHostConfiguration hostConfig, VirtualHost virtualHost) throws Exception
+ private MessageStore initialiseMessageStore(VirtualHostConfiguration hostConfig, VirtualHost virtualHost)
{
final Object storeTypeAttr = virtualHost.getAttribute(VirtualHost.STORE_TYPE);
String storeType = storeTypeAttr == null ? null : String.valueOf(storeTypeAttr);
MessageStore messageStore = null;
if (storeType == null)
{
- final Class<?> clazz = Class.forName(hostConfig.getMessageStoreClass());
- final Object o = clazz.newInstance();
+ try
+ {
+ final Class<?> clazz = Class.forName(hostConfig.getMessageStoreClass());
+ final Object o = clazz.newInstance();
+
+ if (!(o instanceof MessageStore))
+ {
+ throw new ClassCastException(clazz + " does not implement " + MessageStore.class);
+ }
- if (!(o instanceof MessageStore))
+ messageStore = (MessageStore) o;
+ }
+ catch (ClassNotFoundException e)
{
- throw new ClassCastException(clazz + " does not implement " + MessageStore.class);
+ throw new ServerScopedRuntimeException("Failed to fina virtual host message store implementation, " +
+ "check the classpath and the configuration", e);
+ }
+ catch (InstantiationException e)
+ {
+ throw new ServerScopedRuntimeException("Failed to initialise virtual host store, " +
+ "check the configuration", e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ServerScopedRuntimeException("Failed to initialise virtual host store, " +
+ "check the configuration", e);
}
-
- messageStore = (MessageStore) o;
}
else
{
@@ -76,7 +95,7 @@ public class StandardVirtualHost extends
return messageStore;
}
- private DurableConfigurationStore initialiseConfigurationStore(VirtualHost virtualHost) throws Exception
+ private DurableConfigurationStore initialiseConfigurationStore(VirtualHost virtualHost)
{
DurableConfigurationStore configurationStore;
final Object storeTypeAttr = virtualHost.getAttribute(VirtualHost.CONFIG_STORE_TYPE);
@@ -99,7 +118,7 @@ public class StandardVirtualHost extends
}
- protected void initialiseStorage(VirtualHostConfiguration hostConfig, VirtualHost virtualHost) throws Exception
+ protected void initialiseStorage(VirtualHostConfiguration hostConfig, VirtualHost virtualHost)
{
_messageStore = initialiseMessageStore(hostConfig, virtualHost);
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java Fri Feb 14 19:23:14 2014
@@ -46,7 +46,7 @@ public class StandardVirtualHostFactory
StatisticsGatherer brokerStatisticsGatherer,
org.apache.qpid.server.security.SecurityManager parentSecurityManager,
VirtualHostConfiguration hostConfig,
- org.apache.qpid.server.model.VirtualHost virtualHost) throws Exception
+ org.apache.qpid.server.model.VirtualHost virtualHost)
{
return new StandardVirtualHost(virtualHostRegistry, brokerStatisticsGatherer, parentSecurityManager, hostConfig, virtualHost);
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/UnknownExchangeException.java Fri Feb 14 19:23:14 2014
@@ -1,4 +1,4 @@
-package org.apache.qpid.server.virtualhost;/*
+/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,10 +18,9 @@ package org.apache.qpid.server.virtualho
* under the License.
*
*/
+package org.apache.qpid.server.virtualhost;
-import org.apache.qpid.AMQException;
-
-public class UnknownExchangeException extends AMQException
+public class UnknownExchangeException extends Exception
{
private final String _exchangeName;
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java Fri Feb 14 19:23:14 2014
@@ -24,19 +24,18 @@ import java.util.Collection;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ScheduledFuture;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQSecurityException;
+
+import org.apache.qpid.server.exchange.AMQUnknownExchangeType;
import org.apache.qpid.common.Closeable;
import org.apache.qpid.server.configuration.VirtualHostConfiguration;
import org.apache.qpid.server.connection.IConnectionRegistry;
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.message.MessageDestination;
-import org.apache.qpid.server.message.MessageNode;
import org.apache.qpid.server.message.MessageSource;
import org.apache.qpid.server.plugin.ExchangeType;
import org.apache.qpid.server.protocol.LinkRegistry;
import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueRegistry;
+import org.apache.qpid.server.security.QpidSecurityException;
import org.apache.qpid.server.security.SecurityManager;
import org.apache.qpid.server.stats.StatisticsGatherer;
import org.apache.qpid.server.store.DurableConfigurationStore;
@@ -58,7 +57,7 @@ public interface VirtualHost extends Dur
Collection<AMQQueue> getQueues();
- int removeQueue(AMQQueue queue) throws AMQException;
+ int removeQueue(AMQQueue queue) throws QpidSecurityException;
AMQQueue createQueue(UUID id,
String queueName,
@@ -67,7 +66,7 @@ public interface VirtualHost extends Dur
boolean autoDelete,
boolean exclusive,
boolean deleteOnNoConsumer,
- Map<String, Object> arguments) throws AMQException;
+ Map<String, Object> arguments) throws QueueExistsException, QpidSecurityException;
Exchange createExchange(UUID id,
@@ -76,9 +75,11 @@ public interface VirtualHost extends Dur
boolean durable,
boolean autoDelete,
String alternateExchange)
- throws AMQException;
+ throws QpidSecurityException, ExchangeExistsException, ReservedExchangeNameException,
+ UnknownExchangeException, AMQUnknownExchangeType;
- void removeExchange(Exchange exchange, boolean force) throws AMQException;
+ void removeExchange(Exchange exchange, boolean force) throws QpidSecurityException, ExchangeIsAlternateException,
+ RequiredExchangeException;
MessageDestination getMessageDestination(String name);
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java Fri Feb 14 19:23:14 2014
@@ -26,8 +26,6 @@ import java.util.TreeMap;
import java.util.UUID;
import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQStoreException;
import org.apache.qpid.server.exchange.ExchangeFactory;
import org.apache.qpid.server.exchange.ExchangeRegistry;
import org.apache.qpid.server.logging.actors.CurrentActor;
@@ -138,18 +136,8 @@ public class VirtualHostConfigRecoveryHa
public void postCommit()
{
- try
- {
-
- queue.enqueue(message, null);
- ref.release();
- }
- catch (AMQException e)
- {
- _logger.error("Unable to enqueue message " + message.getMessageNumber() + " into " +
- "queue " + queue.getName() + " (from XA transaction)", e);
- throw new RuntimeException(e);
- }
+ queue.enqueue(message, null);
+ ref.release();
}
public void onRollback()
@@ -228,17 +216,8 @@ public class VirtualHostConfigRecoveryHa
}
- try
- {
- branch.setState(DtxBranch.State.PREPARED);
- branch.prePrepareTransaction();
- }
- catch (AMQStoreException e)
- {
- _logger.error("Unexpected database exception when attempting to prepare a recovered XA transaction " +
- xidAsString(id), e);
- throw new RuntimeException(e);
- }
+ branch.setState(DtxBranch.State.PREPARED);
+ branch.prePrepareTransaction();
}
private static StringBuilder xidAsString(Xid id)
@@ -269,74 +248,66 @@ public class VirtualHostConfigRecoveryHa
public void queueEntry(final UUID queueId, long messageId)
{
AMQQueue queue = _virtualHost.getQueue(queueId);
- try
+ if(queue != null)
{
- if(queue != null)
- {
- String queueName = queue.getName();
- ServerMessage message = _recoveredMessages.get(messageId);
- _unusedMessages.remove(messageId);
+ String queueName = queue.getName();
+ ServerMessage message = _recoveredMessages.get(messageId);
+ _unusedMessages.remove(messageId);
- if(message != null)
- {
-
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("On recovery, delivering " + message.getMessageNumber() + " to " + queueName);
- }
-
- Integer count = _queueRecoveries.get(queueName);
- if (count == null)
- {
- count = 0;
- }
+ if(message != null)
+ {
- queue.enqueue(message,null);
- _queueRecoveries.put(queueName, ++count);
+ if (_logger.isDebugEnabled())
+ {
+ _logger.debug("On recovery, delivering " + message.getMessageNumber() + " to " + queueName);
}
- else
+
+ Integer count = _queueRecoveries.get(queueName);
+ if (count == null)
{
- _logger.warn("Message id " + messageId + " referenced in log as enqueued in queue " + queueName + " is unknown, entry will be discarded");
- Transaction txn = _store.newTransaction();
- txn.dequeueMessage(queue, new DummyMessage(messageId));
- txn.commitTranAsync();
+ count = 0;
}
+
+ queue.enqueue(message,null);
+
+ _queueRecoveries.put(queueName, ++count);
}
else
{
- _logger.warn("Message id " + messageId + " in log references queue with id " + queueId + " which is not in the configuration, entry will be discarded");
+ _logger.warn("Message id " + messageId + " referenced in log as enqueued in queue " + queueName + " is unknown, entry will be discarded");
Transaction txn = _store.newTransaction();
- TransactionLogResource mockQueue =
- new TransactionLogResource()
- {
- @Override
- public String getName()
- {
- return "<<UNKNOWN>>";
- }
-
- @Override
- public UUID getId()
- {
- return queueId;
- }
-
- @Override
- public boolean isDurable()
- {
- return false;
- }
- };
- txn.dequeueMessage(mockQueue, new DummyMessage(messageId));
+ txn.dequeueMessage(queue, new DummyMessage(messageId));
txn.commitTranAsync();
}
-
}
- catch(AMQException e)
+ else
{
- throw new RuntimeException(e);
+ _logger.warn("Message id " + messageId + " in log references queue with id " + queueId + " which is not in the configuration, entry will be discarded");
+ Transaction txn = _store.newTransaction();
+ TransactionLogResource mockQueue =
+ new TransactionLogResource()
+ {
+ @Override
+ public String getName()
+ {
+ return "<<UNKNOWN>>";
+ }
+
+ @Override
+ public UUID getId()
+ {
+ return queueId;
+ }
+
+ @Override
+ public boolean isDurable()
+ {
+ return false;
+ }
+ };
+ txn.dequeueMessage(mockQueue, new DummyMessage(messageId));
+ txn.commitTranAsync();
}
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/configuration/updater/TaskExecutorTest.java Fri Feb 14 19:23:14 2014
@@ -42,6 +42,7 @@ import org.apache.qpid.server.logging.ac
import org.apache.qpid.server.logging.actors.TestLogActor;
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.security.SecurityManager;
+import org.apache.qpid.server.util.ServerScopedRuntimeException;
public class TaskExecutorTest extends TestCase
{
@@ -90,7 +91,7 @@ public class TaskExecutorTest extends Te
{
try
{
- Future<?> f = _executor.submit(new NeverEndingCallable(waitForCallLatch));
+ Future<Void> f = _executor.submit(new NeverEndingCallable(waitForCallLatch));
submitLatch.countDown();
f.get();
}
@@ -100,7 +101,14 @@ public class TaskExecutorTest extends Te
{
e = (Exception) e.getCause();
}
- submitExceptions.add(e);
+ if(e instanceof RuntimeException && e.getCause() instanceof Exception)
+ {
+ submitExceptions.add((Exception)e.getCause());
+ }
+ else
+ {
+ submitExceptions.add(e);
+ }
}
}
};
@@ -133,10 +141,10 @@ public class TaskExecutorTest extends Te
public void testSubmitAndWait() throws Exception
{
_executor.start();
- Object result = _executor.submitAndWait(new Callable<String>()
+ Object result = _executor.submitAndWait(new TaskExecutor.Task<Object>()
{
@Override
- public String call() throws Exception
+ public String call()
{
return "DONE";
}
@@ -186,11 +194,11 @@ public class TaskExecutorTest extends Te
_executor.start();
try
{
- _executor.submitAndWait(new Callable<Void>()
+ _executor.submitAndWait(new TaskExecutor.Task<Object>()
{
@Override
- public Void call() throws Exception
+ public Void call()
{
throw exception;
}
@@ -203,29 +211,6 @@ public class TaskExecutorTest extends Te
}
}
- public void testSubmitAndWaitPassesOriginalCheckedException()
- {
- final Exception exception = new Exception();
- _executor.start();
- try
- {
- _executor.submitAndWait(new Callable<Void>()
- {
-
- @Override
- public Void call() throws Exception
- {
- throw exception;
- }
- });
- fail("Exception is expected");
- }
- catch (Exception e)
- {
- assertEquals("Unexpected exception", exception, e.getCause());
- }
- }
-
public void testSubmitAndWaitCurrentActorAndSecurityManagerSubjectAreRespected() throws Exception
{
_executor.start();
@@ -238,10 +223,10 @@ public class TaskExecutorTest extends Te
{
CurrentActor.set(actor);
SecurityManager.setThreadSubject(subject);
- _executor.submitAndWait(new Callable<Void>()
+ _executor.submitAndWait(new TaskExecutor.Task<Object>()
{
@Override
- public Void call() throws Exception
+ public Void call()
{
taskLogActor.set(CurrentActor.get());
taskSubject.set(SecurityManager.getThreadSubject());
@@ -258,16 +243,16 @@ public class TaskExecutorTest extends Te
assertEquals("Unexpected security manager subject", subject, taskSubject.get());
}
- private class SubjectRetriever implements Callable<Subject>
+ private class SubjectRetriever implements TaskExecutor.Task<Subject>
{
@Override
- public Subject call() throws Exception
+ public Subject call()
{
return Subject.getSubject(AccessController.getContext());
}
}
- private class NeverEndingCallable implements Callable<Void>
+ private class NeverEndingCallable implements TaskExecutor.Task<Void>
{
private CountDownLatch _waitLatch;
@@ -278,7 +263,7 @@ public class TaskExecutorTest extends Te
}
@Override
- public Void call() throws Exception
+ public Void call()
{
if (_waitLatch != null)
{
@@ -288,7 +273,14 @@ public class TaskExecutorTest extends Te
// wait forever
synchronized (this)
{
- this.wait();
+ try
+ {
+ this.wait();
+ }
+ catch (InterruptedException e)
+ {
+ throw new ServerScopedRuntimeException(e);
+ }
}
return null;
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/consumer/MockConsumer.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/consumer/MockConsumer.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/consumer/MockConsumer.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/consumer/MockConsumer.java Fri Feb 14 19:23:14 2014
@@ -21,7 +21,6 @@
package org.apache.qpid.server.consumer;
-import org.apache.qpid.AMQException;
import org.apache.qpid.protocol.AMQConstant;
import org.apache.qpid.server.filter.FilterManager;
import org.apache.qpid.server.filter.Filterable;
@@ -153,7 +152,7 @@ public class MockConsumer implements Con
{
}
- public void send(MessageInstance entry, boolean batch) throws AMQException
+ public void send(MessageInstance entry, boolean batch)
{
if (messages.contains(entry))
{
@@ -205,7 +204,7 @@ public class MockConsumer implements Con
}
- public void queueEmpty() throws AMQException
+ public void queueEmpty()
{
}
@@ -243,7 +242,7 @@ public class MockConsumer implements Con
}
@Override
- public void close() throws AMQException
+ public void close()
{
}
@@ -255,7 +254,7 @@ public class MockConsumer implements Con
@Override
public void checkTransactionStatus(long openWarn, long openClose,
- long idleWarn, long idleClose) throws AMQException
+ long idleWarn, long idleClose)
{
}
@@ -340,7 +339,7 @@ public class MockConsumer implements Con
}
@Override
- public void close(AMQConstant cause, String message) throws AMQException
+ public void close(AMQConstant cause, String message)
{
}
}
@@ -394,13 +393,12 @@ public class MockConsumer implements Con
@Override
public void close(AMQConstant cause, String message)
- throws AMQException
{
}
@Override
public void closeSession(AMQSessionModel session, AMQConstant cause,
- String message) throws AMQException
+ String message)
{
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/DefaultExchangeFactoryTest.java Fri Feb 14 19:23:14 2014
@@ -25,7 +25,6 @@ import java.util.Collection;
import java.util.List;
import java.util.UUID;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.plugin.ExchangeType;
import org.apache.qpid.server.virtualhost.VirtualHost;
import org.apache.qpid.test.utils.QpidTestCase;
@@ -179,7 +178,7 @@ public class DefaultExchangeFactoryTest
@Override
public Exchange newInstance(UUID id, VirtualHost host, String name, boolean durable,
- boolean autoDelete) throws AMQException
+ boolean autoDelete)
{
return null;
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java Fri Feb 14 19:23:14 2014
@@ -33,9 +33,7 @@ import java.util.Set;
import java.util.UUID;
import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInternalException;
-import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.security.QpidSecurityException;
import org.apache.qpid.common.AMQPFilterTypes;
import org.apache.qpid.server.logging.LogActor;
import org.apache.qpid.server.logging.actors.CurrentActor;
@@ -54,7 +52,7 @@ public class FanoutExchangeTest extends
private FanoutExchange _exchange;
private VirtualHost _virtualHost;
- public void setUp() throws AMQException
+ public void setUp()
{
CurrentActor.setDefault(mock(LogActor.class));
@@ -85,28 +83,28 @@ public class FanoutExchangeTest extends
assertFalse("calling isBound(AMQQueue) with null queue should return false", _exchange.isBound((AMQQueue) null));
}
- public void testIsBoundStringMapAMQQueue() throws AMQSecurityException, AMQInternalException
+ public void testIsBoundStringMapAMQQueue() throws QpidSecurityException
{
AMQQueue queue = bindQueue();
assertTrue("Should return true for a bound queue",
_exchange.isBound("matters", null, queue));
}
- public void testIsBoundStringAMQQueue() throws AMQSecurityException, AMQInternalException
+ public void testIsBoundStringAMQQueue() throws QpidSecurityException
{
AMQQueue queue = bindQueue();
assertTrue("Should return true for a bound queue",
_exchange.isBound("matters", queue));
}
- public void testIsBoundAMQQueue() throws AMQSecurityException, AMQInternalException
+ public void testIsBoundAMQQueue() throws QpidSecurityException
{
AMQQueue queue = bindQueue();
assertTrue("Should return true for a bound queue",
_exchange.isBound(queue));
}
- private AMQQueue bindQueue() throws AMQSecurityException, AMQInternalException
+ private AMQQueue bindQueue() throws QpidSecurityException
{
AMQQueue queue = mockQueue();
_exchange.addBinding("matters", queue, null);
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java Fri Feb 14 19:23:14 2014
@@ -29,8 +29,7 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
import junit.framework.TestCase;
-import org.apache.qpid.AMQInternalException;
-import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.security.QpidSecurityException;
import org.apache.qpid.common.AMQPFilterTypes;
import org.apache.qpid.server.logging.LogActor;
import org.apache.qpid.server.logging.actors.CurrentActor;
@@ -119,7 +118,7 @@ public class HeadersExchangeTest extends
}
private void bind(String bindingKey, Map<String, Object> arguments, AMQQueue q)
- throws AMQSecurityException, AMQInternalException
+ throws QpidSecurityException
{
_exchange.addBinding(bindingKey,q,arguments);
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/exchange/TopicExchangeTest.java Fri Feb 14 19:23:14 2014
@@ -23,9 +23,7 @@ package org.apache.qpid.server.exchange;
import java.util.List;
import junit.framework.Assert;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.binding.Binding;
-import org.apache.qpid.server.consumer.Consumer;
import org.apache.qpid.server.message.InstanceProperties;
import org.apache.qpid.server.message.MessageReference;
import org.apache.qpid.server.message.ServerMessage;
@@ -72,7 +70,7 @@ public class TopicExchangeTest extends Q
}
}
- public void testNoRoute() throws AMQException
+ public void testNoRoute() throws Exception
{
AMQQueue<?,?,?> queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a*#b", false, null, false, false,
false, null);
@@ -84,7 +82,7 @@ public class TopicExchangeTest extends Q
Assert.assertEquals(0, queue.getMessageCount());
}
- public void testDirectMatch() throws AMQException
+ public void testDirectMatch() throws Exception
{
AMQQueue<?,?,?> queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "ab", false, null, false, false,
false, null);
@@ -107,7 +105,7 @@ public class TopicExchangeTest extends Q
}
- public void testStarMatch() throws AMQException
+ public void testStarMatch() throws Exception
{
AMQQueue<?,?,?> queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a*", false, null, false, false, false, null);
_exchange.registerQueue(new Binding(null, "a.*",queue, _exchange, null));
@@ -138,7 +136,7 @@ public class TopicExchangeTest extends Q
Assert.assertEquals(0, queue.getMessageCount());
}
- public void testHashMatch() throws AMQException
+ public void testHashMatch() throws Exception
{
AMQQueue<?,?,?> queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a#", false, null, false, false, false, null);
_exchange.registerQueue(new Binding(null, "a.#",queue, _exchange, null));
@@ -189,7 +187,7 @@ public class TopicExchangeTest extends Q
}
- public void testMidHash() throws AMQException
+ public void testMidHash() throws Exception
{
AMQQueue<?,?,?> queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a", false, null, false, false,
false, null);
@@ -215,7 +213,7 @@ public class TopicExchangeTest extends Q
}
- public void testMatchAfterHash() throws AMQException
+ public void testMatchAfterHash() throws Exception
{
AMQQueue<?,?,?> queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a#", false, null, false, false,
false, null);
@@ -254,7 +252,7 @@ public class TopicExchangeTest extends Q
}
- public void testHashAfterHash() throws AMQException
+ public void testHashAfterHash() throws Exception
{
AMQQueue<?,?,?> queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a#", false, null, false, false,
false, null);
@@ -276,7 +274,7 @@ public class TopicExchangeTest extends Q
}
- public void testHashHash() throws AMQException
+ public void testHashHash() throws Exception
{
AMQQueue<?,?,?> queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a#", false, null, false, false,
false, null);
@@ -298,7 +296,7 @@ public class TopicExchangeTest extends Q
}
- public void testSubMatchFails() throws AMQException
+ public void testSubMatchFails() throws Exception
{
AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a", false, null, false, false,
false, null);
@@ -311,7 +309,7 @@ public class TopicExchangeTest extends Q
}
- private int routeMessage(String routingKey, long messageNumber) throws AMQException
+ private int routeMessage(String routingKey, long messageNumber)
{
ServerMessage message = mock(ServerMessage.class);
when(message.getRoutingKey()).thenReturn(routingKey);
@@ -328,7 +326,7 @@ public class TopicExchangeTest extends Q
return queues.size();
}
- public void testMoreRouting() throws AMQException
+ public void testMoreRouting() throws Exception
{
AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a", false, null, false, false,
false, null);
@@ -342,7 +340,7 @@ public class TopicExchangeTest extends Q
}
- public void testMoreQueue() throws AMQException
+ public void testMoreQueue() throws Exception
{
AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a", false, null, false, false,
false, null);
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java Fri Feb 14 19:23:14 2014
@@ -20,7 +20,6 @@
*/
package org.apache.qpid.server.logging.actors;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.logging.LogMessage;
import org.apache.qpid.server.logging.LogSubject;
@@ -79,7 +78,7 @@ public class AMQPConnectionActorTest ext
logs.get(0).toString().contains("/ch:"));
}
- public void testConnectionLoggingOff() throws Exception, AMQException
+ public void testConnectionLoggingOff() throws Exception
{
setStatusUpdatesEnabled(false);
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java Fri Feb 14 19:23:14 2014
@@ -22,7 +22,6 @@ package org.apache.qpid.server.logging.a
import org.apache.commons.configuration.ConfigurationException;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.protocol.AMQSessionModel;
import org.apache.qpid.server.logging.LogActor;
import org.apache.qpid.server.logging.NullRootMessageLogger;
@@ -66,10 +65,9 @@ public class CurrentActorTest extends Ba
* And then finally validates that removing the Connection actor results
* in there being no actors set.
*
- * @throws AMQException
* @throws org.apache.commons.configuration.ConfigurationException
*/
- public void testLIFO() throws AMQException, ConfigurationException
+ public void testLIFO() throws ConfigurationException
{
assertTrue("Unexpected actor: " + CurrentActor.get(), CurrentActor.get() instanceof TestLogActor);
AMQPConnectionActor connectionActor = new AMQPConnectionActor(getConnection(),
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java Fri Feb 14 19:23:14 2014
@@ -36,8 +36,6 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
-
-import org.apache.qpid.AMQException;
import org.apache.qpid.exchange.ExchangeDefaults;
import org.apache.qpid.server.configuration.BrokerProperties;
import org.apache.qpid.server.configuration.QueueConfiguration;
@@ -98,7 +96,7 @@ public class AMQQueueFactoryTest extends
}
- private void delegateVhostQueueCreation() throws AMQException
+ private void delegateVhostQueueCreation() throws Exception
{
final ArgumentCaptor<UUID> id = ArgumentCaptor.forClass(UUID.class);
final ArgumentCaptor<String> queueName = ArgumentCaptor.forClass(String.class);
@@ -152,7 +150,7 @@ public class AMQQueueFactoryTest extends
}).when(_queueRegistry).registerQueue(capturedQueue.capture());
}
- private void mockExchangeCreation() throws AMQException
+ private void mockExchangeCreation() throws Exception
{
final ArgumentCaptor<UUID> idCapture = ArgumentCaptor.forClass(UUID.class);
final ArgumentCaptor<String> exchangeNameCapture = ArgumentCaptor.forClass(String.class);
@@ -260,9 +258,8 @@ public class AMQQueueFactoryTest extends
/**
* Tests that setting the {@link QueueArgumentsConverter#X_QPID_DLQ_ENABLED} argument true does
* cause the alternate exchange to be set and DLQ to be produced.
- * @throws AMQException
*/
- public void testDeadLetterQueueEnabled() throws AMQException
+ public void testDeadLetterQueueEnabled() throws Exception
{
Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
@@ -303,7 +300,6 @@ public class AMQQueueFactoryTest extends
/**
* Tests that the deadLetterQueues/maximumDeliveryCount settings from the configuration
* are not applied to the DLQ itself.
- * @throws AMQException
*/
public void testDeadLetterQueueDoesNotInheritDLQorMDCSettings() throws Exception
{
@@ -349,9 +345,8 @@ public class AMQQueueFactoryTest extends
/**
* Tests that setting the {@link QueueArgumentsConverter#X_QPID_DLQ_ENABLED} argument false does not
* result in the alternate exchange being set and DLQ being created.
- * @throws AMQException
*/
- public void testDeadLetterQueueDisabled() throws AMQException
+ public void testDeadLetterQueueDisabled() throws Exception
{
Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) false);
@@ -384,9 +379,8 @@ public class AMQQueueFactoryTest extends
* Tests that setting the {@link QueueArgumentsConverter#X_QPID_DLQ_ENABLED} argument true but
* creating an auto-delete queue, does not result in the alternate exchange
* being set and DLQ being created.
- * @throws AMQException
*/
- public void testDeadLetterQueueNotCreatedForAutodeleteQueues() throws AMQException
+ public void testDeadLetterQueueNotCreatedForAutodeleteQueues() throws Exception
{
Map<String,Object> attributes = Collections.singletonMap(Queue.CREATE_DLQ_ON_CREATION, (Object) true);
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java Fri Feb 14 19:23:14 2014
@@ -20,20 +20,17 @@
*/
package org.apache.qpid.server.queue;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.binding.Binding;
import org.apache.qpid.server.configuration.QueueConfiguration;
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.filter.FilterManager;
import org.apache.qpid.server.logging.LogSubject;
import org.apache.qpid.server.message.InstanceProperties;
-import org.apache.qpid.server.message.MessageInstance;
import org.apache.qpid.server.message.ServerMessage;
import org.apache.qpid.server.protocol.AMQSessionModel;
import org.apache.qpid.server.security.AuthorizationHolder;
import org.apache.qpid.server.consumer.Consumer;
import org.apache.qpid.server.consumer.ConsumerTarget;
-import org.apache.qpid.server.store.StorableMessageMetaData;
import org.apache.qpid.server.txn.ServerTransaction;
import org.apache.qpid.server.util.Action;
import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -213,7 +210,7 @@ public class MockAMQQueue implements AMQ
}
@Override
- public boolean resend(final QueueEntry entry, final Consumer consumer) throws AMQException
+ public boolean resend(final QueueEntry entry, final Consumer consumer)
{
return false;
}
@@ -225,7 +222,7 @@ public class MockAMQQueue implements AMQ
}
@Override
- public void enqueue(final ServerMessage message, final Action action) throws AMQException
+ public void enqueue(final ServerMessage message, final Action action)
{
}
@@ -241,7 +238,7 @@ public class MockAMQQueue implements AMQ
final FilterManager filters,
final Class messageClass,
final String consumerName,
- final EnumSet options) throws AMQException
+ final EnumSet options)
{
return new QueueConsumer(filters, messageClass, options.contains(Consumer.Option.ACQUIRES),
options.contains(Consumer.Option.SEES_REQUEUES), consumerName,
@@ -332,7 +329,7 @@ public class MockAMQQueue implements AMQ
return _deleted;
}
- public int delete() throws AMQException
+ public int delete()
{
_deleted = true;
return getMessageCount();
@@ -347,11 +344,6 @@ public class MockAMQQueue implements AMQ
{
}
- public boolean resend(QueueEntry entry, QueueConsumer consumer) throws AMQException
- {
- return false;
- }
-
@Override
public void removeQueueDeleteTask(final Action task)
{
@@ -451,7 +443,7 @@ public class MockAMQQueue implements AMQ
}
- public void checkMessageStatus() throws AMQException
+ public void checkMessageStatus()
{
}
@@ -461,7 +453,7 @@ public class MockAMQQueue implements AMQ
return null;
}
- public void flushConsumer(Consumer sub) throws AMQException
+ public void flushConsumer(Consumer sub)
{
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockMessageInstance.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockMessageInstance.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockMessageInstance.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/MockMessageInstance.java Fri Feb 14 19:23:14 2014
@@ -20,7 +20,6 @@
*/
package org.apache.qpid.server.queue;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.filter.Filterable;
import org.apache.qpid.server.message.AMQMessageHeader;
import org.apache.qpid.server.message.InstanceProperties;
@@ -71,7 +70,7 @@ public class MockMessageInstance impleme
}
- public boolean expired() throws AMQException
+ public boolean expired()
{
return false;
}
@@ -128,7 +127,7 @@ public class MockMessageInstance impleme
}
@Override
- public boolean resend() throws AMQException
+ public boolean resend()
{
return false;
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueTest.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueTest.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueTest.java Fri Feb 14 19:23:14 2014
@@ -23,9 +23,6 @@ package org.apache.qpid.server.queue;
import java.util.Collections;
import junit.framework.AssertionFailedError;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.logging.LogActor;
-import org.apache.qpid.server.logging.actors.CurrentActor;
import org.apache.qpid.server.message.AMQMessageHeader;
import org.apache.qpid.server.message.MessageInstance;
import org.apache.qpid.server.message.ServerMessage;
@@ -36,7 +33,6 @@ import java.util.EnumSet;
import org.apache.qpid.server.model.Queue;
import org.apache.qpid.server.consumer.Consumer;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class PriorityQueueTest extends SimpleAMQQueueTestBase
@@ -49,7 +45,7 @@ public class PriorityQueueTest extends S
super.setUp();
}
- public void testPriorityOrdering() throws AMQException, InterruptedException
+ public void testPriorityOrdering() throws Exception, InterruptedException
{
// Enqueue messages in order
@@ -102,7 +98,7 @@ public class PriorityQueueTest extends S
}
- protected ServerMessage createMessage(Long id, byte i) throws AMQException
+ protected ServerMessage createMessage(Long id, byte i)
{
ServerMessage msg = super.createMessage(id);
@@ -111,7 +107,7 @@ public class PriorityQueueTest extends S
return msg;
}
- protected ServerMessage createMessage(Long id) throws AMQException
+ protected ServerMessage createMessage(Long id)
{
return createMessage(id, (byte) 0);
}
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTestBase.java Fri Feb 14 19:23:14 2014
@@ -20,7 +20,6 @@ package org.apache.qpid.server.queue;
import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.consumer.ConsumerTarget;
import org.apache.qpid.server.logging.LogActor;
import org.apache.qpid.server.logging.RootMessageLogger;
@@ -48,7 +47,7 @@ public abstract class QueueEntryImplTest
protected QueueEntryImpl _queueEntry2;
protected QueueEntryImpl _queueEntry3;
- public abstract QueueEntryImpl getQueueEntryImpl(int msgId) throws AMQException;
+ public abstract QueueEntryImpl getQueueEntryImpl(int msgId);
public abstract void testCompareTo();
Modified: qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java?rev=1568495&r1=1568494&r2=1568495&view=diff
==============================================================================
--- qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java (original)
+++ qpid/branches/java-broker-amqp-1-0-management/java/broker-core/src/test/java/org/apache/qpid/server/queue/QueueEntryListTestBase.java Fri Feb 14 19:23:14 2014
@@ -21,7 +21,6 @@ package org.apache.qpid.server.queue;
import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
import org.apache.qpid.server.message.AMQMessageHeader;
import org.apache.qpid.server.message.MessageReference;
import org.apache.qpid.server.message.ServerMessage;
@@ -39,7 +38,7 @@ public abstract class QueueEntryListTest
public abstract L getTestList(boolean newList);
public abstract long getExpectedFirstMsgId();
public abstract int getExpectedListLength();
- public abstract ServerMessage getTestMessageToAdd() throws AMQException;
+ public abstract ServerMessage getTestMessageToAdd();
public void testGetQueue()
{
@@ -52,9 +51,8 @@ public abstract class QueueEntryListTest
* Test to add a message with properties specific to the queue type.
* @see QueueEntryListTestBase#getTestList()
* @see QueueEntryListTestBase#getTestMessageToAdd()
- * @throws AMQException
*/
- public void testAddSpecificMessage() throws AMQException
+ public void testAddSpecificMessage()
{
final L list = getTestList();
list.add(getTestMessageToAdd());
@@ -73,9 +71,8 @@ public abstract class QueueEntryListTest
* Test to add a generic mock message.
* @see QueueEntryListTestBase#getTestList()
* @see QueueEntryListTestBase#getExpectedListLength()
- * @throws AMQException
*/
- public void testAddGenericMessage() throws AMQException
+ public void testAddGenericMessage()
{
final L list = getTestList();
final ServerMessage message = createServerMessage(666l);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org