upgrade to cxf 3.0.3

This commit is contained in:
Olivier Lamy 2015-02-06 23:30:09 +11:00
parent d8cb9a50e8
commit 041a8cc8e0
10 changed files with 83 additions and 124 deletions

View File

@ -87,17 +87,7 @@
<!-- normally not needed but here for wadl feature currently in cxf --> <!-- normally not needed but here for wadl feature currently in cxf -->
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId> <artifactId>cxf-rt-frontend-jaxrs</artifactId>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -198,22 +198,22 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId> <artifactId>cxf-rt-frontend-jaxrs</artifactId>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.archiva.redback</groupId> <groupId>org.apache.archiva.redback</groupId>
<artifactId>redback-rest-services</artifactId> <artifactId>redback-rest-services</artifactId>
@ -279,6 +279,12 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.hsqldb</groupId> <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId> <artifactId>hsqldb</artifactId>

View File

@ -18,12 +18,9 @@ package org.apache.archiva.rest.services;
* under the License. * under the License.
*/ */
import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.rest.api.model.ArtifactTransferRequest; import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
import org.apache.archiva.rest.api.services.RepositoriesService; import org.apache.archiva.rest.api.services.RepositoriesService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -79,7 +76,7 @@ public class CopyArtifactTest
} }
} }
@Test( expected = ServerWebApplicationException.class ) @Test( expected = Exception.class )
public void copyNonExistingArtifact() public void copyNonExistingArtifact()
throws Throwable throws Throwable
{ {
@ -95,9 +92,9 @@ public class CopyArtifactTest
artifactTransferRequest.setTargetRepositoryId( TARGET_REPO_ID ); artifactTransferRequest.setTargetRepositoryId( TARGET_REPO_ID );
RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader ); RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
Boolean res = repositoriesService.copyArtifact( artifactTransferRequest ); repositoriesService.copyArtifact( artifactTransferRequest );
} }
catch ( ServerWebApplicationException e ) catch ( Exception e )
{ {
assertTrue( StringUtils.contains( e.getMessage(), "cannot find artifact" ) ); assertTrue( StringUtils.contains( e.getMessage(), "cannot find artifact" ) );
throw e; throw e;

View File

@ -20,11 +20,12 @@ package org.apache.archiva.rest.services;
*/ */
import org.apache.archiva.rest.api.services.PingService; import org.apache.archiva.rest.api.services.PingService;
import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.jaxrs.client.WebClient;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import javax.ws.rs.ForbiddenException;
/** /**
* @author Olivier Lamy * @author Olivier Lamy
* @since 1.4-M1 * @since 1.4-M1
@ -45,7 +46,7 @@ public class PingServiceTest
assertEquals( "Yeah Baby It rocks!", res ); assertEquals( "Yeah Baby It rocks!", res );
} }
@Test( expected = ServerWebApplicationException.class ) @Test( expected = ForbiddenException.class )
public void pingWithAuthzFailed() public void pingWithAuthzFailed()
throws Exception throws Exception
{ {
@ -55,9 +56,9 @@ public class PingServiceTest
String res = getPingService().pingWithAuthz(); String res = getPingService().pingWithAuthz();
fail( "not in exception" ); fail( "not in exception" );
} }
catch ( ServerWebApplicationException e ) catch ( ForbiddenException e )
{ {
assertEquals( 403, e.getStatus() ); assertEquals( 403, e.getResponse().getStatus() );
throw e; throw e;
} }
} }

View File

@ -21,10 +21,10 @@ package org.apache.archiva.rest.services;
import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.beans.RemoteRepository;
import org.apache.archiva.rest.api.services.RemoteRepositoriesService; import org.apache.archiva.rest.api.services.RemoteRepositoriesService;
import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.jaxrs.client.WebClient;
import org.junit.Test; import org.junit.Test;
import javax.ws.rs.ForbiddenException;
import java.util.List; import java.util.List;
/** /**
@ -35,7 +35,7 @@ public class RemoteRepositoriesServiceTest
{ {
@Test (expected = ServerWebApplicationException.class) @Test( expected = ForbiddenException.class )
public void listRemoteRepositoriesKarmaFailed() public void listRemoteRepositoriesKarmaFailed()
throws Exception throws Exception
{ {
@ -44,9 +44,9 @@ public class RemoteRepositoriesServiceTest
{ {
assertFalse( service.getRemoteRepositories().isEmpty() ); assertFalse( service.getRemoteRepositories().isEmpty() );
} }
catch ( ServerWebApplicationException e ) catch ( ForbiddenException e )
{ {
assertEquals( 403, e.getStatus() ); assertEquals( 403, e.getResponse().getStatus() );
throw e; throw e;
} }
} }

View File

@ -29,13 +29,14 @@ import org.apache.archiva.rest.api.services.BrowseService;
import org.apache.archiva.rest.api.services.ManagedRepositoriesService; import org.apache.archiva.rest.api.services.ManagedRepositoriesService;
import org.apache.archiva.rest.api.services.RepositoriesService; import org.apache.archiva.rest.api.services.RepositoriesService;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test; import org.junit.Test;
import javax.ws.rs.ForbiddenException;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
/** /**
* @author Olivier Lamy * @author Olivier Lamy
*/ */
@ -43,7 +44,7 @@ public class RepositoriesServiceTest
extends AbstractArchivaRestTest extends AbstractArchivaRestTest
{ {
@Test ( expected = ServerWebApplicationException.class ) @Test( expected = ForbiddenException.class )
public void scanRepoKarmaFailed() public void scanRepoKarmaFailed()
throws Exception throws Exception
{ {
@ -52,9 +53,9 @@ public class RepositoriesServiceTest
{ {
service.scanRepository( "id", true ); service.scanRepository( "id", true );
} }
catch ( ServerWebApplicationException e ) catch ( ForbiddenException e )
{ {
assertEquals( 403, e.getStatus() ); assertEquals( 403, e.getResponse().getStatus() );
throw e; throw e;
} }
} }
@ -79,7 +80,7 @@ public class RepositoriesServiceTest
assertTrue( service.scanRepository( repoId, true ) ); assertTrue( service.scanRepository( repoId, true ) );
} }
@Test ( expected = ServerWebApplicationException.class ) @Test( expected = ForbiddenException.class )
public void deleteArtifactKarmaFailed() public void deleteArtifactKarmaFailed()
throws Exception throws Exception
{ {
@ -96,15 +97,15 @@ public class RepositoriesServiceTest
repositoriesService.deleteArtifact( artifact ); repositoriesService.deleteArtifact( artifact );
} }
catch ( ServerWebApplicationException e ) catch ( ForbiddenException e )
{ {
assertEquals( 403, e.getStatus() ); assertEquals( 403, e.getResponse().getStatus() );
throw e; throw e;
} }
} }
@Test ( expected = ServerWebApplicationException.class ) @Test( expected = ForbiddenException.class )
public void deleteWithRepoNull() public void deleteWithRepoNull()
throws Exception throws Exception
{ {
@ -121,9 +122,9 @@ public class RepositoriesServiceTest
repositoriesService.deleteArtifact( artifact ); repositoriesService.deleteArtifact( artifact );
} }
catch ( ServerWebApplicationException e ) catch ( ForbiddenException e )
{ {
assertEquals( "not http 400 status", 400, e.getStatus() ); assertEquals( "not http 400 status", 400, e.getResponse().getStatus() );
throw e; throw e;
} }
} }

