public void testApplicationContextShared() throws Exception {
FMSModelIII.reset();
FMS flightManagementSystem = getInstanceByType(FMS.class);
flightManagementSystem.climb();
Timer timer = new Timer().setDelay(20000l).addStopCondition(new StopCondition() {
public boolean isSatisfied() {
return FMSModelIII.isClimbed();
}
}).start();
flightManagementSystem.descend();
timer.addStopCondition(new StopCondition() {
public boolean isSatisfied() {
return FMSModelIII.isDescended();
}
}, true).start();