Package org.jboss.metatype.api.values

Examples of org.jboss.metatype.api.values.SimpleValue.compareTo()


      // Test the temperature constraints
      ManagedProperty temperature = managedObject.getProperty("temperatureD");
      SimpleValue defaultValue = (SimpleValue) temperature.getDefaultValue();
      assertNotNull(defaultValue);
      getLog().debug("temperature default: "+defaultValue);
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap(60.5));
      assertTrue("temperature == 60; "+compare, compare == 0);
  
      ManagedProperty pi = managedObject.getProperty("piD");
      defaultValue = (SimpleValue) pi.getDefaultValue();
      assertNotNull(defaultValue);
View Full Code Here


  
      ManagedProperty pi = managedObject.getProperty("piD");
      defaultValue = (SimpleValue) pi.getDefaultValue();
      assertNotNull(defaultValue);
      getLog().debug("pi default: "+defaultValue);
      compare = defaultValue.compareTo(SimpleValueSupport.wrap(3.14159265358979));
      assertTrue("pi == 3.14159265358979 "+compare, compare == 0);
   }
   /**
    * Test default value for Long property types
    */
 
View Full Code Here

      // Test the temperature constraints
      ManagedProperty temperature = managedObject.getProperty("propLong");
      SimpleValue defaultValue = (SimpleValue) temperature.getDefaultValue();
      assertNotNull(defaultValue);
      getLog().debug("propLong default: "+defaultValue);
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap(123456789l));
      assertTrue("propLong == 123456789; "+compare, compare == 0);
  
      ManagedProperty pi = managedObject.getProperty("propLongPrimitive");
      defaultValue = (SimpleValue) pi.getDefaultValue();
      assertNotNull(defaultValue);
View Full Code Here

  
      ManagedProperty pi = managedObject.getProperty("propLongPrimitive");
      defaultValue = (SimpleValue) pi.getDefaultValue();
      assertNotNull(defaultValue);
      getLog().debug("propLongPrimitive default: "+defaultValue);
      compare = defaultValue.compareTo(SimpleValueSupport.wrap(123456789l));
      assertTrue("propLongPrimitive == 123456789 "+compare, compare == 0);
   }
   /**
    * Test default value for String property types
    */
 
View Full Code Here

      ManagedObject managedObject = super.initManagedObject(bean);
      ManagedProperty month = managedObject.getProperty("month");
      SimpleValue defaultValue = (SimpleValue) month.getDefaultValue();
      assertNotNull(defaultValue);
      getLog().debug("month default: "+defaultValue);
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap("JAN"));
      assertTrue("month == JAN; "+compare, compare == 0);
   }
   /**
    * Test default value for BigDecimal property types
    */
 
View Full Code Here

      ManagedProperty month = managedObject.getProperty("propBD");
      SimpleValue defaultValue = (SimpleValue) month.getDefaultValue();
      assertNotNull(defaultValue);
      getLog().debug("propBD default: "+defaultValue);
      BigDecimal bd = new BigDecimal("123456789.987654321");
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap(bd));
      assertTrue("propBD == 123456789.987654321; "+compare, compare == 0);
   }
   /**
    * Test default value for BigInteger property types
    */
 
View Full Code Here

      SimpleValue defaultValue = (SimpleValue) propBI.getDefaultValue();
      assertEquals(SimpleMetaType.BIGINTEGER, defaultValue.getMetaType());
      assertNotNull(defaultValue);
      getLog().debug("propBI default: "+defaultValue);
      BigInteger bd = new BigInteger("123456789987654321");
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap(bd));
      assertEquals("propBI == 123456789987654321; "+compare, 0, compare);
   }

   /**
    * Test default value for Char property types
View Full Code Here

      ManagedProperty propCharPrimitive = managedObject.getProperty("propCharPrimitive");
      SimpleValue defaultValue = (SimpleValue) propCharPrimitive.getDefaultValue();
      assertNotNull(defaultValue);
      assertEquals(SimpleMetaType.CHARACTER_PRIMITIVE, defaultValue.getMetaType());
      getLog().debug("propCharPrimitive default: "+defaultValue);
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap('c'));
      assertEquals("propCharPrimitive == c; ", 0, compare);

      ManagedProperty propChar = managedObject.getProperty("propChar");
      defaultValue = (SimpleValue) propChar.getDefaultValue();
      assertNotNull(defaultValue);
View Full Code Here

      ManagedProperty propChar = managedObject.getProperty("propChar");
      defaultValue = (SimpleValue) propChar.getDefaultValue();
      assertNotNull(defaultValue);
      assertEquals(SimpleMetaType.CHARACTER, defaultValue.getMetaType());
      getLog().debug("propChar default: "+defaultValue);
      compare = defaultValue.compareTo(SimpleValueSupport.wrap(new Character('C')));
      assertTrue("propChar == c; "+compare, compare == 0);
   }

   /**
    * Test default value for Integer property types
View Full Code Here

      ManagedObject managedObject = super.initManagedObject(bean);
      ManagedProperty day = managedObject.getProperty("day");
      SimpleValue defaultValue = (SimpleValue) day.getDefaultValue();
      assertNotNull(defaultValue);
      getLog().debug("day default: "+defaultValue);
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap(1));
      assertTrue("day == 1; "+compare, compare == 0);

      ManagedProperty century = managedObject.getProperty("century");
      defaultValue = (SimpleValue) century.getDefaultValue();
      assertNotNull(defaultValue);
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.