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
25 * RepositoryServlet Tests, Proxied, Get of Metadata, exists on remote repository only.
27 * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
30 public class RepositoryServletProxiedMetadataRemoteOnlyTest
31 extends AbstractRepositoryServletProxiedMetadataTestCase
33 public void testGetProxiedSnapshotVersionMetadataRemoteOnly()
37 setupSnapshotsRemoteRepo();
38 setupPrivateSnapshotsRemoteRepo();
39 setupCleanInternalRepo();
41 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/maven-metadata.xml";
42 String version = "4.0-alpha-1-SNAPSHOT";
43 String timestamp = "20040305.112233";
44 String buildNumber = "2";
45 String lastUpdated = "20040305112233";
46 String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
47 version, timestamp, buildNumber, lastUpdated);
49 File metadataFile = populateRepo( remoteSnapshots, path, expectedMetadata );
51 setupConnector( REPOID_INTERNAL, remoteSnapshots );
52 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
56 String actualMetadata = requestMetadataOK( path );
59 assertExpectedMetadata( expectedMetadata, actualMetadata );
62 public void testGetProxiedPluginSnapshotVersionMetadataRemoteOnly()
66 setupSnapshotsRemoteRepo();
67 setupPrivateSnapshotsRemoteRepo();
68 setupCleanInternalRepo();
70 String path = "org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-2-SNAPSHOT/maven-metadata.xml";
71 String version = "2.2-beta-2-SNAPSHOT";
72 String timestamp = "20071017.162810";
73 String buildNumber = "20";
74 String lastUpdated = "20071017162810";
75 String expectedMetadata = createVersionMetadata( "org.apache.maven.plugins", "maven-assembly-plugin", version,
76 timestamp, buildNumber, lastUpdated );
78 File metadataFile = populateRepo( remoteSnapshots, path, expectedMetadata );
80 setupConnector( REPOID_INTERNAL, remoteSnapshots );
81 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
85 String actualMetadata = requestMetadataOK( path );
88 assertExpectedMetadata( expectedMetadata, actualMetadata );
91 public void testGetProxiedVersionMetadataRemoteOnly()
95 setupSnapshotsRemoteRepo();
96 setupPrivateSnapshotsRemoteRepo();
97 setupCleanInternalRepo();
99 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-2/maven-metadata.xml";
100 String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
103 File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata );
105 setupConnector( REPOID_INTERNAL, remoteSnapshots );
106 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
110 String actualMetadata = requestMetadataOK( path );
113 assertExpectedMetadata( expectedMetadata, actualMetadata );
116 public void testGetProxiedProjectMetadataRemoteOnly()
120 setupSnapshotsRemoteRepo();
121 setupPrivateSnapshotsRemoteRepo();
122 setupCleanInternalRepo();
124 String path = "org/apache/archiva/archivatest-maven-plugin/maven-metadata.xml";
125 String latest = "1.0-alpha-4";
126 String release = "1.0-alpha-4";
127 String expectedMetadata = createProjectMetadata( "org.apache.archiva", "archivatest-maven-plugin",
128 latest, release, new String[] { "1.0-alpha-4" } );
130 File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata );
132 setupConnector( REPOID_INTERNAL, remoteSnapshots );
133 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
137 String actualMetadata = requestMetadataOK( path );
140 assertExpectedMetadata( expectedMetadata, actualMetadata );