]> source.dussan.org Git - archiva.git/commitdiff
add some snippet for using it in documentation
authorOlivier Lamy <olamy@apache.org>
Fri, 16 Sep 2011 14:09:12 +0000 (14:09 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 16 Sep 2011 14:09:12 +0000 (14:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1171573 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java

index 2e61044df5e2038b15a834d3cb476d2c0fade2b6..82f496e9f28109e03b8a08eef9488c0cd5f71e87 100644 (file)
@@ -42,8 +42,11 @@ import java.io.File;
 public abstract class AbstractArchivaRestTest
     extends AbstractRestServicesTest
 {
+
+    // START SNIPPET: authz-header
     public String guestAuthzHeader =
         "Basic " + org.apache.cxf.common.util.Base64Utility.encode( ( "guest" + ":" ).getBytes() );
+    // END SNIPPET: authz-header
 
     @Override
     protected String getSpringConfigLocation()
@@ -149,6 +152,7 @@ public abstract class AbstractArchivaRestTest
 
     protected SearchService getSearchService( String authzHeader )
     {
+        // START SNIPPET: cxf-searchservice-creation
         SearchService service =
             JAXRSClientFactory.create( "http://localhost:" + port + "/" + getRestServicesPath() + "/archivaServices/",
                                        SearchService.class );
@@ -159,6 +163,7 @@ public abstract class AbstractArchivaRestTest
         }
         WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 );
         return service;
+        // END SNIPPET: cxf-searchservice-creation
 
     }
 
index 12a31bb4419b54cd66050b2f6556a5f4f5b30ffb..0c331474ea3fa87a1c62cd95b4976af242fc22b4 100644 (file)
@@ -77,10 +77,13 @@ public class SearchServiceTest
 
         File targetRepo = createAndIndexRepo( testRepoId );
 
+        // START SNIPPET: searchservice-artifact-versions
         SearchService searchService = getSearchService( authorizationHeader );
 
         List<Artifact> artifacts = searchService.getArtifactVersions( "commons-logging", "commons-logging", "jar" );
 
+        // END SNIPPET: searchservice-artifact-versions
+
         assertNotNull( artifacts );
         assertTrue( " not 3 results for commons-logging search but " + artifacts.size() + ":" + artifacts,
                     artifacts.size() == 13 );