Package org.jboss.metatype.api.values

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


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


      ManagedProperty propByte = managedObject.getProperty("propByte");
      SimpleValue defaultValue = (SimpleValue) propByte.getDefaultValue();
      assertNotNull(defaultValue);
      assertEquals(SimpleMetaType.BYTE, defaultValue.getMetaType());
      getLog().debug("propByte default: "+defaultValue);
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap(10));
      assertTrue("propByte == 1; "+compare, compare == 0);

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

      ManagedProperty propBytePrimitive = managedObject.getProperty("propBytePrimitive");
      defaultValue = (SimpleValue) propBytePrimitive.getDefaultValue();
      assertNotNull(defaultValue);
      assertEquals(SimpleMetaType.BYTE_PRIMITIVE, defaultValue.getMetaType());
      getLog().debug("propBytePrimitive default: "+defaultValue);
      compare = defaultValue.compareTo(SimpleValueSupport.wrap(10));
      assertEquals("propBytePrimitive == 10; ", 0, compare);
   }
   /**
    * Test default value for Short property types
    */
 
View Full Code Here

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

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

      ManagedProperty propShortPrimitive = managedObject.getProperty("propShortPrimitive");
      defaultValue = (SimpleValue) propShortPrimitive.getDefaultValue();
      assertNotNull(defaultValue);
      assertEquals(SimpleMetaType.SHORT_PRIMITIVE, defaultValue.getMetaType());
      getLog().debug("propShortPrimitive default: "+defaultValue);
      compare = defaultValue.compareTo(SimpleValueSupport.wrap(1234));
      assertTrue("propShortPrimitive == 1234; "+compare, compare == 0);
   }
   /**
    * Test default value for Boolean property types
    */
 
View Full Code Here

      ManagedProperty propBoolean = managedObject.getProperty("propBoolean");
      SimpleValue defaultValue = (SimpleValue) propBoolean.getDefaultValue();
      assertNotNull(defaultValue);
      assertEquals(SimpleMetaType.BOOLEAN, defaultValue.getMetaType());
      getLog().debug("propBoolean default: "+defaultValue);
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap(Boolean.TRUE));
      assertTrue("propBoolean == true; "+compare, compare == 0);

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

      ManagedProperty propBooleanPrimitive = managedObject.getProperty("propBooleanPrimitive");
      defaultValue = (SimpleValue) propBooleanPrimitive.getDefaultValue();
      assertNotNull(defaultValue);
      assertEquals(SimpleMetaType.BOOLEAN_PRIMITIVE, defaultValue.getMetaType());
      getLog().debug("propBooleanPrimitive default: "+defaultValue);
      compare = defaultValue.compareTo(SimpleValueSupport.wrap(true));
      assertEquals("propBooleanPrimitive == true; ", 0, compare);
   }
   /**
    * Test default value for a Properties type
    */
 
View Full Code Here

      assertEquals("the total number of classes loaded.", totalLoadedClassCount.getDescription());
      SimpleValue totalLoadedClassCountSV = SimpleValue.class.cast(totalLoadedClassCount.getValue());
      assertNotNull(totalLoadedClassCountSV);
      getLog().debug("totalLoadedClassCountSV"+totalLoadedClassCountSV);
      SimpleValue sv1 = SimpleValueSupport.wrap(new Long(100));
      assertTrue("> 100 classes loaded", sv1.compareTo(totalLoadedClassCountSV) < 0);
      // loadedClassCount
      ManagedProperty loadedClassCount = props.get("loadedClassCount");
      assertNotNull(loadedClassCount);
      assertEquals(SimpleMetaType.INTEGER_PRIMITIVE, loadedClassCount.getMetaType());
      assertEquals("the number of currently loaded classes.", loadedClassCount.getDescription());
View Full Code Here

      // Test the temperature constraints
      ManagedProperty temperature = managedObject.getProperty("temperature");
      SimpleValue minValue = (SimpleValue) temperature.getMinimumValue();
      assertNotNull(minValue);
      getLog().debug("min: "+minValue);
      int compare = minValue.compareTo(SimpleValueSupport.wrap(0f));
      assertTrue("temperature >= 0; "+compare, compare == 0);
      compare = minValue.compareTo(SimpleValueSupport.wrap(0.1f));
      assertTrue("temperature 0.1 > min; "+compare, compare < 0);
      compare = minValue.compareTo(SimpleValueSupport.wrap(-0.1f));
      assertTrue("temperature -0.1 < min; "+compare, compare > 0);
View Full Code Here

      SimpleValue minValue = (SimpleValue) temperature.getMinimumValue();
      assertNotNull(minValue);
      getLog().debug("min: "+minValue);
      int compare = minValue.compareTo(SimpleValueSupport.wrap(0f));
      assertTrue("temperature >= 0; "+compare, compare == 0);
      compare = minValue.compareTo(SimpleValueSupport.wrap(0.1f));
      assertTrue("temperature 0.1 > min; "+compare, compare < 0);
      compare = minValue.compareTo(SimpleValueSupport.wrap(-0.1f));
      assertTrue("temperature -0.1 < min; "+compare, compare > 0);
      compare = minValue.compareTo(SimpleValueSupport.wrap(50f));
      assertTrue("temperature 50 > min; "+compare, compare < 0);
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.