maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1674619 - /maven/shared/trunk/maven-artifact-transfer/src/test/java/org/apache/maven/shared/artifact/install/internal/Maven30ArtifactInstallerTest.java
Date Sun, 19 Apr 2015 12:36:09 GMT
Author: rfscholte
Date: Sun Apr 19 12:36:09 2015
New Revision: 1674619

URL: http://svn.apache.org/r1674619
Log:
Have unittests for setLocalRepositoryBasedir for both SimpleLocalRepositoryManager and EnhancedLocalRepositoryManager

Modified:
    maven/shared/trunk/maven-artifact-transfer/src/test/java/org/apache/maven/shared/artifact/install/internal/Maven30ArtifactInstallerTest.java

Modified: maven/shared/trunk/maven-artifact-transfer/src/test/java/org/apache/maven/shared/artifact/install/internal/Maven30ArtifactInstallerTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-artifact-transfer/src/test/java/org/apache/maven/shared/artifact/install/internal/Maven30ArtifactInstallerTest.java?rev=1674619&r1=1674618&r2=1674619&view=diff
==============================================================================
--- maven/shared/trunk/maven-artifact-transfer/src/test/java/org/apache/maven/shared/artifact/install/internal/Maven30ArtifactInstallerTest.java
(original)
+++ maven/shared/trunk/maven-artifact-transfer/src/test/java/org/apache/maven/shared/artifact/install/internal/Maven30ArtifactInstallerTest.java
Sun Apr 19 12:36:09 2015
@@ -12,6 +12,7 @@ import org.apache.maven.project.ProjectB
 import org.apache.maven.repository.internal.MavenRepositorySystemSession;
 import org.apache.maven.shared.artifact.install.ArtifactInstaller;
 import org.codehaus.plexus.PlexusTestCase;
+import org.sonatype.aether.impl.internal.EnhancedLocalRepositoryManager;
 import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
 
 public class Maven30ArtifactInstallerTest extends PlexusTestCase
@@ -55,7 +56,7 @@ public class Maven30ArtifactInstallerTes
         assertTrue( new File( localRepo, "GROUPID/ARTIFACTID/maven-metadata-local.xml" ).exists()
); //??
     }
 
-    public void testSetLocalRepositoryBasedir() throws Exception
+    public void testSetLocalRepositoryBasedirSimple() throws Exception
     {
         DefaultProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest();
         MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
@@ -69,5 +70,20 @@ public class Maven30ArtifactInstallerTes
         assertEquals( basedir.getAbsoluteFile(), newBuildingRequest.getRepositorySession().getLocalRepository().getBasedir()
);
         
     }
-    
+
+    public void testSetLocalRepositoryBasedirEnhanced() throws Exception
+    {
+        DefaultProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest();
+        MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
+        repositorySession.setLocalRepositoryManager( new EnhancedLocalRepositoryManager(
localRepo ) );
+        buildingRequest.setRepositorySession( repositorySession );
+
+        File basedir = new File( "NEW/LOCAL/REPO" );
+        
+        ProjectBuildingRequest newBuildingRequest = installer.setLocalRepositoryBasedir(
buildingRequest, basedir );
+        
+        assertEquals( basedir.getAbsoluteFile(), newBuildingRequest.getRepositorySession().getLocalRepository().getBasedir()
);
+        
+    }
+
 }



Mime
View raw message