1 package org.apache.maven.archiva.web.repository;
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 * RepositoryServlet Tests, Proxied, Get of Metadata, exists on local managed repository only.
25 * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
28 public class RepositoryServletProxiedMetadataLocalOnlyTest
29 extends AbstractRepositoryServletProxiedMetadataTestCase
31 public void testGetProxiedSnapshotVersionMetadataLocalOnly()
35 setupSnapshotsRemoteRepo();
36 setupPrivateSnapshotsRemoteRepo();
37 setupCleanInternalRepo();
39 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/maven-metadata.xml";
40 String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
41 "4.0-alpha-1-SNAPSHOT" );
43 populateRepo( repoRootInternal, path, expectedMetadata );
45 setupConnector( REPOID_INTERNAL, remoteSnapshots );
46 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
49 String actualMetadata = requestMetadataOK( path );
52 assertExpectedMetadata( expectedMetadata, actualMetadata );
55 public void testGetProxiedVersionMetadataLocalOnly()
59 setupSnapshotsRemoteRepo();
60 setupPrivateSnapshotsRemoteRepo();
61 setupCleanInternalRepo();
63 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-2/maven-metadata.xml";
64 String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
67 populateRepo( repoRootInternal, path, expectedMetadata );
70 String actualMetadata = requestMetadataOK( path );
73 assertExpectedMetadata( expectedMetadata, actualMetadata );
76 public void testGetProxiedProjectMetadataLocalOnly()
80 setupSnapshotsRemoteRepo();
81 setupPrivateSnapshotsRemoteRepo();
82 setupCleanInternalRepo();
84 String path = "org/apache/archiva/archivatest-maven-plugin/maven-metadata.xml";
85 String version = "1.0-alpha-4";
86 String release = "1.0-alpha-4";
87 String expectedMetadata = createProjectMetadata( "org.apache.archiva", "archivatest-maven-plugin", version,
88 release, new String[] { "1.0-alpha-4" } );
90 populateRepo( repoRootInternal, path, expectedMetadata );
93 String actualMetadata = requestMetadataOK( path );
96 assertExpectedMetadata( expectedMetadata, actualMetadata );