From 45248a93901bbdac018a172a9f1db956cba876bf Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 26 May 2016 15:32:55 +0200 Subject: [PATCH] SONAR-7587 end of support of Java 7 - Upgrade to parent 34, which compiles with java 8 and disable javadoc lints - Compilation with java 8 on Travis - Fix ambiguities in assertJ --- .travis.yml | 2 +- pom.xml | 11 +++++------ .../java/org/sonar/server/issue/IssueUpdaterTest.java | 6 +++--- .../java/org/sonar/server/search/BaseDocTest.java | 10 +++++----- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3b0b5e83b6..eb304c809d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: java sudo: false install: true -jdk: oraclejdk7 +jdk: oraclejdk8 script: ./travis.sh env: diff --git a/pom.xml b/pom.xml index 8385b4f9ac6..2896622c35c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.sonarsource.parent parent - 31 + 34 org.sonarsource.sonarqube sonarqube @@ -74,7 +74,6 @@ UTF-8 3.2 - 1.7 ${maven.build.timestamp} yyyy-MM-dd'T'HH:mm:ssZ SonarQube @@ -803,12 +802,12 @@ org.assertj assertj-core - 2.0.0 + 3.4.1 org.assertj assertj-guava - 1.3.1 + 3.0.0 xpp3 @@ -1141,7 +1140,7 @@ maven-enforcer-plugin - enforce-java7 + enforce-java8 enforce @@ -1150,7 +1149,7 @@ To release this project JDK ${jdk.min.version} is required. - [1.7,) + [${jdk.min.version},) diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java index 2c35227264d..a7c94979f0a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java @@ -250,7 +250,7 @@ public class IssueUpdaterTest { issue.setLocations("[1-3]"); boolean updated = updater.setLocations(issue, "[1-4]"); assertThat(updated).isTrue(); - assertThat(issue.getLocations()).isEqualTo("[1-4]"); + assertThat(issue.getLocations().toString()).isEqualTo("[1-4]"); assertThat(issue.currentChange()).isNull(); assertThat(issue.mustSendNotifications()).isFalse(); } @@ -260,7 +260,7 @@ public class IssueUpdaterTest { issue.setLocations("[1-3]"); boolean updated = updater.setLocations(issue, "[1-3]"); assertThat(updated).isFalse(); - assertThat(issue.getLocations()).isEqualTo("[1-3]"); + assertThat(issue.getLocations().toString()).isEqualTo("[1-3]"); assertThat(issue.currentChange()).isNull(); assertThat(issue.mustSendNotifications()).isFalse(); } @@ -270,7 +270,7 @@ public class IssueUpdaterTest { issue.setLocations(null); boolean updated = updater.setLocations(issue, "[1-4]"); assertThat(updated).isTrue(); - assertThat(issue.getLocations()).isEqualTo("[1-4]"); + assertThat(issue.getLocations().toString()).isEqualTo("[1-4]"); assertThat(issue.currentChange()).isNull(); assertThat(issue.mustSendNotifications()).isFalse(); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java index 53bea5371f3..d694b16ff18 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java @@ -40,9 +40,9 @@ public class BaseDocTest { BaseDoc doc = new BaseDoc(fields) { }; - assertThat(doc.getNullableField("a_string")).isEqualTo("foo"); - assertThat(doc.getNullableField("a_int")).isEqualTo(42); - assertThat(doc.getNullableField("a_null")).isNull(); + assertThat((String) doc.getNullableField("a_string")).isEqualTo("foo"); + assertThat((int) doc.getNullableField("a_int")).isEqualTo(42); + assertThat((String) doc.getNullableField("a_null")).isNull(); } @Test @@ -61,7 +61,7 @@ public class BaseDocTest { @Test public void getFieldAsDate() { - BaseDoc doc = new BaseDoc(Maps.newHashMap()) { + BaseDoc doc = new BaseDoc(Maps.newHashMap()) { }; long now = System.currentTimeMillis(); doc.setField("javaDate", new Date(now)); @@ -73,7 +73,7 @@ public class BaseDocTest { @Test public void getNullableFieldAsDate() { - BaseDoc doc = new BaseDoc(Maps.newHashMap()) { + BaseDoc doc = new BaseDoc(Maps.newHashMap()) { }; long now = System.currentTimeMillis(); doc.setField("javaDate", new Date(now)); -- 2.39.5