Search in sources :

Example 11 with ArtifactDescriptor

use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.

the class LocalArtifactRepositoryTest method newBundleArtifactDescriptor.

private ArtifactDescriptor newBundleArtifactDescriptor(boolean maven) {
    ArtifactKey key = new ArtifactKey(PublisherHelper.OSGI_BUNDLE_CLASSIFIER, "org.eclipse.tycho.test." + (maven ? "maven" : "p2"), Version.createOSGi(1, 0, 0));
    ArtifactDescriptor desc = new ArtifactDescriptor(key);
    if (maven) {
        desc.setProperty(RepositoryLayoutHelper.PROP_GROUP_ID, "group");
        desc.setProperty(RepositoryLayoutHelper.PROP_ARTIFACT_ID, key.getId());
        desc.setProperty(RepositoryLayoutHelper.PROP_VERSION, key.getVersion().toString());
    }
    return desc;
}
Also used : IArtifactKey(org.eclipse.equinox.p2.metadata.IArtifactKey) 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 12 with ArtifactDescriptor

use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.

the class FeatureRootfileArtifactRepositoryTest method testRepoWithAttachedArtifactsAndConfigurations.

@Test
public void testRepoWithAttachedArtifactsAndConfigurations() throws Exception {
    FeatureRootfileArtifactRepository subject = new FeatureRootfileArtifactRepository(createPublisherInfo(true), tempFolder.newFolder("testrootfiles"));
    IArtifactDescriptor artifactDescriptor = createArtifactDescriptor(PublisherHelper.BINARY_ARTIFACT_CLASSIFIER, "org.eclipse.tycho.test.p2.win32.win32.x86");
    subject.getOutputStream(artifactDescriptor).close();
    assertAttachedArtifact(subject.getPublishedArtifacts(), 1, "root.win32.win32.x86", "org.eclipse.tycho.test.p2.win32.win32.x86-1.0.0-root.zip");
    Set<IArtifactDescriptor> artifactDescriptors = subject.getArtifactDescriptors();
    Assert.assertEquals(1, artifactDescriptors.size());
    IArtifactDescriptor descriptor = artifactDescriptors.iterator().next();
    assertMavenProperties(descriptor, "root.win32.win32.x86");
}
Also used : IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) FeatureRootAdviceTest(org.eclipse.tycho.p2.impl.publisher.rootfiles.FeatureRootAdviceTest) Test(org.junit.Test)

Example 13 with ArtifactDescriptor

use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.

the class FeatureRootfileArtifactRepositoryTest method testRepoWithoutMavenAdvice.

@Test(expected = ProvisionException.class)
public void testRepoWithoutMavenAdvice() throws Exception {
    FeatureRootfileArtifactRepository subject = new FeatureRootfileArtifactRepository(createPublisherInfo(false), tempFolder.newFolder("testrootfiles"));
    IArtifactDescriptor artifactDescriptor = createArtifactDescriptor(PublisherHelper.BINARY_ARTIFACT_CLASSIFIER, "org.eclipse.tycho.test.p2");
    subject.getOutputStream(artifactDescriptor).close();
}
Also used : IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) FeatureRootAdviceTest(org.eclipse.tycho.p2.impl.publisher.rootfiles.FeatureRootAdviceTest) Test(org.junit.Test)

Example 14 with ArtifactDescriptor

use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.

the class FeatureRootfileArtifactRepositoryTest method testRepoWithAttachedArtifacts.

@Test
public void testRepoWithAttachedArtifacts() throws Exception {
    FeatureRootfileArtifactRepository subject = new FeatureRootfileArtifactRepository(createPublisherInfo(true), tempFolder.newFolder("testrootfiles"));
    IArtifactDescriptor artifactDescriptor = createArtifactDescriptor(PublisherHelper.BINARY_ARTIFACT_CLASSIFIER, "org.eclipse.tycho.test.p2");
    subject.getOutputStream(artifactDescriptor).close();
    assertAttachedArtifact(subject.getPublishedArtifacts(), 1, "root", "org.eclipse.tycho.test.p2-1.0.0-root.zip");
    Set<IArtifactDescriptor> artifactDescriptors = subject.getArtifactDescriptors();
    Assert.assertEquals(1, artifactDescriptors.size());
    IArtifactDescriptor descriptor = artifactDescriptors.iterator().next();
    assertMavenProperties(descriptor, "root");
}
Also used : IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) FeatureRootAdviceTest(org.eclipse.tycho.p2.impl.publisher.rootfiles.FeatureRootAdviceTest) Test(org.junit.Test)

Example 15 with ArtifactDescriptor

use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.

the class ArtifactRepositoryTestUtils method packedDescriptorFor.

public static IArtifactDescriptor packedDescriptorFor(IArtifactKey key) {
    ArtifactDescriptor result = new ArtifactDescriptor(key);
    result.setProcessingSteps(new IProcessingStepDescriptor[] { new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true) });
    result.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
    return result;
}
Also used : ArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor) IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) IProcessingStepDescriptor(org.eclipse.equinox.p2.repository.artifact.IProcessingStepDescriptor) ProcessingStepDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ProcessingStepDescriptor)

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