@Test(dependsOnMethods = "loadPluginDescriptors")
public void testOperationMetadata() {
ResourceType jbossServer = metadataManager.getType("JBossASServer", "JBossAS");
assert jbossServer.getOperationDefinitions() != null;
assert jbossServer.getOperationDefinitions().size() == 1;
OperationDefinition stopOp = jbossServer.getOperationDefinitions().iterator().next();
assert stopOp.getName().equals("stop");
assert stopOp.getDisplayName().equals("Stop JBossAS Server");
assert stopOp.getDescription().equals("Kills the server");
assert stopOp.getTimeout() != null;
assert stopOp.getTimeout().equals(new Integer(30));
assert stopOp.getParametersConfigurationDefinition() != null;
ConfigurationDefinition parameters = stopOp.getParametersConfigurationDefinition();
assert parameters.getPropertyDefinitions().size() == 1;
PropertyDefinition def1 = parameters.get("force");
PropertyDefinition def2 = parameters.getPropertyDefinitions().get("force");
assert def1 != null;
assert def2 != null;
assert def2.equals(def1);
assert def1.getName().equals("force");
assert def1.getDisplayName().equals("Force Kill");
assert def1
.getDescription()
.equals(
"If true, use operating system to kill the process; otherwise, use JBoss remote JMX method to shut it down");
assert !def1.isRequired();
assert def1 instanceof PropertyDefinitionSimple;
assert ((PropertyDefinitionSimple) def1).getType().equals(PropertySimpleType.BOOLEAN);
PropertySimple prop = (PropertySimple) def1.getConfigurationDefinition().getDefaultTemplate()
.getConfiguration().get("force");
assert prop.getBooleanValue().booleanValue() == false;
assert stopOp.getResultsConfigurationDefinition() != null;
ConfigurationDefinition results = stopOp.getResultsConfigurationDefinition();
assert results.getPropertyDefinitions().size() == 1;
def1 = results.get("confirmed");
def2 = results.getPropertyDefinitions().get("confirmed");
assert def1 != null : results.getPropertyDefinitions();
assert def2 != null : results.getPropertyDefinitions();