//System.out.println(executeCommand("fabric:info"));
//System.out.println(executeCommand("fabric:profile-list"));
ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);
try {
FabricService fabricService = fabricProxy.getService();
waitForFabricCommands();
String profile = "mq-amq";
Integer expected = 1;
boolean changed = fabricService.scaleProfile(profile, expected);
assertProfileMinimumSize(fabricService, profile, expected);
// lets call the scale method again, should have no effect as already requirements are updated
// and we've not started an auto-scaler yet
changed = fabricService.scaleProfile(profile, expected);
assertProfileMinimumSize(fabricService, profile, expected);
Assert.assertEquals("should not have changed!", false, changed);
changed = fabricService.scaleProfile(profile, 2);
assertProfileMinimumSize(fabricService, profile, 2);
// now lets scale down
changed = fabricService.scaleProfile(profile, -1);
// since we have no instances right now, scaling down just removes the minimumInstances requirements ;)
assertProfileMinimumSize(fabricService, profile, null);
} finally {
fabricProxy.close();