use of org.eclipse.tycho.packaging.PackageIUMojo in project tycho by eclipse.
the class PackageIUMojoTest method testThatArtifactPayloadIsCorrect.
public void testThatArtifactPayloadIsCorrect() throws Exception {
File basedir = getBasedir("projects/iuWithPayload/");
File platform = new File("src/test/resources/eclipse");
List<MavenProject> projects = getSortedProjects(basedir, platform);
MavenProject project = getProject(projects, "iuWithPayload");
MavenSession session = newMavenSession(project, projects);
// set build qualifier
lookupMojoWithDefaultConfiguration(project, session, "build-qualifier").execute();
PackageIUMojo mojo = (PackageIUMojo) lookupConfiguredMojo(project, "package-iu");
setVariableValueToObject(mojo, "artifactContentFolder", new File(basedir, "src/main/resources").getAbsolutePath());
mojo.execute();
assertThat(getFilesInZip(new File(basedir, "target/iuWithPayload-1.0.0.zip")), hasItem("file.txt"));
}
use of org.eclipse.tycho.packaging.PackageIUMojo in project tycho by eclipse.
the class PackageIUMojoTest method testArtifactWithoutPayload.
public void testArtifactWithoutPayload() throws Exception {
File basedir = getBasedir("projects/iuWithoutPayload");
File platform = new File("src/test/resources/eclipse");
List<MavenProject> projects = getSortedProjects(basedir, platform);
MavenProject project = getProject(projects, "iuWithoutPayload");
MavenSession session = newMavenSession(project, projects);
// set build qualifier
lookupMojoWithDefaultConfiguration(project, session, "build-qualifier").execute();
PackageIUMojo mojo = (PackageIUMojo) lookupConfiguredMojo(project, "package-iu");
mojo.execute();
IU iu = IU.loadIU(new File(basedir, "target"));
Element artifact = iu.getSelfArtifact();
assertThat(artifact, nullValue());
assertThat(new File(basedir, "target/iuWithoutPayload-1.0.0.zip").exists(), is(true));
}
use of org.eclipse.tycho.packaging.PackageIUMojo in project tycho by eclipse.
the class PackageIUMojoTest method testInjectArtifactReference.
public void testInjectArtifactReference() throws Exception {
File basedir = getBasedir("projects/iuWithPayloadButNoArtifactReference");
File platform = new File("src/test/resources/eclipse");
List<MavenProject> projects = getSortedProjects(basedir, platform);
MavenProject project = getProject(projects, "iuWithPayloadButNoArtifactReference");
MavenSession session = newMavenSession(project, projects);
// set build qualifier
lookupMojoWithDefaultConfiguration(project, session, "build-qualifier").execute();
PackageIUMojo mojo = (PackageIUMojo) lookupConfiguredMojo(project, "package-iu");
setVariableValueToObject(mojo, "artifactContentFolder", new File(basedir, "src/main/resources").getAbsolutePath());
mojo.execute();
IU iu = IU.loadIU(new File(basedir, "target"));
Element artifact = iu.getSelfArtifact();
assertNotNull(artifact);
assertThat(artifact.getAttributeValue("classifier"), is("binary"));
assertThat(artifact.getAttributeValue("id"), is("iuWithPayloadButNoArtifactReference"));
assertThat(artifact.getAttributeValue("version"), is("1.0.0"));
}
Aggregations