Package javax.management.openmbean

Examples of javax.management.openmbean.OpenMBeanParameterInfoSupport


      boolean caught = false;
      try
      {
         OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
         {
            new OpenMBeanParameterInfoSupport(
               "name", "description", SimpleType.STRING)
         };
         new OpenMBeanOperationInfoSupport(
            null, "description", parms,
            SimpleType.STRING, MBeanOperationInfo.ACTION_INFO);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected IllegalArgumentException for null name");

      caught = false;
      try
      {
         OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
         {
            new OpenMBeanParameterInfoSupport(
               "name", "description", SimpleType.STRING)
         };
         new OpenMBeanOperationInfoSupport(
            "", "description", parms,
            SimpleType.STRING, MBeanOperationInfo.ACTION_INFO);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected IllegalArgumentException for empty name");

      caught = false;
      try
      {
         OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
         {
            new OpenMBeanParameterInfoSupport(
               "name", "description", SimpleType.STRING)
         };
         new OpenMBeanOperationInfoSupport(
            "name", null, parms,
            SimpleType.STRING, MBeanOperationInfo.ACTION_INFO);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected IllegalArgumentException for null description");

      caught = false;
      try
      {
         OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
         {
            new OpenMBeanParameterInfoSupport(
               "name", "description", SimpleType.STRING)
         };
         new OpenMBeanOperationInfoSupport(
            "name", "", parms,
            SimpleType.STRING, MBeanOperationInfo.ACTION_INFO);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected IllegalArgumentException for empty description");

      caught = false;
      try
      {
         new OpenMBeanOperationInfoSupport(
            "name", "description", new MyOpenMBeanParameterInfo[] { new MyOpenMBeanParameterInfo() },
            SimpleType.STRING, MBeanOperationInfo.ACTION_INFO);
      }
      catch (ArrayStoreException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected ArrayStoreException for non MBeanParameterInfo array");

      caught = false;
      try
      {
         OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
         {
            new OpenMBeanParameterInfoSupport(
               "name", "description", SimpleType.STRING)
         };
         new OpenMBeanOperationInfoSupport(
            "name", "description", parms,
            null, MBeanOperationInfo.ACTION_INFO);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected IllegalArgumentException for null return type");

      caught = false;
      try
      {
         OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
         {
            new OpenMBeanParameterInfoSupport(
               "name", "description", SimpleType.STRING)
         };
         new OpenMBeanOperationInfoSupport(
            "name", "description", parms,
            SimpleType.VOID, MBeanOperationInfo.ACTION_INFO);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == true)
         fail("Didn't expect IllegalArgumentException for VOID return type");

      caught = false;
      try
      {
         OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
         {
            new OpenMBeanParameterInfoSupport(
               "name", "description", SimpleType.STRING)
         };
         new OpenMBeanOperationInfoSupport(
            "name", "description", parms,
            SimpleType.STRING, 1234567);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected IllegalArgumentExecption for invalid action");

      caught = false;
      try
      {
         OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
         {
            new OpenMBeanParameterInfoSupport(
               "name", "description", SimpleType.STRING)
         };
         new OpenMBeanOperationInfoSupport(
            "name", "description", parms,
            SimpleType.STRING, MBeanOperationInfo.UNKNOWN);
View Full Code Here


      assertEquals(0, info.getNotifications().length);
      assertEquals(0, info.getOperations().length);

      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

   public void testEquals()
      throws Exception
   {
      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

   public void testHashCode()
      throws Exception
   {
      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

   public void testToString()
      throws Exception
   {
      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

   public void testSerialization()
      throws Exception
   {
      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

                typeDescriptor(openType, originalType);
            descriptor = ImmutableDescriptor.union(descriptor,
                    Introspector.descriptorForAnnotations(annots[i]));
            final MBeanParameterInfo pi;
            if (canUseOpenInfo(originalType)) {
                pi = new OpenMBeanParameterInfoSupport("p" + i,
                                                       paramDescription,
                                                       openType,
                                                       descriptor);
            } else {
                openParameterTypes = false;
View Full Code Here

        if (equal(name, pi.getName()) &&
                equal(description, pi.getDescription()))
            return pi;
        else if (pi instanceof OpenMBeanParameterInfo) {
            OpenMBeanParameterInfo opi = (OpenMBeanParameterInfo) pi;
            return new OpenMBeanParameterInfoSupport(name,
                                                     description,
                                                     opi.getOpenType(),
                                                     pi.getDescriptor());
        } else {
            return new MBeanParameterInfo(name,
View Full Code Here

                typeDescriptor(openType, originalType);
            descriptor = ImmutableDescriptor.union(descriptor,
                    Introspector.descriptorForAnnotations(annots[i]));
            final MBeanParameterInfo pi;
            if (canUseOpenInfo(originalType)) {
                pi = new OpenMBeanParameterInfoSupport(paramName,
                                                       paramDescription,
                                                       openType,
                                                       descriptor);
            } else {
                openParameterTypes = false;
View Full Code Here

      super.setUp();

      params =
      new OpenMBeanParameterInfo[]{

         new OpenMBeanParameterInfoSupport("name", "The name", SimpleType.STRING)
      };

      signature = new OpenMBeanParameterInfo[]{
         new OpenMBeanParameterInfoSupport("from",
                                           "currency to convert from",
                                           SimpleType.STRING),
         new OpenMBeanParameterInfoSupport("to",
                                           "currency to convert to",
                                           SimpleType.STRING)};
   }
View Full Code Here

TOP

Related Classes of javax.management.openmbean.OpenMBeanParameterInfoSupport

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.