From d3355a0ce4c0ac4c0457c6c698f83ec932345ab2 Mon Sep 17 00:00:00 2001 From: Plotnikov Andrey Date: Mon, 28 Oct 2019 10:29:39 +0300 Subject: [PATCH 1/4] Build optimizations Migration to JaCoCo plugin instead Codehaus --- pom.xml | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index aabb658..9a009a1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ ru.shemplo chat.neerc - 0.1.17 + 0.1.18 jar @@ -13,8 +13,8 @@ 1.8 1.8 - 5.2.0 - 1.2.0 + 5.5.2 + 1.5.2 @@ -88,16 +88,23 @@ - org.codehaus.mojo - cobertura-maven-plugin - 2.7 - - - html - xml - - - + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + + prepare-agent + + + + report + test + + report + + + From 6422ce45020337cfe4fa10121f5957e0e29b0e83 Mon Sep 17 00:00:00 2001 From: Plotnikov Andrey Date: Mon, 28 Oct 2019 10:51:15 +0300 Subject: [PATCH 2/4] Versions of JUnit library updated --- pom.xml | 28 +++++++++---------- .../neerc/test/TestConfigurationReader.java | 16 +++++++++++ .../shemplo/chat/neerc/test/package-info.java | 8 ++++++ 3 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 src/test/java/ru/shemplo/chat/neerc/test/TestConfigurationReader.java create mode 100644 src/test/java/ru/shemplo/chat/neerc/test/package-info.java diff --git a/pom.xml b/pom.xml index 9a009a1..99c8b10 100644 --- a/pom.xml +++ b/pom.xml @@ -72,20 +72,17 @@ maven-surefire-plugin - 2.21.0 - - - org.junit.platform - junit-platform-surefire-provider - ${junit.platform.version} - - + 2.22.2 **/*Test*.java + + maven-failsafe-plugin + 2.22.2 + org.jacoco @@ -110,18 +107,19 @@ - + org.junit.jupiter - junit-jupiter-engine - ${junit.jupiter.version} + junit-jupiter-api + 5.5.2 + test - - org.junit.platform - junit-platform-runner - ${junit.platform.version} + org.junit.jupiter + junit-jupiter-engine + 5.5.2 test + org.projectlombok lombok diff --git a/src/test/java/ru/shemplo/chat/neerc/test/TestConfigurationReader.java b/src/test/java/ru/shemplo/chat/neerc/test/TestConfigurationReader.java new file mode 100644 index 0000000..72bfa39 --- /dev/null +++ b/src/test/java/ru/shemplo/chat/neerc/test/TestConfigurationReader.java @@ -0,0 +1,16 @@ +package ru.shemplo.chat.neerc.test; + +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; + +import ru.shemplo.chat.neerc.config.ConfigStorage; + +public class TestConfigurationReader { + + @Test + public void test () { + ConfigStorage storage = ConfigStorage.shapeConfigStorage (); + assertEquals ("test", storage.get ("login").orElse (null)); + } + +} diff --git a/src/test/java/ru/shemplo/chat/neerc/test/package-info.java b/src/test/java/ru/shemplo/chat/neerc/test/package-info.java new file mode 100644 index 0000000..2db5e1c --- /dev/null +++ b/src/test/java/ru/shemplo/chat/neerc/test/package-info.java @@ -0,0 +1,8 @@ +/** + * + */ +/** + * @author Shemplo + * + */ +package ru.shemplo.chat.neerc.test; From 9ae533f1dd3ada36288fa537b6b07ee06c6c664e Mon Sep 17 00:00:00 2001 From: Plotnikov Andrey Date: Mon, 28 Oct 2019 10:58:14 +0300 Subject: [PATCH 3/4] Cobertura removed --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e138746..ae037d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ deploy: branch: master script: - - mvn clean package cobertura:cobertura + - mvn clean package after_success: - echo "Build was successful. $TRAVIS_TEST_RESULT" From 0496cbd571fb36bd71cc0cc119a911c61a6ddb53 Mon Sep 17 00:00:00 2001 From: Plotnikov Andrey Date: Mon, 28 Oct 2019 12:25:25 +0300 Subject: [PATCH 4/4] Migration to JRE12 --- .travis.yml | 2 +- pom.xml | 25 +++++++++++++++++-- .../chat/neerc/RunNeercChatClient.java | 10 +++++++- .../shemplo/chat/neerc/gfx/WindowManager.java | 2 +- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ae037d0..6536404 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: java -jdk: openjdk8 +jdk: openjdk12 sudo: false services: diff --git a/pom.xml b/pom.xml index 99c8b10..ecd70a0 100644 --- a/pom.xml +++ b/pom.xml @@ -10,8 +10,8 @@ UTF-8 - 1.8 - 1.8 + 12 + 12 5.5.2 1.5.2 @@ -107,6 +107,27 @@ + + org.openjfx + javafx-base + 12.0.2 + + + org.openjfx + javafx-controls + 12.0.2 + + + org.openjfx + javafx-fxml + 12.0.2 + + + org.openjfx + javafx-graphics + 12.0.2 + + org.junit.jupiter junit-jupiter-api diff --git a/src/main/java/ru/shemplo/chat/neerc/RunNeercChatClient.java b/src/main/java/ru/shemplo/chat/neerc/RunNeercChatClient.java index e4de23a..3b3d81c 100644 --- a/src/main/java/ru/shemplo/chat/neerc/RunNeercChatClient.java +++ b/src/main/java/ru/shemplo/chat/neerc/RunNeercChatClient.java @@ -2,14 +2,22 @@ import javafx.application.Application; import lombok.Getter; +import lombok.extern.slf4j.Slf4j; import ru.shemplo.chat.neerc.gfx.ClientAdapter; import ru.shemplo.chat.neerc.gfx.WindowManager; import ru.shemplo.chat.neerc.network.ConnectionService; import ru.shemplo.snowball.annot.Snowflake; import ru.shemplo.snowball.annot.processor.Snowball; +@Slf4j public class RunNeercChatClient extends Snowball { + /* + * TODO: change sequence of initializations + * Now it's: Snowball.shape () -> Application.launch () + * Project: Application.launch () -> Snowball.shape () + */ + public static void main (String... args) { shape (args); } private ConnectionService connectionService; @@ -29,7 +37,7 @@ protected void onShaped (String ... args) { while (!window.isInitialized ()) {} // Waiting for initialization of graphics connectionService.connect (); /* First auto connection */ - } catch (Exception es) { es.printStackTrace(); } + } catch (Exception | Error es) { log.error (es.getMessage ()); } } } diff --git a/src/main/java/ru/shemplo/chat/neerc/gfx/WindowManager.java b/src/main/java/ru/shemplo/chat/neerc/gfx/WindowManager.java index 3eeba11..e3bddff 100644 --- a/src/main/java/ru/shemplo/chat/neerc/gfx/WindowManager.java +++ b/src/main/java/ru/shemplo/chat/neerc/gfx/WindowManager.java @@ -142,7 +142,7 @@ public void switchScene (ClientScene scene) { boolean listenerWasNull = sceneHolder == null; this.sceneHolder = scene.getHolder (); if (listenerWasNull) { - synchronized (this) { this.notify (); } + synchronized (this) { this.notifyAll (); } } }