Package javax.management.openmbean

Examples of javax.management.openmbean.OpenMBeanParameterInfoSupport


   {
      try
      {
         signature =
         new OpenMBeanParameterInfoSupport[]{
            new OpenMBeanParameterInfoSupport("type",
                                              "type of wine",
                                              SimpleType.STRING,
                                              "Red",
                                              new String[]{"Red", "White", "Rose"}),
            new OpenMBeanParameterInfoSupport("winery",
                                              "who produced the wine",
                                              SimpleType.STRING),
            new OpenMBeanParameterInfoSupport("vintage",
                                              "when the wine was produced",
                                              SimpleType.INTEGER,
                                              null,
                                              new Integer(1900),
                                              new Integer(2000))
View Full Code Here


      legalModels = new String[]{"JDMK", "JMX", "JAVA"};
      legalColors = new String[]{"black", "white", "red", "green", "blue"};
      legalSizes = new String[]{"S", "M", "L", "XL", "XXL"};
      minPrice = 9.00f;
      maxPrice = 19.99f;
      priceParamInfo = new OpenMBeanParameterInfoSupport("price",
                                                         "Valid product price",
                                                         SimpleType.FLOAT,
                                                         new Float(10.00), // default price
                                                         new Float(minPrice), // Min legal value for price
                                                         new Float(maxPrice))// Max legal value for price
View Full Code Here

   public void testEquals()
   {
      try
      {
         OpenMBeanParameterInfoSupport infoSupport = new OpenMBeanParameterInfoSupport("test", "hello world", SimpleType.STRING, "black", legalColors);
         OpenMBeanParameterInfoSupport equalInfoSupport = new OpenMBeanParameterInfoSupport("test", "hello world", SimpleType.STRING, "black", legalColors);
         OpenMBeanParameterInfoSupport info2Support = new OpenMBeanParameterInfoSupport("test2", "hello world2", SimpleType.STRING);


         OpenMBeanParameterInfoSupport priceParamInfo2 = new OpenMBeanParameterInfoSupport("price",
                                                                                           "Valid product price",
                                                                                           SimpleType.FLOAT,
                                                                                           new Float(10.00), // default price
                                                                                           new Float(minPrice), // Min legal value for price
                                                                                           new Float(maxPrice))// Max legal value for price
         // test we can equal null values
         assertTrue(!(infoSupport.equals(info2Support)));

         assertTrue(infoSupport.equals(equalInfoSupport));
         assertTrue(equalInfoSupport.equals(infoSupport));
         assertTrue(priceParamInfo.equals(priceParamInfo2));

         OpenMBeanParameterInfo rebootcmd =
                 new OpenMBeanParameterInfoSupport("reboot",
                                                   "Reboot the server",
                                                   SimpleType.INTEGER);
         OpenMBeanParameterInfo rebootquery =
                 new OpenMBeanParameterInfoSupport("reboot",
                                                   "Reboot the server",
                                                   SimpleType.BOOLEAN);
         assertFalse("activeclients.equals(reboot)", rebootcmd.equals(rebootquery));
      }
      catch (OpenDataException e)
View Full Code Here

      }
   }

   public void testBasicCtor()
   {
      OpenMBeanParameterInfoSupport info =
              new OpenMBeanParameterInfoSupport("currency",
                                                "monetary currency",
                                                SimpleType.STRING);
      assertTrue("Null info constructed", info != null);
      assertTrue("Unexpected name",
                 info.getName().compareTo("currency") == 0);
      assertTrue("Unexpected description",
                 info.getDescription().compareTo("monetary currency") == 0);
      assertTrue("Unexpected open type",
                 info.getOpenType().equals(SimpleType.STRING));
      assertFalse("Shouldn't have default value", info.hasDefaultValue());
      assertFalse("Shouldn't have legal values",
                  info.hasLegalValues());
      assertFalse("Shouldn't have a min value", info.hasMinValue());
      assertFalse("Shouldn't have a max value", info.hasMaxValue());
   }
View Full Code Here

   public void testBasicCtorNullName()
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport(null,
                                                   "monetary currency",
                                                   SimpleType.STRING);
         fail("Expecting IllegalArgumentException");
      }
      catch (IllegalArgumentException x)
View Full Code Here

   public void testBasicCtorEmptyName()
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("",
                                                   "monetary currency",
                                                   SimpleType.STRING);
         fail("Expecting IllegalArgumentException");
      }
      catch (IllegalArgumentException x)
View Full Code Here

   public void testBasicCtorNullDescription()
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("currency",
                                                   null,
                                                   SimpleType.STRING);
         fail("Expecting IllegalArgumentException");
      }
      catch (IllegalArgumentException x)
View Full Code Here

   public void testBasicCtorEmptyDescription()
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("currency",
                                                   "",
                                                   SimpleType.STRING);
         fail("Expecting IllegalArgumentException");
      }
      catch (IllegalArgumentException x)
View Full Code Here

   public void testBasicCtorNullOpenType()
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("currency",
                                                   "monetary currency",
                                                   null);
         fail("Expecting IllegalArgumentException");
      }
      catch (IllegalArgumentException x)
View Full Code Here

      }
   }

   public void testDefaultValueCtor() throws Exception
   {
      OpenMBeanParameterInfoSupport info =
              new OpenMBeanParameterInfoSupport("currency",
                                                "monetary currency",
                                                SimpleType.STRING,
                                                "Euro");
      assertTrue("Null info constructed", info != null);
      assertTrue("Unexpected name",
                 info.getName().compareTo("currency") == 0);
      assertTrue("Unexpected description",
                 info.getDescription().compareTo("monetary currency") == 0);
      assertTrue("Unexpected open type",
                 info.getOpenType().equals(SimpleType.STRING));
      assertTrue("Should have default value", info.hasDefaultValue());
      assertTrue("Unexpected default value",
                 ((String)info.getDefaultValue()).compareTo("Euro") == 0);
      assertFalse("Shouldn't have legal values",
                  info.hasLegalValues());
      assertFalse("Shouldn't have a min value", info.hasMinValue());
      assertFalse("Shouldn't have a max value", info.hasMaxValue());
   }
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.