[jboss-cvs] CacheBenchFwk/src/org/cachebench/tests ...
Manik Surtani
manik at jboss.org
Tue Mar 13 10:50:46 EDT 2007
User: msurtani
Date: 07/03/13 10:50:46
Modified: src/org/cachebench/tests CacheTest.java
SimpleTest.java TransientTest.java
AssociationsTest.java SubclassTest.java
PrimitiveTest.java StaticsTest.java
CustomClassTest.java
Log:
wc
Revision Changes Path
1.3 +12 -11 CacheBenchFwk/src/org/cachebench/tests/CacheTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheTest.java
===================================================================
RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/tests/CacheTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- CacheTest.java 27 Dec 2005 05:30:13 -0000 1.2
+++ CacheTest.java 13 Mar 2007 14:50:46 -0000 1.3
@@ -12,6 +12,7 @@
{
/**
* Performs the benchmarking on the given tese.
+ *
* @param testName The name of the test to be performed.
* @param cache The Cache wrapper for the product under bench-mark.
* @param testCaseName The name of the test case.
@@ -19,5 +20,5 @@
* @return The result of the test.
* @throws Exception When the cache opertations blow up an error.
*/
- public TestResult doTest( String testName, CacheWrapper cache, String testCaseName, int sampleSize ) throws Exception;
+ public TestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize) throws Exception;
}
1.5 +123 -123 CacheBenchFwk/src/org/cachebench/tests/SimpleTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SimpleTest.java
===================================================================
RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/tests/SimpleTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- SimpleTest.java 3 Jan 2006 06:40:36 -0000 1.4
+++ SimpleTest.java 13 Mar 2007 14:50:46 -0000 1.5
@@ -1,8 +1,5 @@
package org.cachebench.tests;
-import java.io.Serializable;
-import java.util.Date;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;
@@ -10,6 +7,9 @@
import org.cachebench.SerializableCacheWrapper;
import org.cachebench.TestResult;
+import java.io.Serializable;
+import java.util.Date;
+
/**
* @author Manik Surtani (manik at surtani.org)
@@ -22,17 +22,17 @@
protected TestResult performTestWithObjectType(String testCaseName, CacheWrapper cache, Class valueClass, String testName, int sampleSize) throws Exception
{
TestResult result = new TestResult();
- result.setTestName( testCaseName );
- result.setTestTime( new Date() );
- result.setTestType( testName );
+ result.setTestName(testCaseName);
+ result.setTestTime(new Date());
+ result.setTestType(testName);
logger.info("Performing PUTs");
- DescriptiveStatistics putStats = doPuts( cache, valueClass, sampleSize );
+ DescriptiveStatistics putStats = doPuts(cache, valueClass, sampleSize);
logger.info("Performing GETs");
- DescriptiveStatistics getStats = doGets( cache, sampleSize );
+ DescriptiveStatistics getStats = doGets(cache, sampleSize);
- result.setGetData( getStats );
- result.setPutData( putStats );
+ result.setGetData(getStats);
+ result.setPutData(putStats);
result.setTestPassed(true); // The test is passed. The report would make use of this attribute.
return result;
@@ -45,13 +45,13 @@
*/
private DescriptiveStatistics doGets(CacheWrapper cache, int sampleSize) throws Exception
{
- logger.debug("Inside doGets for : "+ cache);
+ logger.debug("Inside doGets for : " + cache);
String key = "baseKey";
Object value = null;
DescriptiveStatistics stats = DescriptiveStatistics.newInstance();
boolean useSerializable = cache instanceof SerializableCacheWrapper;
- for (int i=0; i<sampleSize; i++)
+ for (int i = 0; i < sampleSize; i++)
{
if (!useSerializable)
{
@@ -60,7 +60,7 @@
cache.get(key + i);
long statValue = (System.currentTimeMillis() - startTime);
stats.addValue(statValue);
- logger.debug("The Get stat : "+ statValue);
+ logger.debug("The Get stat : " + statValue);
}
else
{
@@ -69,12 +69,12 @@
sCache.getSerializable(key + i);
long statValue = (System.currentTimeMillis() - startTime);
stats.addValue(statValue);
- logger.debug("The Get stat : "+ statValue);
+ logger.debug("The Get stat : " + statValue);
}
}
// return the raw data
- logger.debug("Leaving doGets for : "+ cache);
+ logger.debug("Leaving doGets for : " + cache);
return stats;
}
@@ -86,18 +86,18 @@
*/
private DescriptiveStatistics doPuts(CacheWrapper cache, Class valueClass, int sampleSize) throws Exception
{
- logger.debug("Inside doPuts for "+cache);
+ logger.debug("Inside doPuts for " + cache);
String key = "baseKey";
Object value = null;
DescriptiveStatistics stats = DescriptiveStatistics.newInstance();
boolean useSerializable = cache instanceof SerializableCacheWrapper;
- for (int i=0; i<sampleSize; i++)
+ for (int i = 0; i < sampleSize; i++)
{
// generate some value
try
{
- if (valueClass==null)
+ if (valueClass == null)
value = null;
else if (valueClass.getName().equals("java.lang.String"))
value = "value" + i;
@@ -118,7 +118,7 @@
cache.put(key + i, value);
long statValue = (System.currentTimeMillis() - startTime);
stats.addValue(statValue);
- logger.debug("The Put stat : "+ statValue);
+ logger.debug("The Put stat : " + statValue);
}
else
{
@@ -128,13 +128,13 @@
sCache.putSerializable(key + i, sValue);
long statValue = (System.currentTimeMillis() - startTime);
stats.addValue(statValue);
- logger.debug("The Put stat : "+ statValue);
+ logger.debug("The Put stat : " + statValue);
}
}
// return the raw data
- logger.debug("Leaving doPuts for "+cache);
+ logger.debug("Leaving doPuts for " + cache);
return stats;
}
}
1.3 +8 -8 CacheBenchFwk/src/org/cachebench/tests/TransientTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TransientTest.java
===================================================================
RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/tests/TransientTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- TransientTest.java 27 Dec 2005 05:30:13 -0000 1.2
+++ TransientTest.java 13 Mar 2007 14:50:46 -0000 1.3
@@ -17,9 +17,9 @@
/* (non-Javadoc)
* @see org.cachebench.tests.CacheTest#doTest(org.cachebench.config.TestConfig)
*/
- public TestResult doTest( String testName, CacheWrapper cache, String testCaseName, int sampleSize ) throws Exception
+ public TestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize) throws Exception
{
- return performTestWithObjectType( testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeWithTransient.class : CustomTypeWithTransient.class, testCaseName, sampleSize);
+ return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeWithTransient.class : CustomTypeWithTransient.class, testCaseName, sampleSize);
}
1.3 +8 -8 CacheBenchFwk/src/org/cachebench/tests/AssociationsTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AssociationsTest.java
===================================================================
RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/tests/AssociationsTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- AssociationsTest.java 27 Dec 2005 05:30:13 -0000 1.2
+++ AssociationsTest.java 13 Mar 2007 14:50:46 -0000 1.3
@@ -17,9 +17,9 @@
/* (non-Javadoc)
* @see org.cachebench.tests.CacheTest#doTest(org.cachebench.config.TestConfig)
*/
- public TestResult doTest( String testName, CacheWrapper cache, String testCaseName, int sampleSize ) throws Exception
+ public TestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize) throws Exception
{
- return performTestWithObjectType( testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeWithAssocs.class : CustomTypeWithAssocs.class, testCaseName, sampleSize);
+ return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeWithAssocs.class : CustomTypeWithAssocs.class, testCaseName, sampleSize);
}
1.3 +8 -8 CacheBenchFwk/src/org/cachebench/tests/SubclassTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SubclassTest.java
===================================================================
RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/tests/SubclassTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- SubclassTest.java 27 Dec 2005 05:30:13 -0000 1.2
+++ SubclassTest.java 13 Mar 2007 14:50:46 -0000 1.3
@@ -17,9 +17,9 @@
/* (non-Javadoc)
* @see org.cachebench.tests.CacheTest#doTest(org.cachebench.config.TestConfig)
*/
- public TestResult doTest( String testName, CacheWrapper cache, String testCaseName, int sampleSize ) throws Exception
+ public TestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize) throws Exception
{
- return performTestWithObjectType( testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeSubclassOfAbstract.class : CustomTypeSubclassOfAbstract.class, testCaseName, sampleSize);
+ return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeSubclassOfAbstract.class : CustomTypeSubclassOfAbstract.class, testCaseName, sampleSize);
}
1.3 +8 -8 CacheBenchFwk/src/org/cachebench/tests/PrimitiveTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PrimitiveTest.java
===================================================================
RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/tests/PrimitiveTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- PrimitiveTest.java 27 Dec 2005 05:30:13 -0000 1.2
+++ PrimitiveTest.java 13 Mar 2007 14:50:46 -0000 1.3
@@ -14,9 +14,9 @@
/* (non-Javadoc)
* @see org.cachebench.tests.CacheTest#doTest(org.cachebench.config.TestConfig)
*/
- public TestResult doTest( String testName, CacheWrapper cache, String testCaseName, int sampleSize ) throws Exception
+ public TestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize) throws Exception
{
- return performTestWithObjectType( testName, cache, Integer.class, testCaseName, sampleSize);
+ return performTestWithObjectType(testName, cache, Integer.class, testCaseName, sampleSize);
}
1.3 +8 -8 CacheBenchFwk/src/org/cachebench/tests/StaticsTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: StaticsTest.java
===================================================================
RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/tests/StaticsTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- StaticsTest.java 27 Dec 2005 05:30:13 -0000 1.2
+++ StaticsTest.java 13 Mar 2007 14:50:46 -0000 1.3
@@ -17,9 +17,9 @@
/* (non-Javadoc)
* @see org.cachebench.tests.CacheTest#doTest(org.cachebench.config.TestConfig)
*/
- public TestResult doTest( String testName, CacheWrapper cache, String testCaseName, int sampleSize ) throws Exception
+ public TestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize) throws Exception
{
- return performTestWithObjectType( testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeWithStatics.class : CustomTypeWithStatics.class, testCaseName, sampleSize);
+ return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeWithStatics.class : CustomTypeWithStatics.class, testCaseName, sampleSize);
}
}
1.3 +8 -8 CacheBenchFwk/src/org/cachebench/tests/CustomClassTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CustomClassTest.java
===================================================================
RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/tests/CustomClassTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- CustomClassTest.java 27 Dec 2005 05:30:13 -0000 1.2
+++ CustomClassTest.java 13 Mar 2007 14:50:46 -0000 1.3
@@ -17,9 +17,9 @@
/* (non-Javadoc)
* @see org.cachebench.tests.CacheTest#doTest(org.cachebench.config.TestConfig)
*/
- public TestResult doTest( String testName, CacheWrapper cache, String testCaseName, int sampleSize ) throws Exception
+ public TestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize) throws Exception
{
- return performTestWithObjectType( testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomType.class : CustomType.class, testCaseName, sampleSize);
+ return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomType.class : CustomType.class, testCaseName, sampleSize);
}
More information about the jboss-cvs-commits
mailing list