[jboss-cvs] JBossAS SVN: r67523 - in branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1136: unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 27 18:09:33 EST 2007


Author: bstansberry at jboss.com
Date: 2007-11-27 18:09:33 -0500 (Tue, 27 Nov 2007)
New Revision: 67523

Added:
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1136/unit/
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1136/unit/ClusteredCacheCleanStartUnitTestCase.java
Log:
[EJBTHREE-1136] Always clear main cache tree in StatefulTreeCache.initialize().

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1136/unit/ClusteredCacheCleanStartUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1136/unit/ClusteredCacheCleanStartUnitTestCase.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1136/unit/ClusteredCacheCleanStartUnitTestCase.java	2007-11-27 23:09:33 UTC (rev 67523)
@@ -0,0 +1,69 @@
+/*
+ * 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.ejb3.test.ejbthree1136.unit;
+
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree1136.SFSBCacheManipulator;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Tests that StatefulTreeCache properly cleans up state when initializing.
+ * 
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClusteredCacheCleanStartUnitTestCase extends JBossTestCase
+{
+   /**
+    * Create a new ClusteredCacheCleanupTestCase.
+    * 
+    * @param name
+    */
+   public ClusteredCacheCleanStartUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(ClusteredCacheCleanStartUnitTestCase.class, "ejbthree1136.sar");
+   }
+
+   public void testClusteredCacheCleanStart() throws Exception
+   {
+      assertEquals("Extraneous data present before deploy", SFSBCacheManipulator.VALUE, getExtraneousData());
+      
+      deploy("ejbthree1136.jar");
+
+      assertEquals("Extraneous data removed", null, getExtraneousData());
+   }
+   
+   private Object getExtraneousData() throws Exception
+   {
+      ObjectName on = new ObjectName("jboss.test:service=Ejb3SFSBCacheManipulator");
+      return invoke(on, "getFromBeanCache", new Object[]{}, new String[]{});
+   }
+}




More information about the jboss-cvs-commits mailing list