[jboss-cvs] JBossAS SVN: r80711 - trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Nov 8 22:10:16 EST 2008
Author: bstansberry at jboss.com
Date: 2008-11-08 22:10:16 -0500 (Sat, 08 Nov 2008)
New Revision: 80711
Removed:
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/CacheListenerUnitTestCase.java
Log:
Move unit test case to the ha-server-cache-jbc project
Deleted: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/CacheListenerUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/CacheListenerUnitTestCase.java 2008-11-09 03:09:38 UTC (rev 80710)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/CacheListenerUnitTestCase.java 2008-11-09 03:10:16 UTC (rev 80711)
@@ -1,119 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.test.cluster.defaultcfg.simpleweb.test;
-
-import junit.framework.TestCase;
-
-import org.jboss.cache.Fqn;
-import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.CacheListener;
-import org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.CacheListenerBase;
-import org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.FieldBasedJBossCacheService;
-import org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.JBossCacheService;
-
-/**
- * A CacheListenerUnitTestCase.
- *
- * FIXME: Move this to the ha-server-cache-jbc project
- *
- * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision$
- */
-public class CacheListenerUnitTestCase extends TestCase
-{
- private static final String DATA_OWNER = "localhost_12345";
-
- public void testIsBuddyFqn()
- {
- assertFalse("ROOT is not buddy", CacheListenerBase.isBuddyFqn(Fqn.ROOT));
-
- Fqn test = new Fqn(new Object[]{"random", BuddyManager.BUDDY_BACKUP_SUBTREE});
- assertFalse("Random is not buddy", CacheListenerBase.isBuddyFqn(test));
-
- test = JBossCacheService.getSessionFqn("localhost", "webapp", "123");
- assertFalse("Normal is not buddy", CacheListenerBase.isBuddyFqn(test));
-
- test = JBossCacheService.getSessionFqn(DATA_OWNER, "localhost", "webapp", "123");
- assertTrue("Buddy is a buddy", CacheListenerBase.isBuddyFqn(test));
- }
-
- public void testGetBuddyBackupOwner()
- {
- Fqn test = JBossCacheService.getSessionFqn(DATA_OWNER, "localhost", "webapp", "123");
- assertEquals("Got correct owner", DATA_OWNER, CacheListenerBase.getBuddyOwner(test));
- }
-
- public void testIsFqnSessionRootSized()
- {
- Fqn test = JBossCacheService.getSessionFqn("localhost", "webapp", "123");
- assertTrue("Non-buddy session root correct", CacheListenerBase.isFqnSessionRootSized(test, false));
- assertFalse("Non-buddy session root correct with wrong isBuddy", CacheListenerBase.isFqnSessionRootSized(test, true));
-
- test = JBossCacheService.getSessionFqn(DATA_OWNER, "localhost", "webapp", "123");
- assertTrue("Buddy session root correct", CacheListenerBase.isFqnSessionRootSized(test, true));
- assertFalse("Buddy session root correct with wrong isBuddy", CacheListenerBase.isFqnSessionRootSized(test, false));
-
- test = JBossCacheService.getAttributeFqn("localhost", "webapp", "123");
- assertFalse("Non-buddy non-session root correct", CacheListenerBase.isFqnSessionRootSized(test, false));
-
- test = JBossCacheService.getSessionFqn(DATA_OWNER, "localhost", "webapp", "123");
- test = new Fqn(test, JBossCacheService.ATTRIBUTE);
- assertFalse("Buddy non-session root correct", CacheListenerBase.isFqnSessionRootSized(test, true));
- }
-
- public void testIsPossibleInternalPojoFqn()
- {
- Fqn test = JBossCacheService.getSessionFqn("localhost", "webapp", "123");
- assertFalse("Session root correct", CacheListener.isPossibleInternalPojoFqn(test));
-
- test = JBossCacheService.getAttributeFqn("localhost", "webapp", "123");
- assertFalse("ATTRIBUTE fqn correct", CacheListener.isPossibleInternalPojoFqn(test));
-
- test = FieldBasedJBossCacheService.getFieldFqn("localhost", "webapp", "123", "person");
- assertFalse("Pojo attach point correct", CacheListener.isPossibleInternalPojoFqn(test));
-
- test = JBossCacheService.getSessionFqn("localhost", "webapp", "123");
- test = new Fqn(test, "_JBossInternal_");
- test = new Fqn(test, "person");
- assertTrue("Internal pojo correct", CacheListener.isPossibleInternalPojoFqn(test));
- }
-
- public void testGetPojoKeyFromFqn()
- {
- Fqn test = FieldBasedJBossCacheService.getFieldFqn("localhost", "webapp", "123", "person");
- assertEquals("Non-buddy pojo field correct", "person", CacheListener.getPojoKeyFromFqn(test, false));
-
- test = FieldBasedJBossCacheService.getFieldFqn("localhost", "webapp", "123", "person");
- test = new Fqn(test, "subobject");
- assertEquals("Non-buddy pojo field correct with subobject", "person", CacheListener.getPojoKeyFromFqn(test, false));
-
- test = JBossCacheService.getSessionFqn(DATA_OWNER, "localhost", "webapp", "123");
- test = new Fqn(test, JBossCacheService.ATTRIBUTE);
- test = new Fqn(test, "person");
- assertEquals("Buddy pojo field correct", "person", CacheListener.getPojoKeyFromFqn(test, true));
-
- test = new Fqn(test, "subobject");
- assertEquals("Buddy pojo field correct with subobject", "person", CacheListener.getPojoKeyFromFqn(test, true));
-
- }
-}
More information about the jboss-cvs-commits
mailing list