You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by as...@apache.org on 2006/02/10 18:05:42 UTC
svn commit: r376764 - in /jakarta/jcs/trunk/src/test/org/apache/jcs/access:
SystemPropetyUnitTest.java TestCacheAccess.java
Author: asmuts
Date: Fri Feb 10 09:05:41 2006
New Revision: 376764
URL: http://svn.apache.org/viewcvs?rev=376764&view=rev
Log:
cleaning
Modified:
jakarta/jcs/trunk/src/test/org/apache/jcs/access/SystemPropetyUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/access/SystemPropetyUnitTest.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test/org/apache/jcs/access/SystemPropetyUnitTest.java?rev=376764&r1=376763&r2=376764&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/access/SystemPropetyUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/access/SystemPropetyUnitTest.java Fri Feb 10 09:05:41 2006
@@ -1,16 +1,15 @@
package org.apache.jcs.access;
+import junit.framework.TestCase;
+
import org.apache.jcs.JCS;
-import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
import org.apache.jcs.engine.control.CompositeCacheManager;
-import junit.framework.TestCase;
-
/**
+ * This test is for the system property usage in configuration values.
*
- *
* @author Aaron Smuts
- *
+ *
*/
public class SystemPropetyUnitTest
extends TestCase
@@ -18,40 +17,47 @@
/**
* Verify that we use a system property for a ${FOO} string in a value.
- * @throws Exception
- *
+ *
+ * @throws Exception
+ *
*/
- public void testSystemPropertyInValueDelimeter() throws Exception
+ public void testSystemPropertyInValueDelimeter()
+ throws Exception
{
-
+
int maxMemory = 1234;
System.getProperties().setProperty( "MY_SYSTEM_PROPERTY_DISK_DIR", "system_set" );
System.getProperties().setProperty( "MY_SYSTEM_PROPERTY_MAX_SIZE", String.valueOf( maxMemory ) );
-
+
JCS.setConfigFilename( "/TestSystemProperties.ccf" );
-
+
JCS cache = JCS.getInstance( "test1" );
- assertEquals( "We should have used the system property for the memory size", maxMemory, cache.getCacheAttributes().getMaxObjects() );
-
+ assertEquals( "We should have used the system property for the memory size", maxMemory, cache
+ .getCacheAttributes().getMaxObjects() );
+
}
-
+
/**
- * Verify that we use a system property for a ${FOO} string in a value. We define a propety in the
- * cache.ccf file, but we do not have it as a system property. The default value should be used, if one exists.
- * @throws Exception
- *
+ * Verify that we use a system property for a ${FOO} string in a value. We
+ * define a propety in the cache.ccf file, but we do not have it as a system
+ * property. The default value should be used, if one exists.
+ *
+ * @throws Exception
+ *
*/
- public void testSystemPropertyMissingInValueDelimeter() throws Exception
+ public void testSystemPropertyMissingInValueDelimeter()
+ throws Exception
{
System.getProperties().setProperty( "MY_SYSTEM_PROPERTY_DISK_DIR", "system_set" );
-
+
CompositeCacheManager mgr = CompositeCacheManager.getUnconfiguredInstance();
mgr.configure( "/TestSystemProperties.ccf" );
-
+
JCS cache = JCS.getInstance( "missing" );
// TODO check against the actual default def
- assertEquals( "We should have used the default property for the memory size", 100, cache.getCacheAttributes().getMaxObjects() );
-
+ assertEquals( "We should have used the default property for the memory size", 100, cache.getCacheAttributes()
+ .getMaxObjects() );
+
}
-
+
}
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java?rev=376764&r1=376763&r2=376764&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java Fri Feb 10 09:05:41 2006
@@ -56,7 +56,7 @@
}
/**
- * @param ccfFileName
+ * @param regionName the name of the region.
*/
public TestCacheAccess( String regionName )
{
---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org