use of com.gargoylesoftware.htmlunit.WebRequest in project archiva by apache.
the class RepositoryServletRepositoryGroupTest method testGetInvalidManagedRepositoryInGroupReturnNotFound.
/*
* Test Case 3.a
*/
@Test
public void testGetInvalidManagedRepositoryInGroupReturnNotFound() throws Exception {
String resourceName = "dummy/dummy-no-resource/1.0/dummy-no-resource-1.0.txt";
WebRequest request = new GetMethodWebRequest("http://machine.com/repository/" + REPO_GROUP_WITH_INVALID_REPOS + "/" + resourceName);
WebResponse response = getServletUnitClient().getResponse(request);
assertResponseInternalServerError(response);
}
use of com.gargoylesoftware.htmlunit.WebRequest in project archiva by apache.
the class RepositoryServletNoProxyTest method testGetNoProxyDualExtensionDefaultLayout.
/**
* [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error
*/
@Test
public void testGetNoProxyDualExtensionDefaultLayout() throws Exception {
String expectedContents = "the-contents-of-the-dual-extension";
String dualExtensionPath = "org/project/example-presentation/3.2/example-presentation-3.2.xml.zip";
Path checksumFile = repoRootInternal.resolve(dualExtensionPath);
Files.createDirectories(checksumFile.getParent());
org.apache.archiva.common.utils.FileUtils.writeStringToFile(checksumFile, Charset.defaultCharset(), expectedContents);
WebRequest request = new GetMethodWebRequest("http://machine.com/repository/internal/" + dualExtensionPath);
WebResponse response = getServletUnitClient().getResponse(request);
assertResponseOK(response);
assertEquals("Expected file contents", expectedContents, response.getContentAsString());
}
use of com.gargoylesoftware.htmlunit.WebRequest in project archiva by apache.
the class RepositoryServletNoProxyTest method testGetNoProxyChecksumDefaultLayoutManagedLegacy.
@Test
public void testGetNoProxyChecksumDefaultLayoutManagedLegacy() throws Exception {
String commonsLangSha1 = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar.sha1";
Path checksumFile = repoRootLegacy.resolve("commons-lang/jars/commons-lang-2.1.jar.sha1");
Files.createDirectories(checksumFile.getParent());
org.apache.archiva.common.utils.FileUtils.writeStringToFile(checksumFile, Charset.defaultCharset(), "dummy-checksum");
WebRequest request = new GetMethodWebRequest("http://machine.com/repository/legacy/" + commonsLangSha1);
WebResponse response = getServletUnitClient().getResponse(request);
assertResponseNotFound(response);
}
use of com.gargoylesoftware.htmlunit.WebRequest in project archiva by apache.
the class RepositoryServletNoProxyTest method testGetNoProxyTimestampedSnapshotArtifactLegacyLayout.
@Test
public void testGetNoProxyTimestampedSnapshotArtifactLegacyLayout() throws Exception {
String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-20050821.023400-1.jar";
String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
Path artifactFile = repoRootInternal.resolve(commonsLangJar);
Files.createDirectories(artifactFile.getParent());
org.apache.archiva.common.utils.FileUtils.writeStringToFile(artifactFile, Charset.defaultCharset(), expectedArtifactContents);
WebRequest request = new GetMethodWebRequest("http://machine.com/repository/internal/" + "commons-lang/jars/commons-lang-2.1-20050821.023400-1.jar");
WebResponse response = getServletUnitClient().getResponse(request);
assertResponseNotFound(response);
}
use of com.gargoylesoftware.htmlunit.WebRequest in project archiva by apache.
the class RepositoryServletNoProxyTest method testGetNoProxySnapshotArtifactDefaultLayoutManagedLegacy.
@Test
public void testGetNoProxySnapshotArtifactDefaultLayoutManagedLegacy() throws Exception {
String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-SNAPSHOT.jar";
String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
Path artifactFile = repoRootLegacy.resolve("commons-lang/jars/commons-lang-2.1-SNAPSHOT.jar");
Files.createDirectories(artifactFile.getParent());
org.apache.archiva.common.utils.FileUtils.writeStringToFile(artifactFile, Charset.defaultCharset(), expectedArtifactContents);
WebRequest request = new GetMethodWebRequest("http://machine.com/repository/legacy/" + commonsLangJar);
WebResponse response = getServletUnitClient().getResponse(request);
assertResponseNotFound(response);
}
Aggregations