Skip to content
Snippets Groups Projects
Commit 6c238f65 authored by LABOUREL Arnaud's avatar LABOUREL Arnaud
Browse files

Update 2023

parent fbf0dac7
No related branches found
No related tags found
No related merge requests found
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider .gradle/
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 .idea/
idea/
# User-specific stuff build/
.idea/**/workspace.xml *.iml
.idea/**/tasks.xml *.ipr
.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
*.iws *.iws
gradle/wrapper/gradle-wrapper.jar
# IntelliJ
out/ 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
plugins { plugins {
id 'application' id 'application'
id "org.openjfx.javafxplugin" version "0.0.13" id "org.openjfx.javafxplugin" version "0.0.14"
} }
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17
...@@ -10,7 +10,7 @@ group 'M2_DLAD_AMU' ...@@ -10,7 +10,7 @@ group 'M2_DLAD_AMU'
version '0.1-SNAPSHOT' version '0.1-SNAPSHOT'
javafx { javafx {
version = "18.0.2" version = "20"
modules = [ 'javafx.controls', 'javafx.fxml' ] modules = [ 'javafx.controls', 'javafx.fxml' ]
} }
...@@ -19,9 +19,9 @@ repositories { ...@@ -19,9 +19,9 @@ repositories {
} }
dependencies { dependencies {
testImplementation('org.junit.jupiter:junit-jupiter-api:5.9.0', testImplementation('org.junit.jupiter:junit-jupiter-api:5.10.0',
'org.assertj:assertj-core:3.23.1') 'org.assertj:assertj-core:3.24.2')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.9.0') testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
} }
test { test {
......
package mandelbrot; package mandelbrot;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assertions.*;
...@@ -27,14 +28,15 @@ public class ComplexTest { ...@@ -27,14 +28,15 @@ public class ComplexTest {
} }
@Test @Test
@Disabled
void testEquals(){ void testEquals(){
assertThat(onePlusI).isEqualTo(onePlusI);
assertThat(onePlusI).isEqualTo(new Complex(1, 1)); assertThat(onePlusI).isEqualTo(new Complex(1, 1));
assertThat(onePlusI).isNotEqualTo(oneMinusI); assertThat(onePlusI).isNotEqualTo(oneMinusI);
assertThat(two).isNotEqualTo(twoI); assertThat(two).isNotEqualTo(twoI);
} }
@Test @Test
@Disabled
void testGetReal(){ void testGetReal(){
assertThat(two.getReal()).isCloseTo(2., within(Helpers.EPSILON)); assertThat(two.getReal()).isCloseTo(2., within(Helpers.EPSILON));
assertThat(onePlusI.getReal()).isCloseTo(1., within(Helpers.EPSILON)); assertThat(onePlusI.getReal()).isCloseTo(1., within(Helpers.EPSILON));
...@@ -43,6 +45,7 @@ public class ComplexTest { ...@@ -43,6 +45,7 @@ public class ComplexTest {
} }
@Test @Test
@Disabled
void testGetImaginary(){ void testGetImaginary(){
assertThat(two.getImaginary()).isCloseTo(0., within(Helpers.EPSILON)); assertThat(two.getImaginary()).isCloseTo(0., within(Helpers.EPSILON));
assertThat(onePlusI.getImaginary()).isCloseTo(1., within(Helpers.EPSILON)); assertThat(onePlusI.getImaginary()).isCloseTo(1., within(Helpers.EPSILON));
...@@ -50,22 +53,26 @@ public class ComplexTest { ...@@ -50,22 +53,26 @@ public class ComplexTest {
} }
@Test @Test
@Disabled
void testOne(){ void testOne(){
assertThat(Complex.ONE.getReal()).isCloseTo(1., within(Helpers.EPSILON)); assertThat(Complex.ONE.getReal()).isCloseTo(1., within(Helpers.EPSILON));
assertThat(Complex.ONE.getImaginary()).isCloseTo(0., within(Helpers.EPSILON)); assertThat(Complex.ONE.getImaginary()).isCloseTo(0., within(Helpers.EPSILON));
} }
@Test @Test
@Disabled
void testI(){ void testI(){
assertThat(Complex.I.getReal()).isCloseTo(0., within(Helpers.EPSILON)); assertThat(Complex.I.getReal()).isCloseTo(0., within(Helpers.EPSILON));
assertThat(Complex.I.getImaginary()).isCloseTo(1., within(Helpers.EPSILON)); assertThat(Complex.I.getImaginary()).isCloseTo(1., within(Helpers.EPSILON));
} }
@Test @Test
@Disabled
void testZero(){ void testZero(){
assertThat(Complex.ZERO.getReal()).isCloseTo(0., within(Helpers.EPSILON)); assertThat(Complex.ZERO.getReal()).isCloseTo(0., within(Helpers.EPSILON));
assertThat(Complex.ZERO.getImaginary()).isCloseTo(0., within(Helpers.EPSILON)); assertThat(Complex.ZERO.getImaginary()).isCloseTo(0., within(Helpers.EPSILON));
} }
@Test @Test
@Disabled
void testNegate(){ void testNegate(){
assertThat(two.negate()).isEqualTo(new Complex(-2,0)); assertThat(two.negate()).isEqualTo(new Complex(-2,0));
assertThat(minusI.negate()).isEqualTo(i); assertThat(minusI.negate()).isEqualTo(i);
...@@ -73,6 +80,7 @@ public class ComplexTest { ...@@ -73,6 +80,7 @@ public class ComplexTest {
} }
@Test @Test
@Disabled
void testReciprocal(){ void testReciprocal(){
assertThat(one.reciprocal()).isEqualTo(one); assertThat(one.reciprocal()).isEqualTo(one);
assertThat(minusI.reciprocal()).isEqualTo(i); assertThat(minusI.reciprocal()).isEqualTo(i);
...@@ -81,12 +89,14 @@ public class ComplexTest { ...@@ -81,12 +89,14 @@ public class ComplexTest {
} }
@Test @Test
@Disabled
void testReciprocalOfZero(){ void testReciprocalOfZero(){
assertThatExceptionOfType(ArithmeticException.class) assertThatExceptionOfType(ArithmeticException.class)
.isThrownBy(()->zero.reciprocal()); .isThrownBy(()->zero.reciprocal());
} }
@Test @Test
@Disabled
void testDivide(){ void testDivide(){
assertThat(onePlusI.divide(Complex.ONE)).isEqualTo(onePlusI); assertThat(onePlusI.divide(Complex.ONE)).isEqualTo(onePlusI);
assertThat(Complex.ONE.divide(two)).isEqualTo(new Complex(0.5, 0)); assertThat(Complex.ONE.divide(two)).isEqualTo(new Complex(0.5, 0));
...@@ -94,18 +104,21 @@ public class ComplexTest { ...@@ -94,18 +104,21 @@ public class ComplexTest {
} }
@Test @Test
@Disabled
void testDivideByZero(){ void testDivideByZero(){
assertThatExceptionOfType(ArithmeticException.class) assertThatExceptionOfType(ArithmeticException.class)
.isThrownBy(()->one.divide(zero)); .isThrownBy(()->one.divide(zero));
} }
@Test @Test
@Disabled
void testConjugate(){ void testConjugate(){
assertThat(two.conjugate()).isEqualTo(two); assertThat(two.conjugate()).isEqualTo(two);
assertThat(oneMinusI.conjugate()).isEqualTo(onePlusI); assertThat(oneMinusI.conjugate()).isEqualTo(onePlusI);
} }
@Test @Test
@Disabled
void testRotation(){ void testRotation(){
assertThat(Complex.rotation(Math.PI/2)).isEqualTo(i); assertThat(Complex.rotation(Math.PI/2)).isEqualTo(i);
assertThat(Complex.rotation(-Math.PI/2)).isEqualTo(minusI); assertThat(Complex.rotation(-Math.PI/2)).isEqualTo(minusI);
...@@ -115,12 +128,14 @@ public class ComplexTest { ...@@ -115,12 +128,14 @@ public class ComplexTest {
} }
@Test @Test
@Disabled
void testBasicToString(){ void testBasicToString(){
assertThat(two.toString()).contains("2.0"); assertThat(two.toString()).contains("2.0");
assertThat(i.toString()).contains("i"); assertThat(i.toString()).contains("i");
} }
@Test @Test
@Disabled
void testToStringFormat(){ void testToStringFormat(){
assertThat(oneMinusI.toString()).isEqualTo("1.0 - 1.0i"); assertThat(oneMinusI.toString()).isEqualTo("1.0 - 1.0i");
assertThat(onePlusI.toString()).isEqualTo("1.0 + 1.0i"); assertThat(onePlusI.toString()).isEqualTo("1.0 + 1.0i");
...@@ -130,6 +145,7 @@ public class ComplexTest { ...@@ -130,6 +145,7 @@ public class ComplexTest {
} }
@Test @Test
@Disabled
void testAdd(){ void testAdd(){
assertThat(i.add(i)).isEqualTo(twoI); assertThat(i.add(i)).isEqualTo(twoI);
assertThat(one.add(i)).isEqualTo(onePlusI); assertThat(one.add(i)).isEqualTo(onePlusI);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment