1 package org.apache.maven.archiva.repository.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
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.apache.maven.archiva.repository.ArchivaArtifact;
25 * LegacyBidirectionalRepositoryLayoutTest
27 * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
30 public class LegacyBidirectionalRepositoryLayoutTest extends AbstractBidirectionalRepositoryLayoutTestCase
32 private BidirectionalRepositoryLayout layout;
34 protected void setUp() throws Exception
38 layout = (BidirectionalRepositoryLayout) lookup( BidirectionalRepositoryLayout.class.getName(), "legacy" );
41 public void testToPathBasic()
43 ArchivaArtifact artifact = createArtifact( "com.foo", "foo-tool", "1.0", "", "jar" );
45 assertEquals( "com.foo/jars/foo-tool-1.0.jar", layout.pathOf( artifact ) );
48 public void testToPathEjbClient()
50 ArchivaArtifact artifact = createArtifact( "com.foo", "foo-client", "1.0", "", "ejb-client" );
52 assertEquals( "com.foo/ejbs/foo-client-1.0.jar", layout.pathOf( artifact ) );
55 public void testToPathWithClassifier()
57 ArchivaArtifact artifact = createArtifact( "com.foo.lib", "foo-lib", "2.1-alpha-1", "sources", "jar" );
59 assertEquals( "com.foo.lib/javadoc.jars/foo-lib-2.1-alpha-1-sources.jar", layout.pathOf( artifact ) );
62 public void testToPathUsingUniqueSnapshot()
64 ArchivaArtifact artifact = createArtifact( "com.foo", "foo-connector", "2.1-20060822.123456-35", "", "jar" );
66 assertEquals( "com.foo/jars/foo-connector-2.1-20060822.123456-35.jar",
67 layout.pathOf( artifact ) );