Package javax.management.openmbean

Examples of javax.management.openmbean.OpenMBeanParameterInfoSupport


   public void testMinMaxValueCtorDefaultOutOfRange() throws Exception
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("price",
                                                   "how much it costs",
                                                   SimpleType.FLOAT,
                                                   new Float(0.75),
                                                   new Float(1.00),
                                                   new Float(1.50));
         fail("Expecting OpenDataException default < min");
      }
      catch (OpenDataException x)
      {
         assertTrue(true);
      }

      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("price",
                                                   "how much it costs",
                                                   SimpleType.FLOAT,
                                                   new Float(1.50),
                                                   new Float(0.75),
                                                   new Float(1.00));
View Full Code Here


      }
   }

   public void testBasicHashCode() throws Exception
   {
      OpenMBeanParameterInfoSupport infoone =
              new OpenMBeanParameterInfoSupport("currency",
                                                "monetary currency",
                                                SimpleType.STRING);
      assertTrue("Unexpected basic hash code",
                 infoone.hashCode() == hashCode(infoone));

      OpenMBeanParameterInfoSupport infotwo =
              new OpenMBeanParameterInfoSupport("currency",
                                                "legal tender",
                                                SimpleType.STRING);
      assertTrue("Expecting hash codes to be equal", infotwo.hashCode() == infoone.hashCode());
   }
View Full Code Here

      assertTrue("Expecting hash codes to be equal", infotwo.hashCode() == infoone.hashCode());
   }

   public void testDefaultValueHashCode() throws Exception
   {
      OpenMBeanParameterInfoSupport infoone =
              new OpenMBeanParameterInfoSupport("currency",
                                                "monetary currency",
                                                SimpleType.STRING,
                                                "Euro");
      assertTrue("Unexpected default value hash code",
                 infoone.hashCode() == hashCode(infoone));

      OpenMBeanParameterInfoSupport infotwo =
              new OpenMBeanParameterInfoSupport("currency",
                                                "legal tender",
                                                SimpleType.STRING,
                                                "Euro");
      assertTrue("Unexpected default value hash code",
                 infotwo.hashCode() == infoone.hashCode());
   }
View Full Code Here

                 infotwo.hashCode() == infoone.hashCode());
   }

   public void testLegalValueHashCode() throws Exception
   {
      OpenMBeanParameterInfoSupport infoone =
              new OpenMBeanParameterInfoSupport("currency",
                                                "monetary currency",
                                                SimpleType.STRING,
                                                "Euro",
                                                new String[]{"Dollar", "Euro", "Yen"});
      assertTrue("Unexpected legal value hash code",
                 infoone.hashCode() == hashCode(infoone));

      OpenMBeanParameterInfoSupport infotwo =
              new OpenMBeanParameterInfoSupport("currency",
                                                "monetary currency",
                                                SimpleType.STRING,
                                                "Euro",
                                                new String[]{"Dollar", "Euro", "Yen"});
      assertTrue("Unexpected legal value hash code",
View Full Code Here

                 infoone.hashCode() == hashCode(infotwo));
   }

   public void testMinMaxHashCode() throws Exception
   {
      OpenMBeanParameterInfoSupport infoone =
              new OpenMBeanParameterInfoSupport("price",
                                                "how much it costs",
                                                SimpleType.FLOAT,
                                                new Float(1.00),
                                                new Float(0.75),
                                                new Float(1.50));
      assertTrue("Unexpected minmax hash code",
                 infoone.hashCode() == hashCode(infoone));

      OpenMBeanParameterInfoSupport infotwo =
              new OpenMBeanParameterInfoSupport("price",
                                                "retail",
                                                SimpleType.FLOAT,
                                                new Float(1.00),
                                                new Float(0.75),
                                                new Float(1.50));
      assertTrue("Unexpected minmax hash code",
                 infotwo.hashCode() == infoone.hashCode());
   }
View Full Code Here

      OpenMBeanConstructorInfo[] testctors =
              new OpenMBeanConstructorInfoSupport[]{
                 new OpenMBeanConstructorInfoSupport("CurrencyMBean",
                                                     "create a currency mbean",
                                                     new OpenMBeanParameterInfoSupport[]{
                                                        new OpenMBeanParameterInfoSupport("currencies",
                                                                                          "currencies that may be exchanged",
                                                                                          new ArrayType(1, SimpleType.STRING))})
              };

      OpenMBeanParameterInfo[] ratesig =
              new OpenMBeanParameterInfo[]{
                 new OpenMBeanParameterInfoSupport("to",
                                                   "currency to convert to",
                                                   SimpleType.STRING),
                 new OpenMBeanParameterInfoSupport("from",
                                                   "currency to convert from",
                                                   SimpleType.STRING)};

      OpenMBeanParameterInfo[] exsig =
              new OpenMBeanParameterInfo[]{
                 new OpenMBeanParameterInfoSupport("from",
                                                   "currency to convert from",
                                                   SimpleType.STRING),
                 new OpenMBeanParameterInfoSupport("amount",
                                                   "amount of currency to convert",
                                                   SimpleType.FLOAT),
                 new OpenMBeanParameterInfoSupport("to",
                                                   "currency to convert to",
                                                   SimpleType.STRING)};

      OpenMBeanOperationInfo[] testops =
              new OpenMBeanOperationInfoSupport[]{
View Full Code Here

      ctors =
      new OpenMBeanConstructorInfoSupport[]{
         new OpenMBeanConstructorInfoSupport("CurrencyMBean",
                                             "create a currency mbean",
                                             new OpenMBeanParameterInfoSupport[]{
                                                new OpenMBeanParameterInfoSupport("currencies",
                                                                                  "currencies that may be exchanged",
                                                                                  new ArrayType(1, SimpleType.STRING))})
      };

      OpenMBeanParameterInfo[] ratesig =
              new OpenMBeanParameterInfo[]{
                 new OpenMBeanParameterInfoSupport("from",
                                                   "currency to convert from",
                                                   SimpleType.STRING),
                 new OpenMBeanParameterInfoSupport("to",
                                                   "currency to convert to",
                                                   SimpleType.STRING)};

      OpenMBeanParameterInfo[] exsig =
              new OpenMBeanParameterInfo[]{
                 new OpenMBeanParameterInfoSupport("from",
                                                   "currency to convert from",
                                                   SimpleType.STRING),
                 new OpenMBeanParameterInfoSupport("to",
                                                   "currency to convert to",
                                                   SimpleType.STRING),
                 new OpenMBeanParameterInfoSupport("amount",
                                                   "amount of currency to convert",
                                                   SimpleType.FLOAT)};

      ops =
      new OpenMBeanOperationInfoSupport[]{
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

        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("p" + i,
                                                       paramDescription,
                                                       openType,
                                                       descriptor);
            } else {
                openParameterTypes = false;
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.