View File

@ -104,6 +104,13 @@ public class SecuritySystemStub
return result; return result;
} }
@Override
public AuthorizationResult authorize( User user, String permission, String resource )
throws AuthorizationException
{
return null;
}
public String getAuthenticatorId() public String getAuthenticatorId()
{ {
return null; return null;

View File

@ -767,61 +767,12 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId> <artifactId>cxf-rt-frontend-jaxrs</artifactId>
<exclusions> </dependency>
<exclusion>
<groupId>org.eclipse.jetty</groupId> <dependency>
<artifactId>jetty-server</artifactId> <groupId>org.apache.cxf</groupId>
</exclusion> <artifactId>cxf-rt-rs-extension-providers</artifactId>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-continuation</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-security</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-javamail_1.4_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-stax-api_1.0_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-activation_1.1_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>

View File

@ -82,6 +82,8 @@ public class BypassSecuritySystem
return new AuthorizationResult( true, session.getUser(), null ); return new AuthorizationResult( true, session.getUser(), null );
} }
@Override @Override
public String getAuthenticatorId() public String getAuthenticatorId()
{ {

40
pom.xml
View File

@ -71,7 +71,7 @@
<redback.registry.version>2.4-SNAPSHOT</redback.registry.version> <redback.registry.version>2.4-SNAPSHOT</redback.registry.version>
<redback.spring-utils.version>2.1</redback.spring-utils.version> <redback.spring-utils.version>2.1</redback.spring-utils.version>
<redback.taskqueue.version>2.1</redback.taskqueue.version> <redback.taskqueue.version>2.1</redback.taskqueue.version>
<slf4j.version>1.7.7</slf4j.version> <slf4j.version>1.7.10</slf4j.version>
<log4j.version>2.1</log4j.version> <log4j.version>2.1</log4j.version>
<spring.version>4.1.4.RELEASE</spring.version> <spring.version>4.1.4.RELEASE</spring.version>
@ -85,7 +85,7 @@
<sirona.version>0.1-incubating</sirona.version> <sirona.version>0.1-incubating</sirona.version>
<cxfVersion>2.6.15</cxfVersion> <cxf.version>3.0.3</cxf.version>
<derbyVersion>10.10.1.1</derbyVersion> <derbyVersion>10.10.1.1</derbyVersion>
<httpclient.version>4.3.6</httpclient.version> <httpclient.version>4.3.6</httpclient.version>
<httpclient.core.version>4.4</httpclient.core.version> <httpclient.core.version>4.4</httpclient.core.version>
@ -562,22 +562,20 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId> <artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxfVersion}</version> <version>${cxf.version}</version>
<exclusions> </dependency>
<exclusion>
<groupId>org.eclipse.jetty</groupId> <dependency>
<artifactId>jetty-server</artifactId> <groupId>org.apache.cxf</groupId>
</exclusion> <artifactId>cxf-rt-rs-client</artifactId>
<exclusion> <version>${cxf.version}</version>
<groupId>commons-logging</groupId> </dependency>
<artifactId>commons-logging</artifactId>
</exclusion> <dependency>
<exclusion> <groupId>org.apache.cxf</groupId>
<groupId>org.codehaus.jettison</groupId> <artifactId>cxf-rt-rs-extension-providers</artifactId>
<artifactId>jettison</artifactId> <version>${cxf.version}</version>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.archiva</groupId> <groupId>org.apache.archiva</groupId>
@ -1261,6 +1259,12 @@
<version>${slf4j.version}</version> <version>${slf4j.version}</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>commons-logging</groupId> <groupId>commons-logging</groupId>