Examples of OpenMBeanConstructorInfoSupport


Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

         OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
         {
            new OpenMBeanParameterInfoSupport(
               "name", "description", SimpleType.STRING)
         };
         new OpenMBeanConstructorInfoSupport(
            null, "description", parms);
      }
      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 OpenMBeanConstructorInfoSupport(
            "", "description", parms);
      }
      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 OpenMBeanConstructorInfoSupport(
            "name", null, parms);
      }
      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 OpenMBeanConstructorInfoSupport(
            "name", "", parms);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Expected IllegalArgumentException for empty description");

      caught = false;
      try
      {
         new OpenMBeanConstructorInfoSupport(
            "name", "description", new MyOpenMBeanParameterInfo[] { new MyOpenMBeanParameterInfo() });
      }
      catch (ArrayStoreException e)
      {
         caught = true;
View Full Code Here

Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

         new OpenMBeanAttributeInfoSupport(
         "name", "description", SimpleType.STRING, true, true, false)
      };
      OpenMBeanConstructorInfoSupport[] constructors = new OpenMBeanConstructorInfoSupport[]
      {
         new OpenMBeanConstructorInfoSupport(
         "name", "description", parms)
      };
      OpenMBeanOperationInfoSupport[] operations = new OpenMBeanOperationInfoSupport[]
      {
         new OpenMBeanOperationInfoSupport(
View Full Code Here

Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

         new OpenMBeanAttributeInfoSupport(
         "name", "description", SimpleType.STRING, true, true, false)
      };
      OpenMBeanConstructorInfoSupport[] constructors = new OpenMBeanConstructorInfoSupport[]
      {
         new OpenMBeanConstructorInfoSupport(
         "name", "description", parms)
      };
      OpenMBeanOperationInfoSupport[] operations = new OpenMBeanOperationInfoSupport[]
      {
         new OpenMBeanOperationInfoSupport(
         "name", "description", parms,
         SimpleType.STRING, MBeanOperationInfo.ACTION_INFO)
      };
      MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[]
      {
         new MBeanNotificationInfo(new String[] { "type1", "type" }, "name", "description")
      };
      OpenMBeanInfoSupport info = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations, notifications);

      assertTrue("Null is not equal to any instance", info.equals(null) == false);
      assertTrue("Instance is only equal another OpenMBeanInfo instance", info.equals(new Object()) == false);
      assertTrue("Instance should equal itself", info.equals(info));

      OpenMBeanInfoSupport info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations, notifications);
      assertTrue("Instances with same values should be equal", info.equals(info2));
      assertTrue("Instances with same values should be equal", info2.equals(info));

      info2 = new OpenMBeanInfoSupport(
         "name2", "description", attributes, constructors,
         operations, notifications);
      assertTrue("Instances with different class names are not equal", info.equals(info2) == false);
      assertTrue("Instances with different class names are not equal", info2.equals(info) == false);

      info2 = new OpenMBeanInfoSupport(
         "name", "description2", attributes, constructors,
         operations, notifications);
      assertTrue("Instances with different descriptions are equal", info.equals(info2));
      assertTrue("Instances with different descriptions are equal", info2.equals(info));

      OpenMBeanAttributeInfoSupport[] attributes2 = new OpenMBeanAttributeInfoSupport[]
      {
         new OpenMBeanAttributeInfoSupport(
         "name2", "description", SimpleType.STRING, true, true, false)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes2, constructors,
         operations, notifications);
      assertTrue("Instances with different attributes are not equal", info.equals(info2) == false);
      assertTrue("Instances with different attributes are not equal", info2.equals(info) == false);

      attributes2 = new OpenMBeanAttributeInfoSupport[]
      {
         new OpenMBeanAttributeInfoSupport(
         "name2", "description", SimpleType.STRING, true, true, false),
         new OpenMBeanAttributeInfoSupport(
         "name3", "description", SimpleType.STRING, true, true, false)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes2, constructors,
         operations, notifications);
      assertTrue("Instances with different numbers of attributes are not equal", info.equals(info2) == false);
      assertTrue("Instances with different numbers of attributes are not equal", info2.equals(info) == false);

      info2 = new OpenMBeanInfoSupport(
         "name", "description", null, constructors,
         operations, notifications);
      assertTrue("Instances with and without attributes are not equal", info.equals(info2) == false);
      assertTrue("Instances with and without attributes are not equal", info2.equals(info) == false);

      OpenMBeanConstructorInfoSupport[] constructors2 = new OpenMBeanConstructorInfoSupport[]
      {
         new OpenMBeanConstructorInfoSupport(
         "name2", "description", parms)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors2,
         operations, notifications);
      assertTrue("Instances with different constructors are not equal", info.equals(info2) == false);
      assertTrue("Instances with different constructors are not equal", info2.equals(info) == false);

      constructors2 = new OpenMBeanConstructorInfoSupport[]
      {
         new OpenMBeanConstructorInfoSupport(
         "name2", "description", parms),
         new OpenMBeanConstructorInfoSupport(
         "name3", "description", parms)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors2,
View Full Code Here

Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

         new OpenMBeanAttributeInfoSupport(
         "name", "description", SimpleType.STRING, true, true, false)
      };
      OpenMBeanConstructorInfoSupport[] constructors = new OpenMBeanConstructorInfoSupport[]
      {
         new OpenMBeanConstructorInfoSupport(
         "name", "description", parms)
      };
      OpenMBeanOperationInfoSupport[] operations = new OpenMBeanOperationInfoSupport[]
      {
         new OpenMBeanOperationInfoSupport(
View Full Code Here

Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

         new OpenMBeanAttributeInfoSupport(
         "name", "description", SimpleType.STRING, true, true, false)
      };
      OpenMBeanConstructorInfoSupport[] constructors = new OpenMBeanConstructorInfoSupport[]
      {
         new OpenMBeanConstructorInfoSupport(
         "name", "description", parms)
      };
      OpenMBeanOperationInfoSupport[] operations = new OpenMBeanOperationInfoSupport[]
      {
         new OpenMBeanOperationInfoSupport(
View Full Code Here

Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

         new OpenMBeanAttributeInfoSupport(
         "name", "description", SimpleType.STRING, true, true, false)
      };
      OpenMBeanConstructorInfoSupport[] constructors = new OpenMBeanConstructorInfoSupport[]
      {
         new OpenMBeanConstructorInfoSupport(
         "name", "description", parms)
      };
      OpenMBeanOperationInfoSupport[] operations = new OpenMBeanOperationInfoSupport[]
      {
         new OpenMBeanOperationInfoSupport(
View Full Code Here

Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

                identicalArrays(signature, ci.getSignature()))
            return ci;
        if (ci instanceof OpenMBeanConstructorInfo) {
            OpenMBeanParameterInfo[] oparams =
                paramsToOpenParams(signature);
            return new OpenMBeanConstructorInfoSupport(ci.getName(),
                                                       description,
                                                       oparams,
                                                       ci.getDescriptor());
        } else {
            return new MBeanConstructorInfo(ci.getName(),
View Full Code Here

Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

      TestRunner.run(OpenMBeanConstructorInfoSupportTest.class);
   }

   public void testCtor() throws Exception
   {
      OpenMBeanConstructorInfoSupport info =
              new OpenMBeanConstructorInfoSupport("wine",
                                                  "Non-default constructor",
                                                  signature);
      assertTrue("Null info constructed", info != null);
      assertTrue("Unexpected name", info.getName().compareTo("wine") == 0);
      assertTrue("Unexpected description",
                 info.getDescription().compareTo("Non-default constructor") == 0);
      assertTrue("Unexpected signature",
                 Arrays.equals(info.getSignature(), signature));

      info =
      new OpenMBeanConstructorInfoSupport("wine",
                                          "Non-default constructor",
                                          null);
      assertTrue("Null info constructed", info != null);
      assertTrue("Unexpected name", info.getName().compareTo("wine") == 0);
      assertTrue("Unexpected description",
                 info.getDescription().compareTo("Non-default constructor") == 0);
      assertTrue("Unexpected signature", info.getSignature() == null || info.getSignature().length == 0);

      info =
      new OpenMBeanConstructorInfoSupport("wine",
                                          "Non-default constructor",
                                          new OpenMBeanParameterInfoSupport[0]);
      assertTrue("Null info constructed", info != null);
      assertTrue("Unexpected name", info.getName().compareTo("wine") == 0);
      assertTrue("Unexpected description",
                 info.getDescription().compareTo("Non-default constructor") == 0);
      assertTrue("Unexpected signature", info.getSignature().length == 0);
   }
View Full Code Here

Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

   public void testCtorNullName() throws Exception
   {
      try
      {
         OpenMBeanConstructorInfoSupport info =
                 new OpenMBeanConstructorInfoSupport(null,
                                                     "Non-default constructor",
                                                     signature);
         fail("Expecting IllegalArgumentException");
      }
      catch (IllegalArgumentException x)
View Full Code Here

Examples of javax.management.openmbean.OpenMBeanConstructorInfoSupport

   public void testCtorEmptyName() throws Exception
   {
      try
      {
         OpenMBeanConstructorInfoSupport info =
                 new OpenMBeanConstructorInfoSupport("",
                                                     "Non-default constructor",
                                                     signature);
         fail("Expecting IllegalArgumentException");
      }
      catch (IllegalArgumentException x)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.