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 org.junit.After;
24 import org.junit.Before;
25 import org.junit.Test;
28 * RepositoryServlet Tests, Proxied, Get of Metadata, exists on remote repository only.
32 public class RepositoryServletProxiedMetadataRemoteOnlyTest
33 extends AbstractRepositoryServletProxiedMetadataTestCase
44 public void tearDown()
52 public void testGetProxiedSnapshotVersionMetadataRemoteOnly()
56 setupSnapshotsRemoteRepo();
57 setupPrivateSnapshotsRemoteRepo();
58 setupCleanInternalRepo();
60 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/maven-metadata.xml";
61 String version = "4.0-alpha-1-SNAPSHOT";
62 String timestamp = "20040305.112233";
63 String buildNumber = "2";
64 String lastUpdated = "20040305112233";
65 String expectedMetadata =
66 createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin", version, timestamp, buildNumber,
69 populateRepo( remoteSnapshots, path, expectedMetadata );
71 setupConnector( REPOID_INTERNAL, remoteSnapshots );
72 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
76 String actualMetadata = requestMetadataOK( path );
79 assertExpectedMetadata( expectedMetadata, actualMetadata );
83 public void testGetProxiedPluginSnapshotVersionMetadataRemoteOnly()
87 setupSnapshotsRemoteRepo();
88 setupPrivateSnapshotsRemoteRepo();
89 setupCleanInternalRepo();
91 String path = "org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-2-SNAPSHOT/maven-metadata.xml";
92 String version = "2.2-beta-2-SNAPSHOT";
93 String timestamp = "20071017.162810";
94 String buildNumber = "20";
95 String lastUpdated = "20071017162810";
96 String expectedMetadata =
97 createVersionMetadata( "org.apache.maven.plugins", "maven-assembly-plugin", version, timestamp, buildNumber,
100 populateRepo( remoteSnapshots, path, expectedMetadata );
102 setupConnector( REPOID_INTERNAL, remoteSnapshots );
103 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
107 String actualMetadata = requestMetadataOK( path );
110 assertExpectedMetadata( expectedMetadata, actualMetadata );
114 public void testGetProxiedVersionMetadataRemoteOnly()
118 setupSnapshotsRemoteRepo();
119 setupPrivateSnapshotsRemoteRepo();
120 setupCleanInternalRepo();
122 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-2/maven-metadata.xml";
123 String expectedMetadata =
124 createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin", "4.0-alpha-2" );
126 populateRepo( remoteSnapshots, path, expectedMetadata );
128 setupConnector( REPOID_INTERNAL, remoteSnapshots );
129 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
133 String actualMetadata = requestMetadataOK( path );
136 assertExpectedMetadata( expectedMetadata, actualMetadata );
140 public void testGetProxiedProjectMetadataRemoteOnly()
144 setupSnapshotsRemoteRepo();
145 setupPrivateSnapshotsRemoteRepo();
146 setupCleanInternalRepo();
148 String path = "org/apache/archiva/archivatest-maven-plugin/maven-metadata.xml";
149 String latest = "1.0-alpha-4";
150 String release = "1.0-alpha-4";
151 String expectedMetadata =
152 createProjectMetadata( "org.apache.archiva", "archivatest-maven-plugin", latest, release,
153 new String[]{ "1.0-alpha-4" } );
155 populateRepo( remoteSnapshots, path, expectedMetadata );
157 setupConnector( REPOID_INTERNAL, remoteSnapshots );
158 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
162 String actualMetadata = requestMetadataOK( path );
165 assertExpectedMetadata( expectedMetadata, actualMetadata );
169 public void testGetProxiedGroupMetadataRemoteOnly()
173 setupSnapshotsRemoteRepo();
174 setupPrivateSnapshotsRemoteRepo();
175 setupCleanInternalRepo();
177 String path = "org/apache/archiva/maven-metadata.xml";
178 String expectedMetadata =
179 createGroupMetadata( "org.apache.archiva", new String[]{ "archivatest-maven-plugin" } );
181 populateRepo( remoteSnapshots, path, expectedMetadata );
183 setupConnector( REPOID_INTERNAL, remoteSnapshots );
184 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
188 String actualMetadata = requestMetadataOK( path );
191 assertExpectedMetadata( expectedMetadata, actualMetadata );