Package org.jboss.managed.api

Examples of org.jboss.managed.api.ManagedProperty


      }
      log.info("Propertys with null values: "+nullValues);
      assertEquals("InvalidPropertys: "+invalidValues, 0, invalidValues.size());

      // Validate more details on specific properties
      ManagedProperty securityDomain = props.get("security-domain");
      assertNotNull("security-domain", securityDomain);
      MetaType securityDomainType = securityDomain.getMetaType();
      assertTrue("security-domain type("+securityDomainType+") is a GenericMetaType", securityDomainType instanceof CompositeMetaType);
      log.debug("security-domain type: "+securityDomainType);
   }
View Full Code Here


      }

      // Ensure all expected properties are in place
      for (final String expectedProperty : expectedProperties)
      {
         final ManagedProperty prop = component.getProperty(expectedProperty);
         TestCase.assertNotNull("Component did not contain expected managed property \"" + expectedProperty + "\": "
               + component, prop);
      }
   }
View Full Code Here

   private InvocationStats getInvocationStats(ManagedComponent component)
   {
      InvocationStats invocationStats = new InvocationStats();
      List<MethodStats> allMethodStats = new ArrayList<MethodStats>();
      ManagedProperty invocationStatsProp = component.getProperty("invocationStats");
      invocationStats.endTime = System.currentTimeMillis();
      CompositeValue invocationStatsMetaValue = (CompositeValue) invocationStatsProp.getValue();
      CompositeValue allMethodStatsMetaValue = (CompositeValue) invocationStatsMetaValue.get("methodStats");
      Set<String> methodNames = allMethodStatsMetaValue.getMetaType().keySet();
      for (String methodName : methodNames)
      {
         CompositeValue methodStatsMetaValue = (CompositeValue) allMethodStatsMetaValue.get(methodName);
View Full Code Here

      this.dispatcher = dispatcher;
   }

   public MetaValue get(Long propID, Object componentName, String propertyName)
   {
      ManagedProperty mp = this.registry.getManagedProperty(propID);
      return dispatcher.get(componentName, mp);
   }
View Full Code Here

      // Query the interleaving
      ManagementView mgtView = getManagementView();
      ComponentType type = KnownComponentTypes.DataSourceTypes.XA.getType();
      ManagedComponent txcf = mgtView.getComponent(jndiName, type);
      assertNotNull(txcf);
      ManagedProperty interleaving = txcf.getProperty("interleaving");
      assertNotNull("interleaving", interleaving);
      MetaValue interleavingMV = interleaving.getValue();
      assertNotNull("interleaving.value", interleavingMV);
      assertEquals("interleaving.value is true", SimpleValueSupport.wrap(Boolean.TRUE), interleavingMV);
   }
View Full Code Here

      // Query the interleaving
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("ConnectionFactory", "Tx");
      ManagedComponent txcf = mgtView.getComponent(jndiName, type);
      assertNotNull(txcf);
      ManagedProperty interleaving = txcf.getProperty("interleaving");
      assertNotNull("interleaving", interleaving);
      MetaValue interleavingMV = interleaving.getValue();
      assertNotNull("interleaving.value", interleavingMV);
     
   }
View Full Code Here

      // Query the interleaving
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("ConnectionFactory", "Tx");
      ManagedComponent txcf = mgtView.getComponent(jndiName, type);
      assertNotNull(txcf);
      ManagedProperty interleaving = txcf.getProperty("interleaving");
      assertNotNull("interleaving", interleaving);
      MetaValue interleavingMV = interleaving.getValue();
      assertNotNull("interleaving.value", interleavingMV);
      assertEquals(SimpleValueSupport.wrap(Boolean.TRUE), interleavingMV);
   }
View Full Code Here

      createComponentTest("NoTxConnectionFactoryTemplate", propValues, "testNoTxCf", compType, jndiName);

      // Validate the config-property
      ManagementView mgtView = getManagementView();
      ManagedComponent dsMC = getManagedComponent(mgtView, compType, jndiName);
      ManagedProperty configProperty = dsMC.getProperty("config-property");
      assertNotNull(configProperty);
      MetaValue value = configProperty.getValue();
      assertTrue("MapCompositeMetaType", value.getMetaType() instanceof MapCompositeMetaType);
     
      MapCompositeValueSupport cValue = (MapCompositeValueSupport) value;
      cValue.put("testKey", new SimpleValueSupport(SimpleMetaType.STRING, "testValue"));
     
      mgtView.updateComponent(dsMC);

      mgtView = getManagementView();
      dsMC = getManagedComponent(mgtView, compType, jndiName);
      configProperty = dsMC.getProperty("config-property");
      assertNotNull(configProperty);
      cValue = (MapCompositeValueSupport) configProperty.getValue();
      assertNotNull(cValue.get("testKey"));
   }
View Full Code Here

    * @return the property
    * @throws IllegalStateException if the property is not registered
    */
   public ManagedProperty getManagedProperty(Long propID)
   {
      ManagedProperty prop = this.properties.get(propID);
      if(prop == null)
         throw new IllegalStateException("property not found for id " + propID);
      return prop;
   }
View Full Code Here

      assertNotNull("template " + templateName + " found", dsInfo);
      Map<String, ManagedProperty> props = dsInfo.getProperties();

      for(String propName : propValues.keySet())
      {
         ManagedProperty prop = props.get(propName);
         // If the property does not exist on the template we don't set it
         if(prop == null)
            continue;
        
         log.debug("template property before: "+prop.getName()+","+prop.getValue());
         assertNotNull("property " + propName + " found in template " + templateName, prop);
         prop.setValue(propValues.get(propName));
         log.debug("template property after: "+prop.getName()+","+prop.getValue());
      }
     
      // Assert map composite
      if(dsInfo.getProperties().get("config-property") != null)
         assertTrue(dsInfo.getProperties().get("config-property").getMetaType() instanceof MapCompositeMetaType);
     
      mgtView.applyTemplate(deploymentName, dsInfo);

      // reload the view
      activeView = null;
      mgtView = getManagementView();
      ManagedComponent dsMC = getManagedComponent(mgtView, componentType, componentName);
      assertNotNull(dsMC);

      Set<String> mcPropNames = new HashSet<String>(dsMC.getPropertyNames());
      for(String propName : propValues.keySet())
      {
         ManagedProperty prop = dsMC.getProperty(propName);
         log.debug("Checking: "+propName);
         assertNotNull(propName, prop);
         Object propValue = prop.getValue();
         Object expectedValue = propValues.get(propName);
         if(propValue instanceof MetaValue)
         {
            if (prop.getMetaType().isComposite())
            {
               // TODO / FIXME - compare composites
               log.warn("Not checking composite: "+propValue);
            }
            else
            {
               // Compare the MetaValues
               assertEquals(prop.getName(), expectedValue, propValue);
            }
         }
         else if(propValue != null)
         {
            fail(prop.getName()+" is not a MetaValue: "+propValue);
         }

         mcPropNames.remove(propName);
      }

      if(!mcPropNames.isEmpty())
      {
         log.warn(getName() + "> untested properties: " + mcPropNames);
         for(String propName : mcPropNames)
         {
            ManagedProperty prop = dsMC.getProperty(propName);
            log.info(prop);
         }
      }
   }
View Full Code Here

TOP

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

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.