org.apache.jcs.auxiliary.disk.block
Class BlockDiskUnitTest

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

public class BlockDiskUnitTest
extends junit.framework.TestCase

Test for the disk access layer of the Block Disk Cache.

Author:
Aaron Smuts

Constructor Summary
BlockDiskUnitTest()
          Creates the base directory
 
Method Summary
 void testCalculateBlocksNeededDouble()
          Verify that it says we need two blocks if the total size will fit.
 void testWrite_128BlockElement()
          Test writing an element that takes 128 blocks.
 void testWrite_DoubleBlockElement()
          Test writing an element that takes two blocks.
 void testWrite_NullBlockElement()
          Test writing a null object within a single block size.
 void testWrite_SingleBlockElement()
          Test writing an element within a single block size.
 void testWrite_TwoSingleBlockElements()
          Test writing two elements that each fit within a single block size.
 void testWriteAndRead_BigString()
          Verify that the block disk can handle a big string.
 void testWriteAndRead_BigString2()
          Verify that the block disk can handle a big string.
 void testWriteAndRead_SingleBlockElement()
          Test writing and reading an element within a single block size.
 void testWriteAndReadMultipleMultiBlockElement_setSize()
          Test writing and reading elements that do not fit within a single block.
 void testWriteAndReadMultipleMultiBlockElement()
          Test writing and reading elements that do not fit within a single block.
 
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

BlockDiskUnitTest

public BlockDiskUnitTest()
Creates the base directory

Method Detail

testWrite_NullBlockElement

public void testWrite_NullBlockElement()
                                throws Exception
Test writing a null object within a single block size.

Throws:
Exception

testWrite_SingleBlockElement

public void testWrite_SingleBlockElement()
                                  throws Exception
Test writing an element within a single block size.

Throws:
Exception

testWriteAndRead_SingleBlockElement

public void testWriteAndRead_SingleBlockElement()
                                         throws Exception
Test writing and reading an element within a single block size.

Throws:
Exception

testWrite_TwoSingleBlockElements

public void testWrite_TwoSingleBlockElements()
                                      throws Exception
Test writing two elements that each fit within a single block size.

Throws:
Exception

testCalculateBlocksNeededDouble

public void testCalculateBlocksNeededDouble()
                                     throws Exception
Verify that it says we need two blocks if the total size will fit.

Throws:
Exception

testWrite_DoubleBlockElement

public void testWrite_DoubleBlockElement()
                                  throws Exception
Test writing an element that takes two blocks.

Throws:
Exception

testWrite_128BlockElement

public void testWrite_128BlockElement()
                               throws Exception
Test writing an element that takes 128 blocks. There was a byte in a for loop that limited the number to 127. I fixed this.

Throws:
Exception

testWriteAndReadMultipleMultiBlockElement

public void testWriteAndReadMultipleMultiBlockElement()
                                               throws Exception
Test writing and reading elements that do not fit within a single block.

Throws:
Exception

testWriteAndReadMultipleMultiBlockElement_setSize

public void testWriteAndReadMultipleMultiBlockElement_setSize()
                                                       throws Exception
Test writing and reading elements that do not fit within a single block.

Throws:
Exception

testWriteAndRead_BigString

public void testWriteAndRead_BigString()
                                throws Exception
Verify that the block disk can handle a big string.

Throws:
Exception

testWriteAndRead_BigString2

public void testWriteAndRead_BigString2()
                                 throws Exception
Verify that the block disk can handle a big string.

Throws:
Exception


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