String deploymentName = "profileservice-datasource.ear";
try
{
// deployPackage(deploymentName);
ManagementView mgtView = getManagementView();
ManagedDeployment deployment = mgtView.getDeployment(deploymentName);
assertNotNull(deployment);
assertNotNull(deployment.getChildren());
assertFalse(deployment.getChildren().isEmpty());
// Check 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("ChangedNestedDsJNDIName");
assertNotNull("test-ds.xml", mc);
ManagedProperty property = mc.getProperty("prepared-statement-cache-size");
assertEquals("prepared-statement-cache-size: "+ property.getValue(), SimpleValueSupport.wrap(34), property.getValue());
// This should work too
ManagedComponent comp = getManagedComponent(mgtView, "ChangedNestedDsJNDIName");
assertNotNull(comp);
ManagedComponent comp3 = getManagedComponent(mgtView, "ProfileServiceNestedTestDS");
assertNull(comp3);
// Check 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");
assertNotNull("test-second-ds.xml", mc);
// prepared-statement-cache-size
property = mc.getProperty("prepared-statement-cache-size");
assertEquals(property.getValue(), SimpleValueSupport.wrap(33));