MessageConsumer cons = sess.createConsumer(queue);
conn.start();
StreamMessage msg = sess.createStreamMessage();
msg.writeInt(1);
msg.writeInt(2);
msg.writeInt(3);
StreamMessage received = (StreamMessage)sendAndConsumeMessage(msg, prod, cons);
Assert.assertNotNull(received);
assertEquals(1, received.readObject());
assertEquals(2, received.readObject());
assertEquals(3, received.readObject());
try
{
received.readObject();
fail("Should throw exception");
}
catch (MessageEOFException e)
{
//Ok
}
try
{
received.readBoolean();
fail("Should throw exception");
}
catch (MessageEOFException e)
{
//Ok
}
try
{
received.readByte();
fail("Should throw exception");
}
catch (MessageEOFException e)
{
//Ok
}
try
{
received.readChar();
fail("Should throw exception");
}
catch (MessageEOFException e)
{
//Ok
}
try
{
received.readDouble();
fail("Should throw exception");
}
catch (MessageEOFException e)
{
//Ok
}
try
{
received.readFloat();
fail("Should throw exception");
}
catch (MessageEOFException e)
{
//Ok
}
try
{
received.readInt();
fail("Should throw exception");
}
catch (MessageEOFException e)
{
//Ok
}
try
{
received.readLong();
fail("Should throw exception");
}
catch (MessageEOFException e)
{
//Ok
}
try
{
received.readShort();
fail("Should throw exception");
}
catch (MessageEOFException e)
{
//Ok
}
try
{
received.readString();
fail("Should throw exception");
}
catch (MessageEOFException e)
{