ARTEMIS-3027 Fixing tests after some large messages changes

This commit is contained in:
Clebert Suconic 2020-12-14 15:19:10 -05:00
parent e9b188e7a4
commit 3b0fa74970
3 changed files with 14 additions and 2 deletions

View File

@ -141,6 +141,7 @@ public class AMQPLargeMessage extends AMQPMessage implements LargeServerMessage
largeBody = new LargeBody(this, copy.largeBody.getStorageManager(), fileCopy);
largeBody.setBodySize(copy.largeBody.getStoredBodySize());
this.storageManager = copy.largeBody.getStorageManager();
this.reencoded = copy.reencoded;
setMessageID(newID);
}

View File

@ -229,6 +229,17 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
protected AMQPMessage(AMQPMessage copy) {
this(copy.messageFormat, copy.extraProperties, copy.coreMessageObjectPools);
this.headerPosition = copy.headerPosition;
this.encodedHeaderSize = copy.encodedHeaderSize;
this.deliveryAnnotationsPosition = copy.deliveryAnnotationsPosition;
this.encodedDeliveryAnnotationsSize = copy.encodedDeliveryAnnotationsSize;
this.messageAnnotationsPosition = copy.messageAnnotationsPosition;
this.propertiesPosition = copy.propertiesPosition;
this.applicationPropertiesPosition = copy.applicationPropertiesPosition;
this.remainingBodyPosition = copy.remainingBodyPosition;
this.applicationProperties = copy.applicationProperties;
this.messageDataScanned = copy.messageDataScanned;
}
protected AMQPMessage(long messageFormat) {
@ -469,6 +480,7 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
}
protected ApplicationProperties lazyDecodeApplicationProperties() {
ensureMessageDataScanned();
if (applicationProperties != null || applicationPropertiesPosition == VALUE_NOT_PRESENT) {
return applicationProperties;
}

View File

@ -713,8 +713,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport {
final Queue queueViewAfterRestart = getProxyToQueue(getQueueName());
Wait.assertEquals(2, queueViewAfterRestart::getMessageCount);
Thread.sleep(1000);
Wait.assertTrue(server::isActive);
linkedListIterator = queueViewAfterRestart.iterator();
count = 0;