mirror of https://github.com/apache/activemq.git
Revert "AMQ-7291 - allow setting properties after clearProperties for BytesMessage, closes #420"
This reverts commit 503416a001
.
This commit is contained in:
parent
bbb73ec3fc
commit
6355f507c3
|
@ -912,6 +912,12 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setObjectProperty(String name, Object value) throws JMSException {
|
||||
initializeWriting();
|
||||
super.setObjectProperty(name, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + " ActiveMQBytesMessage{ " + "bytesOut = " + bytesOut + ", dataOut = " + dataOut + ", dataIn = " + dataIn + " }";
|
||||
|
|
|
@ -269,30 +269,6 @@ public class ActiveMQBytesMessageTest extends TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
public void testClearProperties() throws Exception {
|
||||
ActiveMQBytesMessage bytesMessage = new ActiveMQBytesMessage();
|
||||
bytesMessage.setIntProperty("one", 1);
|
||||
// simulate send
|
||||
bytesMessage.onSend();
|
||||
|
||||
assertEquals(1, bytesMessage.getIntProperty("one"));
|
||||
assertTrue(bytesMessage.isReadOnlyProperties());
|
||||
|
||||
try {
|
||||
bytesMessage.setIntProperty("two", 2);
|
||||
fail("should have thrown b/c readonly");
|
||||
} catch (MessageNotWriteableException expected) {
|
||||
}
|
||||
|
||||
// allow writing new properties
|
||||
bytesMessage.clearProperties();
|
||||
assertFalse(bytesMessage.propertyExists("one"));
|
||||
assertFalse(bytesMessage.isReadOnlyProperties());
|
||||
|
||||
bytesMessage.setIntProperty("two", 2);
|
||||
assertEquals(2, bytesMessage.getIntProperty("two"));
|
||||
}
|
||||
|
||||
public void testReset() throws JMSException {
|
||||
ActiveMQBytesMessage message = new ActiveMQBytesMessage();
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue