JBoss Cache SVN: r5215 - benchmarks/benchmark-fwk/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-24 08:13:04 -0500 (Thu, 24 Jan 2008)
New Revision: 5215
Modified:
benchmarks/benchmark-fwk/trunk/cluster.sh
Log:
Modified: benchmarks/benchmark-fwk/trunk/cluster.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cluster.sh 2008-01-24 13:11:46 UTC (rev 5214)
+++ benchmarks/benchmark-fwk/trunk/cluster.sh 2008-01-24 13:13:04 UTC (rev 5215)
@@ -60,6 +60,6 @@
echo "Usage: ${0} [start | stop] [cache distribution to test] [name of configuration file to use] [number of servers to launch on]"
echo
echo "Example:"
- echo " ${0} start jbosscache-2.0.0 repl_async.xml 6
+ echo " ${0} start jbosscache-2.0.0 repl_async.xml 6"
;;
esac
17 years, 11 months
JBoss Cache SVN: r5214 - benchmarks/benchmark-fwk/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-24 08:11:46 -0500 (Thu, 24 Jan 2008)
New Revision: 5214
Added:
benchmarks/benchmark-fwk/trunk/README.txt
Removed:
benchmarks/benchmark-fwk/trunk/doc/
Log:
Added README.txt
Added: benchmarks/benchmark-fwk/trunk/README.txt
===================================================================
--- benchmarks/benchmark-fwk/trunk/README.txt (rev 0)
+++ benchmarks/benchmark-fwk/trunk/README.txt 2008-01-24 13:11:46 UTC (rev 5214)
@@ -0,0 +1,6 @@
+README.txt
+
+All information on this framework, including usage, is maintained online:
+
+ http://wiki.jboss.org/wiki/Wiki.jsp?page=CacheBenchmarkFramework
+
17 years, 11 months
JBoss Cache SVN: r5213 - in benchmarks/benchmark-fwk/trunk: conf and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-24 08:10:34 -0500 (Thu, 24 Jan 2008)
New Revision: 5213
Added:
benchmarks/benchmark-fwk/trunk/killNode.sh
Removed:
benchmarks/benchmark-fwk/trunk/lib/smartfrog-3.12.014.jar
benchmarks/benchmark-fwk/trunk/smartfrog/
Modified:
benchmarks/benchmark-fwk/trunk/cluster.sh
benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
benchmarks/benchmark-fwk/trunk/runNode.sh
benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
Log:
Updated scripts, which now take in the config to launch. Also created a killNode script.
Modified: benchmarks/benchmark-fwk/trunk/cluster.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cluster.sh 2008-01-24 12:12:47 UTC (rev 5212)
+++ benchmarks/benchmark-fwk/trunk/cluster.sh 2008-01-24 13:10:34 UTC (rev 5213)
@@ -1,6 +1,6 @@
#!/bin/bash
-#####################################################
+##################################################################################
#
# This script allows you to start multiple cache bench instances across a cluster
#
@@ -12,7 +12,7 @@
#
# will work without prompting for passwords, or any user input.
#
-#####################################################
+##################################################################################
## Some user-cnfigurable variables:
@@ -22,8 +22,10 @@
# Cache instance you wish to run - taken from the command line.
CACHE_DIST=${2}
+CFG_FILE=${3}
+
# Number of servers to launch on - taken from the command line.
-NUM_SERVERS=${3}
+NUM_SERVERS=${4}
COMMAND=${1}
@@ -41,14 +43,23 @@
do
server="${HOSTNAMES[idx]}"
echo Starting CacheBenchmarkFramework on host ${server}
- ssh ${SSH_USER}(a)${server}.${DOMAIN} "cd ${CACHE_BENCHMARK_HOME} && ./runNode.sh &"
+ ssh ${SSH_USER}(a)${server}.${DOMAIN} "cd ${CACHE_BENCHMARK_HOME} && ./runNode.sh ${idx} ${CACHE_DIST} ${CFG_FILE} ${NUM_SERVERS}"
sleep 2
done
;;
stop)
- echo "stop not implemented yet"
+ for ((idx=0; idx < NUM_SERVERS ; idx++))
+ do
+ server="${HOSTNAMES[idx]}"
+ echo Starting CacheBenchmarkFramework on host ${server}
+ ssh ${SSH_USER}(a)${server}.${DOMAIN} "cd ${CACHE_BENCHMARK_HOME} && ./killNode.sh"
+ sleep 2
+ done
;;
*)
- echo "Usage: $0 [start | stop] [cache distribution to test] [number of servers to launch on]"
+ echo "Usage: ${0} [start | stop] [cache distribution to test] [name of configuration file to use] [number of servers to launch on]"
+ echo
+ echo "Example:"
+ echo " ${0} start jbosscache-2.0.0 repl_async.xml 6
;;
esac
Modified: benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/conf/cachebench.xml 2008-01-24 12:12:47 UTC (rev 5212)
+++ benchmarks/benchmark-fwk/trunk/conf/cachebench.xml 2008-01-24 13:10:34 UTC (rev 5213)
@@ -8,7 +8,7 @@
emptyCacheBetweenTests - again, use if you're running out of mem.
numThreads - the number of executor threads to use to perform the required number of operations.
-->
-<cachebench sampleSize="5500" gcBetweenTestsEnabled="true" sleepBetweenTests="1000" emptyCacheBetweenTests="true" numThreads="10">
+<cachebench sampleSize="10000" gcBetweenTestsEnabled="true" sleepBetweenTests="1000" emptyCacheBetweenTests="true" numThreads="10">
<!--
@@ -76,16 +76,9 @@
<test name="Custom Types With Associations" testClass="org.cachebench.tests.simpletests.AssociationsTest" weight="2.0" />
-->
- <!-- arbitrary params may be passed into the cacheWrapper implementation, typically used to pass in config files for the cache product. -->
- <!-- JBoss Cache 1.4.x and 2.x -->
- <param name="config" value="jbc210-br_tcp_mping.xml" />
- <!--<param name="config" value="pess-repl-async.xml" />-->
-
- <!-- EHCache -->
- <!--<param name="config" value="ehcache-repl-sync.xml" />-->
-
- <!-- Terracotta -->
- <!--<param name="config" value="tc-config-pojo.xml" />-->
+ <!-- WARNING - Configuration file name is now DEPRECATED and will be ignored. Please pass in your cache config
+ file name that you wish to use with the -DcacheBenchFwk.cacheConfigFile JVM parameter. The runNode.sh
+ and cluster.sh scripts will also do this for you. -->
</testcase>
Added: benchmarks/benchmark-fwk/trunk/killNode.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/killNode.sh (rev 0)
+++ benchmarks/benchmark-fwk/trunk/killNode.sh 2008-01-24 13:10:34 UTC (rev 5213)
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+##################################################################################
+#
+# This script allows you to kill benchmark runner instances started with runNode.sh
+#
+# Note that runNode.sh will create a PID.pid file in the current directory, which
+# this script will use to get the process id of the process to kill.
+#
+##################################################################################
+
+PIDFILE="PID.pid"
+
+if [ -e ${PIDFILE} ]
+then
+ pid=`cat ${PIDFILE}`
+ echo "Killing process ${pid}"
+ kill -9 ${pid}
+ rm ${PIDFILE}
+fi
+
+exit 0
\ No newline at end of file
Deleted: benchmarks/benchmark-fwk/trunk/lib/smartfrog-3.12.014.jar
===================================================================
(Binary files differ)
Modified: benchmarks/benchmark-fwk/trunk/runNode.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/runNode.sh 2008-01-24 12:12:47 UTC (rev 5212)
+++ benchmarks/benchmark-fwk/trunk/runNode.sh 2008-01-24 13:10:34 UTC (rev 5213)
@@ -4,29 +4,41 @@
# those would make an automatic conversion from unix CLASSPATH to win classpath, needed when executing java -cp
preferIPv4Stack=true
-export JVM_OPTIONS=" -DcurrentIndex=$1 -DclusterSize=$3 "
+CURRENT_INDEX=${1}
+CACHE_PRODUCT=${2}
+TEST_CFG=${3}
+CLUSTER_SIZE=${4}
+DEBUG=${5}
+PIDFILE="PID.pid"
+if [ -e ${PIDFILE} ]
+then
+ # first test if the process is still running. If not, clean up the PID file.
+ pid=`cat ${PIDFILE}`
+ if ps -C ${pid} > /dev/null
+ then
+ echo "A stale process already exists on this host! Run killNode.sh to kill it first."
+ exit 3
+ else
+ ## This is a stale PID file. No such process is running.
+ rm ${PIDFILE}
+ fi
+fi
+
if [ -z $1 ]
then
- echo "Usage:"
+ echo Usage:
echo
- echo " ./runNode.sh <currentNodeIndex> <testConfig> <clusterSize>"
- echo "param <currentNodeIndex> : the index of this node in the list of nodes in the cluster(0..<clusterSize>-1)"
- echo "param <testConfig> : must be one of the directories names under './cache-products'"
- echo "param <clusterSize> : total number of nodes that will run tests. "
- echo "Ex: './runNode.sh 0 jbosscache-2.0.0 3' will start the 1st node running an instance of jbc2.0.0 on a cluster made out of 3 nodes."
+ echo ./runNode.sh [current node index] [cache product to test] [test config file] [cluster size]
+ echo param [current node index] : the index of this node in the list of nodes in the cluster [0 .. <cluster size> - 1]
+ echo param [cache product to test] : must be one of the directories names under './cache-products'
+ echo param [test config file] : configuration file to use with the cache product. Typically resides in './cache-products/XXX/conf/'
+ echo param [cluster size] : total number of nodes that will run tests.
+ echo
+ echo Example: './runNode.sh 0 jbosscache-2.0.0 repl_async.xml 3' will start the 1st node running an instance of jbc2.0.0 on a cluster made out of 3 nodes, using the repl_async configuration.
exit 1
fi
-export SYS_PROPS="-DcurrentIndex=$1 -Djava.net.preferIPv4Stack=$preferIPv4Stack"
-
-#first kill all the exisiting processes as they might interfere with the new ones/ not sure this works on cygwin
-ps -fe | grep "Cache*BenchmarkRunner" | cut -c 10-20 | xargs -r kill
-#for PID in `ps -fe | grep "Cache*BenchmarkRunner" | cut -c 10-20`
-#do
-# kill PID
-#done
-
#libraries needed by the fwk, add them to the classpath
for JAR in ./lib/*
do
@@ -35,21 +47,29 @@
export CLASSPATH=$CLASSPATH:./conf:./classes/production/Framework
-configFile=./cache-products/$2/config.sh
+configFile=./cache-products/${CACHE_PRODUCT}/config.sh
#first check whether the config file exists and load it
-if [ -f $configFile ]
+if [ -f ${configFile} ]
then
- . $configFile
- echo "Calling $configFile exit code is $?"
+ . ${configFile}
+ echo Calling ${configFile} exit code is $?
else
- echo could not find config file $configFile, exit!
+ echo could not find config file ${configFile}, aborting!
exit 2
fi
+JVM_OPTIONS="${JVM_OPTIONS} -DcacheBenchFwk.cacheConfigFile=${TEST_CFG} -DcurrentIndex=${CURRENT_INDEX} -DclusterSize=${CLUSTER_SIZE} -DcurrentIndex=${CURRENT_INDEX} -Djava.net.preferIPv4Stack=${preferIPv4Stack}"
TO_EXECUTE="java $JVM_OPTIONS -cp $CLASSPATH org.cachebench.CacheBenchmarkRunner"
-echo executing:
-echo $TO_EXECUTE
-java $JVM_OPTIONS -cp $CLASSPATH org.cachebench.CacheBenchmarkRunner
+
+if [ "$DEBUG" = "debug" ]
+then
+ echo Executing:
+ echo ${TO_EXECUTE}
+ echo
+fi
+
+${TO_EXECUTE} &
+echo $!>${PIDFILE}
echo "Return code from benchmark runner is $?"
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-01-24 12:12:47 UTC (rev 5212)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-01-24 13:10:34 UTC (rev 5213)
@@ -16,6 +16,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.Map;
/**
@@ -102,7 +103,12 @@
cache = getCacheWrapperInstance(test);
if (cache != null)
{
- cache.init(test.getParams());
+ Map<String,String> params = test.getParams();
+ // now add the config file, if any is passed in:
+ String configSystemProperty = System.getProperty("cacheBenchFwk.cacheConfigFile");
+ if (configSystemProperty != null) params.put("config", configSystemProperty);
+ logger.info("Initialising cache with params " + params);
+ cache.init(params);
barrier("BEFORE_WARMUP");
warmupCache(test, cache);
barrier("AFTER_WARMUP");
17 years, 11 months
JBoss Cache SVN: r5212 - benchmarks/benchmark-fwk/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-24 07:12:47 -0500 (Thu, 24 Jan 2008)
New Revision: 5212
Modified:
benchmarks/benchmark-fwk/trunk/cluster.sh
Log:
Modified: benchmarks/benchmark-fwk/trunk/cluster.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cluster.sh 2008-01-24 12:06:18 UTC (rev 5211)
+++ benchmarks/benchmark-fwk/trunk/cluster.sh 2008-01-24 12:12:47 UTC (rev 5212)
@@ -1,29 +1,54 @@
#!/bin/bash
-CACHE_DIST=${1}
-NUM_SERVERS=${2}
-COMMAND=start
+#####################################################
+#
+# This script allows you to start multiple cache bench instances across a cluster
+#
+# Note that this requires BASH, as well as that all your instances have the cache
+# bench framework installed in the same location. Finally, it requires SSH keys
+# set up such that executing commands using
+#
+# $ ssh hostName "command"
+#
+# will work without prompting for passwords, or any user input.
+#
+#####################################################
-SERVER_POSTFIX="qa.atl.jboss.com"
-SERVERS=( cluster01 cluster02 cluster03 cluster04 cluster05 cluster06 cluster07 cluster08 cluster09 cluster10 )
+## Some user-cnfigurable variables:
-CACHE_BENCHMARK_HOME=`pwd`/code/cache-bench-fwk
+# Defaults to the currently logged in user
+SSH_USER=${USER}
+
+# Cache instance you wish to run - taken from the command line.
+CACHE_DIST=${2}
+
+# Number of servers to launch on - taken from the command line.
+NUM_SERVERS=${3}
+
+COMMAND=${1}
+
+# the DNS domain of your servers
+DOMAIN="qa.atl.jboss.com"
+# the host names of available servers
+HOSTNAMES=( cluster01 cluster02 cluster03 cluster04 cluster05 cluster06 cluster07 cluster08 cluster09 cluster10 )
+
+CACHE_BENCHMARK_HOME=`pwd`
echo "Using cache benchmark home: $CACHE_BENCHMARK_HOME"
case $COMMAND in
start)
for ((idx=0; idx < NUM_SERVERS ; idx++))
do
- server="${SERVERS[idx]}"
- echo "jboss: Startup CacheBenchmarkFramework@$server"
- ssh $server.$SERVER_POSTFIX "cd ${CACHE_BENCHMARK_HOME} && ./runNode.sh &"
- sleep 5
+ server="${HOSTNAMES[idx]}"
+ echo Starting CacheBenchmarkFramework on host ${server}
+ ssh ${SSH_USER}(a)${server}.${DOMAIN} "cd ${CACHE_BENCHMARK_HOME} && ./runNode.sh &"
+ sleep 2
done
;;
stop)
echo "stop not implemented yet"
;;
*)
- echo "Usage: $0 [start] CACHE_DIST NUM_SERVERS"
+ echo "Usage: $0 [start | stop] [cache distribution to test] [number of servers to launch on]"
;;
esac
17 years, 11 months
JBoss Cache SVN: r5211 - in benchmarks/benchmark-fwk/trunk/cache-products: jbosscache-1.4.1 and 3 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-24 07:06:18 -0500 (Thu, 24 Jan 2008)
New Revision: 5211
Added:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/config.sh
Removed:
benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.4.8/
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/config.sh
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/config.sh
benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/config.sh
Log:
Updated shell scripts, removed old TC 2.4.8 stuff
Copied: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/config.sh (from rev 5209, benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/config.sh)
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/config.sh (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/config.sh 2008-01-24 12:06:18 UTC (rev 5211)
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+#see "$CACHE_ROOT/cache-products/cache.sh" for details
+
+THIS_DIR="./cache-products/jbosscache-1.4.1"
+
+#setting up classpath
+for JAR in $THIS_DIR/lib/*
+do
+ CLASSPATH=$CLASSPATH:$JAR
+done
+CLASSPATH=$CLASSPATH:./classes/production/jbosscache-1.4.1
+CLASSPATH=$CLASSPATH:$THIS_DIR/conf
+#--classpath was set
+
+#additional JVM options
+JVM_OPTIONS="$JVM_OPTIONS -Xmx1024m -Djava.net.preferIPv4Stack=true -DcacheBenchFwk.cacheWrapperClassName=org.cachebench.cachewrappers.JBossCacheWrapper"
+
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/config.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/config.sh 2008-01-24 12:05:43 UTC (rev 5210)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/config.sh 2008-01-24 12:06:18 UTC (rev 5211)
@@ -14,5 +14,5 @@
#--classpath was set
#additional JVM options
-JVM_OPTIONS="$JVM_OPTIONS -Xmx1024m -Djava.net.preferIPv4Stack=true"
+JVM_OPTIONS="$JVM_OPTIONS -Xmx1024m -Djava.net.preferIPv4Stack=true -DcacheBenchFwk.cacheWrapperClassName=org.cachebench.cachewrappers.JBossCache200Wrapper"
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/config.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/config.sh 2008-01-24 12:05:43 UTC (rev 5210)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/config.sh 2008-01-24 12:06:18 UTC (rev 5211)
@@ -15,5 +15,4 @@
#--classpath was set
#additional JVM options
-JVM_OPTIONS="$JVM_OPTIONS -Xmx1024m -Djava.net.preferIPv4Stack=true"
-JVM_OPTIONS="$JVM_OPTIONS -DcacheBenchFwk.cacheWrapperClassName=org.cachebench.cachewrappers.JBossCache210Wrapper"
\ No newline at end of file
+JVM_OPTIONS="$JVM_OPTIONS -Xmx1024m -Djava.net.preferIPv4Stack=true" JVM_OPTIONS="$JVM_OPTIONS -DcacheBenchFwk.cacheWrapperClassName=org.cachebench.cachewrappers.JBossCache210Wrapper"
\ No newline at end of file
Modified: benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/config.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/config.sh 2008-01-24 12:05:43 UTC (rev 5210)
+++ benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/config.sh 2008-01-24 12:06:18 UTC (rev 5211)
@@ -3,7 +3,7 @@
#see "$CACHE_ROOT/cache-products/cache.sh" for details
THIS_DIR=./cache-products/terracotta-2.5.0
-TC_HOME="/qa/home/mmarkus/java/terracotta-2.5.0"
+TC_HOME="${HOME}/java/terracotta-2.5.0"
#addint terracotta wrapper class to classpath
CLASSPATH=$CLASSPATH:./classes/production/terracotta-2.5.0
17 years, 11 months
JBoss Cache SVN: r5210 - benchmarks/benchmark-fwk/trunk/src/org/cachebench.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-24 07:05:43 -0500 (Thu, 24 Jan 2008)
New Revision: 5210
Modified:
benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
Log:
Updated logging
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-01-24 11:19:54 UTC (rev 5209)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-01-24 12:05:43 UTC (rev 5210)
@@ -26,7 +26,7 @@
{
private Configuration conf;
- private Log logger = LogFactory.getLog("org.cachebench.CacheBenchmarkRunner");
+ private Log logger = LogFactory.getLog(CacheBenchmarkRunner.class);
private Log errorLogger = LogFactory.getLog("CacheException");
public static void main(String[] args)
17 years, 11 months
JBoss Cache SVN: r5209 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/lib.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-24 06:19:54 -0500 (Thu, 24 Jan 2008)
New Revision: 5209
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/lib/jboss-cache.jar
Log:
Updated JBC jar
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/lib/jboss-cache.jar
===================================================================
(Binary files differ)
17 years, 11 months
JBoss Cache SVN: r5208 - in pojo/trunk: src/test/java/org/jboss/cache/pojo and 7 other directories.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2008-01-23 20:08:22 -0500 (Wed, 23 Jan 2008)
New Revision: 5208
Removed:
pojo/trunk/src/test/java/org/jboss/cache/pojo/TestingUtil.java
Modified:
pojo/trunk/pom.xml
pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTxTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncListTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java
Log:
Merge from 2.1
Modified: pojo/trunk/pom.xml
===================================================================
--- pojo/trunk/pom.xml 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/pom.xml 2008-01-24 01:08:22 UTC (rev 5208)
@@ -4,13 +4,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-pojo-version>2.1.0-SNAPSHOT</jbosscache-pojo-version>
- <jboss.aop.version>2.0.0.beta1</jboss.aop.version>
+ <jbosscache-pojo-version>2.2.0-SNAPSHOT</jbosscache-pojo-version>
+ <jbosscache-core-version>2.1.0-SNAPSHOT</jbosscache-core-version>
+ <jboss.aop.version>2.0.0.CR3</jboss.aop.version>
</properties>
<parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-common-parent</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
</parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-pojo</artifactId>
@@ -27,22 +28,15 @@
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>2.1.0.BETA1</version>
+ <version>${jbosscache-core-version}</version>
</dependency>
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>2.1.0.BETA1</version>
+ <version>${jbosscache-core-version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
- <!-- Hack AOP has broken deps -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- <version>2.0.0.Beta4</version>
- <scope>runtime</scope>
- </dependency>
</dependencies>
<build>
<plugins>
@@ -104,11 +98,6 @@
<!-- HACK: AOP project and plugin has broken deps -->
<dependencies>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- <version>2.0.0.Beta4</version>
- </dependency>
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
@@ -116,9 +105,14 @@
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>2.1.0-SNAPSHOT</version>
+ <version>${jbosscache-core-version}</version>
</dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <version>${jboss.aop.version}</version>
+ </dependency>
+ </dependencies>
<executions>
<execution>
<id>aopc</id>
@@ -279,14 +273,13 @@
<!-- basic JBoss repository so that the common parent POM in jbosscache-support can be found -->
<repositories>
- <repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <url>http://snapshots.jboss.org/maven2</url>
- </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <url>http://snapshots.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <id>repository.jboss.org</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
</repositories>
-
</project>
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -18,6 +18,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.lock.UpgradeException;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTxTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTxTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -24,6 +24,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -30,7 +30,7 @@
* @author Ben Wang
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional"}, enabled=false)
public class NewReplicatedTest
{
Log log_ = LogFactory.getLog(NewReplicatedTest.class);
@@ -251,7 +251,7 @@
// restart cache1_
cache1_.stop();
- cache1_.getCache().removeNode(Fqn.fromString("/a"));
+ //cache1_.getCache().removeNode(Fqn.fromString("/a"));
cache1_.start();
// Start from scratch for initial state transfer
Person remote = (Person) cache1_.find("/a");
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -26,6 +26,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
@@ -39,7 +40,7 @@
* @author Ben Wang
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional"}, enabled=false)
public class NewReplicatedTxTest
{
Log log = LogFactory.getLog(NewReplicatedTxTest.class);
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -19,6 +19,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Link;
import org.jboss.cache.pojo.test.NodeManager;
import org.jboss.cache.pojo.test.Person;
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -7,6 +7,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.testng.annotations.AfterMethod;
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -19,6 +19,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
import org.testng.annotations.AfterMethod;
Deleted: pojo/trunk/src/test/java/org/jboss/cache/pojo/TestingUtil.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/TestingUtil.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/TestingUtil.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -1,139 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-
-package org.jboss.cache.pojo;
-
-import org.jboss.cache.CacheImpl;
-import org.jgroups.Address;
-
-import java.util.List;
-
-/**
- * Utilities for unit testing JBossCache.
- *
- * @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
- * @version $Revision$
- */
-public class TestingUtil
-{
-
- /**
- * @param caches caches which must all have consistent views
- * @param timeout max number of ms to loop
- * @throws RuntimeException if <code>timeout</code> ms have elapse without
- * all caches having the same number of members.
- */
- public static void blockUntilViewsReceived(PojoCache[] caches, long timeout)
- {
- long failTime = System.currentTimeMillis() + timeout;
-
- while (System.currentTimeMillis() < failTime)
- {
- org.jboss.cache.pojo.TestingUtil.sleepThread(100);
- if (org.jboss.cache.pojo.TestingUtil.areCacheViewsComplete(caches))
- return;
- }
-
- throw new RuntimeException("timed out before caches had complete views");
- }
-
- /**
- */
- public static void blockUntilViewReceived(PojoCache cache, int groupSize, long timeout)
- {
- long failTime = System.currentTimeMillis() + timeout;
-
- CacheImpl<Object, Object> tcache = (CacheImpl<Object, Object>) cache.getCache();
- while (System.currentTimeMillis() < failTime)
- {
- org.jboss.cache.pojo.TestingUtil.sleepThread(100);
- if (org.jboss.cache.pojo.TestingUtil.isCacheViewComplete(tcache, groupSize))
- return;
- }
-
- throw new RuntimeException("timed out before caches had complete views");
- }
-
- /**
- * Checks each cache to see if the number of elements in the array
- * returned by {@link org.jboss.cache.CacheImpl#getMembers()} matches the size of
- * the <code>caches</code> parameter.
- *
- * @param caches caches that should form a View
- * @return <code>true</code> if all caches have
- * <code>caches.length</code> members; false otherwise
- * @throws IllegalStateException if any of the caches have MORE view
- * members than caches.length
- */
- public static boolean areCacheViewsComplete(PojoCache[] caches)
- {
- int memberCount = caches.length;
-
- for (int i = 0; i < memberCount; i++)
- {
- CacheImpl<Object, Object> cache = (CacheImpl<Object, Object>) caches[i].getCache();
- return org.jboss.cache.pojo.TestingUtil.isCacheViewComplete(cache, memberCount);
- }
-
- return true;
- }
-
- /**
- * FIXME Comment this
- *
- * @param cache
- * @param memberCount
- */
- public static boolean isCacheViewComplete(CacheImpl<Object, Object> cache, int memberCount)
- {
- List<Address> members = cache.getMembers();
- if (members == null || memberCount > members.size())
- {
- return false;
- }
- else if (memberCount < members.size())
- {
- // This is an exceptional condition
- StringBuffer sb = new StringBuffer("Cache at address ");
- sb.append(cache.getLocalAddress());
- sb.append(" had ");
- sb.append(members.size());
- sb.append(" members; expecting ");
- sb.append(memberCount);
- sb.append(". Members were (");
- for (int j = 0; j < members.size(); j++)
- {
- if (j > 0)
- sb.append(", ");
- sb.append(members.get(j));
- }
- sb.append(')');
-
- throw new IllegalStateException(sb.toString());
- }
-
- return true;
- }
-
-
- /**
- * Puts the current thread to sleep for the desired number of ms, suppressing
- * any exceptions.
- *
- * @param sleeptime number of ms to sleep
- */
- public static void sleepThread(long sleeptime)
- {
- try
- {
- Thread.sleep(sleeptime);
- }
- catch (InterruptedException ie)
- {
- }
- }
-}
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncListTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncListTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncListTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -29,7 +29,7 @@
* @author Ben Wang
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional"}, enabled=false)
public class ReplicatedSyncListTest
{
Log log = LogFactory.getLog(ReplicatedSyncListTest.class);
@@ -48,7 +48,7 @@
@AfterMethod(alwaysRun = true)
protected void tearDown() throws Exception
{
- cache1.getCache().removeNode(Fqn.fromString("/"));
+ //cache1.getCache().removeNode(Fqn.fromString("/"));
cache1.stop();
cache2.stop();
}
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -2,7 +2,7 @@
import javax.management.ObjectName;
-import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
@@ -26,7 +26,7 @@
protected Object createCacheAndJmxWrapper() throws Exception
{
pojoCache = createCache(CLUSTER_NAME);
- cache = (CacheImpl<Object, Object>) pojoCache.getCache();
+ cache = (CacheSPI<Object, Object>)pojoCache.getCache();
return new PojoCacheJmxWrapper(pojoCache);
}
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -19,9 +19,9 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.pojo.test.SerializedAddress;
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -370,7 +370,7 @@
System.out.println("*** " + oa.length);
System.arraycopy(oa, 0, na, 0, oa.length);
na[oa.length] = new DefaultDataVersion();
- newList.add(MethodCallFactory.create(MethodDeclarations.getVersionedMethod(c.getMethodId()), na));
+ newList.add(MethodCallFactory.create(c.getMethodId(), na));
}
return newList;
}
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -17,9 +17,9 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.lock.UpgradeException;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -107,7 +107,7 @@
Fqn<String> fqn = new Fqn<String>(Fqn.fromString(REGION), InternalConstant.JBOSS_INTERNAL);
assertTrue("Internal region node should exist ",
cache_.getCache().getRoot().hasChild(fqn));
- System.out.println("Cache content: " +((org.jboss.cache.CacheImpl<Object, Object>)cache_.getCache()).printDetails());
+ //System.out.println("Cache content: " +((org.jboss.cache.CacheImpl<Object, Object>)cache_.getCache()).printDetails());
}
public void testModification() throws Exception
@@ -123,8 +123,8 @@
createPerson("person/test3", "Joe", 32);
cache_.detach("person/test3");
- String str = ((CacheImpl<Object, Object>) cache_.getCache()).printDetails();
- System.out.println("**** Details ***/n" + str);
+ //String str = ((CacheImpl<Object, Object>) cache_.getCache()).printDetails();
+ //System.out.println("**** Details ***/n" + str);
Fqn<String> fqn = new Fqn<String>(Fqn.fromString(REGION), InternalConstant.JBOSS_INTERNAL);
Node<Object, Object> n = cache_.getCache().getRoot().getChild(fqn);
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -26,9 +26,9 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.TestingUtil;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
import org.testng.annotations.AfterMethod;
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java 2008-01-23 17:56:11 UTC (rev 5207)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java 2008-01-24 01:08:22 UTC (rev 5208)
@@ -79,13 +79,13 @@
cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
Person ben = createPerson("/person/test1", "Ben Wang", 40);
- System.out.println("\n*** I ***");
- System.out.println(((CacheImpl<Object, Object>) cache.getCache()).printDetails());
+ //System.out.println("\n*** I ***");
+ //System.out.println(((CacheImpl<Object, Object>) cache.getCache()).printDetails());
cache1 = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
cache1.start();
- System.out.println("\n*** II ***");
- System.out.println(((CacheImpl<Object, Object>) cache1.getCache()).printDetails());
+ //System.out.println("\n*** II ***");
+ //System.out.println(((CacheImpl<Object, Object>) cache1.getCache()).printDetails());
log.info("testSimple() ....");
assertEquals("Ben Wang", ben.getName());
17 years, 11 months
JBoss Cache SVN: r5207 - core/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-23 12:56:11 -0500 (Wed, 23 Jan 2008)
New Revision: 5207
Modified:
core/trunk/README-Maven.txt
Log:
Updated readme
Modified: core/trunk/README-Maven.txt
===================================================================
--- core/trunk/README-Maven.txt 2008-01-23 17:14:55 UTC (rev 5206)
+++ core/trunk/README-Maven.txt 2008-01-23 17:56:11 UTC (rev 5207)
@@ -1,14 +1,16 @@
-Working with Maven
-------------------
+1. WORKING WITH MAVEN
+=====================
+
Requirements:
* Java 5.0 and above
* Maven 2.x
-Typical lifecycle phases
-------------------------
+1.1. Typical lifecycle phases
+-----------------------------
+
Maven will create a target/ directory under the root for the creation of
output at every stage.
@@ -16,19 +18,26 @@
* mvn compile: compiles java source code.
-* mvn test: runs the TestNG unit test suite on the compiled code. Will also compile the tests. See the testing section below for more information.
+* mvn test: runs the TestNG unit test suite on the compiled code. Will also compile the tests. See the testing section
+ below for more information.
* mvn package: packages the module as a jar file and builds the javadocs and user documentation from docbook sources.
-* mvn install: will install the artifacts in your local repo for use by other projects (such as JBoss Cache POJO edition which depends on JBoss Cache Core). Will also use Maven's assembly plugin to build ZIP files for download (in target/distribution)
+* mvn install: will install the artifacts in your local repo for use by other projects (such as JBoss Cache POJO edition
+ which depends on JBoss Cache Core). Will also use Maven's assembly plugin to build ZIP files for download
+ (in target/distribution)
-* mvn deploy: will build and deploy the project to the JBoss snapshots repository. Note that you should have your WebDAV username and password set up. (Deploys snapshots to http://snapshots.jboss.org/maven2/org/jboss/cache/). If you have a non-SNAPSHOT version number in your pom.xml, it will be deployed to the live releases repository (see below)
+* mvn deploy: will build and deploy the project to the JBoss snapshots repository. Note that you should have your WebDAV
+ username and password set up. (Deploys snapshots to http://snapshots.jboss.org/maven2/org/jboss/cache/). If you have
+ a non-SNAPSHOT version number in your pom.xml, it will be deployed to the live releases repository (see below)
-Setting up your WebDAV username and password to deploy project snapshots
-------------------------------------------------------------------------
+1.2. Setting up your WebDAV username and password to deploy project snapshots
+-----------------------------------------------------------------------------
-You will also have to configure maven to use your username and password to access this repository. For this, you will have to modify the servers section of maven settings file ($MAVEN_HOME/conf/settings.xml, or ~/.m2/settings.xml). Something similar to the following should be added:
+You will also have to configure maven to use your username and password to access this repository. For this, you will
+have to modify the servers section of maven settings file ($MAVEN_HOME/conf/settings.xml, or ~/.m2/settings.xml).
+Something similar to the following should be added:
<settings>
@@ -49,12 +58,13 @@
</settings>
-Deploying a release to a live repository
-----------------------------------------
+1.3. Deploying a release to a live repository
+---------------------------------------------
-Very simple. Make sure you have the version number in your pom.xml set to a non-SNAPSHOT version. Maven will pick up on this and deploy to your release repository rather than the snapshot repository.
+Very simple. Make sure you have the version number in your pom.xml set to a non-SNAPSHOT version. Maven will pick up
+on this and deploy to your release repository rather than the snapshot repository.
-Sadly JBoss release repository cannot be accessed via WebDAV, as the snapshot repository can. So what you need to do is:
+JBoss release repository cannot be accessed via WebDAV, as the snapshot repository can. So what you need to do is:
1) Check out the release repository from Subversion (svn co https://svn.jboss.org/repos/repository.jboss.org/maven2)
2) Add a property in ~/.m2/settings.xml to point to this 'local' copy of the repo. (See maven settings below)
@@ -62,8 +72,8 @@
4) Deploy your project (mvn clean deploy)
5) Check in your 'local' copy of the repo checked out in (1), adding any new directories/files created by (4).
-Maven settings.xml
-------------------
+1.4. Maven settings.xml
+-----------------------
Working with the JBoss Cache source tree, I have configured my ~/.m2/settings.xml to look like:
@@ -93,79 +103,114 @@
</settings>
-Testing
-=======
+2. TESTING
+==========
-Tests are written against the TestNG testing framework. Each test should belong to one or more group. The group acts as a filter, and is used to select which tests are ran as part of the maven test lifecycle. There are 3 groups that are currently in use, but there is not formal, you can make up any group name if you like.
+Tests are written against the TestNG testing framework. Each test should belong to one or more group. The group acts as
+a filter, and is used to select which tests are ran as part of the maven test lifecycle. There are 3 groups that are
+currently in use, but there is not formal, you can make up any group name if you like.
-Current Groups
---------------
+2.1. Current Groups
+-------------------
* functional - Tests which test the general functionality of JBoss Cache
* jgroups - Tests which need to send data on a JGroups Channel
* transaction - Tests which use a transaction manager
+* profiling - Tests used for manual profiling, not meant for automated test runs
-It should be noted that every test should at least be in the functional group, since this is the default test group that is executed by maven, and the one that is required to prepare a release.
+It should be noted that every test (except those not intended to be run by Hudson) should at least be in the functional
+group, since this is the default test group that is executed by maven, and the one that is required to prepare a release.
-Executing the default test run
-------------------------------
+2.2. Executing the default test run
+-----------------------------------
The default run executes all tests in the functional group. To just run the tests with txt and xml output the command is:
- mvn test
+ $ mvn test
Alternatively, you can execute the tests AND generate a report with:
- mvn surefire-report:report
+ $ mvn surefire-report:report
-If you already have ran a test cycle, and you want to generate a report off the current reports, then you use the report-only goal, ike so:
+If you already have ran a test cycle, and you want to generate a report off the current reports, then you use the
+report-only goal, ike so:
- mvn surefire-report:report-only
+ $ mvn surefire-report:report-only
-Executing different groups
---------------------------
+2.3. Executing different groups
+-------------------------------
A group can be executed (using the default configuration) by simply using the groups property like so:
- mvn -Dgroups=jgroups test
+ $ mvn -Dgroups=jgroups test
Mutiple groups can also be executed, although if a test is in more than of the selected groups, it is executed only once:
- mvn -Dgroups=jgroups,transaction test
+ $ mvn -Dgroups=jgroups,transaction test
-Executing a single test
------------------------
-A single test can be executed using the test property. The value is the short name (not the fully qualified package name) of the test.
+2.4. Executing a single test
+----------------------------
+A single test can be executed using the test property. The value is the short name (not the fully qualified package name)
+of the test.
- mvn -Dtest=FqnTest test
+ $ mvn -Dtest=FqnTest test
-Alternatively, if there is more than one test with a given classname in your test suite, you could provide the path to the test.
+Alternatively, if there is more than one test with a given classname in your test suite, you could provide the path to
+the test.
- mvn -Dtest=org/jboss/cache/multiplexer/SyncReplTxTest test
+ $ mvn -Dtest=org/jboss/cache/multiplexer/SyncReplTxTest test
-Executing all tests in a given package
---------------------------------------
+2.5. Executing all tests in a given package
+--------------------------------------------
This can be achieved by passing in the package name with a wildcard to the test parameter.
- mvn -Dtest=org/jboss/cache/multiplexer/* test
+ $ mvn -Dtest=org/jboss/cache/multiplexer/* test
-Skipping the test run
----------------------
-It is sometimes desirable to install the jboss cache package in your local repository without performing a full test run. To do this, simply use the maven.test.skip.exec property:
+2.6. Skipping the test run
+--------------------------
+It is sometimes desirable to install the jboss cache package in your local repository without performing a full test run.
+To do this, simply use the maven.test.skip.exec property:
-mvn -Dmaven.test.skip.exec=true install
+ $ mvn -Dmaven.test.skip.exec=true install
-Again, this is just a shortcut for local use. It SHOULD NEVER BE USED when releasing. Also, make sure "exec" is included in the property, if not the tests will not be built, which will prevent a test jar being produced (POJO Cache needs the Core Cache test jar).
+Again, this is just a shortcut for local use. It SHOULD NEVER BE USED when releasing. Also, make sure "exec" is included
+in the property, if not the tests will not be built, which will prevent a test jar being produced (POJO Cache needs the
+Core Cache test jar).
-Permutations
-------------
-We use the term permutation to describe a group execution against a particular config. This allows us to test a variety of environments and configurations without rewriting the same basic test over and over again. For example, the jgroups-tcp permutation executes the jgroups group using the TCP config. Each permutation requires a maven profile which defines the various options, environmental variables, etc. The command to run the jgroups-tcp permutatin is:
+2.7. Permutations
+-----------------
+We use the term permutation to describe a group execution against a particular config. This allows us to test a variety
+of environments and configurations without rewriting the same basic test over and over again. For example, the jgroups-tcp
+permutation executes the jgroups group using the TCP config. Each permutation requires a maven profile which defines the
+various options, environmental variables, etc. The command to run the jgroups-tcp permutatin is:
-mvn -Pjgroups-tcp surefire-report:report
+ $ mvn -Pjgroups-tcp surefire-report:report
-Each permutation uses its own report directory, and its own html output file name. This allows you to execute multiple permutations without wiping the results from the previous run. Note that due to the way maven operates, only one permutation can be executed per mvn command. So automating multiple runs requires shell scripting, or some other execution framework to make multiple called to maven.
+Each permutation uses its own report directory, and its own html output file name. This allows you to execute multiple
+permutations without wiping the results from the previous run. Note that due to the way maven operates, only one
+permutation can be executed per mvn command. So automating multiple runs requires shell scripting, or some other execution
+framework to make multiple called to maven.
-Integration with CruiseControl / Hudson
----------------------------------------
+2.8. Running permutations manually or in an IDE
+-----------------------------------------------
+Sometimes you want to run a test using settings other than the defaults (such as UDP for "jgroups" group tests or the
+DummyTransactionManager for "transaction" group tests). This can be achieved by referring to the Maven POM file
+to figure out which system properties are passed in to the test when doing something different.
+
+E.g., to run a "jgroups" group test in your IDE using TCP instead of the default UDP, set the following:
+
+ -Djgroups.stack=tcp
+
+Or, to use JBoss JTA (Arjuna TM) instead of the DummyTransactionManager in a "transaction" group test, set:
+
+ -Dorg.jboss.cache.test.tm=jboss-jta
+
+Please refer to the POM file for more properties and permutations.
+
+2.9. Integration with CruiseControl / Hudson
+--------------------------------------------
+
CruiseControl should do the following:
-* Run "mvn clean site" - will clean and run tests, and then prepare reports. In addition to unit tests, this project is set up to run FindBugs, PMD, jxr, and a bunch of other code analysis tools and provide a report in target/site/project-reports.html - which should be linked from the CruiseControl summary page.
+* Run "mvn clean site" - will clean and run tests, and then prepare reports. In addition to unit tests, this project is
+ set up to run FindBugs, PMD, jxr, and a bunch of other code analysis tools and provide a report in
+ target/site/project-reports.html - which should be linked from the CruiseControl summary page.
17 years, 11 months
JBoss Cache SVN: r5206 - core/trunk/src/test/java/org/jboss/cache/optimistic.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-23 12:14:55 -0500 (Wed, 23 Jan 2008)
New Revision: 5206
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticWithCacheLoaderTest.java
Log:
Removed all direct refs to DummyTM
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticWithCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticWithCacheLoaderTest.java 2008-01-23 17:08:28 UTC (rev 5205)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticWithCacheLoaderTest.java 2008-01-23 17:14:55 UTC (rev 5206)
@@ -8,11 +8,11 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.loader.CacheLoader;
-import org.jboss.cache.transaction.DummyTransactionManager;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.Test;
import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
/**
* Tests optimistic locking with cache loaders
@@ -46,7 +46,7 @@
CacheSPI<Object, Object> cache = createCacheWithLoader();
loader = cache.getCacheLoaderManager().getCacheLoader();
- DummyTransactionManager mgr = DummyTransactionManager.getInstance();
+ TransactionManager mgr = cache.getTransactionManager();
Transaction tx;
// make sure the fqn is not in cache
@@ -84,7 +84,7 @@
CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
// test the cache ...
- DummyTransactionManager mgr = DummyTransactionManager.getInstance();
+ TransactionManager mgr = cache.getTransactionManager();
assertNull(mgr.getTransaction());
mgr.begin();
cache.put(fqn, key, value);
@@ -131,7 +131,7 @@
CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
// test the cache ...
- DummyTransactionManager mgr = DummyTransactionManager.getInstance();
+ TransactionManager mgr = cache.getTransactionManager();
assertNull(mgr.getTransaction());
cache.put(fqn, key, value);
@@ -186,7 +186,7 @@
CacheLoader loader2 = cache2.getCacheLoaderManager().getCacheLoader();
// test the cache ...
- DummyTransactionManager mgr = DummyTransactionManager.getInstance();
+ TransactionManager mgr = cache1.getTransactionManager();
assertNull(mgr.getTransaction());
mgr.begin();
@@ -210,7 +210,7 @@
assertEquals(value, cache2.get(fqn, key));
// cache2 removes entry
- mgr.begin();
+ cache2.getTransactionManager().begin();
cache2.removeNode(fqn);
assertNull(cache2.get(fqn, key));
// test that loader1, loader2 and cache2 have the entry
@@ -219,7 +219,7 @@
assertEquals(value, loader2.get(fqn).get(key));
// commit
- mgr.commit();
+ cache2.getTransactionManager().commit();
// test that the entry has been removed everywhere.
assertNull(cache1.getNode(fqn));
@@ -238,7 +238,7 @@
CacheLoader loader2 = cache2.getCacheLoaderManager().getCacheLoader();
// test the cache ...
- DummyTransactionManager mgr = DummyTransactionManager.getInstance();
+ TransactionManager mgr = cache1.getTransactionManager();
assertNull(mgr.getTransaction());
mgr.begin();
@@ -263,7 +263,7 @@
assertEquals(value, cache2.get(fqn, key));
// cache2 removes entry
- mgr.begin();
+ cache2.getTransactionManager().begin();
cache2.removeNode(fqn);
assertNull(cache2.get(fqn, key));
// test that loader1, loader2 and cache2 have the entry
@@ -272,7 +272,7 @@
assertEquals(value, loader2.get(fqn).get(key));
// commit
- mgr.commit();
+ cache2.getTransactionManager().commit();
// test that the entry has been removed everywhere.
assertNull(cache1.getNode(fqn));
17 years, 11 months