[MNG-3288] add integration test

Submitted by: Benjamin Bentmann (via MNG-3768)


git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@741501 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2009-02-06 10:15:33 +00:00
parent 187e3b7978
commit 4594085b96
3 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,60 @@
package org.apache.maven.it;
/*
* 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 org.apache.maven.it.Verifier;
import org.apache.maven.it.VerificationException;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
import java.util.List;
/**
* This is a test for <a href="http://jira.codehaus.org/browse/MNG-3288">MNG-3288</a>.
*
* @author Benjamin Bentmann
*/
public class MavenITmng3288SystemScopeDirTest
extends AbstractMavenIntegrationTestCase
{
/**
* Test the use of a system scoped dependency to a directory instead of a JAR which should fail early.
*/
public void testitMNG3288()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3288" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
try
{
verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution::compile" );
fail( "Usage of directory instead of file for system-scoped dependency did not fail dependency resolution" );
}
catch ( VerificationException e )
{
// expected, <systemPath> of a system-scoped dependency should be a file, not a directory
}
verifier.resetStreams();
}
}

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng3288</groupId>
<artifactId>mng-3288</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-3288</name>
<description>
Test the use of a system scoped dependency to a directory instead of a JAR which should fail early.
</description>
<dependencies>
<dependency>
<groupId>it</groupId>
<artifactId>it</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib</systemPath>
</dependency>
</dependencies>
</project>