use of org.eclipse.equinox.p2.repository.artifact.IArtifactRepository in project tycho by eclipse.
the class RemoteAgentMavenMirrorsTest method loadRepositories.
private Repositories loadRepositories(String id, URI specifiedUrl) throws Exception {
IRepositoryIdManager idManager = (IRepositoryIdManager) subject.getService(IRepositoryIdManager.SERVICE_NAME);
idManager.addMapping(id, specifiedUrl);
IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager) subject.getService(IMetadataRepositoryManager.SERVICE_NAME);
IMetadataRepository metadataRepo = metadataManager.loadRepository(specifiedUrl, null);
IArtifactRepositoryManager artifactsManager = (IArtifactRepositoryManager) subject.getService(IArtifactRepositoryManager.SERVICE_NAME);
IArtifactRepository artifactsRepo = artifactsManager.loadRepository(specifiedUrl, null);
return new Repositories(metadataRepo, artifactsRepo);
}
use of org.eclipse.equinox.p2.repository.artifact.IArtifactRepository in project tycho by eclipse.
the class P2MirrorDisablingArtifactRepositoryManager method loadRepository.
@Override
public IArtifactRepository loadRepository(URI location, IProgressMonitor monitor) throws ProvisionException {
IArtifactRepository repository = delegate.loadRepository(location, monitor);
disableMirrors(repository, mavenLogger);
return repository;
}
use of org.eclipse.equinox.p2.repository.artifact.IArtifactRepository in project tycho by eclipse.
the class ModuleArtifactRepositoryTest method artifactSizeOf.
private static int artifactSizeOf(IArtifactKey artifactKey, IArtifactRepository subject) {
IArtifactDescriptor[] artifactDescriptors = subject.getArtifactDescriptors(artifactKey);
assertEquals(1, artifactDescriptors.length);
ByteArrayOutputStream artifactContent = new ByteArrayOutputStream();
subject.getArtifact(artifactDescriptors[0], artifactContent, null);
return artifactContent.size();
}
use of org.eclipse.equinox.p2.repository.artifact.IArtifactRepository in project tycho by eclipse.
the class ModuleArtifactRepositoryTest method testPersistRepository.
@Test
public void testPersistRepository() throws Exception {
File repoDir = tempManager.newFolder("targetDir");
subject = ModuleArtifactRepository.createInstance(null, repoDir);
// TODO write via sink
OutputStream outputStream = subject.getOutputStream(newDescriptor(BINARY_ARTIFACT_KEY));
writeAndClose(outputStream, BINARY_ARTIFACT_SIZE);
IArtifactRepository result = loadRepositoryViaAgent(repoDir);
assertThat(artifactSizeOf(BINARY_ARTIFACT_KEY, result), is(BINARY_ARTIFACT_SIZE));
}
use of org.eclipse.equinox.p2.repository.artifact.IArtifactRepository in project tycho by eclipse.
the class PublishingRepositoryTest method insertTestArtifact.
private static void insertTestArtifact(PublishingRepository publishingRepo) throws ProvisionException, IOException {
IArtifactRepository writableArtifactRepo = publishingRepo.getArtifactRepositoryForWriting(AttachedTestArtifact.getWriteSessionForArtifact());
OutputStream outputStream = writableArtifactRepo.getOutputStream(writableArtifactRepo.createArtifactDescriptor(AttachedTestArtifact.key));
writeAndClose(outputStream, AttachedTestArtifact.size);
}
Aggregations