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
22 import org.junit.After;
23 import org.junit.Before;
24 import org.junit.Test;
27 * RepositoryServlet Tests, Proxied, Get of Metadata, exists on local managed repository only.
31 public class RepositoryServletProxiedMetadataLocalOnlyTest
32 extends AbstractRepositoryServletProxiedMetadataTestCase
43 public void tearDown()
50 public void testGetProxiedSnapshotVersionMetadataLocalOnly()
54 setupSnapshotsRemoteRepo();
55 setupPrivateSnapshotsRemoteRepo();
56 setupCleanInternalRepo();
58 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/maven-metadata.xml";
59 String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
60 "4.0-alpha-1-SNAPSHOT" );
62 populateRepo( repoRootInternal, path, expectedMetadata );
64 setupConnector( REPOID_INTERNAL, remoteSnapshots );
65 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
68 String actualMetadata = requestMetadataOK( path );
71 assertExpectedMetadata( expectedMetadata, actualMetadata );
75 public void testGetProxiedVersionMetadataLocalOnly()
79 setupSnapshotsRemoteRepo();
80 setupPrivateSnapshotsRemoteRepo();
81 setupCleanInternalRepo();
83 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-2/maven-metadata.xml";
84 String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
87 populateRepo( repoRootInternal, path, expectedMetadata );
90 String actualMetadata = requestMetadataOK( path );
93 assertExpectedMetadata( expectedMetadata, actualMetadata );
97 public void testGetProxiedProjectMetadataLocalOnly()
101 setupSnapshotsRemoteRepo();
102 setupPrivateSnapshotsRemoteRepo();
103 setupCleanInternalRepo();
105 String path = "org/apache/archiva/archivatest-maven-plugin/maven-metadata.xml";
106 String version = "1.0-alpha-4";
107 String release = "1.0-alpha-4";
108 String expectedMetadata = createProjectMetadata( "org.apache.archiva", "archivatest-maven-plugin", version,
109 release, new String[] { "1.0-alpha-4" } );
111 populateRepo( repoRootInternal, path, expectedMetadata );
114 String actualMetadata = requestMetadataOK( path );
117 assertExpectedMetadata( expectedMetadata, actualMetadata );
121 public void testGetProxiedGroupMetadataLocalOnly()
125 setupSnapshotsRemoteRepo();
126 setupPrivateSnapshotsRemoteRepo();
127 setupCleanInternalRepo();
129 String path = "org/apache/archiva/maven-metadata.xml";
130 String expectedMetadata = createGroupMetadata( "org.apache.archiva", new String[] { "archivatest-maven-plugin" } );
132 populateRepo( repoRootInternal, path, expectedMetadata );
135 String actualMetadata = requestMetadataOK( path );
138 assertExpectedMetadata( expectedMetadata, actualMetadata );