add comment in code snippet and add a snippet in pom for rest dependencies

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295689 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-03-01 17:34:21 +00:00
parent 3182934f75
commit aabab285c4
2 changed files with 5 additions and 2 deletions

View File

@ -207,12 +207,14 @@ public abstract class AbstractArchivaRestTest
JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
SearchService.class, SearchService.class,
Collections.singletonList( new JacksonJaxbJsonProvider() ) ); Collections.singletonList( new JacksonJaxbJsonProvider() ) );
// to add authentification
if ( authzHeader != null ) if ( authzHeader != null )
{ {
WebClient.client( service ).header( "Authorization", authzHeader ); WebClient.client( service ).header( "Authorization", authzHeader );
} }
// to configure read timeout
WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 ); WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 );
// if you want to use json as exchange format xml is supported too
WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE ); WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE ); WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
return service; return service;

View File

@ -471,6 +471,7 @@
<artifactId>jsr311-api</artifactId> <artifactId>jsr311-api</artifactId>
<version>1.1.1</version> <version>1.1.1</version>
</dependency> </dependency>
<!-- START SNIPPET: rest-dependencies -->
<dependency> <dependency>
<groupId>org.codehaus.jackson</groupId> <groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId> <artifactId>jackson-jaxrs</artifactId>
@ -505,7 +506,7 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- END SNIPPET: rest-dependencies -->
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>