Package org.jboss.metatype.api.values

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


   
    MetaType type = v1.getMetaType();
    if (v1 instanceof SimpleValue && type instanceof SimpleMetaType) {
      SimpleMetaType st = (SimpleMetaType)type;
      SimpleValue sv = wrap(st, v2);
      return sv.compareTo((SimpleValue)v1) == 0;
    }
    return false;
  }
 
  public static boolean sameValue(MetaValue v1, MetaValue v2) {
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

      ManagedProperty NonDurableSubscriptionsCount = topic.getProperty("nonDurableSubscriptionsCount");
      assertNotNull(NonDurableSubscriptionsCount);
      log.info(NonDurableSubscriptionsCount);
      SimpleValue NonDurableSubscriptionsCountMV = (SimpleValue) NonDurableSubscriptionsCount.getValue();
      log.info(NonDurableSubscriptionsCountMV);
      assertTrue(NonDurableSubscriptionsCountMV.compareTo(SimpleValueSupport.wrap(0)) > 0);

      Set<ManagedOperation> ops = topic.getOperations();
      log.info("Topic ops: "+ops);
      Map<String, ManagedOperation> opsByName = new HashMap<String, ManagedOperation>();
      for(ManagedOperation op : ops)
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

      ManagedProperty NonDurableSubscriptionsCount = topic.getProperty("nonDurableSubscriptionsCount");
      assertNotNull(NonDurableSubscriptionsCount);
      log.info(NonDurableSubscriptionsCount);
      SimpleValue NonDurableSubscriptionsCountMV = (SimpleValue) NonDurableSubscriptionsCount.getValue();
      log.info(NonDurableSubscriptionsCountMV);
      assertTrue(NonDurableSubscriptionsCountMV.compareTo(SimpleValueSupport.wrap(0)) > 0);

      Set<ManagedOperation> ops = topic.getOperations();
      log.info("Topic ops: "+ops);
      Map<String, ManagedOperation> opsByName = new HashMap<String, ManagedOperation>();
      for(ManagedOperation op : ops)
View Full Code Here

      // Message 2
      sender.send(s.createTextMessage("Message2"));
     
      SimpleValue messageCount2 = (SimpleValue) messageCount.getValue();
      assertTrue(messageCount2.compareTo(messageCount1) > 0);
      messageCounterCV = (CompositeValue) messageCounter.getValue();
      assertEquals(messageCounterCV.get("messageCount"), messageCount2);
     
      //
      ManagedOperation listAllMessages = ManagedOperationMatcher.findOperation(ops, "listAllMessages");
View Full Code Here

      assertTrue("value1 < value2", comparator.compare(s1, s2) < 0);
      assertTrue("value2 < value1", comparator.compare(s2, s1) > 0);
      assertTrue("value1 < value2", comparator.compare(s1, s1) == 0);

      assertTrue("value1 < value2", s1.compareTo(s2) < 0);
      assertTrue("value2 < value1", s2.compareTo(s1) > 0);
      assertTrue("value1 < value2", s1.compareTo(s1) == 0);
   }
   public void testBigDecimalComparable()
   {
      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 testBigIntegerComparable()
   {
      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 testBooleanComparable()
   {
      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 testByteComparable()
   {
      SimpleValueComparator comparator = new SimpleValueComparator();
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.