use of org.eclipse.tycho.repository.streaming.testutil.ProbeRawArtifactSink in project tycho by eclipse.
the class LocalArtifactRepositoryP2APITest method readSizeOfRawArtifact.
private int readSizeOfRawArtifact(IArtifactDescriptor descriptor) throws ArtifactSinkException {
// don't use the member here because getArtifact is not the method under test here
ProbeRawArtifactSink temporarySink = newRawArtifactSinkFor(descriptor);
subject.getRawArtifact(temporarySink, null);
return temporarySink.committedBytes();
}
use of org.eclipse.tycho.repository.streaming.testutil.ProbeRawArtifactSink in project tycho by eclipse.
the class CompositeArtifactProviderTestBase method testGetNonExistingRawArtifact.
@Test
public void testGetNonExistingRawArtifact() throws Exception {
rawTestSink = new ProbeRawArtifactSink(canonicalDescriptorFor(NOT_CONTAINED_ARTIFACT_KEY));
status = subject.getRawArtifact(rawTestSink, null);
assertThat(rawTestSink.writeIsStarted(), is(false));
assertThat(status, is(errorStatus()));
assertThat(status.getCode(), is(ProvisionException.ARTIFACT_NOT_FOUND));
assertThat(status, statusWithMessageWhich(containsString("is not available in")));
}
use of org.eclipse.tycho.repository.streaming.testutil.ProbeRawArtifactSink in project tycho by eclipse.
the class CompositeArtifactProviderTestBase method testGetRawArtifactSucceedsInSecondAttempt.
@Test
public void testGetRawArtifactSucceedsInSecondAttempt() throws Exception {
subject = createCompositeArtifactProvider(REPO_BUNLDE_AB_PACK_CORRUPT, REPO_BUNDLE_AB);
rawTestSink = new ProbeRawArtifactSink(packedDescriptorFor(BUNDLE_A_KEY));
status = subject.getRawArtifact(rawTestSink, null);
assertThat(status, is(warningStatus()));
assertThat(status.getMessage(), containsString("Some attempts to read"));
assertThat(asList(status.getChildren()), hasItem(errorStatus()));
assertThat(asList(status.getChildren()), hasItem(okStatus()));
assertThat(rawTestSink.md5AsHex(), is(BUNDLE_A_PACKED_CONTENT_MD5));
}
use of org.eclipse.tycho.repository.streaming.testutil.ProbeRawArtifactSink in project tycho by eclipse.
the class TargetPlatformBundlePublisherTest method artifactMD5Of.
private static String artifactMD5Of(IArtifactKey key, IRawArtifactProvider artifactProvider) throws Exception {
ProbeRawArtifactSink probeSink = ProbeRawArtifactSink.newRawArtifactSinkFor(new ArtifactDescriptor(key));
artifactProvider.getArtifact(probeSink, null);
return probeSink.md5AsHex();
}
Aggregations