Package org.jboss.metatype.api.values

Examples of org.jboss.metatype.api.values.SimpleValue


      ManagedProperty arch = mo.getProperty("arch");
      assertNotNull(arch);
      ManagedProperty availableProcessors = mo.getProperty("availableProcessors");
      assertNotNull(availableProcessors);
      SimpleValue procsSV = (SimpleValue) availableProcessors.getValue();
      Integer procs = (Integer) procsSV.getValue();
      assertTrue(procs.intValue() >= 1);
      ManagedProperty version = mo.getProperty("version");
      assertNotNull(version);
      log.debug(version.getValue());
   }
View Full Code Here


   {
      Map<String, MetaValue> propValues = new HashMap<String, MetaValue>();
      propValues.put("name", SimpleValueSupport.wrap(getName()));
      String jndiName = getName();
     
      SimpleValue bindingValue = SimpleValueSupport.wrap(jndiName);
      ArrayMetaType.getArrayType(bindingValue.getMetaType());
      propValues.put("bindings", new ArrayValueSupport(ArrayMetaType.getArrayType(bindingValue.getMetaType()), new MetaValue[]{bindingValue}));
     
      ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
      createComponentTest("QueueTemplate", propValues, getName(), type, jndiName);
      ManagedComponent queue = activeView.getComponent("testCreateQueue", type);
      assertNotNull(queue);
View Full Code Here

   {
      Map<String, MetaValue> propValues = new HashMap<String, MetaValue>();
      propValues.put("name", SimpleValueSupport.wrap(getName()));
      String jndiName = getName();
     
      SimpleValue bindingValue = SimpleValueSupport.wrap(jndiName);
      ArrayMetaType.getArrayType(bindingValue.getMetaType());
      propValues.put("bindings", new ArrayValueSupport(ArrayMetaType.getArrayType(bindingValue.getMetaType()), new MetaValue[]{bindingValue}));

      createComponentTest("TopicTemplate", propValues, getName(), TopicType, jndiName);
      ManagedComponent topic = activeView.getComponent("testCreateTopic", TopicType);
      assertNotNull(topic);
      assertEquals("testCreateTopic", topic.getName());
View Full Code Here

      // Check some stats
      log.info(topic.getProperties().keySet());
      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

      try
      {
         for(int i = 0; i < 10; i++)
            pub.send(session.createTextMessage("Message nr " + i));
        
         SimpleValue nondurable = (SimpleValue)component.getProperty("nonDurableSubscriptionsCount").getValue();
         SimpleValue durable = (SimpleValue)component.getProperty("durableSubscriptionsCount").getValue();
         SimpleValue all = (SimpleValue)component.getProperty("allSubscriptionsCount").getValue();
         SimpleValue allMessageCount = (SimpleValue)component.getProperty("allMessageCount").getValue();
        
         CollectionValue messageCounters = (CollectionValue) component.getProperty("messageCounters").getValue();
         assertNotNull(messageCounters);
        
         assertEquals(1, nondurable.getValue());
         assertEquals(0, durable.getValue());
         assertEquals(1, all.getValue());
         assertEquals(10, allMessageCount.getValue());
  
         CompositeValue messageCounter = (CompositeValue) messageCounters.iterator().next();
         assertNotNull(messageCounter);
        
         SimpleValue count = (SimpleValue) messageCounter.get("messageCount");
         assertEquals(count, allMessageCount);
      }
      finally
      {
         pub.close();
View Full Code Here

      QueueSender sender = s.createSender(queue);
     
      // Message 1
      sender.send(s.createTextMessage("Hey!"));

      SimpleValue messageCount1 = (SimpleValue) messageCount.getValue();
      //assertTrue((Integer) (messageCount1).getValue() > 0);
      assertEquals(1, messageCount1.getValue());
      //CompositeValue messageCounterCV = (CompositeValue) messageCounter.getValue();
      //log.info(messageCounterCV);
      //assertEquals(messageCounterCV.get("messageCount"), messageCount1);

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

         // Try casting this to a DsDataSourceTemplateInfo
         cfType = ((DsDataSourceTemplateInfo)values).getConnectionFactoryType();
      }
      else
      {
         SimpleValue dsTypeSV = (SimpleValue) dsTypeMP.getValue();
         cfType = dsTypeSV.getValue().toString();
      }

      ManagedConnectionFactoryDeploymentMetaData mcf;
      ManagedObjectFactory mof = ManagedObjectFactoryBuilder.create();
      ManagedObject cfMO;
View Full Code Here

      CompositeMetaType compType = (CompositeMetaType) secDomain.getMetaType();
      assertNotNull(compType);
      CompositeValue sdCV = (CompositeValue) secDomain.getValue();
      assertNotNull("security-domain.CV", sdCV);

      SimpleValue domainName = (SimpleValue) sdCV.get("domain");
      assertNotNull("security-domain.domain", domainName);
      assertEquals(SimpleValueSupport.wrap("java:/jaas/SomeDomain"), domainName);
      assertNotNull("security-domain.deploymentType", sdCV.get("securityDeploymentType"));
      assertEquals("APPLICATION", ((EnumValue) sdCV.get("securityDeploymentType")).getValue());
      assertFalse(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
View Full Code Here

      assertNotNull(listThreadCpuUtilization);
      MetaValue listThreadCpuUtilizationMV = listThreadCpuUtilization.invoke();
      // TODO
      assertNotNull(listThreadCpuUtilizationMV);
      assertEquals(SimpleMetaType.STRING, listThreadCpuUtilizationMV.getMetaType());
      SimpleValue listThreadCpuUtilizationSV = (SimpleValue) listThreadCpuUtilizationMV;
      String cpuUtilization = (String) listThreadCpuUtilizationSV.getValue();
      log.info(cpuUtilization);
      assertTrue(cpuUtilization.length() > 100);
     

      // Try invoking listThreadCpuUtilization and checking freeMemory until it changes
View Full Code Here

      return activeView;
   }

   private long getLong(ManagedProperty prop)
   {
      SimpleValue mv = (SimpleValue) prop.getValue();
      Number value = (Number) mv.getValue();
      return value.longValue();
   }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.values.SimpleValue

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.