Examples of ManagedDeployment


Examples of org.jboss.managed.api.ManagedDeployment

      assertChildContexts(unit);
   }

   protected void assertChildContexts(String deployment, String... paths) throws Exception
   {
      ManagedDeployment unit = getDeploymentUnit(deployment);
      assertChildContexts(unit, paths);
   }
View Full Code Here

Examples of org.jboss.managed.api.ManagedDeployment

   void assertDeploymentState(DeploymentID DtID, DeploymentState state) throws Exception
   {
      String name = DtID.getNames()[0];
      ManagementView mgtView = getManagementView();
      ManagedDeployment md = mgtView.getDeployment(name);
      assertNotNull(name, md);
      assertEquals("deployment: " + name, state, md.getDeploymentState());
      log.debug(md.getSimpleName() + " " + md.getTypes());
   }
View Full Code Here

Examples of org.jboss.managed.api.ManagedDeployment

      try
      {
         deployPackage(deploymentName);
        
         ManagementView mgtView = getManagementView();
         ManagedDeployment md = mgtView.getDeployment(deploymentName);
         assertNotNull("Null managed deployment.", md);
        
         ManagedComponent mc = md.getComponent("ProfileServiceTestDS");
         assertNotNull("Null managed component", mc);
        
         // This should work too
         ManagedComponent comp = getManagedComponent(mgtView, "ProfileServiceTestDS");
         assertNotNull(comp);
        
         ManagedProperty jndiName = mc.getProperty("jndi-name");
         // assert
         assertEquals(jndiName.getValue(), SimpleValueSupport.wrap("ProfileServiceTestDS"));
         // change value
         jndiName.setValue(SimpleValueSupport.wrap("ChangedDsJNDIName"));
        
        
         ManagedProperty property = mc.getProperty("prepared-statement-cache-size");
         // assert
         assertEquals("prepared-statement-cache-size: "+ property.getValue(), SimpleValueSupport.wrap(32), property.getValue());
         // change value
         property.setValue(SimpleValueSupport.wrap(34));
        
         property = mc.getProperty("max-pool-size");
         property.setValue(SimpleValueSupport.wrap(34));
        
        
         ManagedProperty configProps = mc.getProperty("connection-properties");
         assertNotNull(configProps);
         CompositeValue collection = (CompositeValue) configProps.getValue();
         configProps.setValue(collection);
        
        
         // update component
         mgtView.updateComponent(mc);
        
        
         // See if the changes are reflected in the managedView after a reload
         mgtView = getManagementView();
        
         ManagedDeployment md2 = mgtView.getDeployment(deploymentName);
         assertNotNull(md2);
        
         ManagedComponent mc2 = md2.getComponent("ChangedDsJNDIName");
         assertNotNull(mc2);
        
         ManagedProperty changedProperty = mc2.getProperty("prepared-statement-cache-size");
         assertEquals(changedProperty.getValue(), SimpleValueSupport.wrap(34));
        
         mc2 = md2.getComponent("ProfileServiceTestDS");
         assertNull(mc2);
        
         mc2 = getManagedComponent(mgtView, "ProfileServiceTestDS");
         assertNull(mc2);
      }
View Full Code Here

Examples of org.jboss.managed.api.ManagedDeployment

     
      // Reload....
      mgtView.load();
     
      // Check
      ManagedDeployment md = mgtView.getDeployment("LocalTestDS-ds.xml");
      assertNotNull(md);
      ManagedComponent mc = mgtView.getComponent(jndiName, KnownComponentTypes.DataSourceTypes.LocalTx.getType());
      assertNotNull(mc);
     
      ManagedProperty property = mc.getProperty("prepared-statement-cache-size");
View Full Code Here

