public void TestReadOnlyBody()
{
ActiveMQTextMessage textMessage = new ActiveMQTextMessage();
textMessage.Text = "test";
textMessage.ReadOnlyBody = true;
try
{
Assert.IsTrue(textMessage.Text.Length > 0);
}
catch(MessageNotReadableException)
{
Assert.Fail("should be readable");
}
try
{
textMessage.Text = "test";
Assert.Fail("should throw exception");
}
catch(MessageNotWriteableException)
{
}
}