colus 02/01/08 06:19:08
Modified: src/scratchpad/org/apache/avalon/excalibur/cache/test
LRUCacheTestCase.java
Added: src/scratchpad/org/apache/avalon/excalibur/cache/test
AbstractCacheStoreTestCase.java
AbstractCacheTestCase.java
MemoryCacheStoreTestCase.java
Log:
Added more TestCases.
Revision Changes Path
1.4 +6 -2
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/cache/test/LRUCacheTestCase.java
Index: LRUCacheTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/cache/test/LRUCacheTestCase.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LRUCacheTestCase.java 11 Dec 2001 09:53:33 -0000 1.3
+++ LRUCacheTestCase.java 8 Jan 2002 14:19:08 -0000 1.4
@@ -7,7 +7,6 @@
*/
package org.apache.avalon.excalibur.cache.test;
-import junit.framework.TestCase;
import org.apache.avalon.excalibur.cache.Cache;
import org.apache.avalon.excalibur.cache.LRUCache;
@@ -17,11 +16,16 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Eung-ju Park</a>
*/
public class LRUCacheTestCase
- extends TestCase
+ extends AbstractCacheTestCase
{
public LRUCacheTestCase( final String name )
{
super( name );
+ }
+
+ protected void setUp()
+ {
+ m_cache = new LRUCache( 10 );
}
private static final String KEY1 = "key 1";
1.1
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/cache/test/AbstractCacheStoreTestCase.java
Index: AbstractCacheStoreTestCase.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.excalibur.cache.test;
import org.apache.avalon.excalibur.cache.CacheStore;
import junit.framework.TestCase;
/**
* TestCase for CacheStore.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Eung-ju Park</a>
*/
public class AbstractCacheStoreTestCase
extends TestCase
{
protected CacheStore m_store;
public AbstractCacheStoreTestCase( final String name )
{
super( name );
}
public void testNullValue()
{
m_store.put( "KEY", null );
assertTrue( m_store.containsKey( "KEY" ) );
assertEquals( 1, m_store.size() );
}
}
1.1
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/cache/test/AbstractCacheTestCase.java
Index: AbstractCacheTestCase.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.excalibur.cache.test;
import org.apache.avalon.excalibur.cache.Cache;
import junit.framework.TestCase;
/**
* TestCase for Cache.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Eung-ju Park</a>
*/
public class AbstractCacheTestCase
extends TestCase
{
protected Cache m_cache;
public AbstractCacheTestCase( final String name )
{
super( name );
}
public void testNullValue()
{
m_cache.put( "KEY", null );
assertTrue( m_cache.containsKey( "KEY" ) );
assertEquals( 1, m_cache.size() );
}
}
1.1
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/cache/test/MemoryCacheStoreTestCase.java
Index: MemoryCacheStoreTestCase.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.excalibur.cache.test;
import org.apache.avalon.excalibur.cache.MemoryCacheStore;
import junit.framework.TestCase;
/**
* TestCase for MemoryCacheStore.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Eung-ju Park</a>
*/
public class MemoryCacheStoreTestCase
extends AbstractCacheStoreTestCase
{
public MemoryCacheStoreTestCase( final String name )
{
super( name );
}
protected void setUp()
{
m_store = new MemoryCacheStore( 10 );
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>