org.jivesoftware.smackx.bytestreams.ibb
Class InBandBytestreamSessionMessageTest

java.lang.Object
  extended by org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamSessionMessageTest

public class InBandBytestreamSessionMessageTest
extends java.lang.Object

Test for InBandBytestreamSession.

Tests sending data encapsulated in message stanzas.

Author:
Henning Staib

Constructor Summary
InBandBytestreamSessionMessageTest()
           
 
Method Summary
 void setup()
          Initialize fields used in the tests.
 void shouldReadAllReceivedData1()
          Test the input stream read(byte[], int, int) method.
 void shouldReadAllReceivedData2()
          Test the input stream read() method.
 void shouldSendCloseRequestIfInvalidSequenceReceived()
          If a data packet is received out of order the session should be closed.
 void shouldSendNothingOnSuccessiveCallsToFlush()
          Test successive calls to the output stream flush() method.
 void shouldSendThirtyDataPackets()
          Test the output stream flush() method.
 void shouldSendThreeDataPackets1()
          Test the output stream write(byte[]) method.
 void shouldSendThreeDataPackets2()
          Test the output stream write(byte) method.
 void shouldSendThreeDataPackets3()
          Test the output stream write(byte[], int, int) method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InBandBytestreamSessionMessageTest

public InBandBytestreamSessionMessageTest()
Method Detail

setup

public void setup()
Initialize fields used in the tests.


shouldSendThreeDataPackets1

public void shouldSendThreeDataPackets1()
                                 throws java.lang.Exception
Test the output stream write(byte[]) method.

Throws:
java.lang.Exception - should not happen

shouldSendThreeDataPackets2

public void shouldSendThreeDataPackets2()
                                 throws java.lang.Exception
Test the output stream write(byte) method.

Throws:
java.lang.Exception - should not happen

shouldSendThreeDataPackets3

public void shouldSendThreeDataPackets3()
                                 throws java.lang.Exception
Test the output stream write(byte[], int, int) method.

Throws:
java.lang.Exception - should not happen

shouldSendThirtyDataPackets

public void shouldSendThirtyDataPackets()
                                 throws java.lang.Exception
Test the output stream flush() method.

Throws:
java.lang.Exception - should not happen

shouldSendNothingOnSuccessiveCallsToFlush

public void shouldSendNothingOnSuccessiveCallsToFlush()
                                               throws java.lang.Exception
Test successive calls to the output stream flush() method.

Throws:
java.lang.Exception - should not happen

shouldSendCloseRequestIfInvalidSequenceReceived

public void shouldSendCloseRequestIfInvalidSequenceReceived()
                                                     throws java.lang.Exception
If a data packet is received out of order the session should be closed. See XEP-0047 Section 2.2.

Throws:
java.lang.Exception - should not happen

shouldReadAllReceivedData1

public void shouldReadAllReceivedData1()
                                throws java.lang.Exception
Test the input stream read(byte[], int, int) method.

Throws:
java.lang.Exception - should not happen

shouldReadAllReceivedData2

public void shouldReadAllReceivedData2()
                                throws java.lang.Exception
Test the input stream read() method.

Throws:
java.lang.Exception - should not happen