Assert.assertTrue(fired.get());
}
@Test
public void testJavaSignal() {
Signal s = Signal.SIGHUP;
final AtomicBoolean fired = new AtomicBoolean(false);
javaPosix.signal(s, new SignalHandler() {
public void handle(int signal) {
fired.set(true);
}
});
// have to use native here; no abstraction for kill in pure Java
// TODO: sun.misc.Signal.raise can be used to kill current pid
posix.kill(posix.getpid(), s.intValue());
waitUntilTrue(fired, 200);
Assert.assertTrue(fired.get());
}