]> source.dussan.org Git - archiva.git/commitdiff
use a field from parent class
authorOlivier Lamy <olamy@apache.org>
Fri, 23 Sep 2011 06:41:04 +0000 (06:41 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 23 Sep 2011 06:41:04 +0000 (06:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1174538 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArtifactTransferRequest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/CopyArtifactTest.java

index 10416adccf39bd6eead2783249c25cd0c8b1ea19..4bb367f4675a980cc4792bd6154d41f29ad23f86 100644 (file)
@@ -29,20 +29,8 @@ public class ArtifactTransferRequest
     extends Artifact
     implements Serializable
 {
-    private String sourceRepositoryId;
-
     private String targetRepositoryId;
 
-    public String getSourceRepositoryId()
-    {
-        return sourceRepositoryId;
-    }
-
-    public void setSourceRepositoryId( String sourceRepositoryId )
-    {
-        this.sourceRepositoryId = sourceRepositoryId;
-    }
-
     public String getTargetRepositoryId()
     {
         return targetRepositoryId;
index 92203f182f28ed5d3f0848401a523fa50944696b..46dfa8868e5dfe0982c4e78f349e04deee172623 100644 (file)
@@ -39,10 +39,6 @@ public class CopyArtifactTest
 
     static final String SOURCE_REPO_ID = "test-origin-repo";
 
-    @Inject
-    private RepositoryContentFactory repositoryFactory;
-
-
     private void initSourceTargetRepo()
         throws Exception
     {
@@ -119,19 +115,12 @@ public class CopyArtifactTest
         artifactTransferRequest.setGroupId( "org.apache.karaf.features" );
         artifactTransferRequest.setArtifactId( "org.apache.karaf.features.core" );
         artifactTransferRequest.setVersion( "2.2.2" );
-        artifactTransferRequest.setSourceRepositoryId( SOURCE_REPO_ID );
+        artifactTransferRequest.setRepositoryId( SOURCE_REPO_ID );
         artifactTransferRequest.setTargetRepositoryId( TARGET_REPO_ID );
         Boolean res = getRepositoriesService( authorizationHeader ).copyArtifact( artifactTransferRequest );
         // END SNIPPET: copy-artifact
         assertTrue( res );
 
-        ArtifactReference artifactReference = new ArtifactReference();
-        artifactReference.setArtifactId( artifactTransferRequest.getArtifactId() );
-        artifactReference.setGroupId( artifactTransferRequest.getGroupId() );
-        artifactReference.setVersion( artifactTransferRequest.getVersion() );
-        artifactReference.setClassifier( artifactTransferRequest.getClassifier() );
-        String packaging = StringUtils.trim( artifactTransferRequest.getPackaging() );
-        artifactReference.setType( StringUtils.isEmpty( packaging ) ? "jar" : packaging );
 
         String targetRepoPath =
             getManagedRepositoriesService( authorizationHeader ).getManagedRepository( TARGET_REPO_ID ).getLocation();
@@ -143,6 +132,7 @@ public class CopyArtifactTest
                              "/org/apache/karaf/features/org.apache.karaf.features.core/2.2.2/org.apache.karaf.features.core-2.2.2.pom" );
 
         assertTrue( "not exists " + pom.getPath(), pom.exists() );
+        // TODO find a way to force metadata generation and test it !!
         clean();
     }