use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class FeatureRootfileArtifactRepositoryTest method createArtifactDescriptor.
private ArtifactDescriptor createArtifactDescriptor(String classifier, String artifactId) {
ArtifactKey key = new ArtifactKey(classifier, artifactId, Version.createOSGi(1, 0, 0));
ArtifactDescriptor desc = new ArtifactDescriptor(key);
return desc;
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class FeatureRootfileArtifactRepositoryTest method testRepoForNonBinaryArtifacts.
@Test
public void testRepoForNonBinaryArtifacts() throws Exception {
FeatureRootfileArtifactRepository subject = new FeatureRootfileArtifactRepository(createPublisherInfo(true), tempFolder.newFolder("testrootfiles"));
IArtifactDescriptor artifactDescriptor = createArtifactDescriptor("non-binary-classifier", "org.eclipse.tycho.test.p2");
subject.getOutputStream(artifactDescriptor).close();
Map<String, IP2Artifact> attachedArtifacts = subject.getPublishedArtifacts();
Assert.assertEquals(0, attachedArtifacts.size());
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class GAVArtifactDescriptorTest method testSerializationOmitsDefaults.
@Test
public void testSerializationOmitsDefaults() {
MavenRepositoryCoordinates coordinates = new MavenRepositoryCoordinates(TEST_GAV, DEFAULT_CLASSIFIER, DEFAULT_CLASSIFIER);
subject = new GAVArtifactDescriptor(createP2Descriptor(), coordinates);
ArtifactDescriptor serialized = new ArtifactDescriptor(subject);
assertThat(serialized.getProperties().keySet(), not(hasItem("maven-classifier")));
assertThat(serialized.getProperties().keySet(), not(hasItem("maven-extension")));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class GAVArtifactDescriptorTest method testCreationFromPlainP2DescriptorForPackedArtifact.
@Test
public void testCreationFromPlainP2DescriptorForPackedArtifact() {
ArtifactDescriptor input = createP2Descriptor();
input.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
// no maven properties set
subject = new GAVArtifactDescriptor(input);
assertThat(subject.getArtifactKey(), is(TEST_KEY));
assertThat(subject.getMavenCoordinates(), is(new MavenRepositoryCoordinates("p2.p2.class", "p2.id", "4.3.0.20130614", "pack200", "jar.pack.gz")));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class GAVArtifactDescriptorTest method testDeserializationWithRedundantDefaultExt.
@Test
public void testDeserializationWithRedundantDefaultExt() {
ArtifactDescriptor input = createP2Descriptor();
setGAVProperties(input);
input.setProperty("maven-extension", DEFAULT_EXTENSION);
subject = new GAVArtifactDescriptor(input);
assertThat(subject.getMavenCoordinates(), is(new MavenRepositoryCoordinates(TEST_GAV, DEFAULT_CLASSIFIER, DEFAULT_EXTENSION)));
}
Aggregations