You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by jv...@apache.org on 2004/10/23 15:33:59 UTC

cvs commit: maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/installer ArtifactInstallerTest.java

jvanzyl     2004/10/23 06:33:59

  Modified:    maven-artifact/src/test/java/org/apache/maven/artifact
                        ArtifactComponentTestCase.java
               maven-artifact/src/test/java/org/apache/maven/artifact/deployer
                        ArtifactDeployerTest.java
               maven-artifact/src/test/java/org/apache/maven/artifact/installer
                        ArtifactInstallerTest.java
  Log:
  o remove the use of the deprecated basedir field in PlexusTestCase and use
    the getBasedir() method.
  
  o use the getBasedir() method in any test helpers that construct paths.
  
  Revision  Changes    Path
  1.5       +14 -5     maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/ArtifactComponentTestCase.java
  
  Index: ArtifactComponentTestCase.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/ArtifactComponentTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ArtifactComponentTestCase.java	29 Sep 2004 11:20:38 -0000	1.4
  +++ ArtifactComponentTestCase.java	23 Oct 2004 13:33:59 -0000	1.5
  @@ -54,10 +54,11 @@
   
           String path = "target/test-classes/repositories/" + component() + "/bad-local-repository";
   
  -        File f = new File( path );
  +        File f = new File( getBasedir(), path );
  +
           f.createNewFile();
   
  -        localRepository.setUrl( "file://" + path );
  +        localRepository.setUrl( "file://" + f.getPath() );
   
           return localRepository;
       }
  @@ -66,7 +67,11 @@
       {
           ArtifactRepository localRepository = new ArtifactRepository();
   
  -        localRepository.setUrl( "file://" + "target/test-classes/repositories/" + component() + "/local-repository" );
  +        String path = "target/test-classes/repositories/" + component() + "/local-repository";
  +
  +        File f = new File( getBasedir(), path );
  +
  +        localRepository.setUrl( "file://" + f.getPath() );
   
           return localRepository;
       }
  @@ -75,7 +80,11 @@
       {
           ArtifactRepository repository = new ArtifactRepository();
   
  -        repository.setUrl( "file://" + "target/test-classes/repositories/" + component() + "/remote-repository" );
  +        String path = "target/test-classes/repositories/" + component() + "/remote-repository";
  +
  +        File f = new File( getBasedir(), path );
  +
  +        repository.setUrl( "file://" + f.getPath() );
   
           return repository;
       }
  
  
  
  1.2       +2 -2      maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/deployer/ArtifactDeployerTest.java
  
  Index: ArtifactDeployerTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/deployer/ArtifactDeployerTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ArtifactDeployerTest.java	9 Aug 2004 18:37:34 -0000	1.1
  +++ ArtifactDeployerTest.java	23 Oct 2004 13:33:59 -0000	1.2
  @@ -46,7 +46,7 @@
       public void testArtifactInstallation()
           throws Exception
       {
  -        String artifactBasedir = new File( basedir, "src/test/resources/artifact-install" ).getAbsolutePath();
  +        String artifactBasedir = new File( getBasedir(), "src/test/resources/artifact-install" ).getAbsolutePath();
   
           Artifact artifact = createArtifact( "artifact", "1.0" );
   
  
  
  
  1.2       +2 -2      maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/installer/ArtifactInstallerTest.java
  
  Index: ArtifactInstallerTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/test/java/org/apache/maven/artifact/installer/ArtifactInstallerTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ArtifactInstallerTest.java	9 Aug 2004 18:37:34 -0000	1.1
  +++ ArtifactInstallerTest.java	23 Oct 2004 13:33:59 -0000	1.2
  @@ -47,7 +47,7 @@
       public void testArtifactInstallation()
           throws Exception
       {
  -        String artifactBasedir = new File( basedir, "src/test/resources/artifact-install" ).getAbsolutePath();
  +        String artifactBasedir = new File( getBasedir(), "src/test/resources/artifact-install" ).getAbsolutePath();
   
           Artifact artifact = createArtifact( "artifact", "1.0" );