Search in sources :

Example 11 with Proxy

use of org.sonatype.aether.repository.Proxy in project sonatype-aether by sonatype.

the class ProxyPutTest method before.

@Override
@Before
public void before() throws Exception {
    super.before();
    Authentication auth = new Authentication("puser", "password");
    Proxy proxy = new Proxy("http", "localhost", provider().getPort(), auth);
    repository().setProxy(proxy);
}
Also used : Proxy(org.sonatype.aether.repository.Proxy) Authentication(org.sonatype.aether.repository.Authentication) Before(org.junit.Before)

Example 12 with Proxy

use of org.sonatype.aether.repository.Proxy in project sonatype-aether by sonatype.

the class DefaultRepositorySystemSessionTest method testDefaultProxySelectorUsesExistingProxy.

@Test
public void testDefaultProxySelectorUsesExistingProxy() {
    DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
    RemoteRepository repo = new RemoteRepository("id", "default", "void");
    assertSame(null, session.getProxySelector().getProxy(repo));
    repo.setProxy(new Proxy("http", "localhost", 8080, null));
    assertSame(repo.getProxy(), session.getProxySelector().getProxy(repo));
}
Also used : Proxy(org.sonatype.aether.repository.Proxy) RemoteRepository(org.sonatype.aether.repository.RemoteRepository) Test(org.junit.Test)

Aggregations

Proxy (org.sonatype.aether.repository.Proxy)12 Authentication (org.sonatype.aether.repository.Authentication)8 RemoteRepository (org.sonatype.aether.repository.RemoteRepository)5 Test (org.junit.Test)3 MirrorSelector (org.sonatype.aether.repository.MirrorSelector)3 ArrayList (java.util.ArrayList)2 Before (org.junit.Before)2 ProxySelector (org.sonatype.aether.repository.ProxySelector)2 ProxyServer (com.ning.http.client.ProxyServer)1 ListIterator (java.util.ListIterator)1 RemoteRepository (org.apache.maven.artifact.ant.RemoteRepository)1 ProxyInfo (org.apache.maven.wagon.proxy.ProxyInfo)1 ProxyInfoProvider (org.apache.maven.wagon.proxy.ProxyInfoProvider)1 AuthenticationSelector (org.sonatype.aether.repository.AuthenticationSelector)1 RepositoryConnector (org.sonatype.aether.spi.connector.RepositoryConnector)1 RepositoryConnectorFactory (org.sonatype.aether.spi.connector.RepositoryConnectorFactory)1 NoRepositoryConnectorException (org.sonatype.aether.transfer.NoRepositoryConnectorException)1 DefaultProxySelector (org.sonatype.aether.util.repository.DefaultProxySelector)1