1 package org.apache.maven.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
25 * RepositoryServlet Tests, Proxied, Get of Metadata, exists on remote repository only.
29 public class RepositoryServletProxiedMetadataRemoteOnlyTest
30 extends AbstractRepositoryServletProxiedMetadataTestCase
32 public void testGetProxiedSnapshotVersionMetadataRemoteOnly()
36 setupSnapshotsRemoteRepo();
37 setupPrivateSnapshotsRemoteRepo();
38 setupCleanInternalRepo();
40 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/maven-metadata.xml";
41 String version = "4.0-alpha-1-SNAPSHOT";
42 String timestamp = "20040305.112233";
43 String buildNumber = "2";
44 String lastUpdated = "20040305112233";
45 String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
46 version, timestamp, buildNumber, lastUpdated);
48 File metadataFile = populateRepo( remoteSnapshots, path, expectedMetadata );
50 setupConnector( REPOID_INTERNAL, remoteSnapshots );
51 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
55 String actualMetadata = requestMetadataOK( path );
58 assertExpectedMetadata( expectedMetadata, actualMetadata );
61 public void testGetProxiedPluginSnapshotVersionMetadataRemoteOnly()
65 setupSnapshotsRemoteRepo();
66 setupPrivateSnapshotsRemoteRepo();
67 setupCleanInternalRepo();
69 String path = "org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-2-SNAPSHOT/maven-metadata.xml";
70 String version = "2.2-beta-2-SNAPSHOT";
71 String timestamp = "20071017.162810";
72 String buildNumber = "20";
73 String lastUpdated = "20071017162810";
74 String expectedMetadata = createVersionMetadata( "org.apache.maven.plugins", "maven-assembly-plugin", version,
75 timestamp, buildNumber, lastUpdated );
77 File metadataFile = populateRepo( remoteSnapshots, path, expectedMetadata );
79 setupConnector( REPOID_INTERNAL, remoteSnapshots );
80 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
84 String actualMetadata = requestMetadataOK( path );
87 assertExpectedMetadata( expectedMetadata, actualMetadata );
90 public void testGetProxiedVersionMetadataRemoteOnly()
94 setupSnapshotsRemoteRepo();
95 setupPrivateSnapshotsRemoteRepo();
96 setupCleanInternalRepo();
98 String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-2/maven-metadata.xml";
99 String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
102 File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata );
104 setupConnector( REPOID_INTERNAL, remoteSnapshots );
105 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
109 String actualMetadata = requestMetadataOK( path );
112 assertExpectedMetadata( expectedMetadata, actualMetadata );
115 public void testGetProxiedProjectMetadataRemoteOnly()
119 setupSnapshotsRemoteRepo();
120 setupPrivateSnapshotsRemoteRepo();
121 setupCleanInternalRepo();
123 String path = "org/apache/archiva/archivatest-maven-plugin/maven-metadata.xml";
124 String latest = "1.0-alpha-4";
125 String release = "1.0-alpha-4";
126 String expectedMetadata = createProjectMetadata( "org.apache.archiva", "archivatest-maven-plugin",
127 latest, release, new String[] { "1.0-alpha-4" } );
129 File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata );
131 setupConnector( REPOID_INTERNAL, remoteSnapshots );
132 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
136 String actualMetadata = requestMetadataOK( path );
139 assertExpectedMetadata( expectedMetadata, actualMetadata );
142 public void testGetProxiedGroupMetadataRemoteOnly()
146 setupSnapshotsRemoteRepo();
147 setupPrivateSnapshotsRemoteRepo();
148 setupCleanInternalRepo();
150 String path = "org/apache/archiva/maven-metadata.xml";
151 String expectedMetadata = createGroupMetadata( "org.apache.archiva", new String[] { "archivatest-maven-plugin" } );
153 File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata );
155 setupConnector( REPOID_INTERNAL, remoteSnapshots );
156 setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
160 String actualMetadata = requestMetadataOK( path );
163 assertExpectedMetadata( expectedMetadata, actualMetadata );