1 package org.apache.archiva.webdav;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
23 import com.gargoylesoftware.htmlunit.WebRequest;
24 import com.gargoylesoftware.htmlunit.WebResponse;
25 import org.apache.archiva.policies.ReleasesPolicy;
26 import org.junit.Test;
29 * RepositoryServlet Tests, Proxied, Get of Release Artifacts, with varying policy settings.
32 public class RepositoryServletProxiedRelocatedTest
33 extends AbstractRepositoryServletProxiedTestCase
37 public void testGetProxiedReleaseArtifactPolicyOncePass()
41 setupCentralRemoteRepo();
42 setupCleanInternalRepo();
44 String resourcePath = "org/apache/archiva/test/1.0/test-1.0.jar";
45 String expectedRemoteContents = "archiva-test-1.0|jar-remote-contents";
46 populateRepo( remoteCentral, resourcePath, expectedRemoteContents );
48 resourcePath = "archiva/test/1.0/test-1.0.pom";
49 String pom = "<project>" +
50 "<modelVersion>4.0.0</modelVersion>" +
51 "<groupId>archiva</groupId>" +
52 "<artifactId>test</artifactId>" +
53 "<version>1.0</version>" +
54 "<distributionManagement>" +
56 "<groupId>org.apache.archiva</groupId>" +
58 "</distributionManagement>" +
60 populateRepo( remoteCentral, resourcePath, pom );
62 resourcePath = "archiva/jars/test-1.0.jar";
64 setupReleaseConnector( REPOID_INTERNAL, remoteCentral, ReleasesPolicy.ONCE );
68 // process the response code later, not via an exception.
69 //HttpUnitOptions.setExceptionsThrownOnErrorStatus( false );
71 WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + resourcePath );
72 WebResponse response = getServletUnitClient().getResponse( request );
75 assertResponseNotFound( response );