[jboss-cvs] JBossAS SVN: r62178 - branches/Branch_4_0/testsuite/src/main/org/jboss/test/jmx/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Apr 8 08:44:08 EDT 2007


Author: mageshbk at jboss.com
Date: 2007-04-08 08:44:07 -0400 (Sun, 08 Apr 2007)
New Revision: 62178

Modified:
   branches/Branch_4_0/testsuite/src/main/org/jboss/test/jmx/test/RMIAdaptorUnitTestCase.java
Log:
[JBAS-1955] Updated to test the SerializablePolicy too so that it works with getAttributes similar to twiddle.

Modified: branches/Branch_4_0/testsuite/src/main/org/jboss/test/jmx/test/RMIAdaptorUnitTestCase.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/jmx/test/RMIAdaptorUnitTestCase.java	2007-04-08 12:42:04 UTC (rev 62177)
+++ branches/Branch_4_0/testsuite/src/main/org/jboss/test/jmx/test/RMIAdaptorUnitTestCase.java	2007-04-08 12:44:07 UTC (rev 62178)
@@ -23,6 +23,8 @@
 
 import java.util.Iterator;
 
+import javax.management.AttributeList;
+import javax.management.MBeanAttributeInfo;
 import javax.management.MBeanInfo;
 import javax.management.ObjectName;
 import javax.naming.InitialContext;
@@ -31,8 +33,9 @@
 import org.jboss.test.JBossTestCase;
 
 /** 
- * Tests over the RMIAdaptor
+ * Tests over the RMIAdaptor and the SerializablePolicy
  *
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
  * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  * @version <tt>$Revision$</tt>
  */
@@ -65,6 +68,20 @@
          try
          {
             MBeanInfo mbeanInfo = rmiAdaptor.getMBeanInfo(objectName);
+            if (mbeanInfo != null)
+            {
+               // This gives only serializable attributes
+               MBeanAttributeInfo[] attrInfos = mbeanInfo.getAttributes();
+               int attrCount = attrInfos.length;
+               String[] attrNames = new String[attrCount];
+               for (int i = 0; i < attrCount; i++)
+               {
+                  attrNames[i] = ((MBeanAttributeInfo)attrInfos[i]).getName();
+               }
+               // Now call the getAttributes on these serializable attributes
+               // even ClassNotFoundExceptions are overcome with this method
+               AttributeList attrs = rmiAdaptor.getAttributes(objectName,attrNames);
+            }
          }
          catch (Throwable t)
          {




More information about the jboss-cvs-commits mailing list