Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 63384 invoked from network); 21 Mar 2006 09:37:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Mar 2006 09:37:39 -0000 Received: (qmail 30429 invoked by uid 500); 21 Mar 2006 09:37:39 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 30386 invoked by uid 500); 21 Mar 2006 09:37:38 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 30376 invoked by uid 99); 21 Mar 2006 09:37:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Mar 2006 01:37:38 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 21 Mar 2006 01:37:37 -0800 Received: (qmail 63254 invoked by uid 65534); 21 Mar 2006 09:37:16 -0000 Message-ID: <20060321093716.63242.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: activemq-commits@geronimo.apache.org From: aco@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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; + } +}