Package javax.management.openmbean

Examples of javax.management.openmbean.OpenMBeanParameterInfoSupport


   public void testDefaultValueCtorInvalidType() throws Exception
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("currency",
                                                   "monetary currency",
                                                   SimpleType.STRING,
                                                   new Float(0.42));
         fail("Expecting OpenDataException");
      }
View Full Code Here


   public void testDefaultValueCtorArrayType() throws Exception
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("currency",
                                                   "monetary currency",
                                                   new ArrayType(1, SimpleType.STRING),
                                                   null);
         assertTrue("Null info constructed", info != null);

         info =
         new OpenMBeanParameterInfoSupport("currency",
                                           "monetary currency",
                                           new ArrayType(1, SimpleType.STRING),
                                           "Euro");
         fail("Expecting OpenDataException");
      }
View Full Code Here

      }
   }

   public void testLegalValueCtor() throws Exception
   {
      OpenMBeanParameterInfoSupport info =
              new OpenMBeanParameterInfoSupport("currency",
                                                "monetary currency",
                                                SimpleType.STRING,
                                                "Euro",
                                                new String[]{"Dollar", "Euro", "Yen"});
      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);
      assertTrue("Should have legal values",
                 info.getLegalValues() != null && info.getLegalValues().size() == 3);
      assertFalse("Shouldn't have a min value", info.hasMinValue());
      assertFalse("Shouldn't have a max value", info.hasMaxValue());
   }
View Full Code Here

   public void testLegalValueCtorInvalidType() throws Exception
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("currency",
                                                   "monetary currency",
                                                   SimpleType.STRING,
                                                   "Euro",
                                                   new Object[]{"Dollar", "Euro", new Float(0.88)});
         fail("Expecting OpenDataException");
View Full Code Here

   public void testLegalValueCtorArrayType() throws Exception
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("currency",
                                                   "monetary currency",
                                                   new ArrayType(1, SimpleType.STRING),
                                                   null,
                                                   new String[]{"Dollar", "Euro", "Yen"});
         fail("Expecting OpenDataException");
View Full Code Here

   public void testLegalValueCtorBogusDefaultValue() throws Exception
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("currency",
                                                   "monetary currency",
                                                   SimpleType.STRING,
                                                   "Pound",
                                                   new String[]{"Dollar", "Euro", "Yen"});
         fail("Expecting OpenDataException");
View Full Code Here

      }
   }

   public void testMinMaxValueCtor() throws Exception
   {
      OpenMBeanParameterInfoSupport info =
              new OpenMBeanParameterInfoSupport("price",
                                                "how much it costs",
                                                SimpleType.FLOAT,
                                                new Float(1.00),
                                                new Float(0.75),
                                                new Float(1.50));
      assertTrue("Null info constructed", info != null);
      assertTrue("Unexpected name",
                 info.getName().compareTo("price") == 0);
      assertTrue("Unexpected description",
                 info.getDescription().compareTo("how much it costs") == 0);
      assertTrue("Unexpected open type",
                 info.getOpenType().equals(SimpleType.FLOAT));
      assertTrue("Should have default value", info.hasDefaultValue());
      assertTrue("Unexpected default value",
                 ((Float)info.getDefaultValue()).equals(new Float(1.00)));
      assertFalse("Shouldn't have legal values",
                  info.hasLegalValues());
      assertTrue("Should have a min value of 0.75",
                 info.hasMinValue()
                 && ((Float)info.getMinValue()).equals(new Float(0.75)));
      assertTrue("Should have a max value of 1.50",
                 info.hasMaxValue()
                 && ((Float)info.getMaxValue()).equals(new Float(1.50)));
   }
View Full Code Here

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

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

   public void testMinMaxValueCtorMinGTMax() throws Exception
   {
      try
      {
         OpenMBeanParameterInfoSupport info =
                 new OpenMBeanParameterInfoSupport("price",
                                                   "how much it costs",
                                                   SimpleType.FLOAT,
                                                   new Float(1.00),
                                                   new Float(1.50),
                                                   new Float(0.75));
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.