Search in sources :

Example 1 with EngineControl

use of ch.ivyteam.ivy.maven.engine.EngineControl in project project-build-plugin by axonivy.

the class StartTestEngineMojo method startEngine.

Executor startEngine() throws Exception {
    EngineVmOptions vmOptions = new EngineVmOptions(maxmem, additionalClasspath, additionalVmOptions);
    EngineControl engineControl = new EngineControl(new EngineMojoContext(identifyAndGetEngineDirectory(), project, getLog(), engineLogFile, vmOptions, startTimeoutInSeconds));
    return engineControl.start();
}
Also used : EngineMojoContext(ch.ivyteam.ivy.maven.engine.EngineMojoContext) EngineVmOptions(ch.ivyteam.ivy.maven.engine.EngineVmOptions) EngineControl(ch.ivyteam.ivy.maven.engine.EngineControl)

Example 2 with EngineControl

use of ch.ivyteam.ivy.maven.engine.EngineControl in project project-build-plugin by axonivy.

the class StartTestEngineMojo method startEngine.

public Executor startEngine() throws Exception {
    File engineDir = identifyAndGetEngineDirectory();
    if (engineToTarget()) {
        engineDir = copyEngineToTarget(engineDir);
    }
    EngineVmOptions vmOptions = new EngineVmOptions(maxmem, additionalClasspath, additionalVmOptions);
    EngineControl engineControl = new EngineControl(new EngineMojoContext(engineDir, project, getLog(), engineLogFile, vmOptions, startTimeoutInSeconds));
    return engineControl.start();
}
Also used : EngineMojoContext(ch.ivyteam.ivy.maven.engine.EngineMojoContext) EngineVmOptions(ch.ivyteam.ivy.maven.engine.EngineVmOptions) EngineControl(ch.ivyteam.ivy.maven.engine.EngineControl) File(java.io.File)

Example 3 with EngineControl

use of ch.ivyteam.ivy.maven.engine.EngineControl in project project-build-plugin by axonivy.

the class StopTestEngineMojo method createEngineController.

public EngineControl createEngineController() throws MojoExecutionException {
    EngineVmOptions vmOptions = new EngineVmOptions(maxmem, additionalClasspath, additionalVmOptions);
    EngineControl engineControl = new EngineControl(new EngineMojoContext(identifyAndGetEngineDirectory(), project, getLog(), null, vmOptions, stopTimeoutInSeconds));
    return engineControl;
}
Also used : EngineMojoContext(ch.ivyteam.ivy.maven.engine.EngineMojoContext) EngineVmOptions(ch.ivyteam.ivy.maven.engine.EngineVmOptions) EngineControl(ch.ivyteam.ivy.maven.engine.EngineControl)

Example 4 with EngineControl

use of ch.ivyteam.ivy.maven.engine.EngineControl in project project-build-plugin by axonivy.

the class StopTestEngineMojo method createEngineController.

public EngineControl createEngineController() throws MojoExecutionException {
    File engineDir = getEngineDir(project);
    if (engineDir == null || !engineDir.exists()) {
        engineDir = identifyAndGetEngineDirectory();
    }
    EngineVmOptions vmOptions = new EngineVmOptions(maxmem, additionalClasspath, additionalVmOptions);
    EngineControl engineControl = new EngineControl(new EngineMojoContext(engineDir, project, getLog(), null, vmOptions, stopTimeoutInSeconds));
    return engineControl;
}
Also used : EngineMojoContext(ch.ivyteam.ivy.maven.engine.EngineMojoContext) EngineVmOptions(ch.ivyteam.ivy.maven.engine.EngineVmOptions) EngineControl(ch.ivyteam.ivy.maven.engine.EngineControl) File(java.io.File)

Example 5 with EngineControl

use of ch.ivyteam.ivy.maven.engine.EngineControl in project project-build-plugin by axonivy.

the class TestEngineControlEngineDirectory method engineControl_engineDir_doesNotExist.

@Test
public void engineControl_engineDir_doesNotExist() throws Exception {
    LogCollector log = new LogCollector();
    StopTestEngineMojo mojo = rule.getMojo();
    mojo.setLog(log);
    mojo.testEngine = TestEngineLocation.MODIFY_EXISTING;
    EngineControl controller = mojo.createEngineController();
    controller.stop();
    assertThat(log.getWarnings()).isEmpty();
    assertThat(log.getErrors()).isEmpty();
}
Also used : LogCollector(ch.ivyteam.ivy.maven.log.LogCollector) EngineControl(ch.ivyteam.ivy.maven.engine.EngineControl) BaseEngineProjectMojoTest(ch.ivyteam.ivy.maven.BaseEngineProjectMojoTest) Test(org.junit.Test)

Aggregations

EngineControl (ch.ivyteam.ivy.maven.engine.EngineControl)5 EngineMojoContext (ch.ivyteam.ivy.maven.engine.EngineMojoContext)4 EngineVmOptions (ch.ivyteam.ivy.maven.engine.EngineVmOptions)4 File (java.io.File)2 BaseEngineProjectMojoTest (ch.ivyteam.ivy.maven.BaseEngineProjectMojoTest)1 LogCollector (ch.ivyteam.ivy.maven.log.LogCollector)1 Test (org.junit.Test)1