// Prepare OpString
OpStringLoader loader = new OpStringLoader();
OperationalString[] opstrings =
loader.parseOperationalString(new File("src/test/resources/opstring/simple_opstring.groovy"));
org.junit.Assert.assertEquals(1, opstrings.length);
OpString opstring = (OpString)opstrings[0];
logger.info("Loaded "+opstring.getName());
org.junit.Assert.assertEquals(1, opstring.getServices().length);
ServiceElement service = opstring.getServices()[0];
service.setProvisionType(fixed? ServiceElement.ProvisionType.FIXED : ServiceElement.ProvisionType.DYNAMIC);
if (maintain < 0) {
try {
service.setPlanned(maintain);
Assert.fail("IllegalArgumentException expected but not thrown");
} catch (IllegalArgumentException e) {
}
logger.info("checkState, prevFixed: "+prevFixed+", prevMaintainInt: "+prevMaintainInt+", cybernode service count: "+cyberMon.getServices().size());
checkState(prevFixed, prevMaintainInt, cyberMon.getServices());
} else {
logger.info(service.getName()+" set planned="+maintain);
service.setPlanned(maintain);
logger.info("Deploy "+opstring.getName());
testManager.deploy(opstring, monitor);
logger.info("Deployed "+opstring.getName());
checkState(fixed, maintain, cyberMon.getServices());
prevFixed = fixed;
prevMaintainInt = maintain;
}
}