use of org.apache.maven.plugin.logging.SystemStreamLog in project docker-maven-plugin by fabric8io.
the class DockerMachineIT method testLaunchDockerMachine.
@Test
public void testLaunchDockerMachine() throws Exception {
DockerMachineConfiguration mc = new DockerMachineConfiguration("default", "true");
DockerMachine de = new DockerMachine(new AnsiLogger(new SystemStreamLog(), true, true), mc);
Assert.assertTrue(de.getConnectionParameter(null) != null);
}
use of org.apache.maven.plugin.logging.SystemStreamLog in project docker-maven-plugin by fabric8io.
the class DockerAssemblyManagerTest method assemblyFiles.
@Test
public void assemblyFiles(@Injectable final MojoParameters mojoParams, @Injectable final MavenProject project, @Injectable final Assembly assembly) throws AssemblyFormattingException, ArchiveCreationException, InvalidAssemblerConfigurationException, MojoExecutionException, AssemblyReadException, IllegalAccessException {
ReflectionUtils.setVariableValueInObject(assemblyManager, "trackArchiver", trackArchiver);
new Expectations() {
{
mojoParams.getOutputDirectory();
result = "target/";
times = 3;
mojoParams.getProject();
project.getBasedir();
result = ".";
assemblyReader.readAssemblies((AssemblerConfigurationSource) any);
result = Arrays.asList(assembly);
}
};
BuildImageConfiguration buildConfig = createBuildConfig();
assemblyManager.getAssemblyFiles("testImage", buildConfig, mojoParams, new AnsiLogger(new SystemStreamLog(), true, true));
}
use of org.apache.maven.plugin.logging.SystemStreamLog in project docker-maven-plugin by fabric8io.
the class MappingTrackArchiverTest method setup.
@Before
public void setup() throws IllegalAccessException {
archiver = new MappingTrackArchiver();
archiver.init(new AnsiLogger(new SystemStreamLog(), false, false), "maven");
}
use of org.apache.maven.plugin.logging.SystemStreamLog in project tycho by eclipse.
the class OsgiCompilerTest method testWarningAndErrorMessages.
public void testWarningAndErrorMessages() throws Exception {
File basedir = getBasedir("projects/compilermessages");
List<MavenProject> projects = getSortedProjects(basedir, null);
MavenProject project = projects.get(0);
AbstractOsgiCompilerMojo mojo = getMojo(projects, project);
final List<CharSequence> warnings = new ArrayList<>();
mojo.setLog(new SystemStreamLog() {
@Override
public void warn(CharSequence content) {
warnings.add(content);
}
});
try {
mojo.execute();
fail("compilation failure expected");
} catch (CompilationFailureException e) {
String message = e.getLongMessage();
assertThat(message, containsString("3 problems (1 error, 2 warnings)"));
// 1 error
assertThat(message, containsString("Test.java:[23"));
assertThat(message, containsString("System.foo();"));
}
// 2 warnings
List<String> expectedWarnings = asList(//
"Test.java:[19", "Test.java:[21");
assertEquals(expectedWarnings.size(), warnings.size());
for (int i = 0; i < warnings.size(); i++) {
String warning = (String) warnings.get(i);
String expectedWarning = expectedWarnings.get(i);
assertThat(warning, containsString(expectedWarning));
}
}
use of org.apache.maven.plugin.logging.SystemStreamLog in project tycho by eclipse.
the class OsgiCompilerTest method testCompilerArgs.
public void testCompilerArgs() throws Exception {
File basedir = getBasedir("projects/compiler-args");
List<MavenProject> projects = getSortedProjects(basedir, null);
MavenProject project = projects.get(0);
AbstractOsgiCompilerMojo mojo = getMojo(projects, project);
final List<CharSequence> warnings = new ArrayList<>();
mojo.setLog(new SystemStreamLog() {
@Override
public void warn(CharSequence content) {
warnings.add(content);
}
});
try {
mojo.execute();
fail("compilation failure expected");
} catch (CompilationFailureException e) {
String message = e.getLongMessage();
assertThat(message, containsString("2 problems (1 error, 1 warning)"));
// 1 error
assertThat(message, containsString("unused"));
}
// 1 warning
assertThat((String) warnings.iterator().next(), containsString("is boxed"));
}
Aggregations