Examples of ManagedProperty


Examples of org.jboss.managed.api.ManagedProperty

      ManagedComponent ds = getManagedComponent(mgtView, type, "DefaultDS");
      assertNotNull("hsqldb-ds.xml ManagedComponent", ds);
      Map<String,ManagedProperty> props = ds.getProperties();
      log.info("hsqldb-ds.props: "+props);
      // Validate the property names
      ManagedProperty p = props.get("jndi-name");
      assertEquals("jndi-name", SimpleValueSupport.wrap("DefaultDS"), p.getValue());
      p = props.get("driver-class");
      assertEquals("driver-class", SimpleValueSupport.wrap("org.hsqldb.jdbcDriver"), p.getValue());
      p = props.get("connection-url");
      assertEquals("connection-url", SimpleValueSupport.wrap("jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB"), p.getValue());
      p = props.get("user-name");
      assertEquals("user-name", SimpleValueSupport.wrap("sa"), p.getValue());
      p = props.get("password");
      assertEquals("password", SimpleValueSupport.wrap(""), p.getValue());
      p = props.get("min-pool-size");
      assertEquals("min-pool-size", SimpleValueSupport.wrap(5), p.getValue());
      p = props.get("max-pool-size");
      assertEquals("max-pool-size", SimpleValueSupport.wrap(20), p.getValue());
      p = props.get("idle-timeout-minutes");
      assertEquals("idle-timeout-minutes", SimpleValueSupport.wrap(0), p.getValue());
      p = props.get("prepared-statement-cache-size");
      assertEquals("prepared-statement-cache-size", SimpleValueSupport.wrap(32), p.getValue());
/*
      TODO - Uncomment when Weston has ManagedConnectionFactoryDeploymentMetaData/DBMSMetaData done
      p = props.get("type-mapping");
      assertEquals("type-mapping", SimpleValueSupport.wrap("Hypersonic SQL"), p.getValue());
*/
      p = props.get("security-domain");
      assertNotNull("security-domain", p);

      CompositeMetaType secType = (CompositeMetaType) p.getMetaType();
      assertNotNull(secType);
      assertTrue(secType.containsItem("domain"));
      assertTrue(secType.containsItem("securityDeploymentType"));

      log.info("security-domain: "+secType);
View Full Code Here

Examples of org.jboss.managed.api.ManagedProperty

      ComponentType type = new ComponentType("DataSource", "LocalTx");
      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
      Map<String,ManagedProperty> props = hsqldb.getProperties();
      log.info("hsqldb.props: "+props);
      // Update properties
      ManagedProperty minSize = props.get("min-pool-size");
      minSize.setValue(SimpleValueSupport.wrap(new Integer(13)));
      ManagedProperty maxSize = props.get("max-pool-size");
      maxSize.setValue(SimpleValueSupport.wrap(new Integer(53)));

      mgtView.updateComponent(hsqldb);

      // TODO: Query the mbeans to validate the change
      // TODO: Query the profile service repository for the overriden data
View Full Code Here

Examples of org.jboss.managed.api.ManagedProperty

      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
      Map<String,ManagedProperty> props = hsqldb.getProperties();
      validatePropertyMetaValues(props);

      // Validate the config-property
      ManagedProperty configProperty = hsqldb.getProperty("config-property");
      assertNotNull(configProperty);
      MetaValue value = configProperty.getValue();
      assertTrue("MapCompositeMetaType", value.getMetaType() instanceof MapCompositeMetaType);
      log.debug("config-property: "+configProperty);
      assertTrue(value instanceof CompositeValue);
      log.debug("config-property.value: "+value);


      // Validate more details on specific properties
      ManagedProperty interleaving  = props.get("interleaving");
      assertNotNull("interleaving", interleaving);
      assertNotNull("interleaving.value", interleaving.getValue());
      ManagedProperty poolJndiName = props.get("poolJndiName");
      assertNotNull("poolJndiName", poolJndiName);
      assertNotNull("poolJndiName.value", poolJndiName.getValue());

      ManagedProperty securityDomain = props.get("security-domain");
      assertNotNull("security-domain", securityDomain);
      MetaType securityDomainType = securityDomain.getMetaType();
      assertTrue("security-domain type is a GenericMetaType", securityDomainType instanceof CompositeMetaType);
      log.debug("security-domain type: "+securityDomainType);
      MetaValue securityDomainValue = securityDomain.getValue();
      assertTrue("security-domain value is a GenericValue", securityDomainValue instanceof CompositeValue);
      log.debug("security-domain value: "+securityDomainValue);
   }
View Full Code Here

Examples of org.jboss.managed.api.ManagedProperty

      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

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

Examples of org.jboss.managed.api.ManagedProperty

      }

      // 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

Examples of org.jboss.managed.api.ManagedProperty

   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

Examples of org.jboss.managed.api.ManagedProperty

      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

Examples of org.jboss.managed.api.ManagedProperty

      // 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

Examples of org.jboss.managed.api.ManagedProperty

      // 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
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.