o adding IT it0043

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465817 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2006-10-19 20:44:39 +00:00
parent b6bcbd36af
commit 7d6d9d564c
2 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,51 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-it0043</artifactId>
<description>Test for repository inheritence - ensure using the same id overrides the defaults</description>
<version>1.0-SNAPSHOT</version>
<repositories>
<repository>
<id>central</id>
<name>Empty Repository</name>
<url>file:/tmp/emptyRepo</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Empty Repository</name>
<url>file:/tmp/emptyRepo</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<artifactId>junit</artifactId>
<groupId>junit</groupId>
<version>3.8.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-help-plugin</artifactId>
<executions>
<execution>
<phase>generate-test-resources</phase>
<goals>
<goal>effective-pom</goal>
</goals>
<configuration>
<output>${project.build.directory}/effective-pom.xml</output>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,26 @@
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import junit.framework.TestCase;
public class RepositoryOverrideTest extends TestCase
{
public void testPOM() throws Exception
{
BufferedInputStream in = new BufferedInputStream( new FileInputStream("target/effective-pom.xml") );
ByteArrayOutputStream out = new ByteArrayOutputStream();
int rd = 0;
byte [] buffer = new byte[512];
while ( ( rd = in.read( buffer ) ) > 0 )
{
out.write( buffer, 0, rd );
}
assertEquals( -1, out.toString().indexOf("repo1.maven.org") );
}
}