[jboss-cvs] JBossAS SVN: r77501 - in trunk/testsuite/src/main/org/jboss/test/cluster: defaultcfg/web/test and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Aug 26 14:57:46 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-08-26 14:57:46 -0400 (Tue, 26 Aug 2008)
New Revision: 77501
Modified:
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionBasedMaxUnreplicatedIntervalTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/SessionPassivationTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/web/field/test/StateTransferTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java
trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelper.java
trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelperMBean.java
trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelperServletContextListener.java
Log:
[JBAS-5820] Strip out unneeded direct test calls to JBC
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionBasedMaxUnreplicatedIntervalTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionBasedMaxUnreplicatedIntervalTestCase.java 2008-08-26 18:41:53 UTC (rev 77500)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionBasedMaxUnreplicatedIntervalTestCase.java 2008-08-26 18:57:46 UTC (rev 77501)
@@ -237,6 +237,7 @@
// Try to force out the overaged sessions
jbcm1.backgroundProcess();
// Confirm they are still there
+ // FIXME -- avoid direct cache operations
assertNotNull(pojoCaches[1].getCache().get(session1Fqn, JBossCacheService.VERSION_KEY));
assertNotNull(pojoCaches[1].getCache().get(session2Fqn, JBossCacheService.VERSION_KEY));
@@ -250,6 +251,7 @@
// The get restored a new fresh session with the first id, but the 2nd
// one is still there and overaged. Try to force it out
jbcm1.backgroundProcess();
+ // FIXME -- avoid direct cache operations
assertNull(pojoCaches[1].getCache().get(session2Fqn, JBossCacheService.VERSION_KEY));
}
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/SessionPassivationTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/SessionPassivationTestCase.java 2008-08-26 18:41:53 UTC (rev 77500)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/web/test/SessionPassivationTestCase.java 2008-08-26 18:57:46 UTC (rev 77501)
@@ -197,7 +197,6 @@
// Create enough sessions on server0 to trigger passivation
// assuming that max-active-sessions is set to 10 in jboss-web.xml
- getLog().debug("current active sessions = " + SessionTestUtil.getSessionIds(adaptors[0], warFqn_));
for (int i = 0; i < 10; i++)
{
HttpClient newClient = new HttpClient();
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/web/field/test/StateTransferTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/web/field/test/StateTransferTestCase.java 2008-08-26 18:41:53 UTC (rev 77500)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/multicfg/web/field/test/StateTransferTestCase.java 2008-08-26 18:57:46 UTC (rev 77501)
@@ -196,7 +196,7 @@
// Stop the war on server0
undeploy(adaptor0_, getWarName() + ".war");
- boolean buddyRepl = SessionTestUtil.isBuddyReplication(adaptor0_);
+ boolean buddyRepl = SessionTestUtil.isBuddyReplication();
if (buddyRepl)
{
sessions = SessionTestUtil.getSessionIds(adaptor0_, warFqn_);
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java 2008-08-26 18:41:53 UTC (rev 77500)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java 2008-08-26 18:57:46 UTC (rev 77501)
@@ -302,15 +302,6 @@
new String[]{ String.class.getName(), boolean.class.getName() });
}
- public static boolean exists(MBeanServerConnection adaptor, String fqn) throws Exception
- {
- Boolean b = (Boolean) adaptor.invoke(CacheHelper.OBJECT_NAME,
- "exists",
- new Object[] { fqn },
- STRING_ONLY_TYPES);
- return b.booleanValue();
- }
-
public static Set getSessionIds(MBeanServerConnection adaptor, String warFqn) throws Exception
{
return (Set) adaptor.invoke(CacheHelper.OBJECT_NAME,
@@ -327,28 +318,10 @@
STRING_BOOLEAN_TYPES);
}
- public static boolean isBuddyReplication(MBeanServerConnection adaptor) throws Exception
+ public static boolean isBuddyReplication() throws Exception
{
-
- return ((Boolean) adaptor.invoke(CacheHelper.OBJECT_NAME,
- "isBuddyReplication",
- new Object[] { },
- new String[]{})).booleanValue();
+ return Boolean.parseBoolean(System.getProperty("jbosstest.cluster.web.cache.br", "false"));
}
-
- public static void leaveHelperOnServer(MBeanServerConnection adaptor) throws Exception
- {
- adaptor.invoke(CacheHelper.OBJECT_NAME,
- "setLeaveInstalledAfterShutdown",
- new Object[0], new String[0]);
- }
-
- public static void uninstallHelper(MBeanServerConnection adaptor) throws Exception
- {
- adaptor.invoke(CacheHelper.OBJECT_NAME,
- "uninstall",
- new Object[0], new String[0]);
- }
/**
* Loops, continually calling {@link #areCacheViewsComplete(org.jboss.cache.Cache[])}
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelper.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelper.java 2008-08-26 18:41:53 UTC (rev 77500)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelper.java 2008-08-26 18:57:46 UTC (rev 77501)
@@ -34,7 +34,6 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.ha.framework.server.CacheManagerLocator;
import org.jboss.ha.framework.server.PojoCacheManager;
import org.jboss.ha.framework.server.PojoCacheManagerLocator;
@@ -68,7 +67,6 @@
private String cacheConfigName;
private Cache cache;
private boolean usePojoCache;
- private boolean leaveInstalledAfterShutdown;
public CacheHelper()
{
@@ -134,17 +132,6 @@
return result;
}
- public boolean exists(String fqn)
- {
- return getCache().getRoot().hasChild(Fqn.fromString(fqn));
- }
-
- public boolean isBuddyReplication()
- {
- BuddyReplicationConfig brc = getCache().getConfiguration().getBuddyReplicationConfig();
- return (brc != null && brc.isEnabled());
- }
-
public Set getSessionIds(String warFqn) throws Exception
{
return getSessionIds(warFqn, true);
@@ -229,16 +216,6 @@
return false;
}
- public boolean getLeaveInstalledAfterShutdown()
- {
- return leaveInstalledAfterShutdown;
- }
-
- public void setLeaveInstalledAfterShutdown()
- {
- this.leaveInstalledAfterShutdown = true;
- }
-
public void startService() throws Exception
{
super.startService();
@@ -280,22 +257,6 @@
}
}
- public void uninstall()
- {
- Thread t = new Thread() {
- public void run() {
- try
- {
- releaseCache();
- server.unregisterMBean(OBJECT_NAME);
- }
- catch (Exception e) {}
- }
- };
-
- t.start();
- }
-
private Set getBuddyBackupRoots()
{
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelperMBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelperMBean.java 2008-08-26 18:41:53 UTC (rev 77500)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelperMBean.java 2008-08-26 18:57:46 UTC (rev 77501)
@@ -14,16 +14,8 @@
Set getSessionIds(String warFqn, boolean includeBuddies) throws Exception;
- boolean isBuddyReplication();
-
- boolean exists(String fqn);
-
Set getSSOIds() throws Exception;
boolean getCacheHasSSO(String ssoId) throws Exception;
-
- void setLeaveInstalledAfterShutdown();
-
- void uninstall();
}
\ No newline at end of file
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelperServletContextListener.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelperServletContextListener.java 2008-08-26 18:41:53 UTC (rev 77500)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/web/CacheHelperServletContextListener.java 2008-08-26 18:57:46 UTC (rev 77501)
@@ -32,10 +32,9 @@
{
try
{
- if (helper != null && !helper.getLeaveInstalledAfterShutdown()
- && (server.isRegistered(CacheHelper.OBJECT_NAME)))
+ if (helper != null && server.isRegistered(CacheHelper.OBJECT_NAME))
{
- server.unregisterMBean(CacheHelper.OBJECT_NAME);
+ server.unregisterMBean(CacheHelper.OBJECT_NAME);
}
}
catch (Exception e)
More information about the jboss-cvs-commits
mailing list