fix issue when using proxy

This commit is contained in:
Olivier Lamy 2015-10-01 16:13:29 +10:00
parent da1216f734
commit 4ce3140da9
2 changed files with 12 additions and 4 deletions

View File

@ -204,6 +204,11 @@
<artifactId>xercesImpl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
@ -260,6 +265,8 @@
<redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
<redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
<archiva.repositorySessionFactory.id>mock</archiva.repositorySessionFactory.id>
<http.proxyHost></http.proxyHost>
<http.proxyPort></http.proxyPort>
</systemPropertyVariables>
</configuration>
</plugin>

View File

@ -36,6 +36,7 @@ import org.apache.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
import org.apache.archiva.policies.SnapshotsPolicy;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.assertj.core.api.Assertions;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
@ -199,8 +200,8 @@ public class HttpProxyTransferTest
public void testGetOverHttpProxy()
throws Exception
{
assertNull( System.getProperty( "http.proxyHost" ) );
assertNull( System.getProperty( "http.proxyPort" ) );
Assertions.assertThat( System.getProperty( "http.proxyHost" ) ).isEmpty();
Assertions.assertThat( System.getProperty( "http.proxyPort" ) ).isEmpty();
String path = "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar";
@ -226,8 +227,8 @@ public class HttpProxyTransferTest
String actualContents = FileUtils.readFileToString( downloadedFile, Charset.defaultCharset() );
assertEquals( "Check file contents.", expectedContents, actualContents );
assertNull( System.getProperty( "http.proxyHost" ) );
assertNull( System.getProperty( "http.proxyPort" ) );
Assertions.assertThat( System.getProperty( "http.proxyHost" ) ).isEmpty();
Assertions.assertThat( System.getProperty( "http.proxyPort" ) ).isEmpty();
}
private void addConnector()