- Fix message serialization problem using xstream.

- Added some more http test cases.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@387470 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian T. Co 2006-03-21 09:37:12 +00:00
parent cb3f774613
commit 15101c7fbb
3 changed files with 109 additions and 12 deletions

View File

@ -69,18 +69,19 @@ abstract public class Message extends BaseCommand implements MarshallAware, Mess
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();
@ -104,10 +105,12 @@ abstract public class Message extends BaseCommand implements MarshallAware, Mess
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;

View File

@ -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;
}
}

View File

@ -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;
}
}