View Javadoc
1   package org.apache.maven.artifact.transform;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
5    * agreements. See the NOTICE file distributed with this work for additional information regarding
6    * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance with the License. You may obtain a
8    * copy of the License at
9    *
10   * http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software distributed under the License
13   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14   * or implied. See the License for the specific language governing permissions and limitations under
15   * the License.
16   */
17  
18  import java.util.List;
19  
20  import org.apache.maven.repository.legacy.resolver.transform.ArtifactTransformationManager;
21  import org.apache.maven.repository.legacy.resolver.transform.LatestArtifactTransformation;
22  import org.apache.maven.repository.legacy.resolver.transform.ReleaseArtifactTransformation;
23  import org.apache.maven.repository.legacy.resolver.transform.SnapshotTransformation;
24  import org.codehaus.plexus.PlexusTestCase;
25  
26  /** @author Jason van Zyl */
27  public class TransformationManagerTest
28      extends PlexusTestCase
29  {
30      public void testTransformationManager()
31          throws Exception
32      {
33          ArtifactTransformationManager tm = lookup( ArtifactTransformationManager.class );
34  
35          List tms = tm.getArtifactTransformations();
36  
37          assertEquals( 3, tms.size() );
38  
39          assertTrue( "We expected the release transformation and got " + tms.get(0), tms.get(0) instanceof ReleaseArtifactTransformation );
40  
41          assertTrue( "We expected the latest transformation and got " + tms.get(1), tms.get(1) instanceof LatestArtifactTransformation );
42  
43          assertTrue( "We expected the snapshot transformation and got " + tms.get(2), tms.get(2) instanceof SnapshotTransformation );
44      }
45  
46  }