Package org.jboss.deployers.spi.management

Examples of org.jboss.deployers.spi.management.ManagementView


    *
    * @throws Exception if an error occurs while running the test.
    */
   public void testSecurityConfig() throws Exception
   {
      ManagementView managementView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "Security");
      ManagedComponent component = managementView.getComponent("SecurityConfig", type);
      assertNotNull(component);

      // verify that the component has the expected properties.
      Map<String, ManagedProperty> properties = component.getProperties();
      assertNotNull(properties);
View Full Code Here


    * @throws Exception if an error occurs while running the test.
    */
   public void testXMLLoginConfig() throws Exception
   {
      // get the XMLLoginConfig managed component.
      ManagementView managementView = super.getManagementView();
      ComponentType type = new ComponentType("MCBean", "Security");
      ManagedComponent component = managementView.getComponent("XMLLoginConfig", type);
      assertNotNull(component);

      // verify that the component has the expected properties.
      Map<String, ManagedProperty> properties = component.getProperties();
      assertNotNull(properties);
View Full Code Here

    * @throws Exception if an error occurs while running the test.
    */
   public void testJBossSecuritySubjectFactory() throws Exception
   {
      // get the XMLLoginConfig managed component.
      ManagementView managementView = super.getManagementView();
      ComponentType type = new ComponentType("MCBean", "Security");
      ManagedComponent component = managementView.getComponent("JBossSecuritySubjectFactory", type);
      assertNotNull(component);

      // verify that the component has the expected properties.
      Map<String, ManagedProperty> properties = component.getProperties();
      assertNotNull(properties);
View Full Code Here

    * @throws Exception if an error occurs while running the test.
    */
   public void testJNDIContextEstablishment() throws Exception
   {
      // get the XMLLoginConfig managed component.
      ManagementView managementView = super.getManagementView();
      ComponentType type = new ComponentType("MCBean", "Security");
      ManagedComponent component = managementView.getComponent("JNDIContextEstablishment", type);
      assertNotNull(component);

      // verify that the component has the expected properties.
      Map<String, ManagedProperty> properties = component.getProperties();
      assertNotNull(properties);
View Full Code Here

    * @throws Exception if an error occurs while running the test.
    */
   public void testJNDIBasedSecurityManagement() throws Exception
   {
      // get the XMLLoginConfig managed component.
      ManagementView managementView = super.getManagementView();
      ComponentType type = new ComponentType("MCBean", "Security");
      ManagedComponent component = managementView.getComponent("JNDIBasedSecurityManagement", type);
      assertNotNull(component);

      // verify that the component has the expected managed properties.
      Map<String, ManagedProperty> properties = component.getProperties();
      assertNotNull(properties);
View Full Code Here

      // deploy the XML file that contains the test security domains.
      String domainsDeployment = "testdomains-jboss-beans.xml";
      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);

      // verify that the component has the expected managed properties.
      Map<String, ManagedProperty> properties = component.getProperties();
      assertNotNull(properties);
      assertTrue("Missing expected property: securityDomain", properties.containsKey("securityDomain"));
      assertTrue("Missing expected property: state", properties.containsKey("state"));
      // keystore and truststore configuration properties.
      assertTrue("Missing expected property: keyStoreType", properties.containsKey("keyStoreType"));
      assertTrue("Missing expected property: keyStoreURL", properties.containsKey("keyStoreURL"));
      assertTrue("Missing expected property: keyStorePass", properties.containsKey("keyStorePass"));
      assertTrue("Missing expected property: keyStoreAlias", properties.containsKey("keyStoreAlias"));
      assertTrue("Missing expected property: keyStoreProviderArgument", properties.containsKey("keyStoreProviderArgument"));
      assertTrue("Missing expected property: trustStoreType", properties.containsKey("trustStoreType"));
      assertTrue("Missing expected property: trustStoreURL", properties.containsKey("trustStoreURL"));
      assertTrue("Missing expected property: trustStorePass", properties.containsKey("trustStorePass"));
      assertTrue("Missing expected property: trustStoreProviderArgument", properties.containsKey("trustStoreProviderArgument"));
      // security manager service injection properties.
      assertTrue("Missing expected property: managerServiceName", properties.containsKey("managerServiceName"));
      assertTrue("Missing expected property: securityManagement", properties.containsKey("securityManagement"));
      // cipher algorithm properties.
      assertTrue("Missing expected property: salt", properties.containsKey("salt"));
      assertTrue("Missing expected property: iterationCount", properties.containsKey("iterationCount"));
      assertTrue("Missing expected property: cipherAlgorithm", properties.containsKey("cipherAlgorithm"));

      // verify that the component has the expected managed operations.
      Map<String, ManagedOperation> operations = new HashMap<String, ManagedOperation>();
      for (ManagedOperation operation : component.getOperations())
         operations.put(operation.getName(), operation);
      String[] noArgsOperations = {"getKeyStore", "getTrustStore", "getKeyManagerFactory", "getTrustManagerFactory",
            "reloadKeyAndTrustStore"};
      String[] oneArgOperations = {"encode", "decode", "encode64", "decode64"};
      assertEquals("Unexpected number of operations", noArgsOperations.length + oneArgOperations.length, operations
            .size());
      // first check the methods that don't have any parameter.
      for(String operationName : noArgsOperations)
      {
         ManagedOperation operation = operations.get(operationName);
         assertNotNull("Unexpected operation name: " + operationName, operation);
         ManagedParameter[] parameters = operation.getParameters();
         assertEquals("Unexpected number of parameters", 0, parameters.length);
      }
      // now check the methods that contain a 'secret' parameter.
      for(String operationName : oneArgOperations)
      {
         ManagedOperation operation = operations.get(operationName);
         assertNotNull("Unexpected operation name: " + operationName, operation);
         ManagedParameter[] parameters = operation.getParameters();
         assertEquals("Unexpected number of parameters", 1, parameters.length);
         assertEquals("Invalid parameter name", "secret", parameters[0].getName());
      }
     
      // just the check the second security domain is also available - we don't repeat the tests because the
      // properties and operations must be the same of those verified in the first domain.
      component = managementView.getComponent("TestDomain2", type);
      assertNotNull(component);

      // undeploy the test security domains.
      this.undeployResource(domainsDeployment);
   }
View Full Code Here

    *
    * @throws Exception if an error occurs while running the test.
    */
   public void testJNDIBasedSecurityRegistration() throws Exception
   {
      ManagementView mgtMview = getManagementView();
      ComponentType type = new ComponentType("MCBean", "Security");
      ManagedComponent mc = mgtMview.getComponent("JNDIBasedSecurityRegistration", type);
      assertNotNull(mc);
   }
View Full Code Here

    * can be resolved by the ManagementView.
    *
    */
   public void testKnownDeploymentTypes() throws Exception
   {
      ManagementView mgtView = getManagementView();
     
      for(KnownDeploymentTypes type : KnownDeploymentTypes.values())
      {
         log.debug("----- deployment type: " + type);
        
         Set<String> deploymentNames = mgtView.getDeploymentNamesForType(type.getType());
         if(deploymentNames != null)
         {
            for(String deploymentName : deploymentNames)
            {
               try
               {
                  ManagedDeployment deployment = mgtView.getDeployment(deploymentName);
                  log.debug(deployment.getSimpleName());
               }
               catch(Exception e)
               {
                  log.error("failed to get " + deploymentName, e);
View Full Code Here

      log.debug("Bound ProfileService proxy under: "+jndiName);

      // A server side secured ManagementView proxy
      SecurityContainer container2 = new SecurityContainer(serverProxyInterceptors, mgtView);
      Class<?>[] ifaces2 = {ManagementView.class};
      ManagementView mgtViewSecure = (ManagementView) java.lang.reflect.Proxy.newProxyInstance(loader, ifaces2, container2);
      // Create the ManagementView proxy
      Class[] mvIfaces = {ManagementView.class};
      String mvDispatchName = dispatchName+".ManagementView";
      Dispatcher.singleton.registerTarget(mvDispatchName, mgtViewSecure);
      mgtViewProxy = Remoting.createRemoteProxy(mvDispatchName, loader, mvIfaces, locator, proxyInterceptors, "ProfileService");
View Full Code Here

    * @throws Exception
    */
   public void testHAPartition()
      throws Exception
   {
      ManagementView mgtView = getManagementView();
      ComponentType type = new ComponentType("MCBean", "HAPartition");
      ManagedComponent mc = mgtView.getComponent(this.partitionName, type);
      validateHAPartitionManagedComponent(mc);
   }
View Full Code Here

TOP

Related Classes of org.jboss.deployers.spi.management.ManagementView

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.