svn commit: r714178 [3/3] - in /jakarta/jcs/trunk/src: java/org/apache/jcs/access/ java/org/apache/jcs/auxiliary/ java/org/apache/jcs/auxiliary/disk/ java/org/apache/jcs/auxiliary/disk/block/ java/org/apache/jcs/auxiliary/disk/indexed/ java/org/apache/...
[email protected] Fri, 14 Nov 2008 22:50:14 -0000
| Newsgroups | gmane.comp.jakarta.turbine.jcs.devel |
|---|---|
| Message-ID | <[email protected]> |
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java?rev=714178&r1=714177&r2=714178&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java Fri Nov 14 14:50:12 2008
@@ -29,6 +29,7 @@
import org.apache.jcs.JCS;
import org.apache.jcs.access.exception.CacheException;
+import org.apache.jcs.auxiliary.AbstractAuxiliaryCache;
import org.apache.jcs.auxiliary.AuxiliaryCache;
import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
import org.apache.jcs.engine.CacheElement;
@@ -39,6 +40,7 @@
import org.apache.jcs.engine.behavior.IElementAttributes;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
+import org.apache.jcs.engine.match.behavior.IKeyMatcher;
import org.apache.jcs.engine.stats.behavior.IStats;
/**
@@ -289,7 +291,7 @@
* @author Aaron Smuts
*/
public class MockAuxCache
- implements AuxiliaryCache
+ extends AbstractAuxiliaryCache
{
/** Don't change */
private static final long serialVersionUID = 1L;
@@ -310,9 +312,10 @@
lastUpdatedItem = null;
}
- /*
- * (non-Javadoc)
- * @see org.apache.jcs.auxiliary.AuxiliaryCache#update(org.apache.jcs.engine.behavior.ICacheElement)
+ /**
+ * @param ce
+ * @throws IOException
+ *
*/
public void update( ICacheElement ce )
throws IOException
@@ -321,14 +324,15 @@
updateCount++;
}
- /*
- * (non-Javadoc)
- * @see org.apache.jcs.auxiliary.AuxiliaryCache#get(java.io.Serializable)
+ /**
+ * @param key
+ * @return ICacheElement
+ * @throws IOException
+ *
*/
public ICacheElement get( Serializable key )
throws IOException
{
- // TODO Auto-generated method stub
return null;
}
@@ -344,14 +348,15 @@
return new HashMap();
}
- /*
- * (non-Javadoc)
- * @see org.apache.jcs.auxiliary.AuxiliaryCache#remove(java.io.Serializable)
+ /**
+ * @param key
+ * @return false
+ * @throws IOException
+ *
*/
public boolean remove( Serializable key )
throws IOException
{
- // TODO Auto-generated method stub
return false;
}
@@ -474,15 +479,17 @@
}
- /**
- * @param pattern
- * @return Map
- * @throws IOException
- */
+ public String getEventLoggingExtraInfo()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
public Map getMatching( String pattern )
throws IOException
{
- return new HashMap();
+ // TODO Auto-generated method stub
+ return null;
}
}
Copied: jakarta/jcs/trunk/src/test/org/apache/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java (from r707758, jakarta/jcs/trunk/src/test/org/apache/jcs/utils/match/KeyMatcherUtilUnitTest.java)
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java?p2=jakarta/jcs/trunk/src/test/org/apache/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java&p1=jakarta/jcs/trunk/src/test/org/apache/jcs/utils/match/KeyMatcherUtilUnitTest.java&r1=707758&r2=714178&rev=714178&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/utils/match/KeyMatcherUtilUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java Fri Nov 14 14:50:12 2008
@@ -1,11 +1,11 @@
-package org.apache.jcs.utils.match;
+package org.apache.jcs.engine.match;
import java.util.Set;
import junit.framework.TestCase;
/** Unit tests for the key matcher. */
-public class KeyMatcherUtilUnitTest
+public class KeyMatcherPatternImpllUnitTest
extends TestCase
{
/**
@@ -26,8 +26,10 @@
keyArray[i] = keyprefix1 + String.valueOf( i );
}
+ KeyMatcherPatternImpl keyMatcher = new KeyMatcherPatternImpl();
+
// DO WORK
- Set result1 = KeyMatcherUtil.getMatchingKeysFromArray( keyprefix1 + ".", keyArray );
+ Set result1 = keyMatcher.getMatchingKeysFromArray( keyprefix1 + ".", keyArray );
// VERIFY
assertEquals( "Wrong number returned 1: " + result1, numToInsertPrefix1, result1.size() );
@@ -51,8 +53,10 @@
keyArray[i] = keyprefix1 + String.valueOf( i );
}
+ KeyMatcherPatternImpl keyMatcher = new KeyMatcherPatternImpl();
+
// DO WORK
- Set result1 = KeyMatcherUtil.getMatchingKeysFromArray( keyprefix1 + "\\S+", keyArray );
+ Set result1 = keyMatcher.getMatchingKeysFromArray( keyprefix1 + "\\S+", keyArray );
// VERIFY
assertEquals( "Wrong number returned 1: " + result1, numToInsertPrefix1, result1.size() );
@@ -84,9 +88,11 @@
keyArray[i] = keyprefix2 + String.valueOf( i );
}
+ KeyMatcherPatternImpl keyMatcher = new KeyMatcherPatternImpl();
+
// DO WORK
- Set result1 = KeyMatcherUtil.getMatchingKeysFromArray( keyprefix1 + ".+", keyArray );
- Set result2 = KeyMatcherUtil.getMatchingKeysFromArray( keyprefix2 + ".+", keyArray );
+ Set result1 = keyMatcher.getMatchingKeysFromArray( keyprefix1 + ".+", keyArray );
+ Set result2 = keyMatcher.getMatchingKeysFromArray( keyprefix2 + ".+", keyArray );
// VERIFY
assertEquals( "Wrong number returned 1: " + result1, numToInsertPrefix1, result1.size() );
Propchange: jakarta/jcs/trunk/src/test/org/apache/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java
------------------------------------------------------------------------------
svn:mergeinfo =
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/engine/memory/MockMemoryCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/engine/memory/MockMemoryCache.java?rev=714178&r1=714177&r2=714178&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/engine/memory/MockMemoryCache.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/engine/memory/MockMemoryCache.java Fri Nov 14 14:50:12 2008
@@ -32,8 +32,7 @@
import org.apache.jcs.engine.stats.behavior.IStats;
/**
- * Mock implementation of a memory cache for testing things like the memory
- * shrinker.
+ * Mock implementation of a memory cache for testing things like the memory shrinker.
* <p>
* @author Aaron Smuts
*/
@@ -46,35 +45,45 @@
/** Internal map */
private HashMap map = new HashMap();
- /** The number of times waterfall was called. */
+ /** The number of times waterfall was called. */
public int waterfallCallCount = 0;
- /** The number passed to the last call of free elements. */
+ /** The number passed to the last call of free elements. */
public int lastNumberOfFreedElements = 0;
+ /**
+ * Does nothing
+ * @param cache
+ */
public void initialize( CompositeCache cache )
{
- // TODO Auto-generated method stub
+ // nothinh
}
+ /**
+ * Destroy the memory cache
+ * <p>
+ * @throws IOException
+ */
public void dispose()
throws IOException
{
- // TODO Auto-generated method stub
-
+ // nothing
}
+ /** @return size */
public int getSize()
{
return map.size();
}
+ /** @return stats */
public IStats getStatistics()
{
- // TODO Auto-generated method stub
return null;
}
+ /** @return null */
public Iterator getIterator()
{
// return
@@ -141,6 +150,10 @@
waterfallCallCount++;
}
+ /**
+ * @param ce
+ * @throws IOException
+ */
public void update( ICacheElement ce )
throws IOException
{
@@ -150,10 +163,8 @@
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jcs.engine.memory.MemoryCache#getCacheAttributes()
+ /**
+ * @return ICompositeCacheAttributes
*/
public ICompositeCacheAttributes getCacheAttributes()
{
@@ -172,18 +183,18 @@
public CompositeCache getCompositeCache()
{
- // TODO Auto-generated method stub
return null;
}
public Set getGroupKeys( String group )
{
- // TODO Auto-generated method stub
return null;
}
- /* (non-Javadoc)
- * @see org.apache.jcs.engine.memory.MemoryCache#freeElements(int)
+ /**
+ * @param numberToFree
+ * @return 0
+ * @throws IOException
*/
public int freeElements( int numberToFree )
throws IOException
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/utils/threadpool/ThreadPoolUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/utils/threadpool/ThreadPoolUnitTest.java?rev=714178&r1=714177&r2=714178&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/utils/threadpool/ThreadPoolUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/utils/threadpool/ThreadPoolUnitTest.java Fri Nov 14 14:50:12 2008
@@ -22,7 +22,7 @@
import junit.framework.TestCase;
/**
- * This test is experiemental. I'm trying to find out if the max size setting will result in the
+ * This test is experimental. I'm trying to find out if the max size setting will result in the
* removal of threads.
* <p>
* @author Aaron Smuts
@@ -62,7 +62,7 @@
try
{
//System.out.println( cnt );
- //System.out.println( "count = " + cnt + " before sleep current size = " + myPool.getPool().getPoolSize() );
+ System.out.println( "count = " + cnt + " before sleep current size = " + myPool.getPool().getPoolSize() );
Thread.sleep( 200 / cnt );
//System.out.println( "count = " + cnt + " after sleep current size = " + myPool.getPool().getPoolSize() );
}
@@ -83,5 +83,4 @@
//System.out.println( "current size again after sleep = " + pool.getPool().getPoolSize() );
assertEquals( "Pool size should have been reduced.", 4, pool.getPool().getPoolSize() );
}
-
}