package org.apache.maven.archiva.configuration;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import junit.framework.TestCase;

/**
 * Test the generated LegacyArtifactPath class from Modello. This is primarily to test the hand coded methods.
 * @since 1.1
 */
public class LegacyArtifactPathTest
    extends TestCase
{

    private LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath();

    public void testLegacyArtifactPathWithClassifierResolution()
    {
        legacyArtifactPath.setArtifact( "groupId:artifactId:version:classifier:type" );

        assertEquals( "groupId", legacyArtifactPath.getGroupId() );
        assertEquals( "artifactId", legacyArtifactPath.getArtifactId() );
        assertEquals( "version", legacyArtifactPath.getVersion() );
        assertEquals( "classifier", legacyArtifactPath.getClassifier() );
        assertEquals( "type", legacyArtifactPath.getType() );
    }


    public void testLegacyArtifactPathWithoutClassifierResolution()
    {
        legacyArtifactPath.setArtifact( "groupId:artifactId:version::type" );

        assertEquals( "groupId", legacyArtifactPath.getGroupId() );
        assertEquals( "artifactId", legacyArtifactPath.getArtifactId() );
        assertEquals( "version", legacyArtifactPath.getVersion() );
        assertNull( legacyArtifactPath.getClassifier() );
        assertEquals( "type", legacyArtifactPath.getType() );
    }
}

@@ -44,15 +44,12 @@
 ion;
-%0D%0A%0D
+%0A
 %0A/*
-%0D
 %0A * 
@@ -106,17 +106,16 @@
 nder one
-%0D
 %0A * or m
@@ -166,25 +166,24 @@
  NOTICE file
-%0D
 %0A * distribu
@@ -227,17 +227,16 @@
 ormation
-%0D
 %0A * rega
@@ -289,17 +289,16 @@
 his file
-%0D
 %0A * to y
@@ -342,17 +342,16 @@
 2.0 (the
-%0D
 %0A * %22Lic
@@ -404,17 +404,16 @@
 mpliance
-%0D
 %0A * with
@@ -466,21 +466,19 @@
 cense at
-%0D
 %0A *
-%0D
 %0A *  htt
@@ -520,13 +520,11 @@
 -2.0
-%0D
 %0A *
-%0D
 %0A * 
@@ -581,17 +581,16 @@
 writing,
-%0D
 %0A * soft
@@ -644,17 +644,16 @@
 ed on an
-%0D
 %0A * %22AS 
@@ -702,17 +702,16 @@
 S OF ANY
-%0D
 %0A * KIND
@@ -763,17 +763,16 @@
  for the
-%0D
 %0A * spec
@@ -822,17 +822,16 @@
 itations
-%0D
 %0A * unde
@@ -848,16 +848,13 @@
 nse.
-%0D
 %0A */
-%0D%0A%0D
+%0A
 %0Aimp
@@ -886,16 +886,13 @@
 ase;
-%0D%0A%0D
+%0A
 %0A/**
-%0D
 %0A * 
@@ -998,17 +998,16 @@
 methods.
-%0D
 %0A * @sin
@@ -1016,14 +1016,12 @@
  1.1
-%0D
 %0A */
-%0D
 %0Apub
@@ -1052,17 +1052,16 @@
 PathTest
-%0D
 %0A    ext
@@ -1077,14 +1077,11 @@
 Case
-%0D
 %0A%7B
-%0D%0A%0D
+%0A
 %0A   
@@ -1154,19 +1154,17 @@
 tPath();
-%0D%0A%0D
+%0A
 %0A    pub
@@ -1216,32 +1216,30 @@
 Resolution()
-%0D
 %0A    %7B
-%0D
 %0A        leg
@@ -1306,35 +1306,33 @@
 ssifier:type%22 );
-%0D%0A%0D
+%0A
 %0A        assertE
@@ -1375,33 +1375,32 @@
 .getGroupId() );
-%0D
 %0A        assertE
@@ -1449,33 +1449,32 @@
 tArtifactId() );
-%0D
 %0A        assertE
@@ -1517,33 +1517,32 @@
 .getVersion() );
-%0D
 %0A        assertE
@@ -1591,33 +1591,32 @@
 tClassifier() );
-%0D
 %0A        assertE
@@ -1665,20 +1665,16 @@
 ) );
-%0D
 %0A    %7D
-%0D%0A%0D%0A%0D
+%0A%0A
 %0A   
@@ -1741,16 +1741,14 @@
 on()
-%0D
 %0A    %7B
-%0D
 %0A   
@@ -1825,11 +1825,9 @@
 %22 );
-%0D%0A%0D
+%0A
 %0A   
@@ -1886,25 +1886,24 @@
 GroupId() );
-%0D
 %0A        ass
@@ -1960,25 +1960,24 @@
 ifactId() );
-%0D
 %0A        ass
@@ -2028,25 +2028,24 @@
 Version() );
-%0D
 %0A        ass
@@ -2086,25 +2086,24 @@
 ssifier() );
-%0D
 %0A        ass
@@ -2156,16 +2156,13 @@
 ) );
-%0D
 %0A    %7D
-%0D
 %0A%7D
-%0D
 %0A

set line ending