Package org.jboss.metatype.api.values

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


      assertTrue("value1 < value2", comparator.compare(v1, v2) < 0);
      assertTrue("value2 < value1", comparator.compare(v2, v1) > 0);
      assertTrue("value1 < value2", comparator.compare(v1, v1) == 0);

      assertTrue("value1 < value2", v1.compareTo(v2) < 0);
      assertTrue("value2 < value1", v2.compareTo(v1) > 0);
      assertTrue("value1 < value2", v1.compareTo(v1) == 0);
   }
   public void testCharacterComparable()
   {
      SimpleValueComparator comparator = new SimpleValueComparator();
View Full Code Here


      assertTrue("value1 < value2", comparator.compare(v1, v2) < 0);
      assertTrue("value2 < value1", comparator.compare(v2, v1) > 0);
      assertTrue("value1 < value2", comparator.compare(v1, v1) == 0);

      assertTrue("value1 < value2", v1.compareTo(v2) < 0);
      assertTrue("value2 < value1", v2.compareTo(v1) > 0);
      assertTrue("value1 < value2", v1.compareTo(v1) == 0);
   }
   public void testDateComparable()
   {
      SimpleValueComparator comparator = new SimpleValueComparator();
View Full Code Here

      assertTrue("value1 < value2", comparator.compare(v1, v2) < 0);
      assertTrue("value2 < value1", comparator.compare(v2, v1) > 0);
      assertTrue("value1 < value2", comparator.compare(v1, v1) == 0);

      assertTrue("value1 < value2", v1.compareTo(v2) < 0);
      assertTrue("value2 < value1", v2.compareTo(v1) > 0);
      assertTrue("value1 < value2", v1.compareTo(v1) == 0);
   }
   public void testDoubleComparable()
   {
      SimpleValueComparator comparator = new SimpleValueComparator();
View Full Code Here

      assertTrue("value1 < value2", comparator.compare(v1, v2) < 0);
      assertTrue("value2 < value1", comparator.compare(v2, v1) > 0);
      assertTrue("value1 < value2", comparator.compare(v1, v1) == 0);

      assertTrue("value1 < value2", v1.compareTo(v2) < 0);
      assertTrue("value2 < value1", v2.compareTo(v1) > 0);
      assertTrue("value1 < value2", v1.compareTo(v1) == 0);
   }
   public void testFloatComparable()
   {
      SimpleValueComparator comparator = new SimpleValueComparator();
View Full Code Here

      assertTrue("value1 < value2", comparator.compare(v1, v2) < 0);
      assertTrue("value2 < value1", comparator.compare(v2, v1) > 0);
      assertTrue("value1 < value2", comparator.compare(v1, v1) == 0);

      assertTrue("value1 < value2", v1.compareTo(v2) < 0);
      assertTrue("value2 < value1", v2.compareTo(v1) > 0);
      assertTrue("value1 < value2", v1.compareTo(v1) == 0);
   }
   public void testIntegerComparable()
   {
      SimpleValueComparator comparator = new SimpleValueComparator();
View Full Code Here

      assertTrue("value1 < value2", comparator.compare(v1, v2) < 0);
      assertTrue("value2 < value1", comparator.compare(v2, v1) > 0);
      assertTrue("value1 < value2", comparator.compare(v1, v1) == 0);

      assertTrue("value1 < value2", v1.compareTo(v2) < 0);
      assertTrue("value2 < value1", v2.compareTo(v1) > 0);
      assertTrue("value1 < value2", v1.compareTo(v1) == 0);
   }
   public void testLongComparable()
   {
      SimpleValueComparator comparator = new SimpleValueComparator();
View Full Code Here

      assertTrue("value1 < value2", comparator.compare(v1, v2) < 0);
      assertTrue("value2 < value1", comparator.compare(v2, v1) > 0);
      assertTrue("value1 < value2", comparator.compare(v1, v1) == 0);

      assertTrue("value1 < value2", v1.compareTo(v2) < 0);
      assertTrue("value2 < value1", v2.compareTo(v1) > 0);
      assertTrue("value1 < value2", v1.compareTo(v1) == 0);
   }
   public void testShortComparable()
   {
      SimpleValueComparator comparator = new SimpleValueComparator();
View Full Code Here

      assertTrue("value1 < value2", comparator.compare(v1, v2) < 0);
      assertTrue("value2 < value1", comparator.compare(v2, v1) > 0);
      assertTrue("value1 < value2", comparator.compare(v1, v1) == 0);

      assertTrue("value1 < value2", v1.compareTo(v2) < 0);
      assertTrue("value2 < value1", v2.compareTo(v1) > 0);
      assertTrue("value1 < value2", v1.compareTo(v1) == 0);
   }

   /**
    * Test the toString for a simple value
View Full Code Here

      // Test the temperature constraints
      ManagedProperty temperature = managedObject.getProperty("temperature");
      SimpleValue defaultValue = (SimpleValue) temperature.getDefaultValue();
      assertNotNull(defaultValue);
      getLog().debug("temperature default: "+defaultValue);
      int compare = defaultValue.compareTo(SimpleValueSupport.wrap(60f));
      assertTrue("temperature == 60; "+compare, compare == 0);

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

      ManagedProperty pi = managedObject.getProperty("pi");
      defaultValue = (SimpleValue) pi.getDefaultValue();
      assertNotNull(defaultValue);
      getLog().debug("pi default: "+defaultValue);
      compare = defaultValue.compareTo(SimpleValueSupport.wrap(3.14f));
      assertTrue("pi == 3.14; "+compare, compare == 0);
   }
   /**
    * Test default value for Double property types
    */
 
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.