use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class GAVArtifactDescriptorTest method testDeserializationWithClassifierAndExt.
@Test
public void testDeserializationWithClassifierAndExt() {
ArtifactDescriptor input = createP2Descriptor();
setGAVProperties(input);
input.setProperty("maven-classifier", OTHER_CLASSIFIER);
input.setProperty("maven-extension", OTHER_EXTENSION);
subject = new GAVArtifactDescriptor(input);
assertThat(subject.getMavenCoordinates(), is(new MavenRepositoryCoordinates(TEST_GAV, OTHER_CLASSIFIER, OTHER_EXTENSION)));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class LocalArtifactRepositoryTest method getMavenLocationWithClassifierAndExtension.
@Test
public void getMavenLocationWithClassifierAndExtension() {
LocalArtifactRepository repo = new LocalArtifactRepository(localRepoIndices);
ArtifactDescriptor desc = newBundleArtifactDescriptor(true);
Assert.assertEquals(new File(baseDir, "group/org.eclipse.tycho.test.maven/1.0.0/org.eclipse.tycho.test.maven-1.0.0.jar"), repo.internalGetArtifactStorageLocation(desc));
desc.setProperty(RepositoryLayoutHelper.PROP_CLASSIFIER, "classifier.value");
Assert.assertEquals(new File(baseDir, "group/org.eclipse.tycho.test.maven/1.0.0/org.eclipse.tycho.test.maven-1.0.0-classifier.value.jar"), repo.internalGetArtifactStorageLocation(desc));
desc.setProperty(RepositoryLayoutHelper.PROP_EXTENSION, "zip");
Assert.assertEquals(new File(baseDir, "group/org.eclipse.tycho.test.maven/1.0.0/org.eclipse.tycho.test.maven-1.0.0-classifier.value.zip"), repo.internalGetArtifactStorageLocation(desc));
desc.setProperty(RepositoryLayoutHelper.PROP_CLASSIFIER, null);
Assert.assertEquals(new File(baseDir, "group/org.eclipse.tycho.test.maven/1.0.0/org.eclipse.tycho.test.maven-1.0.0.zip"), repo.internalGetArtifactStorageLocation(desc));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class LocalArtifactRepositoryTest method getP2Location.
@Test
public void getP2Location() {
LocalArtifactRepository repo = new LocalArtifactRepository(localRepoIndices);
ArtifactDescriptor desc = newBundleArtifactDescriptor(false);
Assert.assertEquals(new File(baseDir, "p2/osgi/bundle/org.eclipse.tycho.test.p2/1.0.0/org.eclipse.tycho.test.p2-1.0.0.jar"), repo.internalGetArtifactStorageLocation(desc));
ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] { new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true) };
desc.setProcessingSteps(steps);
desc.setProperty(IArtifactDescriptor.FORMAT, "packed");
Assert.assertEquals(new File(baseDir, "p2/osgi/bundle/org.eclipse.tycho.test.p2/1.0.0/org.eclipse.tycho.test.p2-1.0.0-pack200.jar.pack.gz"), repo.internalGetArtifactStorageLocation(desc));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class LocalArtifactRepositoryTest method testGetRawArtifactDummy.
@Test
public void testGetRawArtifactDummy() throws ProvisionException, IOException {
LocalArtifactRepository repo = new LocalArtifactRepository(localRepoIndices);
ArtifactDescriptor p2Artifact = newBundleArtifactDescriptor(false);
byte[] content = new byte[] { 111, 112 };
writeDummyArtifact(repo, p2Artifact, content);
Assert.assertTrue(repo.contains(p2Artifact.getArtifactKey()));
ByteArrayOutputStream destination = new ByteArrayOutputStream();
repo.getRawArtifact(p2Artifact, destination, new NullProgressMonitor());
Assert.assertArrayEquals(content, destination.toByteArray());
}
Aggregations