Package org.jboss.services.deployment

Examples of org.jboss.services.deployment.MBeanData


      attrs.put("Attr1", "aaaaa");
      attrs.put("Attr2", "bbbbb");
      ;

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);

      // Try with a null mbean name:
      try
      {
         data.setName(null);
         updateMBean(data);
         String msg = "Unexpectedly found mbean with invalid name: " + data;
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try with an empty mbean name:
      try
      {
         data.setName("");
         updateMBean(data);
         String msg = "Unexpectedly found mbean with invalid name: " + data;
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try with an unknown mbean name:
      try
      {
         data.setName("jboss.xxx:service=NoneSuch");
         updateMBean(data);
         String msg = "Unexpectedly found mbean with name: " + data;
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try with an unknown mbean name with multiple attributes::
      try
      {
         data.setName("jboss.xxx:service=NoneSuch,type=Unknown,Alias=whatever");
         updateMBean(data);
         String msg = "Unexpectedly found mbean with name: " + data;
         log.error(msg);
         fail(msg);
      }
View Full Code Here


      attrs.put("Attr1", "aaaaa");
      attrs.put("Attr2", "bbbbb");
      ;

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      data.setName("jboss.mq:service=MessageCache");
      data.setAttributes(attrs);

      // Try with a null template name:
      try
      {
         data.setTemplateName(null);
         log.info("Template=" + data.getTemplateName());
         updateMBean(data);
         String msg = "Update was successful with null template name: "
               + data.getTemplateName();
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try again, but with an empty template name:
      try
      {
         data.setTemplateName("");
         log.info("Template=" + data.getTemplateName());
         updateMBean(data);
         String msg = "Update was successful with empty template name "
               + data.getTemplateName();
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try again, but with an unknown template name:
      try
      {
         data.setTemplateName("nonesuch");
         log.info("Template=" + data.getTemplateName());
         updateMBean(data);
         String msg = "Update was successful with null template "
               + data.getTemplateName();
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
View Full Code Here

   public void testUpdateMBeanBadAttributes() throws Exception
   {
      log.info("+++ testUpdateMBeanBadAttributes");

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      data.setName("jboss.mq:service=MessageCache");
      data.setTemplateName("mbean-update");
      data.setAttributes(null);

      // Update the mbean
      boolean result = updateMBean(data);
      // Yes, I could have used assertTrue, but I want to log all errors:
      if (result)
View Full Code Here

      // For some reason, the following value is rounded up to 1000 if set to
      // 999, so we will use 1000 as the value:
      attrs.put("SoftenWaitMillis", "1000");

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      String name = "jboss.mq:service=MessageCache";
      data.setName(name);
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);

      // Update and verify the mbean:
      boolean result = updateMBean(data);
      // Yes, I could have used assertTrue, but I want to log all errors:
      if (!result)
View Full Code Here

      // Establish the dependency values
      Properties depends = new Properties();
      depends.put("NextInterceptor", "jboss.mq:service=DestinationManager");

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      String name = "jboss.mq:service=SecurityManager";
      data.setName(name);
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);
      data.setDepends(depends);

      // Update and verify the mbean:
      boolean result = updateMBean(data);
      // Yes, I could have used assertTrue, but I want to log all errors:
      if (!result)
View Full Code Here

      Properties depends = new Properties();
      depends.put("", "jboss:service=Naming");

      // Set up the MBean configuration bean, this time with the attributes
      // in the order in which they appear when asking the mbean for the name
      MBeanData data = new MBeanData();
      data
            .setName("jboss.mq:alias=UIL2XAConnectionFactory,service=InvocationLayer,type=UIL2XA");
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);
      data.setDepends(depends);

      // Update and verify the mbean:
      if (!updateMBean(data))
      {
         String msg = "Failed to update mbean: " + data;
         log.error(msg);
         fail(msg);
      }
      verifyMBean(data, null);

      // Try again, but with the name attributes in a different order. This
      // time in the order in which they appear in the xml file:
      attrs = new Properties();
      attrs.put("FromName", "RRRRRRRRRRR");
      attrs.put("ToName", "QQQQQQQQQQQQQ");
      data
            .setName("jboss.mq:service=InvocationLayer,type=UIL2XA,alias=UIL2XAConnectionFactory");
      data.setAttributes(attrs);

      // Update and verify the mbean:
      if (!updateMBean(data))
      {
         String msg = "Failed to update mbean: " + data;
         log.error(msg);
         fail(msg);
      }
      verifyMBean(data, null);

      // Try again, but with the name attributes in another order. This
      // time in the order is different that the mbean name or xml file:
      attrs = new Properties();
      attrs.put("FromName", "LLLLLLLLLLLL");
      attrs.put("ToName", "KKKKKKKKKKKK");
      data
            .setName("jboss.mq:type=UIL2XA,alias=UIL2XAConnectionFactory,service=InvocationLayer");
      data.setAttributes(attrs);

      // Update and verify the mbean:
      if (!updateMBean(data))
      {
         String msg = "Failed to update mbean: " + data;
View Full Code Here

      attrs.put("Attr1", "aaaaa");
      attrs.put("Attr2", "bbbbb");
      ;

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);

      // Try with a null mbean name:
      try
      {
         data.setName(null);
         updateMBean(data);
         String msg = "Unexpectedly found mbean with invalid name: " + data;
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try with an empty mbean name:
      try
      {
         data.setName("");
         updateMBean(data);
         String msg = "Unexpectedly found mbean with invalid name: " + data;
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try with an unknown mbean name:
      try
      {
         data.setName("jboss.xxx:service=NoneSuch");
         updateMBean(data);
         String msg = "Unexpectedly found mbean with name: " + data;
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try with an unknown mbean name with multiple attributes::
      try
      {
         data.setName("jboss.xxx:service=NoneSuch,type=Unknown,Alias=whatever");
         updateMBean(data);
         String msg = "Unexpectedly found mbean with name: " + data;
         log.error(msg);
         fail(msg);
      }
View Full Code Here

      attrs.put("Attr1", "aaaaa");
      attrs.put("Attr2", "bbbbb");
      ;

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      data.setName("jboss.mq:service=MessageCache");
      data.setAttributes(attrs);

      // Try with a null template name:
      try
      {
         data.setTemplateName(null);
         log.info("Template=" + data.getTemplateName());
         updateMBean(data);
         String msg = "Update was successful with null template name: "
               + data.getTemplateName();
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try again, but with an empty template name:
      try
      {
         data.setTemplateName("");
         log.info("Template=" + data.getTemplateName());
         updateMBean(data);
         String msg = "Update was successful with empty template name "
               + data.getTemplateName();
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
         // expected
         log.info("passed");
      }

      // Try again, but with an unknown template name:
      try
      {
         data.setTemplateName("nonesuch");
         log.info("Template=" + data.getTemplateName());
         updateMBean(data);
         String msg = "Update was successful with null template "
               + data.getTemplateName();
         log.error(msg);
         fail(msg);
      }
      catch (MBeanException e)
      {
View Full Code Here

   public void testUpdateMBeanBadAttributes() throws Exception
   {
      log.info("+++ testUpdateMBeanBadAttributes");

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      data.setName("jboss.mq:service=MessageCache");
      data.setTemplateName("mbean-update");
      data.setAttributes(null);

      // Update the mbean
      boolean result = updateMBean(data);
      // Yes, I could have used assertTrue, but I want to log all errors:
      if (result)
View Full Code Here

      // For some reason, the following value is rounded up to 1000 if set to
      // 999, so we will use 1000 as the value:
      attrs.put("SoftenWaitMillis", "1000");

      // Set up the MBean configuration bean:
      MBeanData data = new MBeanData();
      String name = "jboss.mq:service=MessageCache";
      data.setName(name);
      data.setTemplateName("mbean-update");
      data.setAttributes(attrs);

      // Update and verify the mbean:
      boolean result = updateMBean(data);
      // Yes, I could have used assertTrue, but I want to log all errors:
      if (!result)
View Full Code Here

TOP

Related Classes of org.jboss.services.deployment.MBeanData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.