Search in sources :

Example 11 with MavenRequest

use of org.appformer.maven.integration.embedder.MavenRequest in project kie-wb-common by kiegroup.

the class ExecuteGoalsCommandTest method prepareExecutionTest.

@Test
public void prepareExecutionTest() {
    final String pomPath = BASE_DIRECTORY + FileSystems.getDefault().getSeparator() + ExecuteGoalsCommand.POM_XML;
    final ExecuteGoalsCommand command = new ExecuteGoalsCommand(BASE_DIRECTORY);
    final MavenRequest request = command.buildMavenRequest();
    assertThat(request.getPom()).isEqualTo(pomPath);
    assertThat(request.getGoals()).isEqualTo(ExecuteGoalsCommand.DEFAULT_GOALS);
    final MavenRequest finalRequest = command.prepareExecution();
    final Properties properties = command.buildUserProperties();
    assertThat(finalRequest.getBaseDirectory()).isEqualTo(BASE_DIRECTORY);
    assertThat(finalRequest.getLoggingLevel()).isEqualTo(MavenExecutionRequest.LOGGING_LEVEL_ERROR);
    assertThat(finalRequest.getUserProperties()).isEqualTo(properties);
}
Also used : Properties(java.util.Properties) MavenRequest(org.appformer.maven.integration.embedder.MavenRequest) Test(org.junit.Test)

Aggregations

MavenRequest (org.appformer.maven.integration.embedder.MavenRequest)11 Test (org.junit.Test)6 MavenEmbedder (org.appformer.maven.integration.embedder.MavenEmbedder)3 Properties (java.util.Properties)2 MavenExecutionResult (org.apache.maven.execution.MavenExecutionResult)2 PrintStream (java.io.PrintStream)1 MavenEmbedderException (org.appformer.maven.integration.embedder.MavenEmbedderException)1 BuildException (org.guvnor.ala.exceptions.BuildException)1