mx4j/src/test/test/javax/management MBeanServerTest.java,1.11,1.12

Simone Bordet <[email protected]> Sun, 13 Feb 2005 18:05:57 +0000
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/test/test/javax/management
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32671/src/test/test/javax/management

Modified Files:
	MBeanServerTest.java 
Log Message:
Fix for #1115165: ReflectionExceptions are not wrapped

Index: MBeanServerTest.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/test/test/javax/management/MBeanServerTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** MBeanServerTest.java	13 Nov 2004 16:38:30 -0000	1.11
--- MBeanServerTest.java	13 Feb 2005 18:05:53 -0000	1.12
***************
*** 13,18 ****
--- 13,20 ----
  import java.util.Arrays;
  import java.util.Set;
+ 
  import javax.management.JMRuntimeException;
  import javax.management.ListenerNotFoundException;
+ import javax.management.MBeanException;
  import javax.management.MBeanServer;
  import javax.management.MBeanServerDelegate;
***************
*** 28,31 ****
--- 30,34 ----
  import test.javax.management.support.ClassLoaderSupport;
  import test.javax.management.support.ComplianceSupport;
+ import test.javax.management.support.MBeanThrowingExceptions;
  import test.javax.management.support.NotificationSupport;
  import test.javax.management.support.PostRegistrationSupport;
***************
*** 351,353 ****
--- 354,374 ----
        if (!mbean1.getClass().equals(mbean4.getClass())) fail("MBean classes should be equal");
     }
+ 
+    public void testWrapExceptionsThrownByMBeanMethods() throws Exception
+    {
+       MBeanServer server = newMBeanServer();
+ 
+       MBeanThrowingExceptions mbean = new MBeanThrowingExceptions();
+       ObjectName objectName = ObjectName.getInstance(":name=exceptions");
+       server.registerMBean(mbean, objectName);
+ 
+       try
+       {
+          server.invoke(objectName, "throwReflectionException", null, null);
+          fail();
+       }
+       catch (MBeanException x)
+       {
+       }
+    }
  }



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click