org.apache.jcs.utils.struct
Class SortedPrefArrayUnitTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.jcs.utils.struct.SortedPrefArrayUnitTest
All Implemented Interfaces:
junit.framework.Test

public class SortedPrefArrayUnitTest
extends junit.framework.TestCase

Tests the SortedPrefArray used by the recycle bin.

Author:
aaronsm

Constructor Summary
SortedPrefArrayUnitTest(String testName)
          Constructor for the TestSimpleLoad object
 
Method Summary
static void main(String[] args)
          Description of the Method
 void testEmptyTake()
          Verify that we don't get an error when taking from an empty array.
 void testEqualToGreatest_LastTwoSameSize()
          Try taking an item equal to the greatest.
 void testEqualToGreatest()
          Try taking an item equal to the greatest.
 void testLargePref()
           
 void testNullInsertion()
          Verify that we don't get a null pointer if we insert a null.
 void testNullTake()
          Verify that we don't get an npe when taking with a null
 void testSingleItemTake()
          Verify that we don't get an npe when taking from an array of only one
 void testSingleItemTakeLarger()
          Verify that we don't get an npe when taking from an array of only one
 void testSingleItemTakeLargerEmpty()
          Verify that we don't get an npe when taking from an array of none
 void testTakeEveryLastItem()
          Test taking every last item.
 void testTakeLargerThanGreatest()
          Try taking an item larger than the greatest.
 void testTakeLargestItem()
          Test taking the largest item.
 
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
 

Constructor Detail

SortedPrefArrayUnitTest

public SortedPrefArrayUnitTest(String testName)
Constructor for the TestSimpleLoad object

Parameters:
testName - Description of the Parameter
Method Detail

main

public static void main(String[] args)
Description of the Method

Parameters:
args - Description of the Parameter

testLargePref

public void testLargePref()
                   throws Exception
Throws:
Exception

testEmptyTake

public void testEmptyTake()
                   throws Exception
Verify that we don't get an error when taking from an empty array.

Throws:
Exception

testNullInsertion

public void testNullInsertion()
                       throws Exception
Verify that we don't get a null pointer if we insert a null.

Throws:
Exception

testNullTake

public void testNullTake()
                  throws Exception
Verify that we don't get an npe when taking with a null

Throws:
Exception

testSingleItemTake

public void testSingleItemTake()
                        throws Exception
Verify that we don't get an npe when taking from an array of only one

Throws:
Exception

testSingleItemTakeLarger

public void testSingleItemTakeLarger()
                              throws Exception
Verify that we don't get an npe when taking from an array of only one

Throws:
Exception

testSingleItemTakeLargerEmpty

public void testSingleItemTakeLargerEmpty()
                                   throws Exception
Verify that we don't get an npe when taking from an array of none

Throws:
Exception

testTakeLargestItem

public void testTakeLargestItem()
                         throws Exception
Test taking the largest item.

Throws:
Exception

testTakeEveryLastItem

public void testTakeEveryLastItem()
                           throws Exception
Test taking every last item.

Throws:
Exception

testTakeLargerThanGreatest

public void testTakeLargerThanGreatest()
Try taking an item larger than the greatest.


testEqualToGreatest_LastTwoSameSize

public void testEqualToGreatest_LastTwoSameSize()
Try taking an item equal to the greatest. Make the last two the same size


testEqualToGreatest

public void testEqualToGreatest()
Try taking an item equal to the greatest. The second to last should be smaller. This verifies the most basic funtionality.



Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.