String driverClassName = lds.getDriverClass();
assertEquals("org.jboss.jdbc.ClusteredDriver", driverClassName);
// Validate the security-domain
ManagedProperty secDomain = mo.getProperty("security-domain");
assertNotNull("security-domain", secDomain);
CompositeMetaType compType = (CompositeMetaType) secDomain.getMetaType();
assertNotNull(compType);
CompositeValue sdCV = (CompositeValue) secDomain.getValue();
assertNotNull("security-domain.CV", sdCV);
SimpleValue domainName = (SimpleValue) sdCV.get("domain");
assertNotNull("security-domain.domain", domainName);
assertEquals(SimpleValueSupport.wrap("java:/jaas/SomeDomain"), domainName);
assertNotNull("security-domain.deploymentType", sdCV.get("securityDeploymentType"));
assertEquals("APPLICATION", ((EnumValue) sdCV.get("securityDeploymentType")).getValue());
assertFalse(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
// Set a new security domain and check if the metaType changed
CompositeValueSupport newSecDomain = new CompositeValueSupport(compType);
newSecDomain.set("domain", SimpleValueSupport.wrap("test"));
newSecDomain.set("securityDeploymentType", new EnumValueSupport(
(EnumMetaType) compType.getType("securityDeploymentType"),
SecurityDeploymentType.DOMAIN_AND_APPLICATION));
secDomain.setValue(newSecDomain);
assertTrue(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
}