org.apache.jcs.auxiliary.disk.indexed
Class IndexDiskCacheUnitTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.jcs.auxiliary.disk.indexed.IndexDiskCacheUnitTest
All Implemented Interfaces:
junit.framework.Test

public class IndexDiskCacheUnitTest
extends junit.framework.TestCase

Tests for common functionality.

Author:
Aaron Smuts

Constructor Summary
IndexDiskCacheUnitTest()
           
 
Method Summary
 void testBytesFreeSize()
          Verify that the data size is as expected after a remove and after a put that should use the spots.
 void testCheckForDedOverlaps_noOverlap()
          Verify that the overlap check returns true when there are no overlaps.
 void testCheckForDedOverlaps_overlaps()
          Verify that the overlap check returns false when there are overlaps.
 void testFileSize()
          Verify that the file size is as expected.
 void testGet_EventLogging_simple()
          Verify event log calls.
 void testGetMultiple_EventLogging_simple()
          Verify event log calls.
 void testProcessUpdate_SameKeyBiggerSize()
          Verify that the old slot gets in the recycle bin.
 void testProcessUpdate_SameKeySameSize()
          Verify the item makes it to disk.
 void testProcessUpdate_SameKeySmallerSize()
          Verify the item makes it to disk.
 void testProcessUpdate_Simple()
          Verify the item makes it to disk.
 void testPutGetMatching_NoWait()
          Test the basic get matching.
 void testPutGetMatching_SmallWait()
          Test the basic get matching.
 void testRecycleBin()
          Verify that we don't override the largest item.
 void testRecyleBinSize()
          Verify that items are added to the recycle bin on removal.
 void testRecyleBinUsage()
          Verify that items of the same size use recycle bin spots.
 void testRemove_EventLogging_simple()
          Verify event log calls.
 void testRemove_Group()
          Verify that group members are removed if we call remove with a group.
 void testRemove_PartialKey()
          Add some items to the disk cache and then remove them one by one.
 void testRemoveAll_EventLogging_simple()
          Verify event log calls.
 void testRemoveItems()
          Add some items to the disk cache and then remove them one by one.
 void testSimplePutAndGet()
          Simply verify that we can put items in the disk cache and retrieve them.
 void testUpdate_EventLogging_simple()
          Verify event log calls.
 void testUTF8ByteArray()
          Verify that the block disk cache can handle utf encoded strings.
 void testUTF8String()
          Verify that the block disk cache can handle utf encoded strings.
 
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

IndexDiskCacheUnitTest

public IndexDiskCacheUnitTest()
Method Detail

testSimplePutAndGet

public void testSimplePutAndGet()
                         throws IOException
Simply verify that we can put items in the disk cache and retrieve them.

Throws:
IOException

testRemoveItems

public void testRemoveItems()
                     throws IOException
Add some items to the disk cache and then remove them one by one.

Throws:
IOException

testRecycleBin

public void testRecycleBin()
                    throws IOException
Verify that we don't override the largest item.

Throws:
IOException

testCheckForDedOverlaps_noOverlap

public void testCheckForDedOverlaps_noOverlap()
Verify that the overlap check returns true when there are no overlaps.


testCheckForDedOverlaps_overlaps

public void testCheckForDedOverlaps_overlaps()
Verify that the overlap check returns false when there are overlaps.


testFileSize

public void testFileSize()
                  throws IOException,
                         InterruptedException
Verify that the file size is as expected.

Throws:
IOException
InterruptedException

testRecyleBinSize

public void testRecyleBinSize()
                       throws IOException,
                              InterruptedException
Verify that items are added to the recycle bin on removal.

Throws:
IOException
InterruptedException

testRecyleBinUsage

public void testRecyleBinUsage()
                        throws IOException,
                               InterruptedException
Verify that items of the same size use recycle bin spots. Setup the recycle bin by removing some items. Add some of the same size. Verify that the recycle count is the number added.

Throws:
IOException
InterruptedException

testBytesFreeSize

public void testBytesFreeSize()
                       throws IOException,
                              InterruptedException
Verify that the data size is as expected after a remove and after a put that should use the spots.

Throws:
IOException
InterruptedException

testRemove_PartialKey

public void testRemove_PartialKey()
                           throws IOException
Add some items to the disk cache and then remove them one by one.

Throws:
IOException

testRemove_Group

public void testRemove_Group()
                      throws IOException
Verify that group members are removed if we call remove with a group.

Throws:
IOException

testUpdate_EventLogging_simple

public void testUpdate_EventLogging_simple()
                                    throws Exception
Verify event log calls.

Throws:
Exception

testGet_EventLogging_simple

public void testGet_EventLogging_simple()
                                 throws Exception
Verify event log calls.

Throws:
Exception

testGetMultiple_EventLogging_simple

public void testGetMultiple_EventLogging_simple()
                                         throws Exception
Verify event log calls.

Throws:
Exception

testRemove_EventLogging_simple

public void testRemove_EventLogging_simple()
                                    throws Exception
Verify event log calls.

Throws:
Exception

testRemoveAll_EventLogging_simple

public void testRemoveAll_EventLogging_simple()
                                       throws Exception
Verify event log calls.

Throws:
Exception

testPutGetMatching_SmallWait

public void testPutGetMatching_SmallWait()
                                  throws Exception
Test the basic get matching.

Throws:
Exception

testPutGetMatching_NoWait

public void testPutGetMatching_NoWait()
                               throws Exception
Test the basic get matching. With no wait this will all come from purgatory.

Throws:
Exception

testUTF8String

public void testUTF8String()
                    throws Exception
Verify that the block disk cache can handle utf encoded strings.

Throws:
Exception

testUTF8ByteArray

public void testUTF8ByteArray()
                       throws Exception
Verify that the block disk cache can handle utf encoded strings.

Throws:
Exception

testProcessUpdate_Simple

public void testProcessUpdate_Simple()
                              throws IOException
Verify the item makes it to disk.

Throws:
IOException

testProcessUpdate_SameKeySameSize

public void testProcessUpdate_SameKeySameSize()
                                       throws IOException
Verify the item makes it to disk.

Throws:
IOException

testProcessUpdate_SameKeySmallerSize

public void testProcessUpdate_SameKeySmallerSize()
                                          throws IOException
Verify the item makes it to disk.

Throws:
IOException

testProcessUpdate_SameKeyBiggerSize

public void testProcessUpdate_SameKeyBiggerSize()
                                         throws IOException
Verify that the old slot gets in the recycle bin.

Throws:
IOException


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