Package org.jboss.managed.api

Examples of org.jboss.managed.api.ManagedComponent


      return result;
   }
  
   public void testUpdatedStandardBindings() throws Exception
   {
      ManagedComponent component = getServiceBindingManagerManagedComponent();
 
      logHierarchy(component);
 
      Map<String, ManagedProperty> properties = component.getProperties();
      assertNotNull(properties);
     
      ManagedProperty prop = properties.get("standardBindings");

      // Before passing the updated component back, store some info about
      // the binding sets so we can use it later
      prop = properties.get("bindingSets");
      assertNotNull("Missing property bindingSets", prop);
      MetaValue val =  prop.getValue();
      assertNotNull("property bindingSets has no value", val);
      assertTrue("property bindingSets value is CollectionValue", val instanceof CollectionValue);
      MetaValue[] elements = ((CollectionValue) val).getElements();
      assertNotNull(elements);
     
      // C) Validate update from B) 
     
      component = getServiceBindingManagerManagedComponent();
      properties = component.getProperties();
     
      Map<String, Integer> offsets = new HashMap<String, Integer>();
      Map<String, String> hosts = new HashMap<String, String>();
      for (MetaValue mv : elements)
      {
View Full Code Here


      return result;
   }
  
   public void testUpdatedServiceBindingSets() throws Exception
   {
      ManagedComponent component = getServiceBindingManagerManagedComponent();
 
      logHierarchy(component);
 
      Map<String, ManagedProperty> properties = component.getProperties();
      assertNotNull(properties);
     
    
      // Before updating get a ref to the standard bindings so we can use it
      // in later validation
View Full Code Here

  
   public void test() throws Exception
   {
      ManagementView managementView = getManagementView();
      ComponentType type = new ComponentType("ConnectionFactory", "Tx");
      ManagedComponent component = managementView.getComponent("JmsXA", type);
      assertNotNull(component);
  
      ManagedProperty property = component.getProperty("max-pool-size");
      assertNotNull(property);
     
      assertEquals(21, ((SimpleValue) property.getValue()).getValue());
   }
View Full Code Here

        
         ManagementView mgtView = getManagementView();
         ManagedDeployment md = mgtView.getDeployment(deploymentName);
         assertNotNull(md);
        
         ManagedComponent mc = md.getComponent("ChangedDsJNDIName");
         assertNotNull(mc);
        
         ManagedProperty property = mc.getProperty("prepared-statement-cache-size");
         assertEquals("prepared-statement-cache-size: "+ property.getValue(), SimpleValueSupport.wrap(34), property.getValue());
        
         property = mc.getProperty("max-pool-size");
         assertEquals("max-pool-size: "+ property.getValue(), SimpleValueSupport.wrap(34), property.getValue());

         // This should work too
         ManagedComponent comp = getManagedComponent(mgtView, "ChangedDsJNDIName");
         assertNotNull(comp);
        
         ManagedComponent mc2 = getManagedComponent(mgtView, "ProfileServiceTestDS");
         assertNull(mc2);
        
         // Check run state
         assertEquals("DS is running", RunState.RUNNING, mc.getRunState());
        
View Full Code Here

   {
      String deploymentName = "LocalTestDS-ds.xml";
      try
      {
         ManagementView mgtView = getManagementView();
         ManagedComponent mc = mgtView.getComponent("TestLocalDS", KnownComponentTypes.DataSourceTypes.LocalTx.getType());
         assertNotNull(mc);
        
         ManagedProperty property = mc.getProperty("prepared-statement-cache-size");
         assertEquals("prepared-statement-cache-size: "+ property.getValue(), SimpleValueSupport.wrap(34), property.getValue());
        
         property = mc.getProperty("max-pool-size");
         assertEquals("max-pool-size: "+ property.getValue(), SimpleValueSupport.wrap(34), property.getValue());

      }
      finally
      {
View Full Code Here

               break;
            }
         }
         assertNotNull(md);
        
         ManagedComponent mc = md.getComponent("ChangedNestedDsJNDIName");
         assertNotNull("test-ds.xml", mc);
         ManagedProperty property = mc.getProperty("prepared-statement-cache-size");
         assertEquals("prepared-statement-cache-size: "+ property.getValue(), SimpleValueSupport.wrap(34), property.getValue());
        
         // This should work too
         ManagedComponent comp = getManagedComponent(mgtView, "ChangedNestedDsJNDIName");
         assertNotNull(comp);
        
         ManagedComponent comp3 = getManagedComponent(mgtView, "ProfileServiceNestedTestDS");
         assertNull(comp3);
        
         // Check 2nd dataSource
         md = null;
         for(ManagedDeployment d : deployment.getChildren())
View Full Code Here

    * @throws Exception
    */
   public void testDLQ() throws Exception
   {
      ManagementView mgtView = getManagementView();
      ManagedComponent queue = mgtView.getComponent("DLQ", QueueType);
      assertNotNull(queue);
      assertEquals("DLQ", queue.getName());
      // Validate some of the expected properties
      ManagedProperty bindings = queue.getProperty("bindings");
      assertNotNull(bindings);
      assertEquals(ArrayMetaType.getArrayType(SimpleMetaType.STRING), bindings.getMetaType());
      Object o = bindings.getValue();
      assertNotNull(o);
      o = getMetaValueFactory().unwrap((MetaValue) o);
View Full Code Here

      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);
      assertEquals("testCreateQueue", queue.getName());

      ManagedProperty bindings = queue.getProperty("bindings");
      assertNotNull(bindings);
      MetaType bindingsType = bindings.getMetaType();
      assertEquals(ArrayMetaType.getArrayType(SimpleMetaType.STRING), bindingsType);
   }
View Full Code Here

   }
  
   public void testQueueMetrics() throws Exception
   {
      // Get the managed component
      ManagedComponent component = getManagementView().getComponent("testCreateQueue", QueueType);
      assertNotNull("testCreateQueue ManagedComponent", component);
     
      // Send a few messages and validate the msg counts
      sendQueueMsgs("testCreateQueue", component);
   }
View Full Code Here

      sendQueueMsgs("testCreateQueue", component);
   }
  
   public void testQueueOperations() throws Exception
   {
      ManagedComponent component = getManagementView().getComponent("testCreateQueue", QueueType);

      // Send a few messages so the message based ops have values
      sendQueueMsgs("testCreateQueue", component);

     
View Full Code Here

TOP

Related Classes of org.jboss.managed.api.ManagedComponent

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.