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/04/10 12:41:28 UTC
svn commit: r1586268 [2/2] - in /qpid/trunk/qpid/java:
broker-core/src/main/java/org/apache/qpid/server/model/
broker-core/src/main/java/org/apache/qpid/server/model/adapter/
broker-core/src/main/java/org/apache/qpid/server/queue/
broker-core/src/main/...
Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java Thu Apr 10 10:41:27 2014
@@ -20,7 +20,9 @@
*/
package org.apache.qpid.server.queue;
-import static org.mockito.Matchers.*;
+import static org.mockito.Matchers.anyMap;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -31,6 +33,10 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
+import org.mockito.ArgumentCaptor;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
import org.apache.qpid.exchange.ExchangeDefaults;
import org.apache.qpid.server.configuration.BrokerProperties;
import org.apache.qpid.server.exchange.DefaultExchangeFactory;
@@ -44,9 +50,6 @@ import org.apache.qpid.server.store.Dura
import org.apache.qpid.server.util.MapValueConverter;
import org.apache.qpid.server.virtualhost.VirtualHostImpl;
import org.apache.qpid.test.utils.QpidTestCase;
-import org.mockito.ArgumentCaptor;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
public class AMQQueueFactoryTest extends QpidTestCase
{
Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java Thu Apr 10 10:41:27 2014
@@ -830,7 +830,7 @@ abstract class AbstractQueueTestBase ext
QueueNotificationListener listener = mock(QueueNotificationListener .class);
_queue.setNotificationListener(listener);
- _queue.setMaximumMessageCount(2);
+ _queue.setAlertThresholdQueueDepthMessages(2);
_queue.enqueue(createMessage(new Long(24)), null);
verifyZeroInteractions(listener);
@@ -849,7 +849,7 @@ abstract class AbstractQueueTestBase ext
_queue.enqueue(createMessage(new Long(26)), null);
_queue.setNotificationListener(listener);
- _queue.setMaximumMessageCount(2);
+ _queue.setAlertThresholdQueueDepthMessages(2);
verifyZeroInteractions(listener);
Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java Thu Apr 10 10:41:27 2014
@@ -21,7 +21,6 @@
package org.apache.qpid.server.util;
import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -40,7 +39,6 @@ import org.apache.qpid.server.model.Conf
import org.apache.qpid.server.model.Queue;
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.model.adapter.BrokerAdapter;
import org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory;
import org.apache.qpid.server.protocol.AMQConnectionModel;
import org.apache.qpid.server.protocol.AMQSessionModel;
@@ -72,9 +70,8 @@ public class BrokerTestHelper
SubjectCreator subjectCreator = mock(SubjectCreator.class);
when(subjectCreator.getMechanisms()).thenReturn("");
Broker broker = mock(Broker.class);
- when(broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT)).thenReturn(1);
- when(broker.getAttribute(Broker.CONNECTION_CLOSE_WHEN_NO_ROUTE)).thenReturn(false);
- when(broker.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(10000l);
+ when(broker.getConnection_sessionCountLimit()).thenReturn(1);
+ when(broker.getConnection_closeWhenNoRoute()).thenReturn(false);
when(broker.getId()).thenReturn(UUID.randomUUID());
when(broker.getSubjectCreator(any(SocketAddress.class))).thenReturn(subjectCreator);
when(broker.getVirtualHostRegistry()).thenReturn(new VirtualHostRegistry(new EventLogger()));
@@ -102,16 +99,6 @@ public class BrokerTestHelper
when(broker.getTaskExecutor()).thenReturn(TASK_EXECUTOR);
SecurityManager securityManager = new SecurityManager(broker, false);
when(broker.getSecurityManager()).thenReturn(securityManager);
- when(broker.getAttribute(eq(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD))).thenReturn(BrokerAdapter.DEFAULT_HOUSEKEEPING_CHECK_PERIOD);
- when(broker.getAttribute(eq(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED))).thenReturn(BrokerAdapter.DEFAULT_DEAD_LETTER_QUEUE_ENABLED);
- when(broker.getAttribute(eq(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE))).thenReturn(BrokerAdapter.DEFAULT_ALERT_THRESHOLD_MESSAGE_AGE);
- when(broker.getAttribute(eq(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE))).thenReturn(BrokerAdapter.DEFAULT_ALERT_THRESHOLD_MESSAGE_SIZE);
- when(broker.getAttribute(eq(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES))).thenReturn(BrokerAdapter.DEFAULT_ALERT_THRESHOLD_MESSAGE_COUNT);
- when(broker.getAttribute(eq(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES))).thenReturn(BrokerAdapter.DEFAULT_ALERT_THRESHOLD_QUEUE_DEPTH);
- when(broker.getAttribute(eq(Broker.QUEUE_ALERT_REPEAT_GAP))).thenReturn(BrokerAdapter.DEFAULT_ALERT_REPEAT_GAP);
- when(broker.getAttribute(eq(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES))).thenReturn(BrokerAdapter.DEFAULT_FLOW_CONTROL_SIZE_BYTES);
- when(broker.getAttribute(eq(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES))).thenReturn(BrokerAdapter.DEFAULT_FLOW_CONTROL_RESUME_SIZE_BYTES);
- when(broker.getAttribute(eq(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS))).thenReturn(BrokerAdapter.DEFAULT_MAXIMUM_DELIVERY_ATTEMPTS);
ConfiguredObjectFactory objectFactory = new ConfiguredObjectFactory();
ConfiguredObjectTypeFactory factory = objectFactory.getConfiguredObjectTypeFactory(org.apache.qpid.server.model.VirtualHost.class,
@@ -120,10 +107,7 @@ public class BrokerTestHelper
AbstractVirtualHost host = (AbstractVirtualHost) factory.create(attributes, broker);
host.setDesiredState(host.getState(), State.ACTIVE);
- /*if(virtualHostRegistry != null)
- {
- virtualHostRegistry.registerVirtualHost(host);
- }*/
+
return host;
}
Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java Thu Apr 10 10:41:27 2014
@@ -256,24 +256,6 @@ public class MockVirtualHost implements
}
@Override
- public int getQueue_maximumDeliveryAttempts()
- {
- return 0;
- }
-
- @Override
- public long getQueue_flowControlSizeBytes()
- {
- return 0;
- }
-
- @Override
- public long getQueue_flowResumeSizeBytes()
- {
- return 0;
- }
-
- @Override
public long getStoreTransactionIdleTimeoutClose()
{
return 0;
@@ -298,36 +280,6 @@ public class MockVirtualHost implements
}
@Override
- public long getQueue_alertRepeatGap()
- {
- return 0;
- }
-
- @Override
- public long getQueue_alertThresholdMessageAge()
- {
- return 0;
- }
-
- @Override
- public long getQueue_alertThresholdMessageSize()
- {
- return 0;
- }
-
- @Override
- public long getQueue_alertThresholdQueueDepthBytes()
- {
- return 0;
- }
-
- @Override
- public long getQueue_alertThresholdQueueDepthMessages()
- {
- return 0;
- }
-
- @Override
public String getSecurityAcl()
{
return null;
@@ -702,54 +654,6 @@ public class MockVirtualHost implements
}
@Override
- public long getDefaultAlertThresholdMessageAge()
- {
- return 0;
- }
-
- @Override
- public long getDefaultAlertThresholdMessageSize()
- {
- return 0;
- }
-
- @Override
- public long getDefaultAlertThresholdQueueDepthMessages()
- {
- return 0;
- }
-
- @Override
- public long getDefaultAlertThresholdQueueDepthBytes()
- {
- return 0;
- }
-
- @Override
- public long getDefaultAlertRepeatGap()
- {
- return 0;
- }
-
- @Override
- public long getDefaultQueueFlowControlSizeBytes()
- {
- return 0;
- }
-
- @Override
- public long getDefaultQueueFlowResumeSizeBytes()
- {
- return 0;
- }
-
- @Override
- public int getDefaultMaximumDeliveryAttempts()
- {
- return 0;
- }
-
- @Override
public TaskExecutor getTaskExecutor()
{
return null;
Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java Thu Apr 10 10:41:27 2014
@@ -20,6 +20,8 @@
*/
package org.apache.qpid.server.protocol.v0_10;
+import static org.apache.qpid.transport.Connection.State.CLOSE_RCVD;
+
import java.security.AccessControlException;
import java.security.Principal;
import java.util.ArrayList;
@@ -30,8 +32,13 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
+
import javax.security.sasl.SaslException;
import javax.security.sasl.SaslServer;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.apache.qpid.common.QpidProperties;
import org.apache.qpid.common.ServerPropertyNames;
import org.apache.qpid.properties.ConnectionStartProperties;
@@ -43,14 +50,23 @@ import org.apache.qpid.server.security.a
import org.apache.qpid.server.security.auth.SubjectAuthenticationResult;
import org.apache.qpid.server.virtualhost.VirtualHostImpl;
import org.apache.qpid.server.virtualhost.VirtualHostState;
-import org.apache.qpid.transport.*;
+import org.apache.qpid.transport.Binary;
+import org.apache.qpid.transport.Connection;
+import org.apache.qpid.transport.ConnectionClose;
+import org.apache.qpid.transport.ConnectionCloseCode;
+import org.apache.qpid.transport.ConnectionOpen;
+import org.apache.qpid.transport.ConnectionOpenOk;
+import org.apache.qpid.transport.ConnectionStartOk;
+import org.apache.qpid.transport.ConnectionTuneOk;
+import org.apache.qpid.transport.ServerDelegate;
+import org.apache.qpid.transport.Session;
+import org.apache.qpid.transport.SessionAttach;
+import org.apache.qpid.transport.SessionDelegate;
+import org.apache.qpid.transport.SessionDetach;
+import org.apache.qpid.transport.SessionDetachCode;
+import org.apache.qpid.transport.SessionDetached;
import org.apache.qpid.transport.network.NetworkConnection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.apache.qpid.transport.Connection.State.CLOSE_RCVD;
-
public class ServerConnectionDelegate extends ServerDelegate
{
private static final Logger LOGGER = LoggerFactory.getLogger(ServerConnectionDelegate.class);
@@ -76,7 +92,7 @@ public class ServerConnectionDelegate ex
_broker = broker;
_localFQDN = localFQDN;
- _maxNoOfChannels = (Integer)broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT);
+ _maxNoOfChannels = broker.getConnection_sessionCountLimit();
_subjectCreator = subjectCreator;
}
Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java Thu Apr 10 10:41:27 2014
@@ -23,21 +23,31 @@ package org.apache.qpid.server.protocol.
import java.nio.ByteBuffer;
import java.security.AccessControlException;
import java.security.PrivilegedAction;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
+import javax.security.auth.Subject;
+
import org.apache.log4j.Logger;
+
import org.apache.qpid.AMQConnectionException;
import org.apache.qpid.AMQException;
-import org.apache.qpid.server.connection.SessionPrincipal;
-import org.apache.qpid.server.consumer.ConsumerImpl;
-import org.apache.qpid.server.exchange.ExchangeImpl;
-import org.apache.qpid.server.filter.AMQInvalidArgumentException;
-import org.apache.qpid.server.filter.Filterable;
-import org.apache.qpid.server.filter.MessageFilter;
import org.apache.qpid.common.AMQPFilterTypes;
import org.apache.qpid.framing.AMQMethodBody;
import org.apache.qpid.framing.AMQShortString;
@@ -51,8 +61,14 @@ import org.apache.qpid.protocol.AMQConst
import org.apache.qpid.server.TransactionTimeoutHelper;
import org.apache.qpid.server.TransactionTimeoutHelper.CloseAction;
import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.connection.SessionPrincipal;
+import org.apache.qpid.server.consumer.ConsumerImpl;
+import org.apache.qpid.server.exchange.ExchangeImpl;
+import org.apache.qpid.server.filter.AMQInvalidArgumentException;
import org.apache.qpid.server.filter.FilterManager;
import org.apache.qpid.server.filter.FilterManagerFactory;
+import org.apache.qpid.server.filter.Filterable;
+import org.apache.qpid.server.filter.MessageFilter;
import org.apache.qpid.server.filter.SimpleFilterManager;
import org.apache.qpid.server.flow.FlowCreditManager;
import org.apache.qpid.server.flow.Pre0_10CreditManager;
@@ -71,10 +87,10 @@ import org.apache.qpid.server.model.Conf
import org.apache.qpid.server.model.ConfiguredObject;
import org.apache.qpid.server.model.Consumer;
import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.protocol.AMQSessionModel;
import org.apache.qpid.server.protocol.CapacityChecker;
import org.apache.qpid.server.protocol.ConsumerListener;
import org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverter;
-import org.apache.qpid.server.protocol.AMQSessionModel;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.queue.QueueEntry;
import org.apache.qpid.server.security.SecurityManager;
@@ -91,8 +107,6 @@ import org.apache.qpid.server.util.Conne
import org.apache.qpid.server.virtualhost.VirtualHostImpl;
import org.apache.qpid.transport.TransportException;
-import javax.security.auth.Subject;
-
public class AMQChannel<T extends AMQProtocolSession<T>>
implements AMQSessionModel<AMQChannel<T>,T>,
AsyncAutoCommitTransaction.FutureRecorder
Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java Thu Apr 10 10:41:27 2014
@@ -181,7 +181,7 @@ public class AMQProtocolEngine implement
_broker = broker;
_port = port;
_transport = transport;
- _maxNoOfChannels = (Integer)broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT);
+ _maxNoOfChannels = broker.getConnection_sessionCountLimit();
_receivedLock = new ReentrantLock();
_stateManager = new AMQStateManager(broker, this);
_codecFactory = new AMQCodecFactory(true, this);
@@ -199,7 +199,7 @@ public class AMQProtocolEngine implement
getEventLogger().message(ConnectionMessages.OPEN(null, null, null, null, false, false, false, false));
- _closeWhenNoRoute = (Boolean)_broker.getAttribute(Broker.CONNECTION_CLOSE_WHEN_NO_ROUTE);
+ _closeWhenNoRoute = _broker.getConnection_closeWhenNoRoute();
initialiseStatistics();
Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ConnectionSecureOkMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ConnectionSecureOkMethodHandler.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ConnectionSecureOkMethodHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ConnectionSecureOkMethodHandler.java Thu Apr 10 10:41:27 2014
@@ -21,6 +21,9 @@
package org.apache.qpid.server.protocol.v0_8.handler;
+import javax.security.sasl.SaslException;
+import javax.security.sasl.SaslServer;
+
import org.apache.log4j.Logger;
import org.apache.qpid.AMQException;
@@ -33,14 +36,11 @@ import org.apache.qpid.protocol.AMQConst
import org.apache.qpid.server.configuration.BrokerProperties;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
-import org.apache.qpid.server.security.SubjectCreator;
-import org.apache.qpid.server.security.auth.SubjectAuthenticationResult;
import org.apache.qpid.server.protocol.v0_8.state.AMQState;
import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
-
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
+import org.apache.qpid.server.security.SubjectCreator;
+import org.apache.qpid.server.security.auth.SubjectAuthenticationResult;
public class ConnectionSecureOkMethodHandler implements StateAwareMethodListener<ConnectionSecureOkBody>
{
@@ -98,9 +98,9 @@ public class ConnectionSecureOkMethodHan
stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
ConnectionTuneBody tuneBody =
- methodRegistry.createConnectionTuneBody((Integer)broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT),
+ methodRegistry.createConnectionTuneBody(broker.getConnection_sessionCountLimit(),
BrokerProperties.FRAME_SIZE,
- (Integer)broker.getAttribute(Broker.CONNECTION_HEART_BEAT_DELAY));
+ broker.getConnection_heartBeatDelay());
session.writeFrame(tuneBody.generateFrame(0));
session.setAuthorizedSubject(authResult.getSubject());
disposeSaslServer(session);
Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ConnectionStartOkMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ConnectionStartOkMethodHandler.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ConnectionStartOkMethodHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ConnectionStartOkMethodHandler.java Thu Apr 10 10:41:27 2014
@@ -20,6 +20,9 @@
*/
package org.apache.qpid.server.protocol.v0_8.handler;
+import javax.security.sasl.SaslException;
+import javax.security.sasl.SaslServer;
+
import org.apache.log4j.Logger;
import org.apache.qpid.AMQException;
@@ -32,14 +35,11 @@ import org.apache.qpid.protocol.AMQConst
import org.apache.qpid.server.configuration.BrokerProperties;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
-import org.apache.qpid.server.security.SubjectCreator;
-import org.apache.qpid.server.security.auth.SubjectAuthenticationResult;
import org.apache.qpid.server.protocol.v0_8.state.AMQState;
import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
-
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
+import org.apache.qpid.server.security.SubjectCreator;
+import org.apache.qpid.server.security.auth.SubjectAuthenticationResult;
public class ConnectionStartOkMethodHandler implements StateAwareMethodListener<ConnectionStartOkBody>
@@ -112,9 +112,9 @@ public class ConnectionStartOkMethodHand
stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
- ConnectionTuneBody tuneBody = methodRegistry.createConnectionTuneBody((Integer)broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT),
+ ConnectionTuneBody tuneBody = methodRegistry.createConnectionTuneBody(broker.getConnection_sessionCountLimit(),
BrokerProperties.FRAME_SIZE,
- (Integer)broker.getAttribute(Broker.CONNECTION_HEART_BEAT_DELAY));
+ broker.getConnection_heartBeatDelay());
session.writeFrame(tuneBody.generateFrame(0));
break;
case CONTINUE:
Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java Thu Apr 10 10:41:27 2014
@@ -20,6 +20,10 @@
*/
package org.apache.qpid.server.protocol.v0_8.handler;
+import java.security.AccessControlException;
+import java.util.Map;
+import java.util.UUID;
+
import org.apache.log4j.Logger;
import org.apache.qpid.AMQException;
@@ -32,20 +36,16 @@ import org.apache.qpid.protocol.AMQConst
import org.apache.qpid.server.model.ExclusivityPolicy;
import org.apache.qpid.server.model.LifetimePolicy;
import org.apache.qpid.server.model.Queue;
-import org.apache.qpid.server.protocol.v0_8.AMQChannel;
import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
import org.apache.qpid.server.protocol.AMQSessionModel;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueArgumentsConverter;
+import org.apache.qpid.server.protocol.v0_8.AMQChannel;
+import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHostImpl;
-
-import java.security.AccessControlException;
-import java.util.Map;
-import java.util.UUID;
+import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.queue.QueueArgumentsConverter;
import org.apache.qpid.server.virtualhost.QueueExistsException;
+import org.apache.qpid.server.virtualhost.VirtualHostImpl;
public class QueueDeclareHandler implements StateAwareMethodListener<QueueDeclareBody>
{
Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngineTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngineTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngineTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngineTest.java Thu Apr 10 10:41:27 2014
@@ -47,7 +47,7 @@ public class AMQProtocolEngineTest exten
super.setUp();
BrokerTestHelper.setUp();
_broker = BrokerTestHelper.createBrokerMock();
- when(_broker.getAttribute(Broker.CONNECTION_CLOSE_WHEN_NO_ROUTE)).thenReturn(true);
+ when(_broker.getConnection_closeWhenNoRoute()).thenReturn(true);
_port = mock(Port.class);
_network = mock(NetworkConnection.class);
Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/QueueMBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/QueueMBean.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/QueueMBean.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/QueueMBean.java Thu Apr 10 10:41:27 2014
@@ -149,12 +149,12 @@ public class QueueMBean extends AMQManag
public Integer getMessageCount()
{
- return (int) _queue.getQueueDepthMessages();
+ return _queue.getQueueDepthMessages();
}
public Integer getMaximumDeliveryCount()
{
- return (Integer) _queue.getAttribute(Queue.MAXIMUM_DELIVERY_ATTEMPTS);
+ return _queue.getMaximumDeliveryAttempts();
}
public Long getReceivedMessageCount()
@@ -200,7 +200,7 @@ public class QueueMBean extends AMQManag
public Long getMaximumMessageAge()
{
- return (Long) _queue.getAttribute(Queue.ALERT_THRESHOLD_MESSAGE_AGE);
+ return _queue.getAlertThresholdMessageAge();
}
public void setMaximumMessageAge(Long age)
@@ -210,7 +210,7 @@ public class QueueMBean extends AMQManag
public Long getMaximumMessageSize()
{
- return (Long) _queue.getAttribute(Queue.ALERT_THRESHOLD_MESSAGE_SIZE);
+ return _queue.getAlertThresholdMessageSize();
}
public void setMaximumMessageSize(Long size)
@@ -220,7 +220,7 @@ public class QueueMBean extends AMQManag
public Long getMaximumMessageCount()
{
- return (Long) _queue.getAttribute(Queue.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES);
+ return _queue.getAlertThresholdQueueDepthMessages();
}
public void setMaximumMessageCount(Long value)
@@ -230,7 +230,7 @@ public class QueueMBean extends AMQManag
public Long getMaximumQueueDepth()
{
- return (Long) _queue.getAttribute(Queue.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES);
+ return _queue.getAlertThresholdQueueDepthBytes();
}
public void setMaximumQueueDepth(Long value)
@@ -240,7 +240,7 @@ public class QueueMBean extends AMQManag
public Long getCapacity()
{
- return (Long) _queue.getAttribute(Queue.QUEUE_FLOW_CONTROL_SIZE_BYTES);
+ return (Long) _queue.getQueueFlowControlSizeBytes();
}
public void setCapacity(Long value)
@@ -250,7 +250,7 @@ public class QueueMBean extends AMQManag
public Long getFlowResumeCapacity()
{
- return (Long) _queue.getAttribute(Queue.QUEUE_FLOW_RESUME_SIZE_BYTES);
+ return _queue.getQueueFlowResumeSizeBytes();
}
public void setFlowResumeCapacity(Long value)
Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/QueueMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/QueueMBeanTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/QueueMBeanTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/QueueMBeanTest.java Thu Apr 10 10:41:27 2014
@@ -18,12 +18,12 @@
*/
package org.apache.qpid.server.jmx.mbeans;
+import static org.mockito.Matchers.argThat;
+import static org.mockito.Matchers.isNull;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import static org.mockito.Mockito.verify;
-import static org.mockito.Matchers.isNull;
-import static org.mockito.Matchers.argThat;
+import static org.mockito.Mockito.when;
import java.nio.ByteBuffer;
import java.util.Arrays;
@@ -35,6 +35,11 @@ import javax.management.NotificationList
import javax.management.OperationsException;
import javax.management.openmbean.CompositeDataSupport;
+import org.mockito.ArgumentMatcher;
+import org.mockito.Matchers;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
import org.apache.qpid.management.common.mbeans.ManagedQueue;
import org.apache.qpid.server.jmx.ManagedObjectRegistry;
import org.apache.qpid.server.jmx.mbeans.QueueMBean.GetMessageVisitor;
@@ -47,10 +52,6 @@ import org.apache.qpid.server.model.Virt
import org.apache.qpid.server.queue.NotificationCheck;
import org.apache.qpid.server.queue.QueueEntry;
import org.apache.qpid.test.utils.QpidTestCase;
-import org.mockito.ArgumentMatcher;
-import org.mockito.Matchers;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
public class QueueMBeanTest extends QpidTestCase
{
@@ -119,7 +120,8 @@ public class QueueMBeanTest extends Qpid
public void testGetQueueDescription() throws Exception
{
- assertAttribute("description", QUEUE_DESCRIPTION, Queue.DESCRIPTION);
+ when(_mockQueue.getAttribute(Queue.DESCRIPTION)).thenReturn(QUEUE_DESCRIPTION);
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "description", QUEUE_DESCRIPTION);
}
public void testSetQueueDescription() throws Exception
@@ -129,17 +131,20 @@ public class QueueMBeanTest extends Qpid
public void testQueueType() throws Exception
{
- assertAttribute("queueType", QUEUE_TYPE, Queue.QUEUE_TYPE);
+ when(_mockQueue.getAttribute(Queue.QUEUE_TYPE)).thenReturn(QUEUE_TYPE);
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "queueType", QUEUE_TYPE);
}
public void testMaximumDeliveryCount() throws Exception
{
- assertAttribute("maximumDeliveryCount", 5, Queue.MAXIMUM_DELIVERY_ATTEMPTS);
+ when(_mockQueue.getMaximumDeliveryAttempts()).thenReturn(5);
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "maximumDeliveryCount", 5);
}
public void testOwner() throws Exception
{
- assertAttribute("owner", "testOwner", Queue.OWNER);
+ when(_mockQueue.getAttribute(Queue.OWNER)).thenReturn("testOwner");
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "owner", "testOwner");
}
public void testIsDurable() throws Exception
@@ -168,62 +173,92 @@ public class QueueMBeanTest extends Qpid
public void testGetMaximumMessageAge() throws Exception
{
- assertAttribute("maximumMessageAge", 10000l, Queue.ALERT_THRESHOLD_MESSAGE_AGE);
+ when(_mockQueue.getAlertThresholdMessageAge()).thenReturn(10000l);
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "maximumMessageAge", 10000l);
}
public void testSetMaximumMessageAge() throws Exception
{
- testSetAttribute("maximumMessageAge", Queue.ALERT_THRESHOLD_MESSAGE_AGE, 1000l, 10000l);
+ when(_mockQueue.getAlertThresholdMessageAge()).thenReturn(1000l);
+
+ MBeanTestUtils.setMBeanAttribute(_queueMBean, "maximumMessageAge", 10000l);
+
+ verify(_mockQueue).setAttribute(Queue.ALERT_THRESHOLD_MESSAGE_AGE, 1000l, 10000l);
}
public void testGetMaximumMessageSize() throws Exception
{
- assertAttribute("maximumMessageSize", 1024l, Queue.ALERT_THRESHOLD_MESSAGE_SIZE);
+ when(_mockQueue.getAlertThresholdMessageSize()).thenReturn(1024l);
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "maximumMessageSize", 1024l);
}
public void testSetMaximumMessageSize() throws Exception
{
- testSetAttribute("maximumMessageSize", Queue.ALERT_THRESHOLD_MESSAGE_SIZE, 1024l, 2048l);
+ when(_mockQueue.getAlertThresholdMessageSize()).thenReturn(1024l);
+
+ MBeanTestUtils.setMBeanAttribute(_queueMBean, "maximumMessageSize", 2048l);
+
+ verify(_mockQueue).setAttribute(Queue.ALERT_THRESHOLD_MESSAGE_SIZE, 1024l, 2048l);
}
public void testGetMaximumMessageCount() throws Exception
{
- assertAttribute("maximumMessageCount", 5000l, Queue.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES);
+ when(_mockQueue.getAlertThresholdQueueDepthMessages()).thenReturn(5000l);
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "maximumMessageCount", 5000l);
}
public void testSetMaximumMessageCount() throws Exception
{
- testSetAttribute("maximumMessageCount", Queue.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 4000l, 5000l);
+ when(_mockQueue.getAlertThresholdQueueDepthMessages()).thenReturn(4000l);
+
+ MBeanTestUtils.setMBeanAttribute(_queueMBean, "maximumMessageCount", 5000l);
+
+ verify(_mockQueue).setAttribute(Queue.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 4000l, 5000l);
}
public void testGetMaximumQueueDepth() throws Exception
{
- assertAttribute("maximumQueueDepth", 1048576l, Queue.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES);
+ when(_mockQueue.getAlertThresholdQueueDepthBytes()).thenReturn(1048576l);
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "maximumQueueDepth", 1048576l);
}
public void testSetMaximumQueueDepth() throws Exception
{
- testSetAttribute("maximumQueueDepth", Queue.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES,1048576l , 2097152l);
+ when(_mockQueue.getAlertThresholdQueueDepthBytes()).thenReturn(1048576l);
+
+ MBeanTestUtils.setMBeanAttribute(_queueMBean, "maximumQueueDepth", 2097152l);
+
+ verify(_mockQueue).setAttribute(Queue.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 1048576l, 2097152l);
}
public void testGetCapacity() throws Exception
{
- assertAttribute("capacity", 1048576l, Queue.QUEUE_FLOW_CONTROL_SIZE_BYTES);
+ when(_mockQueue.getQueueFlowControlSizeBytes()).thenReturn(1048576l);
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "capacity", 1048576l);
}
public void testSetCapacity() throws Exception
{
- testSetAttribute("capacity", Queue.QUEUE_FLOW_CONTROL_SIZE_BYTES,1048576l , 2097152l);
+ when(_mockQueue.getQueueFlowControlSizeBytes()).thenReturn(1048576l);
+
+ MBeanTestUtils.setMBeanAttribute(_queueMBean, "capacity", 2097152l);
+
+ verify(_mockQueue).setAttribute(Queue.QUEUE_FLOW_CONTROL_SIZE_BYTES, 1048576l, 2097152l);
}
public void testGetFlowResumeCapacity() throws Exception
{
- assertAttribute("flowResumeCapacity", 1048576l, Queue.QUEUE_FLOW_RESUME_SIZE_BYTES);
+ when(_mockQueue.getQueueFlowResumeSizeBytes()).thenReturn(1048576l);
+ MBeanTestUtils.assertMBeanAttribute(_queueMBean, "flowResumeCapacity", 1048576l);
}
public void testSetFlowResumeCapacity() throws Exception
{
- testSetAttribute("flowResumeCapacity", Queue.QUEUE_FLOW_RESUME_SIZE_BYTES,1048576l , 2097152l);
+ when(_mockQueue.getQueueFlowResumeSizeBytes()).thenReturn(1048576l);
+
+ MBeanTestUtils.setMBeanAttribute(_queueMBean, "flowResumeCapacity", 2097152l);
+
+ verify(_mockQueue).setAttribute(Queue.QUEUE_FLOW_RESUME_SIZE_BYTES, 1048576l, 2097152l);
}
@@ -370,12 +405,6 @@ public class QueueMBeanTest extends Qpid
MBeanTestUtils.assertMBeanAttribute(_queueMBean, jmxAttributeName, expectedValue);
}
- private void assertAttribute(String jmxAttributeName, Object expectedValue, String underlyingAttributeName) throws Exception
- {
- when(_mockQueue.getAttribute(underlyingAttributeName)).thenReturn(expectedValue);
- MBeanTestUtils.assertMBeanAttribute(_queueMBean, jmxAttributeName, expectedValue);
- }
-
private void testSetAttribute(String jmxAttributeName, String underlyingAttributeName, Object originalAttributeValue, Object newAttributeValue) throws Exception
{
when(_mockQueue.getAttribute(underlyingAttributeName)).thenReturn(originalAttributeValue);
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java Thu Apr 10 10:41:27 2014
@@ -32,7 +32,6 @@ import org.apache.qpid.client.AMQDestina
import org.apache.qpid.client.AMQSession;
import org.apache.qpid.server.management.plugin.HttpManagement;
import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.model.Plugin;
import org.apache.qpid.server.model.Port;
import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory;
@@ -54,8 +53,8 @@ public class AlertingTest extends Abstra
{
_numMessages = 50;
TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, String.valueOf(ALERT_LOG_WAIT_PERIOD));
- brokerConfiguration.setBrokerAttribute(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, _numMessages);
+ setTestSystemProperty("virtualhost.housekeepingCheckPeriod", String.valueOf(ALERT_LOG_WAIT_PERIOD));
+ setTestSystemProperty("queue.alertThresholdQueueDepthMessages", String.valueOf(_numMessages));
// Then we do the normal setup stuff like starting the broker, getting a connection etc.
super.setUp();
@@ -184,7 +183,7 @@ public class AlertingTest extends Abstra
// Change max message count to 5, start broker and make sure that that's triggered at the right time
TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
- brokerConfiguration.setBrokerAttribute(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 5);
+ setTestSystemProperty("queue.alertThresholdQueueDepthMessages","5");
brokerConfiguration.setSaved(false);
restTestHelper.submitRequest("/rest/queue/test/" + getTestQueueName(), "PUT", Collections.<String, Object>singletonMap(org.apache.qpid.server.model.Queue.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 5));
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java Thu Apr 10 10:41:27 2014
@@ -523,7 +523,7 @@ public class VirtualHostMessageStoreTest
private void setQueueExclusivity(boolean exclusive) throws MessageSource.ExistingConsumerPreventsExclusive
{
AMQQueue<?> queue = getVirtualHost().getQueue(durableExclusiveQueueName);
- queue.setExclusivityPolicy(exclusive ? ExclusivityPolicy.CONTAINER : ExclusivityPolicy.NONE);
+ queue.setAttribute(Queue.EXCLUSIVE, queue.getExclusive(), exclusive ? ExclusivityPolicy.CONTAINER : ExclusivityPolicy.NONE);
}
private void validateQueueExclusivityProperty(boolean expected)
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java Thu Apr 10 10:41:27 2014
@@ -134,22 +134,9 @@ public class BrokerRestTest extends Qpid
{
Map<String, Object> invalidAttributes = new HashMap<String, Object>();
invalidAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, "non-existing-host");
- invalidAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, -1000);
- invalidAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, -2000);
- invalidAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, -3000);
- invalidAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, -4000);
- invalidAttributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, -5000);
- invalidAttributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, -7000);
- invalidAttributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, -16000);
- invalidAttributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, -8);
- invalidAttributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, -90000);
invalidAttributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, -10);
invalidAttributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, -11000);
invalidAttributes.put(Broker.STATISTICS_REPORTING_PERIOD, -12000);
- invalidAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, -13000);
- invalidAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, -14000);
- invalidAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, -15000);
- invalidAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, -16000);
for (Map.Entry<String, Object> entry : invalidAttributes.entrySet())
{
@@ -159,12 +146,6 @@ public class BrokerRestTest extends Qpid
assertEquals("Unexpected update response for invalid attribute " + entry.getKey() + "=" + entry.getValue(), 409, response);
}
- // a special case when FLOW_CONTROL_RESUME_SIZE_BYTES > FLOW_CONTROL_SIZE_BYTES
- Map<String, Object> brokerAttributes = getValidBrokerAttributes();
- brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 1000);
- brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 2000);
- int response = getRestTestHelper().submitRequest("/rest/broker", "PUT", brokerAttributes);
- assertEquals("Unexpected update response for flow resume size > flow size", 409, response);
}
public void testSetCloseOnNoRoute() throws Exception
@@ -198,24 +179,10 @@ public class BrokerRestTest extends Qpid
{
Map<String, Object> brokerAttributes = new HashMap<String, Object>();
brokerAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, TEST3_VIRTUALHOST);
- brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 1000);
- brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 2000);
- brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 3000);
- brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 4000);
- brokerAttributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 5000);
- brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 7000);
- brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 6000);
- brokerAttributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 8);
- brokerAttributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, true);
- brokerAttributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 90000);
brokerAttributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 10);
brokerAttributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 11000);
brokerAttributes.put(Broker.STATISTICS_REPORTING_PERIOD, 12000);
brokerAttributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, true);
- brokerAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, 13000);
- brokerAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, 14000);
- brokerAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, 15000);
- brokerAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, 16000);
return brokerAttributes;
}
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java Thu Apr 10 10:41:27 2014
@@ -608,45 +608,45 @@ public class BrokerACLTest extends QpidR
{
getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
- int initialAlertRepeatGap = 30000;
- int updatedAlertRepeatGap = 29999;
+ int initialSessionCountLimit = 256;
+ int updatedSessionCountLimit = 299;
Map<String, Object> brokerAttributes = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
- assertEquals("Unexpected alert repeat gap", initialAlertRepeatGap,
- brokerAttributes.get(Broker.QUEUE_ALERT_REPEAT_GAP));
+ assertEquals("Unexpected alert repeat gap", initialSessionCountLimit,
+ brokerAttributes.get(Broker.CONNECTION_SESSION_COUNT_LIMIT));
Map<String, Object> newAttributes = new HashMap<String, Object>();
- newAttributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, updatedAlertRepeatGap);
+ newAttributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, updatedSessionCountLimit);
int responseCode = getRestTestHelper().submitRequest("/rest/broker", "PUT", newAttributes);
assertEquals("Setting of port attribites should be allowed", 200, responseCode);
brokerAttributes = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
- assertEquals("Unexpected default alert repeat gap", updatedAlertRepeatGap,
- brokerAttributes.get(Broker.QUEUE_ALERT_REPEAT_GAP));
+ assertEquals("Unexpected default alert repeat gap", updatedSessionCountLimit,
+ brokerAttributes.get(Broker.CONNECTION_SESSION_COUNT_LIMIT));
}
public void testSetBrokerAttributesDenied() throws Exception
{
getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
- int initialAlertRepeatGap = 30000;
- int updatedAlertRepeatGap = 29999;
+ int initialSessionCountLimit = 256;
+ int updatedSessionCountLimit = 299;
Map<String, Object> brokerAttributes = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
- assertEquals("Unexpected alert repeat gap", initialAlertRepeatGap,
- brokerAttributes.get(Broker.QUEUE_ALERT_REPEAT_GAP));
+ assertEquals("Unexpected alert repeat gap", initialSessionCountLimit,
+ brokerAttributes.get(Broker.CONNECTION_SESSION_COUNT_LIMIT));
getRestTestHelper().setUsernameAndPassword(DENIED_USER, DENIED_USER);
Map<String, Object> newAttributes = new HashMap<String, Object>();
- newAttributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, updatedAlertRepeatGap);
+ newAttributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, updatedSessionCountLimit);
int responseCode = getRestTestHelper().submitRequest("/rest/broker", "PUT", newAttributes);
assertEquals("Setting of port attribites should be allowed", 403, responseCode);
brokerAttributes = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
- assertEquals("Unexpected default alert repeat gap", initialAlertRepeatGap,
- brokerAttributes.get(Broker.QUEUE_ALERT_REPEAT_GAP));
+ assertEquals("Unexpected default alert repeat gap", initialSessionCountLimit,
+ brokerAttributes.get(Broker.CONNECTION_SESSION_COUNT_LIMIT));
}
/* === GroupProvider === */
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java Thu Apr 10 10:41:27 2014
@@ -20,6 +20,7 @@
*/
package org.apache.qpid.test.client.destination;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
@@ -70,7 +71,8 @@ public class AddressBasedDestinationTest
public void setUp() throws Exception
{
TestBrokerConfiguration config = getBrokerConfiguration();
- config.setObjectAttribute(VirtualHost.class, TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 0);
+ config.setObjectAttribute(VirtualHost.class, TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.CONTEXT,
+ Collections.singletonMap("queue.maximumDeliveryAttempts","0"));
super.setUp();
_connection = getConnection() ;
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java Thu Apr 10 10:41:27 2014
@@ -20,17 +20,11 @@
*/
package org.apache.qpid.test.unit.client;
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.RejectBehaviour;
-import org.apache.qpid.configuration.ClientProperties;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.test.utils.TestBrokerConfiguration;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import javax.jms.Connection;
import javax.jms.Destination;
@@ -43,11 +37,17 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
+import org.apache.log4j.Logger;
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.client.AMQDestination;
+import org.apache.qpid.client.AMQQueue;
+import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.client.RejectBehaviour;
+import org.apache.qpid.configuration.ClientProperties;
+import org.apache.qpid.server.queue.AMQQueueFactory;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
/**
* Test that the MaxRedelivery feature works as expected, allowing the client to reject
@@ -79,8 +79,8 @@ public class MaxDeliveryCountTest extend
//enable DLQ/maximumDeliveryCount support for all queues at the vhost level
TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
- brokerConfiguration.setBrokerAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, true);
- brokerConfiguration.setBrokerAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, MAX_DELIVERY_COUNT);
+ setTestSystemProperty("queue.deadLetterQueueEnabled","true");
+ setTestSystemProperty("queue.maximumDeliveryAttempts", String.valueOf(MAX_DELIVERY_COUNT));
//Ensure management is on
brokerConfiguration.addJmxManagementConfiguration();
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutDisabledTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutDisabledTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutDisabledTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutDisabledTest.java Thu Apr 10 10:41:27 2014
@@ -20,7 +20,6 @@
*/
package org.apache.qpid.test.unit.transacted;
-import org.apache.qpid.server.model.Broker;
import org.apache.qpid.test.utils.TestBrokerConfiguration;
/**
@@ -33,7 +32,7 @@ public class TransactionTimeoutDisabledT
{
// Setup housekeeping every second
TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 100);
+ setTestSystemProperty("virtualhost.housekeepingCheckPeriod", "100");
// No transaction timeout configuration.
}
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTest.java?rev=1586268&r1=1586267&r2=1586268&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTest.java Thu Apr 10 10:41:27 2014
@@ -47,28 +47,28 @@ public class TransactionTimeoutTest exte
// Setup housekeeping every 100ms
TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 100);
+ setTestSystemProperty("virtualhost.housekeepingCheckPeriod","100");
if (getName().contains("ProducerIdle"))
{
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, 0);
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, 0);
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, 500);
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, 1500);
+ setTestSystemProperty("virtualhost.storeTransactionOpenTimeoutWarn", "0");
+ setTestSystemProperty("virtualhost.storeTransactionOpenTimeoutClose", "0");
+ setTestSystemProperty("virtualhost.storeTransactionIdleTimeoutWarn", "500");
+ setTestSystemProperty("virtualhost.storeTransactionIdleTimeoutClose", "1500");
}
else if (getName().contains("ProducerOpen"))
{
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, 1000);
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, 2000);
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, 0);
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, 0);
+ setTestSystemProperty("virtualhost.storeTransactionOpenTimeoutWarn", "1000");
+ setTestSystemProperty("virtualhost.storeTransactionOpenTimeoutClose", "2000");
+ setTestSystemProperty("virtualhost.storeTransactionIdleTimeoutWarn", "0");
+ setTestSystemProperty("virtualhost.storeTransactionIdleTimeoutClose", "0");
}
else
{
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, 1000);
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, 2000);
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, 500);
- brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, 1500);
+ setTestSystemProperty("virtualhost.storeTransactionOpenTimeoutWarn", "1000");
+ setTestSystemProperty("virtualhost.storeTransactionOpenTimeoutClose", "2000");
+ setTestSystemProperty("virtualhost.storeTransactionIdleTimeoutWarn", "500");
+ setTestSystemProperty("virtualhost.storeTransactionIdleTimeoutClose", "1500");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org