Search in sources :

Example 11 with IArtifactRepository

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

the class P2MirrorDisablingArtifactRepositoryManager method createRepository.

// disable mirrors in returned repositories
@Override
public IArtifactRepository createRepository(URI location, String name, String type, Map<String, String> properties) throws ProvisionException {
    IArtifactRepository repository = delegate.createRepository(location, name, type, properties);
    disableMirrors(repository, mavenLogger);
    return repository;
}
Also used : IArtifactRepository(org.eclipse.equinox.p2.repository.artifact.IArtifactRepository)

Example 12 with IArtifactRepository

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, int flags, IProgressMonitor monitor) throws ProvisionException {
    IArtifactRepository repository = delegate.loadRepository(location, flags, monitor);
    disableMirrors(repository, mavenLogger);
    return repository;
}
Also used : IArtifactRepository(org.eclipse.equinox.p2.repository.artifact.IArtifactRepository)

Example 13 with IArtifactRepository

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

the class P2MirrorDisablingArtifactRepositoryManager method refreshRepository.

@Override
public IArtifactRepository refreshRepository(URI location, IProgressMonitor monitor) throws ProvisionException {
    IArtifactRepository repository = delegate.refreshRepository(location, monitor);
    disableMirrors(repository, mavenLogger);
    return repository;
}
Also used : IArtifactRepository(org.eclipse.equinox.p2.repository.artifact.IArtifactRepository)

Example 14 with IArtifactRepository

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

the class RemoteAgentDisableP2MirrorsTest method testWithoutDisableP2Mirrors.

@Test
public void testWithoutDisableP2Mirrors() throws Exception {
    IProvisioningAgent agent = createRemoteAgent(false);
    IArtifactRepository repo = loadRepository(agent, ResourceUtil.resourceFile("p2-mirrors-disable").toURI());
    assertThat(repo.getProperty(IRepository.PROP_MIRRORS_URL), is("file://dummy/"));
}
Also used : IProvisioningAgent(org.eclipse.equinox.p2.core.IProvisioningAgent) IArtifactRepository(org.eclipse.equinox.p2.repository.artifact.IArtifactRepository) Test(org.junit.Test)

Example 15 with IArtifactRepository

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

the class RemoteAgentDisableP2MirrorsTest method testDisableP2Mirrors.

@Test
public void testDisableP2Mirrors() throws Exception {
    IProvisioningAgent agent = createRemoteAgent(true);
    IArtifactRepository repo = loadRepository(agent, ResourceUtil.resourceFile("p2-mirrors-disable").toURI());
    assertThat(repo.getProperty(IRepository.PROP_MIRRORS_URL), is(nullValue()));
}
Also used : IProvisioningAgent(org.eclipse.equinox.p2.core.IProvisioningAgent) IArtifactRepository(org.eclipse.equinox.p2.repository.artifact.IArtifactRepository) Test(org.junit.Test)

Aggregations

IArtifactRepository (org.eclipse.equinox.p2.repository.artifact.IArtifactRepository)23 Test (org.junit.Test)11 IStatus (org.eclipse.core.runtime.IStatus)7 IArtifactDescriptor (org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor)6 File (java.io.File)4 OutputStream (java.io.OutputStream)4 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)4 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 Status (org.eclipse.core.runtime.Status)3 IProvisioningAgent (org.eclipse.equinox.p2.core.IProvisioningAgent)3 ProvisionException (org.eclipse.equinox.p2.core.ProvisionException)3 IArtifactKey (org.eclipse.equinox.p2.metadata.IArtifactKey)3 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)3 IMetadataRepository (org.eclipse.equinox.p2.repository.metadata.IMetadataRepository)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 IOException (java.io.IOException)2 IPublisherAction (org.eclipse.equinox.p2.publisher.IPublisherAction)2 IPublisherAdvice (org.eclipse.equinox.p2.publisher.IPublisherAdvice)2 IPublisherInfo (org.eclipse.equinox.p2.publisher.IPublisherInfo)2 Publisher (org.eclipse.equinox.p2.publisher.Publisher)2