org.exolab.jmscts.test.message.stream
Class StreamMessageTest
java.lang.Object
|
+--junit.framework.Assert
|
+--junit.framework.TestCase
|
+--org.exolab.jmscts.core.JMSTestCase
|
+--org.exolab.jmscts.core.AbstractConnectionFactoryTestCase
|
+--org.exolab.jmscts.core.AbstractConnectionTestCase
|
+--org.exolab.jmscts.core.AbstractSessionTestCase
|
+--org.exolab.jmscts.core.AbstractMessageTestCase
|
+--org.exolab.jmscts.test.message.stream.StreamMessageTest
- All Implemented Interfaces:
- ConnectionFactoryTestCase, ConnectionTestCase, JMSTest, MessageTestCase, MessageValues, PropertyValues, SessionTestCase, junit.framework.Test
- public class StreamMessageTest
- extends AbstractMessageTestCase
- implements MessageValues
This class tests the StreamMessage
message type
- Version:
- $Revision: 1.7 $
- Author:
- Tim Anderson
- See Also:
StreamMessage
Constructor Summary |
StreamMessageTest(java.lang.String name)
Create an instance of this class for a specific test case |
Method Summary |
MessagePopulator |
getMessagePopulator()
Get the message populator. |
static junit.framework.Test |
suite()
Sets up the test suite |
void |
testConversion()
Verifies valid conversions for all types except String
(this is handled by testStringConversion()). |
void |
testFullReadBytes()
Verifies that readBytes can read an entire byte array, and returns -1
on the subsequent call. |
void |
testIncrementalReadBytes()
Verifies that readBytes can read be invoked incrementally. |
void |
testInvalidNumericConversion()
Verifies invalid string to numeric conversions. |
void |
testInvalidObject()
Verifies that an invalid object being written using the writeObject()
method throws MessageFormatException |
void |
testNull()
Verifies null conversions. |
void |
testPartialReadBytes()
Verifies that invoking any read method when a partial byte array has
been read throws MessageFormatException . |
void |
testReadBytesClearBody1()
Verifies that invoking readBytes() followed by clearBody() followed by
readBytes() returns the expected result, when the
first readBytes() call has not completed reading the array field. |
void |
testReadBytesClearBody2()
Verifies that invoking readBytes() followed by clearBody() followed by
readObject() returns the expected result, when the readBytes() call has
not completed reading the array field. |
void |
testReadBytesReset1()
Verifies that invoking readBytes() followed by reset() followed by
readBytes() returns the expected result, when the
first readBytes() call has not completed reading the array field. |
void |
testReadBytesReset2()
Verifies that invoking readBytes() followed by reset() followed by
readObject() returns the expected result, when the readBytes() call has
not completed reading the array field. |
void |
testReadFailure()
Verifies that if a read method throws MessageFormatException
the current position of the read pointer is not
incremented, and that a subsequent read is capable of recovering from
the exception by re-reading the data as a different type. |
void |
testReadWriteBytes()
Verifies that readBytes returns that written by the writeBytes
methods. |
void |
testStringConversion()
Verifies valid string conversions. |
void |
testWriteBytes()
Verifies that invoking writeBytes does not modify the source array |
void |
testWriteObject()
Verifies that writeObject() can handle all supported types |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface junit.framework.Test |
countTestCases, run |
StreamMessageTest
public StreamMessageTest(java.lang.String name)
- Create an instance of this class for a specific test case
- Parameters:
name
- the name of test case
suite
public static junit.framework.Test suite()
- Sets up the test suite
- Returns:
- an instance of this class that may be run by
JMSTestRunner
getMessagePopulator
public MessagePopulator getMessagePopulator()
- Get the message populator. This implementation always returns null
- Overrides:
getMessagePopulator
in class AbstractMessageTestCase
- Returns:
- null
testReadFailure
public void testReadFailure()
throws java.lang.Exception
- Verifies that if a read method throws MessageFormatException
the current position of the read pointer is not
incremented, and that a subsequent read is capable of recovering from
the exception by re-reading the data as a different type.
- Throws:
java.lang.Exception
- for any error
testConversion
public void testConversion()
throws java.lang.Exception
- Verifies valid conversions for all types except String
(this is handled by testStringConversion()).
- Throws:
java.lang.Exception
- for any error
testStringConversion
public void testStringConversion()
throws java.lang.Exception
- Verifies valid string conversions.
- Throws:
java.lang.Exception
- for any error
testInvalidNumericConversion
public void testInvalidNumericConversion()
throws java.lang.Exception
- Verifies invalid string to numeric conversions.
- Throws:
java.lang.Exception
- for any error
testNull
public void testNull()
throws java.lang.Exception
- Verifies null conversions.
- Throws:
java.lang.Exception
- for any error
testWriteObject
public void testWriteObject()
throws java.lang.Exception
- Verifies that writeObject() can handle all supported types
- Throws:
java.lang.Exception
- for any error
testInvalidObject
public void testInvalidObject()
throws java.lang.Exception
- Verifies that an invalid object being written using the writeObject()
method throws
MessageFormatException
- Throws:
java.lang.Exception
- for any error
testReadWriteBytes
public void testReadWriteBytes()
throws java.lang.Exception
- Verifies that readBytes returns that written by the writeBytes
methods.
- Throws:
java.lang.Exception
- for any error
testReadBytesReset1
public void testReadBytesReset1()
throws java.lang.Exception
- Verifies that invoking readBytes() followed by reset() followed by
readBytes() returns the expected result, when the
first readBytes() call has not completed reading the array field. This
verifies that reset() correctly resets the state of the message.
- Throws:
java.lang.Exception
- for any error
testReadBytesReset2
public void testReadBytesReset2()
throws java.lang.Exception
- Verifies that invoking readBytes() followed by reset() followed by
readObject() returns the expected result, when the readBytes() call has
not completed reading the array field. This verifies that reset()
correctly resets the state of the message.
- Throws:
java.lang.Exception
- for any error
testReadBytesClearBody1
public void testReadBytesClearBody1()
throws java.lang.Exception
- Verifies that invoking readBytes() followed by clearBody() followed by
readBytes() returns the expected result, when the
first readBytes() call has not completed reading the array field. This
verifies that clearBody() correctly clears the state of the message.
- Throws:
java.lang.Exception
- for any error
testReadBytesClearBody2
public void testReadBytesClearBody2()
throws java.lang.Exception
- Verifies that invoking readBytes() followed by clearBody() followed by
readObject() returns the expected result, when the readBytes() call has
not completed reading the array field. This ensures that clearBody()
correctly clears the state of the message.
- Throws:
java.lang.Exception
- for any error
testWriteBytes
public void testWriteBytes()
throws java.lang.Exception
- Verifies that invoking writeBytes does not modify the source array
- Throws:
java.lang.Exception
- for any error
testFullReadBytes
public void testFullReadBytes()
throws java.lang.Exception
- Verifies that readBytes can read an entire byte array, and returns -1
on the subsequent call.
- Throws:
java.lang.Exception
- for any error
testIncrementalReadBytes
public void testIncrementalReadBytes()
throws java.lang.Exception
- Verifies that readBytes can read be invoked incrementally.
- Throws:
java.lang.Exception
- for any error
testPartialReadBytes
public void testPartialReadBytes()
throws java.lang.Exception
- Verifies that invoking any read method when a partial byte array has
been read throws
MessageFormatException
.
- Throws:
java.lang.Exception
- for any error
Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.