Adding resources and [commented out] new test method to apply scm inheritance checks to POMs read from a local repository...this is currently broken, as noted in MavenProject, line 291 or thereabouts, which is why the test is commented out.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@629632 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-02-20 22:06:14 +00:00
parent d54cf5b9bb
commit 0be649b7be
4 changed files with 62 additions and 1 deletions

View File

@ -59,6 +59,11 @@ protected void setUp()
}
}
protected MavenProjectBuilder getProjectBuilder()
{
return projectBuilder;
}
// ----------------------------------------------------------------------
// Local repository
// ----------------------------------------------------------------------

View File

@ -95,6 +95,33 @@ public void testScmInfoCalculatedCorrectlyOnChildOnlyRead()
assertEquals( project1.getScm().getUrl(), "http://host/viewer?path=/p0/modules/p1" );
assertEquals( project1.getScm().getConnection(), "scm:svn:http://host/p0/modules/p1" );
assertEquals( project1.getScm().getDeveloperConnection(), "scm:svn:https://host/p0/modules/p1" );
assertEquals( project1.getScm().getDeveloperConnection(),
"scm:svn:https://host/p0/modules/p1" );
}
// public void testScmInfoCalculatedCorrectlyOnChildReadFromLocalRepository()
// throws Exception
// {
// File localRepo = getLocalRepositoryPath();
//
// ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.class );
// Artifact artifact = factory.createProjectArtifact( "maven", "p1", "1.0" );
//
// ArtifactRepositoryFactory repoFactory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.class );
// ArtifactRepository localArtifactRepo = repoFactory.createLocalRepository( localRepo );
//
// MavenProject project1 = getProjectBuilder().buildFromRepository( artifact, Collections.EMPTY_LIST, localArtifactRepo );
//
// System.out.println( "\n\n" );
// System.out.println( "Child SCM URL is: " + project1.getScm().getUrl() );
// System.out.println( "Child SCM connection is: " + project1.getScm().getConnection() );
// System.out.println( "Child SCM developer connection is: "
// + project1.getScm().getDeveloperConnection() );
//
// assertEquals( project1.getScm().getUrl(), "http://host/viewer?path=/p0/modules/p1" );
// assertEquals( project1.getScm().getConnection(), "scm:svn:http://host/p0/modules/p1" );
// assertEquals( project1.getScm().getDeveloperConnection(),
// "scm:svn:https://host/p0/modules/p1" );
// }
}

View File

@ -0,0 +1,18 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>maven</groupId>
<artifactId>p0</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<scm>
<connection>scm:svn:http://host/p0</connection>
<developerConnection>scm:svn:https://host/p0</developerConnection>
<url>http://host/viewer?path=/p0</url>
</scm>
<modules>
<module>modules/p1</module>
</modules>
</project>

View File

@ -0,0 +1,11 @@
<project>
<parent>
<artifactId>p0</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>p1</artifactId>
</project>