001package org.apache.maven.artifact.transform;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
005 * agreements. See the NOTICE file distributed with this work for additional information regarding
006 * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance with the License. You may obtain a
008 * copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software distributed under the License
013 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
014 * or implied. See the License for the specific language governing permissions and limitations under
015 * the License.
016 */
017
018import java.util.List;
019
020import org.apache.maven.repository.legacy.resolver.transform.ArtifactTransformationManager;
021import org.apache.maven.repository.legacy.resolver.transform.LatestArtifactTransformation;
022import org.apache.maven.repository.legacy.resolver.transform.ReleaseArtifactTransformation;
023import org.apache.maven.repository.legacy.resolver.transform.SnapshotTransformation;
024import org.codehaus.plexus.PlexusTestCase;
025
026/** @author Jason van Zyl */
027public class TransformationManagerTest
028    extends PlexusTestCase
029{
030    public void testTransformationManager()
031        throws Exception
032    {
033        ArtifactTransformationManager tm = lookup( ArtifactTransformationManager.class );
034
035        List tms = tm.getArtifactTransformations();
036
037        assertEquals( 3, tms.size() );
038
039        assertTrue( "We expected the release transformation and got " + tms.get(0), tms.get(0) instanceof ReleaseArtifactTransformation );
040
041        assertTrue( "We expected the latest transformation and got " + tms.get(1), tms.get(1) instanceof LatestArtifactTransformation );
042
043        assertTrue( "We expected the snapshot transformation and got " + tms.get(2), tms.get(2) instanceof SnapshotTransformation );
044    }
045
046}