1 package org.apache.archiva.repository.maven.content;
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
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import org.apache.archiva.model.ArtifactReference;
22 import org.apache.archiva.repository.LayoutException;
23 import org.apache.archiva.repository.BaseRepositoryContentLayout;
24 import org.apache.archiva.repository.ManagedRepositoryContent;
25 import org.apache.archiva.repository.RemoteRepository;
26 import org.apache.archiva.repository.RemoteRepositoryContent;
27 import org.apache.archiva.repository.RepositoryContent;
28 import org.apache.archiva.repository.content.Artifact;
29 import org.apache.archiva.repository.content.ItemSelector;
30 import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider;
31 import org.junit.Before;
33 import javax.inject.Inject;
34 import java.util.List;
37 * RemoteDefaultRepositoryContentTest
39 public class RemoteDefaultRepositoryContentTest
40 extends AbstractRepositoryContentTest
44 private List<? extends ArtifactMappingProvider> artifactMappingProviders;
46 private RemoteRepositoryContent repoContent;
52 RemoteRepository repository =
53 createRemoteRepository( "testRemoteRepo", "Unit Test Remote Repo", "http://repo1.maven.org/maven2/" );
55 repoContent = new RemoteDefaultRepositoryContent(artifactMappingProviders);
56 //repoContent = (RemoteRepositoryContent) lookup( RemoteRepositoryContent.class, "default" );
57 repoContent.setRepository( repository );
61 protected Artifact createArtifact( String groupId, String artifactId, String version, String classifier, String type ) throws LayoutException
68 protected String toPath( Artifact reference ) throws LayoutException
70 ItemSelector selector = toItemSelector( reference.getAsset( ).getPath( ) );
71 return repoContent.toPath( selector );
75 protected ItemSelector toItemSelector( String path ) throws LayoutException
77 return repoContent.toItemSelector( path );
81 protected ManagedRepositoryContent getManaged( )
87 protected RepositoryContent getContent( )
93 protected String toPath( ItemSelector selector ) {
94 return repoContent.toPath( selector );