diff options
Diffstat (limited to 'qpid/java/broker/src/test/java/org/apache/qpid/server/store')
4 files changed, 49 insertions, 50 deletions
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java index 90adaa1319..d49f0586ba 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java @@ -20,12 +20,8 @@ */ package org.apache.qpid.server.store; -import java.io.File; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.apache.commons.configuration.PropertiesConfiguration; + import org.apache.qpid.AMQException; import org.apache.qpid.common.AMQPFilterTypes; import org.apache.qpid.framing.AMQShortString; @@ -58,6 +54,11 @@ import org.apache.qpid.server.util.InternalBrokerBaseCase; import org.apache.qpid.server.virtualhost.VirtualHost; import org.apache.qpid.util.FileUtils; +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * This tests the MessageStores by using the available interfaces. * @@ -70,26 +71,26 @@ public class MessageStoreTest extends InternalBrokerBaseCase public static final String SELECTOR_VALUE = "Test = 'MST'"; public static final String LVQ_KEY = "MST-LVQ-KEY"; - AMQShortString nonDurableExchangeName = new AMQShortString("MST-NonDurableDirectExchange"); - AMQShortString directExchangeName = new AMQShortString("MST-DirectExchange"); - AMQShortString topicExchangeName = new AMQShortString("MST-TopicExchange"); + private AMQShortString nonDurableExchangeName = new AMQShortString("MST-NonDurableDirectExchange"); + private AMQShortString directExchangeName = new AMQShortString("MST-DirectExchange"); + private AMQShortString topicExchangeName = new AMQShortString("MST-TopicExchange"); - AMQShortString durablePriorityTopicQueueName = new AMQShortString("MST-PriorityTopicQueue-Durable"); - AMQShortString durableTopicQueueName = new AMQShortString("MST-TopicQueue-Durable"); - AMQShortString priorityTopicQueueName = new AMQShortString("MST-PriorityTopicQueue"); - AMQShortString topicQueueName = new AMQShortString("MST-TopicQueue"); + private AMQShortString durablePriorityTopicQueueName = new AMQShortString("MST-PriorityTopicQueue-Durable"); + private AMQShortString durableTopicQueueName = new AMQShortString("MST-TopicQueue-Durable"); + private AMQShortString priorityTopicQueueName = new AMQShortString("MST-PriorityTopicQueue"); + private AMQShortString topicQueueName = new AMQShortString("MST-TopicQueue"); - AMQShortString durableExclusiveQueueName = new AMQShortString("MST-Queue-Durable-Exclusive"); - AMQShortString durablePriorityQueueName = new AMQShortString("MST-PriorityQueue-Durable"); - AMQShortString durableLastValueQueueName = new AMQShortString("MST-LastValueQueue-Durable"); - AMQShortString durableQueueName = new AMQShortString("MST-Queue-Durable"); - AMQShortString priorityQueueName = new AMQShortString("MST-PriorityQueue"); - AMQShortString queueName = new AMQShortString("MST-Queue"); + private AMQShortString durableExclusiveQueueName = new AMQShortString("MST-Queue-Durable-Exclusive"); + private AMQShortString durablePriorityQueueName = new AMQShortString("MST-PriorityQueue-Durable"); + private AMQShortString durableLastValueQueueName = new AMQShortString("MST-LastValueQueue-Durable"); + private AMQShortString durableQueueName = new AMQShortString("MST-Queue-Durable"); + private AMQShortString priorityQueueName = new AMQShortString("MST-PriorityQueue"); + private AMQShortString queueName = new AMQShortString("MST-Queue"); - AMQShortString directRouting = new AMQShortString("MST-direct"); - AMQShortString topicRouting = new AMQShortString("MST-topic"); + private AMQShortString directRouting = new AMQShortString("MST-direct"); + private AMQShortString topicRouting = new AMQShortString("MST-topic"); - AMQShortString queueOwner = new AMQShortString("MST"); + private AMQShortString queueOwner = new AMQShortString("MST"); protected PropertiesConfiguration _config; @@ -586,11 +587,7 @@ public class MessageStoreTest extends InternalBrokerBaseCase currentMessage.setExchange(exchange); - ContentHeaderBody headerBody = new ContentHeaderBody(); - headerBody.classId = BasicConsumeBodyImpl.CLASS_ID; - headerBody.bodySize = 0; - - headerBody.setProperties(properties); + ContentHeaderBody headerBody = new ContentHeaderBody(BasicConsumeBodyImpl.CLASS_ID,0,properties,0l); try { @@ -603,7 +600,7 @@ public class MessageStoreTest extends InternalBrokerBaseCase currentMessage.setExpiration(); - MessageMetaData mmd = currentMessage.headersReceived(); + MessageMetaData mmd = currentMessage.headersReceived(System.currentTimeMillis()); currentMessage.setStoredMessage(getVirtualHost().getMessageStore().addMessage(mmd)); currentMessage.getStoredMessage().flushToStore(); currentMessage.route(); diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java index 44006df517..09d865cb05 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java @@ -21,21 +21,14 @@ package org.apache.qpid.server.store; import org.apache.commons.configuration.Configuration; -import org.apache.qpid.AMQException; + import org.apache.qpid.AMQStoreException; import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.framing.FieldTable; -import org.apache.qpid.framing.abstraction.ContentChunk; -import org.apache.qpid.server.message.EnqueableMessage; -import org.apache.qpid.server.message.MessageMetaData; -import org.apache.qpid.server.queue.AMQQueue; import org.apache.qpid.server.exchange.Exchange; -import org.apache.qpid.server.message.ServerMessage; import org.apache.qpid.server.logging.LogSubject; - -import java.util.List; -import java.util.concurrent.atomic.AtomicLong; -import java.nio.ByteBuffer; +import org.apache.qpid.server.message.EnqueableMessage; +import org.apache.qpid.server.queue.AMQQueue; /** * A message store that does nothing. Designed to be used in tests that do not want to use any message store @@ -153,6 +146,14 @@ public class SkeletonMessageStore implements MessageStore { } + + public void removeXid(long format, byte[] globalId, byte[] branchId) + { + } + + public void recordXid(long format, byte[] globalId, byte[] branchId, Record[] enqueues, Record[] dequeues) + { + } }; } diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java index fa698f4cf8..8a261b3b86 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStore.java @@ -20,14 +20,8 @@ */ package org.apache.qpid.server.store; -import org.apache.qpid.server.message.MessageMetaData; -import org.apache.qpid.framing.abstraction.ContentChunk; - -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.List; import java.nio.ByteBuffer; +import java.util.concurrent.atomic.AtomicInteger; /** * Adds some extra methods to the memory message store for testing purposes. diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java index 3804d0dc8e..104e06d29a 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java @@ -20,22 +20,21 @@ */ package org.apache.qpid.server.store; -import java.nio.ByteBuffer; -import java.util.HashMap; -import java.util.concurrent.atomic.AtomicInteger; - import org.apache.qpid.AMQStoreException; import org.apache.qpid.server.message.EnqueableMessage; -import org.apache.qpid.server.message.ServerMessage; import org.apache.qpid.server.queue.AMQQueue; +import java.nio.ByteBuffer; +import java.util.HashMap; +import java.util.concurrent.atomic.AtomicInteger; + /** * Adds some extra methods to the memory message store for testing purposes. */ public class TestableMemoryMessageStore extends MemoryMessageStore { - MemoryMessageStore _mms = null; + private MemoryMessageStore _mms = null; private HashMap<Long, AMQQueue> _messages = new HashMap<Long, AMQQueue>(); private AtomicInteger _messageCount = new AtomicInteger(0); @@ -101,6 +100,14 @@ public class TestableMemoryMessageStore extends MemoryMessageStore public void abortTran() throws AMQStoreException { } + + public void removeXid(long format, byte[] globalId, byte[] branchId) + { + } + + public void recordXid(long format, byte[] globalId, byte[] branchId, Record[] enqueues, Record[] dequeues) + { + } } |