1 package org.apache.maven;
2
3 import org.apache.maven.execution.MavenExecutionRequest;
4 import org.apache.maven.execution.MavenExecutionResult;
5
6 import static java.util.Arrays.asList;
7
8 /*
9 * Licensed to the Apache Software Foundation (ASF) under one
10 * or more contributor license agreements. See the NOTICE file
11 * distributed with this work for additional information
12 * regarding copyright ownership. The ASF licenses this file
13 * to you under the Apache License, Version 2.0 (the
14 * "License"); you may not use this file except in compliance
15 * with the License. You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing,
20 * software distributed under the License is distributed on an
21 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22 * KIND, either express or implied. See the License for the
23 * specific language governing permissions and limitations
24 * under the License.
25 */
26 public class DefaultMavenTest extends AbstractCoreMavenComponentTestCase{
27
28 public void testThatErrorDuringProjectDependencyGraphCreationAreStored()
29 throws Exception
30 {
31 Maven maven = getContainer().lookup( Maven.class );
32 MavenExecutionRequest request = createMavenExecutionRequest( getProject( "cyclic-reference" ) ).setGoals( asList("validate") );
33
34 MavenExecutionResult result = maven.execute( request );
35
36 assertEquals( ProjectCycleException.class, result.getExceptions().get( 0 ).getClass() );
37 }
38
39 @Override
40 protected String getProjectsDirectory()
41 {
42 return "src/test/projects/default-maven";
43 }
44
45 }