apply patch from https://issues.apache.org/jira/browse/AMQ-3067 with thanks and additional test

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1041351 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2010-12-02 12:41:58 +00:00
parent 7d5494258b
commit 78a54c9353
2 changed files with 3 additions and 0 deletions

View File

@ -60,6 +60,7 @@ public class ActiveMQBlobMessage extends ActiveMQMessage implements BlobMessage
copy.setMimeType(getMimeType());
copy.setDeletedByBroker(isDeletedByBroker());
copy.setBlobUploader(getBlobUploader());
copy.setName(getName());
}
public byte getDataStructureType() {

View File

@ -50,6 +50,7 @@ public class FTPBlobTest extends FTPTestSupport {
MessageProducer producer = session.createProducer(destination);
MessageConsumer consumer = session.createConsumer(destination);
BlobMessage message = session.createBlobMessage(file);
message.setName("fileName");
producer.send(message);
Thread.sleep(1000);
@ -58,6 +59,7 @@ public class FTPBlobTest extends FTPTestSupport {
Message msg = consumer.receive(1000);
Assert.assertTrue(msg instanceof ActiveMQBlobMessage);
assertEquals("name is correct", "fileName", ((ActiveMQBlobMessage)msg).getName());
InputStream input = ((ActiveMQBlobMessage) msg).getInputStream();
StringBuilder b = new StringBuilder();
int i = input.read();