Author: jason.greene(a)jboss.com
Date: 2008-01-14 19:19:02 -0500 (Mon, 14 Jan 2008)
New Revision: 5129
Removed:
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/TestingUtil.java
Modified:
pojo/branches/2.1/pom.xml
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalTxTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java
Log:
Prepare for a CR3 release
Modified: pojo/branches/2.1/pom.xml
===================================================================
--- pojo/branches/2.1/pom.xml 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/pom.xml 2008-01-15 00:19:02 UTC (rev 5129)
@@ -4,9 +4,9 @@
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.CR2</jbosscache-pojo-version>
- <jbosscache-core-version>2.1.0.CR2</jbosscache-core-version>
- <jboss.aop.version>2.0.0.beta1</jboss.aop.version>
+ <jbosscache-pojo-version>2.1.0.CR3</jbosscache-pojo-version>
+ <jbosscache-core-version>2.1.0.CR3</jbosscache-core-version>
+ <jboss.aop.version>2.0.0.CR3</jboss.aop.version>
</properties>
<parent>
<groupId>org.jboss.cache</groupId>
@@ -105,11 +105,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>
@@ -119,7 +114,12 @@
<artifactId>jbosscache-core</artifactId>
<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>
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalTxTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalTxTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalTxTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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;
Modified:
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/TestingUtil.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/TestingUtil.java 2008-01-14
22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/TestingUtil.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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/branches/2.1/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java
===================================================================
---
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java 2008-01-14
22:50:46 UTC (rev 5128)
+++
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java 2008-01-15
00:19:02 UTC (rev 5129)
@@ -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());