use of org.appformer.maven.integration.embedder.MavenRequest in project kie-wb-common by kiegroup.
the class AbstractMavenCommand method prepareExecution.
MavenRequest prepareExecution() {
final MavenRequest mavenRequest = buildMavenRequest();
mavenRequest.setBaseDirectory(baseDirectory);
mavenRequest.setLoggingLevel(loggingLevel);
mavenRequest.setUserProperties(buildUserProperties());
return mavenRequest;
}
use of org.appformer.maven.integration.embedder.MavenRequest in project kie-wb-common by kiegroup.
the class ExecuteGoalsCommandTest method useDefaultGoalsTest.
@Test
public void useDefaultGoalsTest() {
final ExecuteGoalsCommand command = new ExecuteGoalsCommand(BASE_DIRECTORY);
final MavenRequest request = command.buildMavenRequest();
assertThat(request.getGoals()).isEqualTo(ExecuteGoalsCommand.DEFAULT_GOALS);
}
use of org.appformer.maven.integration.embedder.MavenRequest in project kie-wb-common by kiegroup.
the class ExecuteGoalsCommandTest method useCustomGoalsTest.
@Test
public void useCustomGoalsTest() {
final List<String> customGoals = Collections.singletonList("compile");
final ExecuteGoalsCommand command = new ExecuteGoalsCommand(BASE_DIRECTORY, customGoals);
final MavenRequest request = command.buildMavenRequest();
assertThat(request.getGoals()).isEqualTo(customGoals);
}
use of org.appformer.maven.integration.embedder.MavenRequest in project kie-wb-common by kiegroup.
the class ExecuteGoalsCommandTest method executeTest.
@Test
public void executeTest() throws MavenEmbedderException {
final ExecuteGoalsCommand command = spy(new ExecuteGoalsCommand(BASE_DIRECTORY));
final MavenRequest mavenRequest = mock(MavenRequest.class);
doReturn(mavenRequest).when(command).prepareExecution();
final MavenEmbedder mavenEmbedder = mock(MavenEmbedder.class);
final MavenExecutionResult result = mock(MavenExecutionResult.class);
doReturn(result).when(mavenEmbedder).execute(mavenRequest);
doReturn(mavenEmbedder).when(command).createMavenEmbedder();
final MavenExecutionResult executionResult = command.execute();
assertSame(result, executionResult);
}
use of org.appformer.maven.integration.embedder.MavenRequest in project kie-wb-common by kiegroup.
the class ExecuteGoalsCommandTest method buildMavenRequestTest.
@Test
public void buildMavenRequestTest() {
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);
}
Aggregations