archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1388176 - in /archiva/trunk/archiva-modules/plugins/stage-repository-merge/src: main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java
Date Thu, 20 Sep 2012 19:43:06 GMT
Author: olamy
Date: Thu Sep 20 19:43:05 2012
New Revision: 1388176

URL: http://svn.apache.org/viewvc?rev=1388176&view=rev
Log:
fix unit in fact fix issue :-)

Modified:
    archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java
    archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java

Modified: archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java?rev=1388176&r1=1388175&r2=1388176&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java
(original)
+++ archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java
Thu Sep 20 19:43:05 2012
@@ -261,7 +261,7 @@ public class Maven2RepositoryMerger
                 if ( !projectMetadataFileInTargetRepo.exists() )
                 {
 
-                    copyFile( projectMetadataFileInSourceRepo, projectMetadataFileInSourceRepo
);
+                    copyFile( projectMetadataFileInSourceRepo, projectMetadataFileInTargetRepo
);
                 }
                 else
                 {

Modified: archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java?rev=1388176&r1=1388175&r2=1388176&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java
Thu Sep 20 19:43:05 2012
@@ -26,6 +26,7 @@ import org.apache.archiva.configuration.
 import org.apache.archiva.configuration.RepositoryScanningConfiguration;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.repository.MetadataRepository;
+import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -36,12 +37,11 @@ import javax.inject.Inject;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
 
 import static org.mockito.Mockito.*;
 
-@RunWith( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml"
} )
+@RunWith (ArchivaSpringJUnit4ClassRunner.class)
+@ContextConfiguration (locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml"
})
 public class Maven2RepositoryMergerTest
     extends TestCase
 {
@@ -84,6 +84,10 @@ public class Maven2RepositoryMergerTest
     public void testMerge()
         throws Exception
     {
+        String targetRepoPath = "target" + File.separatorChar + "test-repository-target";
+        File mergedArtifact = new File( targetRepoPath,
+                                        "com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar"
);
+        assertFalse( mergedArtifact.exists() );
         Configuration c = new Configuration();
         ManagedRepositoryConfiguration testRepo = new ManagedRepositoryConfiguration();
         testRepo.setId( TEST_REPO_ID );
@@ -97,7 +101,7 @@ public class Maven2RepositoryMergerTest
 
         ManagedRepositoryConfiguration targetRepo = new ManagedRepositoryConfiguration();
         targetRepo.setId( "target-rep" );
-        targetRepo.setLocation( "target" );
+        targetRepo.setLocation( targetRepoPath );
         c.addManagedRepository( testRepo );
         c.addManagedRepository( targetRepo );
         configuration.save( c );
@@ -105,6 +109,7 @@ public class Maven2RepositoryMergerTest
         when( metadataRepository.getArtifacts( TEST_REPO_ID ) ).thenReturn( getArtifacts()
);
         repositoryMerger.merge( metadataRepository, TEST_REPO_ID, "target-rep" );
         verify( metadataRepository ).getArtifacts( TEST_REPO_ID );
+        assertTrue( mergedArtifact.exists() );
     }
 
     @Test



Mime
View raw message