Search in sources :

Example 21 with ArtifactDescriptor

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;
}
Also used : ArtifactKey(org.eclipse.equinox.internal.p2.metadata.ArtifactKey) ArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor) IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor)

Example 22 with ArtifactDescriptor

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());
}
Also used : IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) IP2Artifact(org.eclipse.tycho.p2.metadata.IP2Artifact) FeatureRootAdviceTest(org.eclipse.tycho.p2.impl.publisher.rootfiles.FeatureRootAdviceTest) Test(org.junit.Test)

Example 23 with ArtifactDescriptor

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")));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) ArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor) Test(org.junit.Test)

Example 24 with ArtifactDescriptor

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")));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) ArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor) Test(org.junit.Test)

Example 25 with ArtifactDescriptor

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)));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) ArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor) Test(org.junit.Test)

Aggregations

IArtifactDescriptor (org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor)29 ArtifactDescriptor (org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor)25 Test (org.junit.Test)22 File (java.io.File)8 MavenRepositoryCoordinates (org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates)8 FeatureRootAdviceTest (org.eclipse.tycho.p2.impl.publisher.rootfiles.FeatureRootAdviceTest)4 ArtifactKey (org.eclipse.equinox.internal.p2.metadata.ArtifactKey)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 IArtifactKey (org.eclipse.equinox.p2.metadata.IArtifactKey)2 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)2 ProcessingStepDescriptor (org.eclipse.equinox.p2.repository.artifact.spi.ProcessingStepDescriptor)2 IP2Artifact (org.eclipse.tycho.p2.metadata.IP2Artifact)2 BufferedOutputStream (java.io.BufferedOutputStream)1 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 IStatus (org.eclipse.core.runtime.IStatus)1