Package org.jboss.test.deployers.deployer.support

Examples of org.jboss.test.deployers.deployer.support.TestServiceAttributeMetaData


      // The mbeans associated with the local DS
      TestServiceMetaData localMBeans = new TestServiceMetaData();
      localMBeans.setObjectName("jboss.jca:service.SecurityDomain");
      localMBeans.setCode(SimpleMetaData.class.getName());
      ArrayList<TestServiceAttributeMetaData> localMBeanAttrs = new ArrayList<TestServiceAttributeMetaData>();
      localMBeanAttrs.add(new TestServiceAttributeMetaData("java:/jaas/domain1", "domain"));
      localMBeanAttrs.add(new TestServiceAttributeMetaData("java:DefaultDS1", "jndiName"));
      TestServiceAttributeMetaData typeAttribute = new TestServiceAttributeMetaData(SimpleMetaData.SecurityDeploymentType.NONE, "type");
      localMBeanAttrs.add(typeAttribute);
      localMBeans.setAttributes(localMBeanAttrs);
      a1.addAttachment(TestServiceMetaData.class, localMBeans);
      ps.addDeployment(ctx1);

      Deployment ctx2 = createSimpleDeployment("deployment2");
      MutableAttachments a2 = (MutableAttachments)ctx2.getPredeterminedManagedObjects();

      TestServiceMetaData localMBeans2 = new TestServiceMetaData();
      localMBeans2.setCode(RuntimeComponentMetaData.class.getName());
      ArrayList<TestServiceAttributeMetaData> localMBeanAttrs2 = new ArrayList<TestServiceAttributeMetaData>();
      localMBeanAttrs2.add(new TestServiceAttributeMetaData("java:/jaas/domain2", "domain"));
      CustomName customName = new CustomName("runtime-name-1");
      localMBeanAttrs2.add(new TestServiceAttributeMetaData(customName, "customName"));
      localMBeans2.setAttributes(localMBeanAttrs2);
      a2.addAttachment(TestServiceMetaData.class, localMBeans2);
      ps.addDeployment(ctx2);

      ps.process();

      ManagedObject mo = ps.getManagedObject("java:/jaas/domain1/SecurityDomain");
      assertNotNull(mo);
      assertEquals(localMBeans.getObjectName(), mo.getComponentName());

      ManagedObject mo2 = ps.getManagedObject("java:/jaas/domain2/SecurityDomain");
      assertNotNull(mo2);
      assertEquals(customName.getName(), mo2.getComponentName());

      ManagedDeployment md = ps.getManagedDeployment("deployment1");
      assertNotNull(md);
      ManagedComponent mc = md.getComponent("java:/jaas/domain1");
      assertNotNull(mc);
      ManagedProperty prop = mc.getProperty("security-criteria");
      assertNotNull(prop);
      assertEquals(typeAttribute.getValue(), SimpleMetaData.SecurityDeploymentType.NONE);
      SimpleMetaData.SecurityDeploymentType value = SimpleMetaData.SecurityDeploymentType.APPLICATION;
      prop.setValue(getMetaValueFactory().create(value));
      assertEquals(typeAttribute.getValue(), SimpleMetaData.SecurityDeploymentType.APPLICATION);

      ManagedProperty targetProp = mc.getProperty("jndi-name");
      assertNotNull(targetProp);
      targetProp.setValue(getMetaValueFactory().create("java:DefaultDS2"));
      // test target runtime component invocation (if intendet here)
View Full Code Here


      a1.addAttachment(DSMetaData.class, dsmd);
      // The mbeans associated with the local DS
      TestServiceMetaData localMBeans = new TestServiceMetaData();
      localMBeans.setCode(DSService.class.getName());
      ArrayList<TestServiceAttributeMetaData> localMBeanAttrs = new ArrayList<TestServiceAttributeMetaData>();
      localMBeanAttrs.add(new TestServiceAttributeMetaData("java:DefaultDS1", "managementName"));
      localMBeans.setAttributes(localMBeanAttrs);
      a1.addAttachment(TestServiceMetaData.class, localMBeans);
      ps.addDeployment(ctx1);

      // Deploy security domain1
View Full Code Here

TOP

Related Classes of org.jboss.test.deployers.deployer.support.TestServiceAttributeMetaData

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.