Example usage for org.apache.commons.exec ShutdownHookProcessDestroyer size

List of usage examples for org.apache.commons.exec ShutdownHookProcessDestroyer size

Introduction

In this page you can find the example usage for org.apache.commons.exec ShutdownHookProcessDestroyer size.

Prototype

public int size() 

Source Link

Document

Returns the number of registered processes.

Usage

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);
    }
}