/** * Randomly adds items to cache, gets them, and removes them. The range * count is more than the size of the memory cache, so items should spool to * disk. * <p> * @param region * Name of the region to access * @param range * @param numOps * @param testNum * * @throws Exception * If an error occurs */ public void runTestForRegion( String region, int range, int numOps, int testNum ) throws Exception { // run a rondom operation test to detect deadlocks TestCacheAccess tca = new TestCacheAccess( "/TestBlockDiskCacheCon.ccf" ); tca.setRegion( region ); tca.random( range, numOps ); // make sure a simple put then get works // this may fail if the other tests are flooding the disk cache CacheAccess<String, String> jcs = JCS.getInstance( region ); String key = "testKey" + testNum; String data = "testData" + testNum; jcs.put( key, data ); String value = jcs.get( key ); assertEquals( data, value ); }
/** * Randomly adds items to cache, gets them, and removes them. The range * count is more than the size of the memory cache, so items should spool to * disk. * <p> * @param region * Name of the region to access * @param range * @param numOps * @param testNum * * @throws Exception * If an error occurs */ public void runTestForRegion( String region, int range, int numOps, int testNum ) throws Exception { // run a rondom operation test to detect deadlocks TestCacheAccess tca = new TestCacheAccess( "/TestBlockDiskCacheCon.ccf" ); tca.setRegion( region ); tca.random( range, numOps ); // make sure a simple put then get works // this may fail if the other tests are flooding the disk cache CacheAccess<String, String> jcs = JCS.getInstance( region ); String key = "testKey" + testNum; String data = "testData" + testNum; jcs.put( key, data ); String value = jcs.get( key ); assertEquals( data, value ); }