List of usage examples for org.apache.commons.exec ShutdownHookProcessDestroyer size
public int size()
From source file:ch.ivyteam.ivy.maven.TestStartEngine.java
@Test public void testKillEngineOnVmExit() throws Exception { StartTestEngineMojo mojo = rule.getMojo(); Executor startedProcess = null; try {//from www . j a v a 2 s . com startedProcess = mojo.startEngine(); assertThat(startedProcess.getProcessDestroyer()).isInstanceOf(ShutdownHookProcessDestroyer.class); ShutdownHookProcessDestroyer jvmShutdownHoock = (ShutdownHookProcessDestroyer) startedProcess .getProcessDestroyer(); assertThat(jvmShutdownHoock.size()).as("One started engine process must be killed on VM end.") .isEqualTo(1); } finally { kill(startedProcess); } }