o Fixed test setup and re-enabled test

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@786578 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-06-19 16:50:11 +00:00
parent b8d81a36a8
commit 14960422e0
3 changed files with 18 additions and 10 deletions

View File

@ -107,15 +107,6 @@
</models>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/ProjectClasspathTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>

View File

@ -32,8 +32,10 @@ public class ProjectClasspathTest
public void setUp()
throws Exception
{
//super.setUp();
projectBuilder = lookup( ProjectBuilder.class, "classpath" );
// the metadata source looks up the default impl, so we have to trick it
getContainer().addComponent( projectBuilder, ProjectBuilder.class, "default" );
}
@Override

View File

@ -3,9 +3,12 @@
*/
package org.apache.maven.project;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Collections;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.codehaus.plexus.component.annotations.Component;
@Component(role=ProjectBuilder.class,hint="classpath")
@ -36,4 +39,16 @@ public class TestProjectBuilder
}
return build( artifact.getFile(), request );
}
@Override
public MavenProject build( File pomFile, ProjectBuildingRequest configuration )
throws ProjectBuildingException
{
MavenProject project = super.build( pomFile, configuration );
project.setRemoteArtifactRepositories( Collections.<ArtifactRepository> emptyList() );
return project;
}
}