* JBAS-6672 related testing of properties having default values
* @throws Exception
*/
public void testRemovedProperties() throws Exception
{
ManagementView mgtView = getManagementView();
String templateName = "LocalTxDataSourceTemplate";
String jndiName = "testRemovedPropertiesDS";
DeploymentTemplateInfo dsInfo = mgtView.getTemplate(templateName);
assertNotNull("template " + templateName + " found", dsInfo);
log.info(dsInfo.getProperties().keySet());
Map<String, ManagedProperty> props = dsInfo.getProperties();
// Set key property values
ManagedProperty jndiNameMP = props.get("jndi-name");
jndiNameMP.setValue(SimpleValueSupport.wrap(jndiName));
ManagedProperty driverClass = props.get("driver-class");
driverClass.setValue(SimpleValueSupport.wrap("org.hsqldb.jdbcDriver"));
ManagedProperty connUrl = props.get("connection-url");
connUrl.setValue(SimpleValueSupport.wrap("jdbc:hsqldb:."));
ManagedProperty userName = props.get("user-name");
userName.setValue(SimpleValueSupport.wrap("sa"));
ManagedProperty password = props.get("password");
password.setValue(SimpleValueSupport.wrap(""));
// Remove the
ManagedProperty useJavaCtx = props.get("use-java-context");
SimpleValue nullBoolean = SimpleValueSupport.wrap(false);
((SimpleValueSupport)nullBoolean).setValue(null);
useJavaCtx.setValue(nullBoolean);
useJavaCtx.setRemoved(true);
mgtView.applyTemplate("testRemovedProperties", dsInfo);
// reload the view and new datasource component
ComponentType componentType = new ComponentType("DataSource", "LocalTx");
activeView = null;
mgtView = getManagementView();