001package org.apache.maven;
002
003import org.apache.maven.execution.MavenExecutionRequest;
004import org.apache.maven.execution.MavenExecutionResult;
005
006import static java.util.Arrays.asList;
007
008/*
009 * Licensed to the Apache Software Foundation (ASF) under one
010 * or more contributor license agreements.  See the NOTICE file
011 * distributed with this work for additional information
012 * regarding copyright ownership.  The ASF licenses this file
013 * to you under the Apache License, Version 2.0 (the
014 * "License"); you may not use this file except in compliance
015 * with the License.  You may obtain a copy of the License at
016 *
017 *  http://www.apache.org/licenses/LICENSE-2.0
018 *
019 * Unless required by applicable law or agreed to in writing,
020 * software distributed under the License is distributed on an
021 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
022 * KIND, either express or implied.  See the License for the
023 * specific language governing permissions and limitations
024 * under the License.
025 */
026public class DefaultMavenTest extends AbstractCoreMavenComponentTestCase{
027
028    public void testThatErrorDuringProjectDependencyGraphCreationAreStored()
029            throws Exception
030    {
031        Maven maven = getContainer().lookup( Maven.class );
032        MavenExecutionRequest request = createMavenExecutionRequest( getProject( "cyclic-reference" ) ).setGoals( asList("validate") );
033
034        MavenExecutionResult result = maven.execute( request );
035
036        assertEquals( ProjectCycleException.class, result.getExceptions().get( 0 ).getClass() );
037    }
038
039    @Override
040    protected String getProjectsDirectory()
041    {
042        return "src/test/projects/default-maven";
043    }
044
045}