Skip to content

Commit

Permalink
Update to Java 8 compatibility
Browse files Browse the repository at this point in the history
* Spring IO Athens-BUILD-SNAPSHOT -> Cairo-BUILD-SNAPSHOT
* CGLib 3.1 -> 3.2.5 latest release Issue related to ASM cglib/cglib#20
* AssertJ 2.2.0 -> 3.6.2 latest release
* PowerMock 1.6.2 -> 1.6.5 latest release is 1.6.6 but has regression Issue powermock/powermock#717
* Update maven-compiler-plugin source/target to 1.8
  • Loading branch information
jgrandja committed Apr 7, 2017
1 parent 8a05548 commit 2b81983
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package org.springframework.security.core;

import org.junit.Test;

import java.io.DataInputStream;
import java.io.InputStream;

import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

/**
Expand All @@ -29,7 +29,7 @@
*/
public class JavaVersionTests {

private static final int JDK6_CLASS_VERSION = 50;
private static final int JDK8_CLASS_VERSION = 52;

@Test
public void authenticationCorrectJdkCompatibility() throws Exception {
Expand All @@ -45,7 +45,7 @@ private void assertClassVersion(Class<?> clazz) throws Exception {
data.readInt();
data.readShort(); // minor
int major = data.readShort();
assertThat(major).isEqualTo(JDK6_CLASS_VERSION);
assertThat(major).isEqualTo(JDK8_CLASS_VERSION);
}
finally {
try {
Expand Down
11 changes: 6 additions & 5 deletions gradle/javaprojects.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ apply plugin: 'javadocHotfix'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'

sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 1.8
targetCompatibility = 1.8

ext.apacheDsVersion = '1.5.5'
ext.aspectjVersion = '1.8.4'
ext.casClientVersion = '3.4.1'
ext.cglibVersion = '3.1'
ext.cglibVersion = '3.2.5'
ext.commonsCodecVersion = '1.10'
ext.commonsCollectionsVersion = '3.2.2'
ext.commonsLoggingVersion = '1.2'
Expand All @@ -27,7 +27,7 @@ ext.jettyVersion = '6.1.26'
ext.jstlVersion = '1.2.1'
ext.junitVersion = '4.12'
ext.logbackVersion = '1.1.2'
ext.powerMockVersion = '1.6.2'
ext.powerMockVersion = '1.6.5'
ext.seleniumVersion = '2.44.0'
ext.servletApiVersion = '3.1.0'
ext.slf4jVersion = '1.7.7'
Expand All @@ -41,6 +41,7 @@ ext.thymeleafVersion = '3.0.2.RELEASE'
ext.jsonassertVersion = '1.3.0'
ext.validationApiVersion = '1.1.0.Final'


ext.spockDependencies = [
dependencies.create("org.spockframework:spock-spring:$spockVersion") {
exclude group: 'junit', module: 'junit-dep'
Expand Down Expand Up @@ -148,7 +149,7 @@ dependencies {
testCompile "junit:junit:$junitVersion",
'org.mockito:mockito-core:1.10.19',
"org.springframework:spring-test:$springVersion",
'org.assertj:assertj-core:2.2.0'
'org.assertj:assertj-core:3.6.2'

// Use slf4j/logback for logging
testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion",
Expand Down
11 changes: 8 additions & 3 deletions gradle/maven-deployment.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ def customizePom(pom, gradleProject) {
developer {
id = 'rwinch'
name = 'Rob Winch'
email = 'rwinch@gopivotal.com'
email = 'rwinch@pivotal.io'
}
developer {
id = 'jgrandja'
name = 'Joe Grandja'
email = 'jgrandja@pivotal.io'
}
}

Expand Down Expand Up @@ -113,8 +118,8 @@ def customizePom(pom, gradleProject) {
.appendNode('plugin')
.appendNode('artifactId','maven-compiler-plugin').parent()
.appendNode('configuration')
.appendNode('source','1.7').parent()
.appendNode('target','1.7')
.appendNode('source','1.8').parent()
.appendNode('target','1.8')
if(isWar) {
plugins
.appendNode('plugin')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ public void run() {
DelegatingSecurityContextRunnable wrappedRunnable = (DelegatingSecurityContextRunnable) runnableCaptor
.getValue();
assertThat(
WhiteboxImpl.getInternalState(wrappedRunnable, "delegateSecurityContext"))
WhiteboxImpl.<SecurityContext>getInternalState(wrappedRunnable, "delegateSecurityContext"))
.isEqualTo(context);
assertThat(WhiteboxImpl.getInternalState(wrappedRunnable, "delegate"))
assertThat(WhiteboxImpl.<SecurityContext>getInternalState(wrappedRunnable, "delegate"))
.isEqualTo(runnable);
}

Expand Down Expand Up @@ -361,9 +361,9 @@ public void run() {
DelegatingSecurityContextRunnable wrappedRunnable = (DelegatingSecurityContextRunnable) runnableCaptor
.getValue();
assertThat(
WhiteboxImpl.getInternalState(wrappedRunnable, "delegateSecurityContext"))
WhiteboxImpl.<SecurityContext>getInternalState(wrappedRunnable, "delegateSecurityContext"))
.isEqualTo(context);
assertThat(WhiteboxImpl.getInternalState(wrappedRunnable, "delegate"))
assertThat(WhiteboxImpl.<SecurityContext>getInternalState(wrappedRunnable, "delegate"))
.isEqualTo(runnable);
}

Expand Down Expand Up @@ -392,9 +392,9 @@ public void run() {
DelegatingSecurityContextRunnable wrappedRunnable = (DelegatingSecurityContextRunnable) runnableCaptor
.getValue();
assertThat(
WhiteboxImpl.getInternalState(wrappedRunnable, "delegateSecurityContext"))
WhiteboxImpl.<SecurityContext>getInternalState(wrappedRunnable, "delegateSecurityContext"))
.isEqualTo(context);
assertThat(WhiteboxImpl.getInternalState(wrappedRunnable, "delegate"))
assertThat(WhiteboxImpl.<SecurityContext>getInternalState(wrappedRunnable, "delegate"))
.isEqualTo(runnable);
}

Expand Down

0 comments on commit 2b81983

Please sign in to comment.