From 6c238f65f378d06b6e39667698617438ab2bbd9c Mon Sep 17 00:00:00 2001 From: arnaudlabourel <arnaud.labourel@univ-amu.fr> Date: Wed, 6 Sep 2023 09:41:54 +0200 Subject: [PATCH] Update 2023 --- .gitignore | 81 ++--------------------- build.gradle | 10 +-- src/test/java/mandelbrot/ComplexTest.java | 18 ++++- 3 files changed, 29 insertions(+), 80 deletions(-) diff --git a/.gitignore b/.gitignore index 033f6e1..c923efa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,76 +1,9 @@ -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format +.gradle/ +.idea/ +idea/ +build/ +*.iml +*.ipr *.iws - -# IntelliJ +gradle/wrapper/gradle-wrapper.jar out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - - diff --git a/build.gradle b/build.gradle index 2516ce0..d8cedee 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'application' - id "org.openjfx.javafxplugin" version "0.0.13" + id "org.openjfx.javafxplugin" version "0.0.14" } sourceCompatibility = JavaVersion.VERSION_17 @@ -10,7 +10,7 @@ group 'M2_DLAD_AMU' version '0.1-SNAPSHOT' javafx { - version = "18.0.2" + version = "20" modules = [ 'javafx.controls', 'javafx.fxml' ] } @@ -19,9 +19,9 @@ repositories { } 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') + testImplementation('org.junit.jupiter:junit-jupiter-api:5.10.0', + 'org.assertj:assertj-core:3.24.2') + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0' } test { diff --git a/src/test/java/mandelbrot/ComplexTest.java b/src/test/java/mandelbrot/ComplexTest.java index ba5474d..512e943 100644 --- a/src/test/java/mandelbrot/ComplexTest.java +++ b/src/test/java/mandelbrot/ComplexTest.java @@ -1,5 +1,6 @@ package mandelbrot; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.*; @@ -27,14 +28,15 @@ public class ComplexTest { } @Test + @Disabled void testEquals(){ - assertThat(onePlusI).isEqualTo(onePlusI); assertThat(onePlusI).isEqualTo(new Complex(1, 1)); assertThat(onePlusI).isNotEqualTo(oneMinusI); assertThat(two).isNotEqualTo(twoI); } @Test + @Disabled void testGetReal(){ assertThat(two.getReal()).isCloseTo(2., within(Helpers.EPSILON)); assertThat(onePlusI.getReal()).isCloseTo(1., within(Helpers.EPSILON)); @@ -43,6 +45,7 @@ public class ComplexTest { } @Test + @Disabled void testGetImaginary(){ assertThat(two.getImaginary()).isCloseTo(0., within(Helpers.EPSILON)); assertThat(onePlusI.getImaginary()).isCloseTo(1., within(Helpers.EPSILON)); @@ -50,22 +53,26 @@ public class ComplexTest { } @Test + @Disabled void testOne(){ assertThat(Complex.ONE.getReal()).isCloseTo(1., within(Helpers.EPSILON)); assertThat(Complex.ONE.getImaginary()).isCloseTo(0., within(Helpers.EPSILON)); } @Test + @Disabled void testI(){ assertThat(Complex.I.getReal()).isCloseTo(0., within(Helpers.EPSILON)); assertThat(Complex.I.getImaginary()).isCloseTo(1., within(Helpers.EPSILON)); } @Test + @Disabled void testZero(){ assertThat(Complex.ZERO.getReal()).isCloseTo(0., within(Helpers.EPSILON)); assertThat(Complex.ZERO.getImaginary()).isCloseTo(0., within(Helpers.EPSILON)); } @Test + @Disabled void testNegate(){ assertThat(two.negate()).isEqualTo(new Complex(-2,0)); assertThat(minusI.negate()).isEqualTo(i); @@ -73,6 +80,7 @@ public class ComplexTest { } @Test + @Disabled void testReciprocal(){ assertThat(one.reciprocal()).isEqualTo(one); assertThat(minusI.reciprocal()).isEqualTo(i); @@ -81,12 +89,14 @@ public class ComplexTest { } @Test + @Disabled void testReciprocalOfZero(){ assertThatExceptionOfType(ArithmeticException.class) .isThrownBy(()->zero.reciprocal()); } @Test + @Disabled void testDivide(){ assertThat(onePlusI.divide(Complex.ONE)).isEqualTo(onePlusI); assertThat(Complex.ONE.divide(two)).isEqualTo(new Complex(0.5, 0)); @@ -94,18 +104,21 @@ public class ComplexTest { } @Test + @Disabled void testDivideByZero(){ assertThatExceptionOfType(ArithmeticException.class) .isThrownBy(()->one.divide(zero)); } @Test + @Disabled void testConjugate(){ assertThat(two.conjugate()).isEqualTo(two); assertThat(oneMinusI.conjugate()).isEqualTo(onePlusI); } @Test + @Disabled void testRotation(){ assertThat(Complex.rotation(Math.PI/2)).isEqualTo(i); assertThat(Complex.rotation(-Math.PI/2)).isEqualTo(minusI); @@ -115,12 +128,14 @@ public class ComplexTest { } @Test + @Disabled void testBasicToString(){ assertThat(two.toString()).contains("2.0"); assertThat(i.toString()).contains("i"); } @Test + @Disabled void testToStringFormat(){ assertThat(oneMinusI.toString()).isEqualTo("1.0 - 1.0i"); assertThat(onePlusI.toString()).isEqualTo("1.0 + 1.0i"); @@ -130,6 +145,7 @@ public class ComplexTest { } @Test + @Disabled void testAdd(){ assertThat(i.add(i)).isEqualTo(twoI); assertThat(one.add(i)).isEqualTo(onePlusI); -- GitLab