activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r387470 - in /incubator/activemq/trunk: activemq-core/src/main/java/org/apache/activemq/command/ activemq-optional/src/test/java/org/apache/activemq/transport/http/
Date Tue, 21 Mar 2006 09:37:14 GMT
Author: aco
Date: Tue Mar 21 01:37:12 2006
New Revision: 387470

URL: http://svn.apache.org/viewcvs?rev=387470&view=rev
Log:
- Fix message serialization problem using xstream.
- Added some more http test cases.

Added:
    incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java
    incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java
Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/Message.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/Message.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/Message.java?rev=387470&r1=387469&r2=387470&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/Message.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/Message.java
Tue Mar 21 01:37:12 2006
@@ -46,9 +46,9 @@
     protected ActiveMQDestination originalDestination;
     protected TransactionId originalTransactionId;
 
-    protected ProducerId producerId;    
-    protected ActiveMQDestination destination;    
-    protected TransactionId transactionId;    
+    protected ProducerId producerId;
+    protected ActiveMQDestination destination;
+    protected TransactionId transactionId;
     
     protected long expiration;
     protected long timestamp;
@@ -68,20 +68,21 @@
     protected ByteSequence marshalledProperties;
     protected DataStructure dataStructure;
     protected int redeliveryCounter;
-    
-    protected transient int size;    
-    protected transient HashMap properties;
-    protected transient boolean readOnlyProperties = false;
-    protected transient boolean readOnlyBody = false;
+
+    protected int size;
+    protected HashMap properties;
+    protected boolean readOnlyProperties = false;
+    protected boolean readOnlyBody = false;
     protected transient boolean recievedByDFBridge = false;
 
-    private BrokerId [] brokerPath;
     private transient short referenceCount;
     private transient ActiveMQConnection connection;
     private transient org.apache.activemq.broker.region.Destination regionDestination;
-    private WireFormat cachedWireFormat;
-    private ByteSequence cachedWireFormatData;
-    
+    private transient WireFormat cachedWireFormat;
+    private transient ByteSequence cachedWireFormatData;
+
+    private BrokerId [] brokerPath;
+
     abstract public Message copy();
     
     protected void copy(Message copy) {
@@ -104,10 +105,12 @@
         copy.groupID = groupID;
         copy.userID = userID;
         copy.groupSequence = groupSequence;
+
         if( properties!=null )
             copy.properties = new HashMap(properties);
         else
             copy.properties = properties;
+
         copy.content = content;
         copy.marshalledProperties = marshalledProperties;
         copy.dataStructure = dataStructure;

Added: incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java?rev=387470&view=auto
==============================================================================
--- incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java
(added)
+++ incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java
Tue Mar 21 01:37:12 2006
@@ -0,0 +1,56 @@
+/**
+ *
+ * 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.transport.http;
+
+import org.apache.activemq.JmsDurableTopicSendReceiveTest;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
+
+public class HttpJmsDurableTopicSendReceiveTest extends JmsDurableTopicSendReceiveTest {
+    protected BrokerService broker;
+
+    protected void setUp() throws Exception {
+        if (broker == null) {
+            broker = createBroker();
+            broker.start();
+        }
+        super.setUp();
+    }
+
+    protected void tearDown() throws Exception {
+        super.tearDown();
+        if (broker != null) {
+            broker.stop();
+        }
+    }
+
+    protected ActiveMQConnectionFactory createConnectionFactory() {
+        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(getBrokerURL());
+        return connectionFactory;
+    }
+
+    protected String getBrokerURL() {
+        return "http://localhost:8161";
+    }
+
+    protected BrokerService createBroker() throws Exception {
+        BrokerService answer = new BrokerService();
+        answer.setPersistent(false);
+        answer.addConnector(getBrokerURL());
+        return answer;
+    }
+}

Added: incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java?rev=387470&view=auto
==============================================================================
--- incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java
(added)
+++ incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java
Tue Mar 21 01:37:12 2006
@@ -0,0 +1,38 @@
+/**
+ *
+ * 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.transport.http;
+
+import org.apache.activemq.broker.BrokerService;
+
+import javax.jms.DeliveryMode;
+
+public class HttpPersistentSendAndReceiveTest extends HttpJmsSendAndReceiveTest {
+    protected BrokerService broker;
+
+    protected void setUp() throws Exception {
+        this.topic = false;
+        this.deliveryMode = DeliveryMode.PERSISTENT;
+        super.setUp();
+    }
+
+    protected BrokerService createBroker() throws Exception {
+        BrokerService answer = new BrokerService();
+        answer.setPersistent(true);
+        answer.addConnector(getBrokerURL());
+        return answer;
+    }
+}



Mime
View raw message