activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r812941 - in /activemq/trunk/activemq-ra/src: main/java/org/apache/activemq/ra/ test/java/org/apache/activemq/ra/
Date Wed, 09 Sep 2009 13:15:16 GMT
Author: rajdavies
Date: Wed Sep  9 13:15:15 2009
New Revision: 812941

URL: http://svn.apache.org/viewvc?rev=812941&view=rev
Log:
fix for https://issues.apache.org/activemq/browse/AMQ-910

Added:
    activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/UnsubscribeResubscribeTest.java
  (with props)
Modified:
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/MessageActivationSpec.java

Modified: activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java?rev=812941&r1=812940&r2=812941&view=diff
==============================================================================
--- activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java
(original)
+++ activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java
Wed Sep  9 13:15:15 2009
@@ -587,7 +587,7 @@
         }
     }
 
-    public short getBackOffMultiplier() {
+    public double getBackOffMultiplier() {
         if (redeliveryPolicy == null) {
             return 0;
         }

Modified: activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java?rev=812941&r1=812940&r2=812941&view=diff
==============================================================================
--- activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java
(original)
+++ activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java
Wed Sep  9 13:15:15 2009
@@ -197,8 +197,8 @@
         return useInboundSession != null && useInboundSession.booleanValue();
     }
 
-    public Short getRedeliveryBackOffMultiplier() {
-        return Short.valueOf(redeliveryPolicy().getBackOffMultiplier());
+    public Double getRedeliveryBackOffMultiplier() {
+        return Double.valueOf(redeliveryPolicy().getBackOffMultiplier());
     }
 
     public Long getInitialRedeliveryDelay() {

Modified: activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java?rev=812941&r1=812940&r2=812941&view=diff
==============================================================================
--- activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java
(original)
+++ activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java
Wed Sep  9 13:15:15 2009
@@ -306,7 +306,7 @@
     /**
      * @return redelivery backoff multiplier
      */
-    public Short getRedeliveryBackOffMultiplier() {
+    public Double getRedeliveryBackOffMultiplier() {
         return info.getRedeliveryBackOffMultiplier();
     }
 

Modified: activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/MessageActivationSpec.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/MessageActivationSpec.java?rev=812941&r1=812940&r2=812941&view=diff
==============================================================================
--- activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/MessageActivationSpec.java
(original)
+++ activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/MessageActivationSpec.java
Wed Sep  9 13:15:15 2009
@@ -115,7 +115,7 @@
 
     String getMaxMessagesPerBatch();
 
-    short getBackOffMultiplier();
+    double getBackOffMultiplier();
 
     long getInitialRedeliveryDelay();
 

Added: activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/UnsubscribeResubscribeTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/UnsubscribeResubscribeTest.java?rev=812941&view=auto
==============================================================================
--- activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/UnsubscribeResubscribeTest.java
(added)
+++ activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/UnsubscribeResubscribeTest.java
Wed Sep  9 13:15:15 2009
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.ra;
+
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.jms.TopicSubscriber;
+import javax.resource.ResourceException;
+import javax.transaction.xa.XAException;
+
+import junit.framework.TestCase;
+import org.apache.activemq.ActiveMQConnectionFactory;
+
+/**
+ * @version $Revision$
+ */
+public class UnsubscribeResubscribeTest extends TestCase {
+
+    private static final String DEFAULT_HOST = "vm://localhost";
+
+    private ConnectionManagerAdapter connectionManager = new ConnectionManagerAdapter();
+    private ActiveMQManagedConnectionFactory managedConnectionFactory;
+    private ConnectionFactory connectionFactory;
+    private ManagedConnectionProxy connection;
+    private ActiveMQManagedConnection managedConnection;
+
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+
+        managedConnectionFactory = new ActiveMQManagedConnectionFactory();
+        managedConnectionFactory.setServerUrl(DEFAULT_HOST);
+        managedConnectionFactory.setUserName(ActiveMQConnectionFactory.DEFAULT_USER);
+        managedConnectionFactory.setPassword(ActiveMQConnectionFactory.DEFAULT_PASSWORD);
+        managedConnectionFactory.setClientid("clientId");
+
+    }
+
+    private void getConnection() throws ResourceException, JMSException {
+        connectionFactory = (ConnectionFactory)managedConnectionFactory.createConnectionFactory(connectionManager);
+        connection = (ManagedConnectionProxy)connectionFactory.createConnection();
+        managedConnection = connection.getManagedConnection();
+    }
+
+    public void testUnsubscribeResubscribe() throws ResourceException, JMSException, XAException
{
+        getConnection();
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        Topic topic = session.createTopic("topic");
+        TopicSubscriber sub = session.createDurableSubscriber(topic, "sub");
+        Message message = session.createTextMessage("text message");
+        MessageProducer producer = session.createProducer(topic);
+        producer.send(message);
+        sub.close();
+        session.unsubscribe("sub");
+        sub = session.createDurableSubscriber(topic, "sub");
+    }
+
+}
\ No newline at end of file

Propchange: activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/UnsubscribeResubscribeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/UnsubscribeResubscribeTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message