From ef31ea104d0c6f6c3c0014f038b5b919305a4507 Mon Sep 17 00:00:00 2001 From: arnaudlabourel <arnaud.labourel@univ-amu.fr> Date: Fri, 15 Sep 2023 17:21:14 +0200 Subject: [PATCH] =?UTF-8?q?mise=20=C3=A0=20jour=20config=20junit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 27 ++++++++++++++++-------- gradle/wrapper/gradle-wrapper.properties | 2 +- src/test/java/ByteGrayColorTest.java | 6 ++++++ src/test/java/MatrixGrayImageTest.java | 5 ++++- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index aeb540c..26fe882 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,14 @@ plugins { + id 'java' id 'application' - id "org.openjfx.javafxplugin" version "0.0.13" + id "org.openjfx.javafxplugin" version "0.0.14" } +group 'M2_BIO_INFO' +version '1.0-SNAPSHOT' + javafx { - version = "17" + version = "20" modules = [ 'javafx.controls', 'javafx.fxml' ] } @@ -12,16 +16,21 @@ repositories { mavenCentral() } -dependencies { - testImplementation('org.junit.jupiter:junit-jupiter-api:5.9.0', - 'org.assertj:assertj-core:3.23.1') - testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.9.0') -} - test { useJUnitPlatform() } +dependencies { + testRuntimeOnly("org.junit.platform:junit-platform-launcher") { + because("Only needed to run tests in a version of IntelliJ IDEA that bundles older versions") + } + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") + testImplementation("org.assertj:assertj-core:3.24.2") + testImplementation("org.junit.jupiter:junit-jupiter:5.10.0") +} + + + application { - mainClassName = "Main" + mainClass.set("Main") } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..db9a6b8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/test/java/ByteGrayColorTest.java b/src/test/java/ByteGrayColorTest.java index 2f05626..673439d 100644 --- a/src/test/java/ByteGrayColorTest.java +++ b/src/test/java/ByteGrayColorTest.java @@ -1,9 +1,11 @@ +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.*; public class ByteGrayColorTest { @Test + @Disabled public void testGetLuminosity_whenColorCreatedWithGrayLevel(){ ByteGrayColor black = new ByteGrayColor(0); ByteGrayColor white = new ByteGrayColor(255); @@ -12,6 +14,7 @@ public class ByteGrayColorTest { } @Test + @Disabled public void testGetLuminosity_whenColorCreatedWithLuminosity(){ ByteGrayColor color1 = new ByteGrayColor(.25); ByteGrayColor color2 = new ByteGrayColor(.75); @@ -20,6 +23,7 @@ public class ByteGrayColorTest { } @Test + @Disabled public void testCompareTo_whenColorsCreatedWithGrayLevel(){ ByteGrayColor color1 = new ByteGrayColor(100); ByteGrayColor color2 = new ByteGrayColor(150); @@ -34,6 +38,7 @@ public class ByteGrayColorTest { } @Test + @Disabled public void testCompareTo_whenColorsCreatedWithLuminosity(){ ByteGrayColor color1 = new ByteGrayColor(0.20); ByteGrayColor color2 = new ByteGrayColor(0.60); @@ -48,6 +53,7 @@ public class ByteGrayColorTest { } @Test + @Disabled public void testCompareTo_whenColorsCreatedWithLuminosityAndGrayLevel(){ ByteGrayColor color1 = new ByteGrayColor(0.); ByteGrayColor color2 = new ByteGrayColor(150); diff --git a/src/test/java/MatrixGrayImageTest.java b/src/test/java/MatrixGrayImageTest.java index a08520d..cd5da0b 100644 --- a/src/test/java/MatrixGrayImageTest.java +++ b/src/test/java/MatrixGrayImageTest.java @@ -1,11 +1,12 @@ +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.*; -import static org.assertj.core.api.Assertions.assertThat; class MatrixGrayImageTest { @Test + @Disabled void testGetWidth() { assertThat(new MatrixGrayImage(0,0).getWidth()).isEqualTo(0); assertThat(new MatrixGrayImage(10,20).getWidth()).isEqualTo(10); @@ -13,6 +14,7 @@ class MatrixGrayImageTest { } @Test + @Disabled void testGetHeight() { assertThat(new MatrixGrayImage(0,0).getHeight()).isEqualTo(0); assertThat(new MatrixGrayImage(10,20).getHeight()).isEqualTo(20); @@ -20,6 +22,7 @@ class MatrixGrayImageTest { } @Test + @Disabled void testGetPixel_whenPixelHasBeenSet() { GrayColor grey1 = new ByteGrayColor(0.2); GrayColor grey2 = new ByteGrayColor(0.8); -- GitLab