Examples of org.jboss.managed.api.ManagedDeployment

      String deploymentName = "profileservice-datasource.ear";
      try
      {
         deployPackage(deploymentName);
         ManagementView mgtView = getManagementView();
         ManagedDeployment deployment = mgtView.getDeployment(deploymentName);
         assertNotNull("Null managed deployment", deployment);
        
         assertNotNull(deployment.getChildren());
         assertFalse(deployment.getChildren().isEmpty());

         // Update first DataSource
         // get test-ds.xml child
         ManagedDeployment md =  null;
         for(ManagedDeployment d : deployment.getChildren())
         {
            if(d.getName().endsWith("test-ds.xml"))
            {
               md = d;
               break;
            }
         }
         assertNotNull(md);
        
         ManagedComponent mc = md.getComponent("ProfileServiceNestedTestDS");
         assertNotNull("Null managed component", mc);
        
         // This should work too
         ManagedComponent comp = getManagedComponent(mgtView, "ProfileServiceNestedTestDS");
         assertNotNull(comp);
        
         ManagedProperty p = mc.getProperty("jndi-name");
         p.setValue(SimpleValueSupport.wrap("ChangedNestedDsJNDIName"));
        
         // Update prepared-statement-cache-size
         ManagedProperty property = mc.getProperty("prepared-statement-cache-size");
         // assert
         assertEquals("prepared-statement-cache-size: "+ property.getValue(), SimpleValueSupport.wrap(32), property.getValue());
         // change value
         property.setValue(SimpleValueSupport.wrap(34));
        
         // updateComponent and process()
         mgtView.updateComponent(mc);
        
         //
         // Update 2nd DataSource
         md = null;
         for(ManagedDeployment d : deployment.getChildren())
         {
            if(d.getName().endsWith("test-second-ds.xml"))
            {
               md = d;
               break;
            }
         }
         assertNotNull(md);
         mc = md.getComponent("OtherNestedTestDS");
        
         // prepared-statement-cache-size
         property = mc.getProperty("prepared-statement-cache-size");
         // assert
         assertEquals(property.getValue(), SimpleValueSupport.wrap(12));
View Full Code Here

Examples of org.jboss.managed.api.ManagedDeployment

      this.deployResource(domainsDeployment, "profileservice/security/" + domainsDeployment);

      // validate the managed deployment.
      ManagementView managementView = getManagementView();
     
      ManagedDeployment deployment = managementView.getDeployment(domainsDeployment);
      assertNotNull(deployment);
      // verify the deployment contains the expected managed components.
      assertEquals("Unexpected number of components", 2, deployment.getComponents().size());
      assertNotNull("Missing expected component: TestDomain1", deployment.getComponent("TestDomain1"));
      assertNotNull("Missing expected component: TestDomain2", deployment.getComponent("TestDomain2"));

      // validate the components created upon deployment.
      ComponentType type = new ComponentType("MCBean", "Security");
      ManagedComponent component = managementView.getComponent("TestDomain1", type);
      assertNotNull(component);
View Full Code Here

Examples of org.jboss.managed.api.ManagedDeployment

         {
            for(String deploymentName : deploymentNames)
            {
               try
               {
                  ManagedDeployment deployment = mgtView.getDeployment(deploymentName);
                  log.debug(deployment.getSimpleName());
               }
               catch(Exception e)
               {
                  log.error("failed to get " + deploymentName, e);
                  throw e;
View Full Code Here

Examples of org.jboss.managed.api.ManagedDeployment

         if(mdaSimpleName.length() > 0 && ManagementConstants.GENERATED.equals(mdaSimpleName) == false)
            simpleName = mdAnnotation.simpleName();
         types = mdAnnotation.types();
      }
     
      ManagedDeployment md = new ManagedDeploymentImpl(unit.getName(), simpleName, parent, validUnitMOs);
      if(types.length > 0)
      {
         for(String type : types)
            addType(md, type);
      }
View Full Code Here

Examples of org.jboss.managed.api.ManagedDeployment

            assertTrue("DeploymentStatus.isCompleted: " + status, status.isCompleted());
            assertFalse("DeploymentStatus.isRunning: " + status, status.isRunning());
            assertFalse("DeploymentStatus.isFailed: " + status, status.isFailed());
            // Check for a
            ManagementView mgtView = getManagementView(getNamingContext(0));
            ManagedDeployment deployment = mgtView.getDeployment(uploadedNames[0]);
            assertNotNull(deployment);
            getLog().info("Found " + type + " deployment: " + deployment);
            Set<String> types = deployment.getTypes();
            if (types != null && types.isEmpty() == false)
               assertTrue("Missing type: " + type + ", available: " + types, types.contains(type));
            if (tester != null)
            {
               tester.testManagedDeployment();
View Full Code Here

Examples of org.jboss.managed.api.ManagedDeployment

      if (mgtDeploymentCreator == null)
         throw new IllegalArgumentException("Null managed deployment creator.");

      DeploymentContext context = getDeploymentContext(name, true);
      Map<String, ManagedObject> rootMOs = getManagedObjects(context);
      ManagedDeployment root = mgtDeploymentCreator.build(context.getDeploymentUnit(), rootMOs, null);
      for (DeploymentContext childContext : context.getChildren())
      {
         processManagedDeployment(childContext, root);
      }
      return root;
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.