"src"+File.separator+
"test"+File.separator+
"resources"+File.separator+
"opstring"+File.separator+
"outofmemory_test.groovy");
OperationalStringManager mgr = testManager.deploy(opstring);
OutOfMemory outOfMemory = (OutOfMemory)testManager.waitForService(OutOfMemory.class);
try {
BasicEventConsumer eventConsumer = new BasicEventConsumer(ProvisionMonitorEvent.getEventDescriptor(), l);
eventConsumer.register(items[0]);
} catch (Exception e) {
thrown = e;
e.printStackTrace();
}
Assert.assertNull(thrown);
thrown = null;
try {
outOfMemory.createOOME();
} catch (IOException e) {
thrown = e;
e.printStackTrace();
}
Assert.assertNull(thrown);
long waited = wait(l, true);
System.out.println("Waited "+waited/1000+" seconds for failure to be observed");
Assert.assertTrue("OutOfMemory should have failed", l.failed);
waited = wait(l, false);
System.out.println("Waited "+waited/1000+" seconds for re-creation to be observed");
Assert.assertNotNull("OutOfMemory should be re-allocated", outOfMemory);
thrown = null;
try {
sleep(10*1000);
testManager.undeploy(mgr.getOperationalString().getName());
} catch (IOException e) {
thrown = e;
e.printStackTrace();
}
Assert.assertNull(thrown);