You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2007/01/28 20:39:31 UTC

svn commit: r500863 - /incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DestinationCursorConfigTest.java

Author: rajdavies
Date: Sun Jan 28 11:39:30 2007
New Revision: 500863

URL: http://svn.apache.org/viewvc?view=rev&rev=500863
Log:
Updated support for configurable Cursor types from the Destination Policy Map

Added:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DestinationCursorConfigTest.java   (with props)

Added: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DestinationCursorConfigTest.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DestinationCursorConfigTest.java?view=auto&rev=500863
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DestinationCursorConfigTest.java (added)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DestinationCursorConfigTest.java Sun Jan 28 11:39:30 2007
@@ -0,0 +1,62 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.broker.policy;
+
+import javax.jms.Destination;
+import org.apache.activemq.TestSupport;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.region.cursors.PendingMessageCursor;
+import org.apache.activemq.broker.region.policy.PendingQueueMessageStoragePolicy;
+import org.apache.activemq.broker.region.policy.PolicyEntry;
+import org.apache.activemq.broker.region.policy.VMPendingQueueMessageStoragePolicy;
+import org.apache.activemq.broker.region.policy.VMPendingSubscriberMessageStoragePolicy;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.xbean.BrokerFactoryBean;
+import org.springframework.core.io.ClassPathResource;
+
+/**
+ *
+ * @version $Revision: 2765 $
+ */
+public class DestinationCursorConfigTest extends TestSupport {
+
+
+   
+    protected BrokerService createBroker() throws Exception {
+        BrokerFactoryBean factory = new BrokerFactoryBean(new ClassPathResource("org/apache/activemq/broker/policy/cursor.xml"));
+        factory.afterPropertiesSet();
+        BrokerService answer = factory.getBroker();
+        return answer;
+    }
+
+    public void testConfiguration() throws Exception{
+        BrokerService broker = createBroker();
+        super.topic=false;
+        ActiveMQDestination destination = (ActiveMQDestination)createDestination("org.apache.foo");
+        PolicyEntry entry=broker.getDestinationPolicy().getEntryFor(destination);
+        PendingQueueMessageStoragePolicy policy = entry.getPendingQueuePolicy();
+        assertNotNull(policy);
+        assert(policy instanceof VMPendingQueueMessageStoragePolicy);
+        
+        super.topic=true;
+        destination = (ActiveMQDestination)createDestination("org.apache.foo");
+        entry=broker.getDestinationPolicy().getEntryFor(destination);
+        assertNotNull(policy);
+        assert(policy instanceof VMPendingSubscriberMessageStoragePolicy);
+        
+    }
+}

Propchange: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DestinationCursorConfigTest.java
------------------------------------------------------------------------------
    svn:eol-style = native