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

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

public class BlockDiskCacheSameRegionConcurrentUnitTest
extends junit.framework.TestCase

Test which exercises the block disk cache. Runs three threads against the same region.


Constructor Summary
BlockDiskCacheSameRegionConcurrentUnitTest(String testName)
          Constructor for the TestDiskCache object.
 
Method Summary
static void main(String[] args)
          Main method passes this test to the text test runner.
 void runTestForRegion(String region, int start, int end)
          Adds items to cache, gets them, and removes them.
 void setUp()
          Test setup.
static junit.framework.Test suite()
          A unit test suite for JUnit
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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

BlockDiskCacheSameRegionConcurrentUnitTest

public BlockDiskCacheSameRegionConcurrentUnitTest(String testName)
Constructor for the TestDiskCache object.

Parameters:
testName -
Method Detail

main

public static void main(String[] args)
                 throws InterruptedException
Main method passes this test to the text test runner.

Parameters:
args -
Throws:
InterruptedException

suite

public static junit.framework.Test suite()
A unit test suite for JUnit

Returns:
The test suite

setUp

public void setUp()
           throws Exception
Test setup. Sets the config name and clears the region.

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

runTestForRegion

public void runTestForRegion(String region,
                             int start,
                             int end)
                      throws Exception
Adds items to cache, gets them, and removes them. The item count is more than the size of the memory cache, so items should spool to disk.

Parameters:
region - Name of the region to access
start -
end -
Throws:
Exception - If an error occurs


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