* @author Heiko W. Rupp
*/
public class ServerGroupTest extends AbstractIntegrationTest {
public void createServerGroupViaApi() throws Exception {
ASConnection connection = getDomainControllerASConnection();
HostControllerComponent hcc = new HostControllerComponent();
hcc.setConnection(connection);
Configuration rc = new Configuration();
rc.put(new PropertySimple("profile", "default"));
rc.put(new PropertySimple("socket-binding-group", "standard-sockets"));
ResourceType rt = new ResourceType("ServerGroup", PLUGIN_NAME, ResourceCategory.SERVICE, null);
String serverGroupName = "_test-sg";
try {
CreateResourceReport report = new CreateResourceReport(serverGroupName, rt, new Configuration(), rc, null);
report = hcc.createResource(report);
assert report != null : "Report was null.";
assert report.getStatus() == CreateResourceStatus.SUCCESS : "Create was a failure: "
+ report.getErrorMessage();
} finally {
Remove r = new Remove("server-group", serverGroupName);
connection.execute(r);
}
}