From 38036165f075680f3824216e8ee8d507077427de Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 23 Sep 2011 06:41:41 +0000 Subject: [PATCH] better documentation in SNIPPET git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1174540 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/archiva/rest/services/CopyArtifactTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/CopyArtifactTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/CopyArtifactTest.java index 46dfa8868..9eb1faf86 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/CopyArtifactTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/CopyArtifactTest.java @@ -22,6 +22,7 @@ import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.RepositoryContentFactory; import org.apache.archiva.rest.api.model.ArtifactTransferRequest; +import org.apache.archiva.rest.api.services.RepositoriesService; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.junit.Test; @@ -111,13 +112,18 @@ public class CopyArtifactTest initSourceTargetRepo(); // START SNIPPET: copy-artifact + // configure the artifact you want to copy + // if package ommited default will be jar ArtifactTransferRequest artifactTransferRequest = new ArtifactTransferRequest(); artifactTransferRequest.setGroupId( "org.apache.karaf.features" ); artifactTransferRequest.setArtifactId( "org.apache.karaf.features.core" ); artifactTransferRequest.setVersion( "2.2.2" ); artifactTransferRequest.setRepositoryId( SOURCE_REPO_ID ); artifactTransferRequest.setTargetRepositoryId( TARGET_REPO_ID ); - Boolean res = getRepositoriesService( authorizationHeader ).copyArtifact( artifactTransferRequest ); + // retrieve the service + RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader ); + // copy the artifact + Boolean res = repositoriesService.copyArtifact( artifactTransferRequest ); // END SNIPPET: copy-artifact assertTrue( res );