User: d_jencks
  Date: 01/12/05 13:22:21

  Modified:    src/main/org/jboss/test/jmx/test
                        DeployServiceUnitTestCase.java
  Log:
  testcase for bad DynamicMBean that returns null MBeanInfo -- is it registered? 
Thanks to David Budworth
  
  Revision  Changes    Path
  1.8       +36 -1     
jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java
  
  Index: DeployServiceUnitTestCase.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/jmx/test/DeployServiceUnitTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DeployServiceUnitTestCase.java    2001/11/30 15:48:05     1.7
  +++ DeployServiceUnitTestCase.java    2001/12/05 21:22:21     1.8
  @@ -32,7 +32,7 @@
   /**
    * @see       <related>
    * @author    <a href="mailto:[EMAIL PROTECTED]";>David Jencks</a>
  - * @version   $Revision: 1.7 $
  + * @version   $Revision: 1.8 $
    */
   public class DeployServiceUnitTestCase
          extends JBossTestCase
  @@ -749,6 +749,41 @@
         } finally 
         {
            undeployService(testUrl);
  +      } // end of try-catch
  +      
  +   }
  +
  +   public void testNullInfoInDynamicMBean() throws Exception
  +   //Thanks to David Budworth for this test.
  +   //Tries to deploy a DynamicMBean that returns null from getMBeanInfo.
  +   //The Sun RI jmx registers this invalid mbean!!
  +   {
  +      String testUrl = "testnullinfo.sar";
  +      getLog().debug("testUrl is : " + testUrl);
  +      ObjectName nullInfoName = new ObjectName("NullInfoTest:name=NullInfo");
  +      //deploy sar
  +      deployService(testUrl);
  +      try 
  +      {
  +         deployService(testUrl);
  +         assertTrue("nullinfo mbean is registered!", 
!getServer().isRegistered(nullInfoName));
  +
  +      } finally 
  +      {
  +         try
  +         {         
  +            undeployService(testUrl);
  +         }
  +         catch (Exception e) 
  +         { } // end of catch
  +         
  +         try
  +         {         
  +            getServer().unregisterMBean(nullInfoName);
  +         }
  +         catch (Exception e) 
  +         { } // end of catch
  +         
         } // end of try-catch
         
      }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to