]> source.dussan.org Git - archiva.git/commitdiff
fix unit tests
authorOlivier Lamy <olamy@apache.org>
Thu, 1 Mar 2012 16:34:03 +0000 (16:34 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 1 Mar 2012 16:34:03 +0000 (16:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295659 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/pom.xml
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/AbstractDownloadTest.java

index d3541552500b1bd40f21af68377f1536cc2ddffb..7c5a04a6da2a5466b9581648792af16c49a4518a 100644 (file)
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.jackson</groupId>
+      <artifactId>jackson-jaxrs</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.jackson</groupId>
+      <artifactId>jackson-xc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.jackson</groupId>
+      <artifactId>jackson-core-asl</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.cxf</groupId>
       <artifactId>cxf-bundle-jaxrs</artifactId>
           <groupId>org.apache.geronimo.specs</groupId>
           <artifactId>geronimo-servlet_2.5_spec</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>org.codehaus.jettison</groupId>
+          <artifactId>jettison</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
index 8e1d0db3756c1dd86efbf3663d7e331695094981..408a790288ea40c4cd413306678de5033cdbc226 100644 (file)
@@ -31,6 +31,7 @@ import org.apache.cxf.common.util.Base64Utility;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.transport.servlet.CXFServlet;
+import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
 import org.codehaus.redback.integration.security.role.RedbackRoleConstants;
 import org.codehaus.redback.rest.api.model.User;
 import org.codehaus.redback.rest.api.services.RoleManagementService;
@@ -47,6 +48,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.context.ContextLoaderListener;
 
+import java.util.Collections;
+
 /**
  * @author Olivier Lamy
  */
@@ -153,7 +156,8 @@ public abstract class AbstractDownloadTest
     {
         ProxyConnectorService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
-                                       ProxyConnectorService.class );
+                                       ProxyConnectorService.class,
+                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
 
         WebClient.client( service ).header( "Authorization", authorizationHeader );
         WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
@@ -164,7 +168,8 @@ public abstract class AbstractDownloadTest
     {
         RemoteRepositoriesService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
-                                       RemoteRepositoriesService.class );
+                                       RemoteRepositoriesService.class,
+                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
 
         WebClient.client( service ).header( "Authorization", authorizationHeader );
         WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
@@ -175,7 +180,8 @@ public abstract class AbstractDownloadTest
     {
         ManagedRepositoriesService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
-                                       ManagedRepositoriesService.class );
+                                       ManagedRepositoriesService.class,
+                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
 
         WebClient.client( service ).header( "Authorization", authorizationHeader );
         WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
@@ -187,7 +193,8 @@ public abstract class AbstractDownloadTest
     {
         RepositoryGroupService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
-                                       RepositoryGroupService.class );
+                                       RepositoryGroupService.class,
+                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
 
         WebClient.client( service ).header( "Authorization", authorizationHeader );
         WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
@@ -198,7 +205,8 @@ public abstract class AbstractDownloadTest
     {
         RepositoriesService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
-                                       RepositoriesService.class );
+                                       RepositoriesService.class,
+                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
 
         WebClient.client( service ).header( "Authorization", authorizationHeader );
         WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
@@ -209,7 +217,8 @@ public abstract class AbstractDownloadTest
     {
         SearchService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
-                                       SearchService.class );
+                                       SearchService.class,
+                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
 
         WebClient.client( service ).header( "Authorization", authorizationHeader );
         WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
@@ -227,7 +236,8 @@ public abstract class AbstractDownloadTest
     {
         RoleManagementService service =
             JAXRSClientFactory.create( "http://localhost:" + port + "/" + getRestServicesPath() + "/redbackServices/",
-                                       RoleManagementService.class );
+                                       RoleManagementService.class,
+                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
 
         // for debuging purpose
         WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 3000000L );
@@ -243,7 +253,7 @@ public abstract class AbstractDownloadTest
     {
         UserService service =
             JAXRSClientFactory.create( "http://localhost:" + port + "/" + getRestServicesPath() + "/redbackServices/",
-                                       UserService.class );
+                                       UserService.class, Collections.singletonList( new JacksonJaxbJsonProvider() ) );
 
         // for debuging purpose
         WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 3000000L );