use of org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor 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");
}
use of org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor 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();
}
use of org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor 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");
}
use of org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor in project tycho by eclipse.
the class AbstractArtifactRepository2 method getArtifact.
// implementations for old get(Raw)Artifact methods
/**
* {@inheritDoc}
*
* @deprecated Obsolete. Use {@link #getArtifact(IArtifactSink, IProgressMonitor)} instead.
*/
// TODO make final?
@Override
@Deprecated
public IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
try {
// use any format for getting the canonical artifact
IArtifactKey requestedKey = descriptor.getArtifactKey();
IStatus status = getArtifact(writeToStream(requestedKey, destination), monitor);
setStatusOnStreamIfPossible(destination, status);
return status;
} catch (ArtifactSinkException e) {
// the sink used shouldn't throw this exception
return new Status(IStatus.ERROR, BUNDLE_ID, e.getMessage(), e);
}
}
use of org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor in project tycho by eclipse.
the class ArtifactRepositoryBaseImpl method getRawArtifact.
@Override
public final IStatus getRawArtifact(IRawArtifactSink sink, IProgressMonitor monitor) throws ArtifactSinkException {
canWriteToSink(sink);
IArtifactDescriptor descriptor = sink.getArtifactFormatToBeWritten();
if (!contains(descriptor)) {
return errorStatus("Artifact " + descriptor + " is not available in the repository " + getLocation(), null, ProvisionException.ARTIFACT_NOT_FOUND);
}
IStatus status = readRawArtifact(descriptor, sink.beginWrite());
closeSinkAccordingToStatus(sink, status);
return status;
}
Aggregations