List of usage examples for org.apache.commons.exec Executor getProcessDestroyer
ProcessDestroyer getProcessDestroyer();
From source file:ch.ivyteam.ivy.maven.TestStartEngine.java
@Test public void testKillEngineOnVmExit() throws Exception { StartTestEngineMojo mojo = rule.getMojo(); Executor startedProcess = null; try {/*from w w w . java 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); } }