net.sourceforge.jpcap.net
Class PacketEncodingTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bynet.sourceforge.jpcap.net.PacketEncodingTest
All Implemented Interfaces:
junit.framework.Test

public class PacketEncodingTest
extends junit.framework.TestCase


Constructor Summary
PacketEncodingTest(java.lang.String testName)
           
 
Method Summary
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testExtractDataAtPosition0()
          Test of extractData method with header start at position 0
 void testExtractDataAtPosition2()
          Test of extractData method with header start at position 2
 void testExtractDataNegativeLength()
          Test of extractData method with negative header length.
 void testExtractDataNegativeOffset()
          Test of extractData method with negative offset.
 void testExtractDataNullArray()
          Test of extractData method with null input array.
 void testExtractDataTooLargeLength()
          Test of extractData method with header length out of bounds.
 void testExtractDataTooLargeOffset()
          Test of extractData method with offset out of bounds.
 void testExtractHeaderAtPosition0()
          Test of extractHeader method with header start at position 0
 void testExtractHeaderAtPosition2()
          Test of extractHeader method with header start at position 2
 void testExtractHeaderNegativeLength()
          Test of extractHeader method with negative header length.
 void testExtractHeaderNegativeOffset()
          Test of extractHeader method with negative offset.
 void testExtractHeaderNullArray()
          Test of extractHeader method with null input array.
 void testExtractHeaderTooLargeLength()
          Test of extractHeader method with offset out of bounds.
 void testExtractHeaderTooLargeOffset()
          Test of extractHeader method with offset out of bounds.
 void testExtractSizedDataAtPosition0()
          Test of extractData method with header start at position 0
 void testExtractSizedDataAtPosition2()
          Test of extractData method with header start at position 0
 void testExtractSizedDataNegativeSize()
          Test of extractData method with negative size.
 void testExtractSizedDataNullArray()
          Test of extractData method with null input array.
 void testExtractSizedDataTooLargeLength()
          Test of extractData method with header length out of bounds.
 void testExtractSizedDataTooLargeOffset()
          Test of extractData method with offset out of bounds.
 void testExtractSizedDataTooLargeSize()
          Test of extractData method with header length out of bounds.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, 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
 

Constructor Detail

PacketEncodingTest

public PacketEncodingTest(java.lang.String testName)
Method Detail

main

public static void main(java.lang.String[] args)

suite

public static junit.framework.Test suite()

testExtractHeaderAtPosition0

public void testExtractHeaderAtPosition0()
Test of extractHeader method with header start at position 0


testExtractHeaderAtPosition2

public void testExtractHeaderAtPosition2()
Test of extractHeader method with header start at position 2


testExtractHeaderTooLargeOffset

public void testExtractHeaderTooLargeOffset()
Test of extractHeader method with offset out of bounds. Should return 0 length byte array


testExtractHeaderTooLargeLength

public void testExtractHeaderTooLargeLength()
Test of extractHeader method with offset out of bounds. Should return whole byte array


testExtractHeaderNegativeOffset

public void testExtractHeaderNegativeOffset()
Test of extractHeader method with negative offset.


testExtractHeaderNegativeLength

public void testExtractHeaderNegativeLength()
Test of extractHeader method with negative header length. Should return 0 length byte array


testExtractHeaderNullArray

public void testExtractHeaderNullArray()
Test of extractHeader method with null input array. Should return null byte array


testExtractDataAtPosition0

public void testExtractDataAtPosition0()
Test of extractData method with header start at position 0


testExtractDataAtPosition2

public void testExtractDataAtPosition2()
Test of extractData method with header start at position 2


testExtractDataTooLargeOffset

public void testExtractDataTooLargeOffset()
Test of extractData method with offset out of bounds. Should return 0 length byte array


testExtractDataTooLargeLength

public void testExtractDataTooLargeLength()
Test of extractData method with header length out of bounds. Should return whole byte array


testExtractDataNegativeOffset

public void testExtractDataNegativeOffset()
Test of extractData method with negative offset. Should return 0 length byte array


testExtractDataNegativeLength

public void testExtractDataNegativeLength()
Test of extractData method with negative header length. Should return 0 length byte array


testExtractDataNullArray

public void testExtractDataNullArray()
Test of extractData method with null input array. Should return null byte array


testExtractSizedDataAtPosition0

public void testExtractSizedDataAtPosition0()
Test of extractData method with header start at position 0


testExtractSizedDataAtPosition2

public void testExtractSizedDataAtPosition2()
Test of extractData method with header start at position 0


testExtractSizedDataTooLargeOffset

public void testExtractSizedDataTooLargeOffset()
Test of extractData method with offset out of bounds. Should return 0 length byte array


testExtractSizedDataTooLargeLength

public void testExtractSizedDataTooLargeLength()
Test of extractData method with header length out of bounds. Should return whole byte array


testExtractSizedDataNegativeSize

public void testExtractSizedDataNegativeSize()
Test of extractData method with negative size. Should return 0 length byte array


testExtractSizedDataTooLargeSize

public void testExtractSizedDataTooLargeSize()
Test of extractData method with header length out of bounds. Should return whole byte array


testExtractSizedDataNullArray

public void testExtractSizedDataNullArray()
Test of extractData method with null input array. Should return null byte array