1 package org.apache.maven.archiva.configuration;
\r
3 import junit.framework.TestCase;
\r
5 import org.apache.maven.archiva.model.ArtifactReference;
\r
8 * Licensed to the Apache Software Foundation (ASF) under one
\r
9 * or more contributor license agreements. See the NOTICE file
\r
10 * distributed with this work for additional information
\r
11 * regarding copyright ownership. The ASF licenses this file
\r
12 * to you under the Apache License, Version 2.0 (the
\r
13 * "License"); you may not use this file except in compliance
\r
14 * with the License. You may obtain a copy of the License at
\r
16 * http://www.apache.org/licenses/LICENSE-2.0
\r
18 * Unless required by applicable law or agreed to in writing,
\r
19 * software distributed under the License is distributed on an
\r
20 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
\r
21 * KIND, either express or implied. See the License for the
\r
22 * specific language governing permissions and limitations
\r
23 * under the License.
\r
27 * Test the generated LegacyArtifactPath class from Modello. This is primarily to test the hand coded methods.
\r
30 public class LegacyArtifactPathTest
\r
34 private LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath();
\r
36 public void testLegacyArtifactPathWithClassifierResolution()
\r
38 legacyArtifactPath.setArtifact( "groupId:artifactId:version:classifier:type" );
\r
40 ArtifactReference artifact = legacyArtifactPath.getArtifactReference();
\r
41 assertEquals( "groupId", artifact.getGroupId() );
\r
42 assertEquals( "artifactId", artifact.getArtifactId() );
\r
43 assertEquals( "version", artifact.getVersion() );
\r
44 assertEquals( "classifier", artifact.getClassifier() );
\r
45 assertEquals( "type", artifact.getType() );
\r
49 public void testLegacyArtifactPathWithoutClassifierResolution()
\r
51 legacyArtifactPath.setArtifact( "groupId:artifactId:version::type" );
\r
53 ArtifactReference artifact = legacyArtifactPath.getArtifactReference();
\r
54 assertEquals( "groupId", artifact.getGroupId() );
\r
55 assertEquals( "artifactId", artifact.getArtifactId() );
\r
56 assertEquals( "version", artifact.getVersion() );
\r
57 assertEquals( null, artifact.getClassifier() );
\r
58 assertEquals( "type", artifact.getType() );
\r