diff --git a/pom.xml b/pom.xml index 45a52f3c..da8f481d 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 4.1.4.RELEASE - 1.7.7 + 1.7.10 2.1 UTF-8 @@ -663,7 +663,7 @@ junit junit - 4.11 + 4.12 xmlunit @@ -673,7 +673,7 @@ org.assertj assertj-core - 1.6.0 + 1.7.1 @@ -739,6 +739,7 @@ maven-surefire-plugin -Xmx256m -Xms256m + alphabetical diff --git a/redback-integrations/redback-rest/redback-rest-services/pom.xml b/redback-integrations/redback-rest/redback-rest-services/pom.xml index 5bd18df9..d7c21ccf 100644 --- a/redback-integrations/redback-rest/redback-rest-services/pom.xml +++ b/redback-integrations/redback-rest/redback-rest-services/pom.xml @@ -175,6 +175,19 @@ test + + org.apache.logging.log4j + log4j-core + ${log4j2Version} + test + + + + org.slf4j + jul-to-slf4j + test + + org.hsqldb hsqldb @@ -237,7 +250,7 @@ org.apache.archiva.redback.users;version=${project.version}, org.apache.commons.io;version="[1.4,2)", org.apache.commons.lang;version="[2.6,3)", - org.apache.cxf*;version="[3.0.3)", + org.apache.cxf*;version="[3.0.3,4)", com.fasterxml.jackson.databind;version="[2.2,3)", org.codehaus.plexus.util;version="[3,4)", org.springframework*;version="[3,4)", diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/AbstractInterceptor.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/AbstractInterceptor.java index 040f3814..45b30312 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/AbstractInterceptor.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/AbstractInterceptor.java @@ -37,7 +37,7 @@ import java.lang.reflect.Method; public abstract class AbstractInterceptor { - private Logger log = LoggerFactory.getLogger( getClass() ); + private final Logger log = LoggerFactory.getLogger( getClass() ); @Context private HttpServletRequest httpServletRequest; diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/AuthenticationInterceptor.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/AuthenticationInterceptor.java index 8489aefe..ae16637f 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/AuthenticationInterceptor.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/AuthenticationInterceptor.java @@ -71,7 +71,7 @@ public class AuthenticationInterceptor @Named(value = "httpAuthenticator#basic") private HttpBasicAuthentication httpAuthenticator; - private Logger log = LoggerFactory.getLogger( getClass() ); + private final Logger log = LoggerFactory.getLogger( getClass() ); public void filter( ContainerRequestContext containerRequestContext ) { diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/DebugJAXRSInInterceptor.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/DebugJAXRSInInterceptor.java index 994db065..340d6a17 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/DebugJAXRSInInterceptor.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/DebugJAXRSInInterceptor.java @@ -26,7 +26,8 @@ import org.apache.cxf.message.Message; * @author Olivier Lamy * @since 1.3 */ -public class DebugJAXRSInInterceptor extends JAXRSInInterceptor +public class DebugJAXRSInInterceptor + extends JAXRSInInterceptor { @Override public void handleMessage( Message message ) diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/PermissionsInterceptor.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/PermissionsInterceptor.java index be877dbb..23fba4ad 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/PermissionsInterceptor.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/PermissionsInterceptor.java @@ -62,7 +62,7 @@ public class PermissionsInterceptor @Named( value = "httpAuthenticator#basic" ) private HttpBasicAuthentication httpAuthenticator; - private Logger log = LoggerFactory.getLogger( getClass() ); + private final Logger log = LoggerFactory.getLogger( getClass() ); public void filter( ContainerRequestContext containerRequestContext ) { @@ -151,6 +151,7 @@ public class PermissionsInterceptor { log.debug( "user {} not authenticated", securitySession.getUser().getUsername() ); } + return; } } else diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/ThreadLocalUserCleaner.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/ThreadLocalUserCleaner.java index d938938d..861ef0cf 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/ThreadLocalUserCleaner.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/interceptors/ThreadLocalUserCleaner.java @@ -32,17 +32,19 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.ws.rs.core.Response; +import javax.ws.rs.ext.Provider; /** * @author Olivier Lamy * @since 1.4 */ @Service( "threadLocalUserCleaner#rest" ) +@Provider public class ThreadLocalUserCleaner extends AbstractPhaseInterceptor implements PhaseInterceptor { - private Logger log = LoggerFactory.getLogger( getClass() ); + private final Logger log = LoggerFactory.getLogger( getClass() ); public ThreadLocalUserCleaner( String phase ) { diff --git a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/AbstractRestServicesTest.java b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/AbstractRestServicesTest.java index b0240c53..806f3220 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/AbstractRestServicesTest.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/AbstractRestServicesTest.java @@ -41,6 +41,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.slf4j.bridge.SLF4JBridgeHandler; import org.springframework.web.context.ContextLoaderListener; import javax.ws.rs.core.MediaType; @@ -98,6 +99,10 @@ public abstract class AbstractRestServicesTest throws Exception { + SLF4JBridgeHandler.removeHandlersForRootLogger(); + + SLF4JBridgeHandler.install(); + tomcat = new Tomcat(); tomcat.setBaseDir( System.getProperty( "java.io.tmpdir" ) ); tomcat.setPort( 0 ); diff --git a/redback-integrations/redback-rest/redback-rest-services/src/test/resources/log4j2-test.xml b/redback-integrations/redback-rest/redback-rest-services/src/test/resources/log4j2-test.xml index 8496a73a..33521cfd 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/test/resources/log4j2-test.xml +++ b/redback-integrations/redback-rest/redback-rest-services/src/test/resources/log4j2-test.xml @@ -17,24 +17,26 @@ ~ specific language governing permissions and limitations ~ under the License. --> + - - - + + - - - + + + + +