[jboss-cvs] JBossAS SVN: r82610 - in branches/JBPAPP_4_2_0_GA_CP: ejb3/src/test/org/jboss/ejb3/test/clusteredsession/unit and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jan 5 11:28:42 EST 2009
Author: galder.zamarreno at jboss.com
Date: 2009-01-05 11:28:42 -0500 (Mon, 05 Jan 2009)
New Revision: 82610
Modified:
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/ProxiedStatefulBeanContext.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/clusteredsession/unit/NestedBeanUnitTestCase.java
branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/buildmagic.ent
branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/version-info.xml
Log:
[JBPAPP-1543] Implement equals() and hashCode() for ProxiedStatefulBeanContext so that nested SFSBs can be shown when printing cache details.
Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/ProxiedStatefulBeanContext.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/ProxiedStatefulBeanContext.java 2009-01-05 14:44:23 UTC (rev 82609)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/ProxiedStatefulBeanContext.java 2009-01-05 16:28:42 UTC (rev 82610)
@@ -40,6 +40,7 @@
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @author Brian Stansberry
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
*
* @version $Revision$
*/
@@ -412,8 +413,7 @@
{
// ignore
}
-
- /**
+/**
* Ignores the call, as replication of this proxy context
* does not affect the underlying bean (which is replicated
* along with its parent context).
@@ -424,4 +424,26 @@
// ignore
}
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+
+ if (obj instanceof ProxiedStatefulBeanContext)
+ {
+ ProxiedStatefulBeanContext other = (ProxiedStatefulBeanContext) obj;
+ return (containerId.equals(other.containerId) && oid.equals(other.oid));
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = 11;
+ result = 29 * result + containerId.hashCode();
+ result = 29 * result + oid.hashCode();
+ return result;
+ }
}
Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/clusteredsession/unit/NestedBeanUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/clusteredsession/unit/NestedBeanUnitTestCase.java 2009-01-05 14:44:23 UTC (rev 82609)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/clusteredsession/unit/NestedBeanUnitTestCase.java 2009-01-05 16:28:42 UTC (rev 82610)
@@ -10,6 +10,8 @@
import java.rmi.dgc.VMID;
import java.util.Properties;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -26,6 +28,7 @@
* the beans.
*
* @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
* @version $Revision$
*/
public class NestedBeanUnitTestCase
@@ -167,4 +170,32 @@
getLog().debug("ok");
}
+ public void testStatefulBeanWithCachePrintDetails()
+ throws Exception
+ {
+ getLog().debug("Test Nested Stateful Bean And Call TreeCache.printDetails() Afterwards");
+ getLog().debug("======================================================================");
+
+ NestedBeanSet beanSet = runner.getNestedBeanSet();
+ ParentStatefulRemote stateful = beanSet.parent;
+ VMID node1 = stateful.getVMID();
+ assertNotNull("State node: ", node1);
+ getLog ().debug ("Node 1 ID: " +node1);
+
+ assertEquals("Counter: ", 1, stateful.incrementLocal());
+ assertEquals("Counter: ", 2, stateful.incrementLocal());
+
+ callCachePrintDetails();
+
+ runner.removeBean(stateful);
+ getLog().debug("ok");
+ }
+
+ protected void callCachePrintDetails()
+ throws Exception
+ {
+ InitialContext ctx = getInitialContext(0);
+ MBeanServerConnection server = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");
+ server.invoke(new ObjectName("jboss.cache:service=EJB3SFSBClusteredCache"), "printDetails", new Object[0], new String[0]);
+ }
}
Modified: branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/buildmagic.ent
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/buildmagic.ent 2009-01-05 14:44:23 UTC (rev 82609)
+++ branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/buildmagic.ent 2009-01-05 16:28:42 UTC (rev 82610)
@@ -100,9 +100,9 @@
<!-- Version identifiers for the server. -->
<property name="version.major" value="4"/>
- <property name="version.minor" value="2"/>
+ <property name="version.minor" value="3"/>
<property name="version.revision" value="0"/>
- <property name="version.tag" value="GA_CP02"/>
+ <property name="version.tag" value="GA_CP03"/>
<property name="version.name" value="Trinity"/>
<!-- This must be set to the CVS tag for any release -->
<property name="version.cvstag" value="JBPAPP_${version.major}_${version.minor}_${version.revision}_${version.tag}" />
Modified: branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/version-info.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/version-info.xml 2009-01-05 14:44:23 UTC (rev 82609)
+++ branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/version-info.xml 2009-01-05 16:28:42 UTC (rev 82610)
@@ -15,9 +15,9 @@
<!-- Version identifiers for the server. -->
<property name="version.major" value="4"/>
- <property name="version.minor" value="2"/>
+ <property name="version.minor" value="3"/>
<property name="version.revision" value="0"/>
- <property name="version.tag" value="GA_CP02"/>
+ <property name="version.tag" value="GA_CP03"/>
<property name="version.name" value="Trinity"/>
<!-- This must be set to the CVS tag for any release -->
<property name="version.cvstag" value="JBPAPP_${version.major}_${version.minor}_${version.revision}_${version.tag}"/>
More information about the jboss-cvs-commits
mailing list