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

Update projet 2024

parent 437c4b08
No related branches found
No related tags found
No related merge requests found
Showing
with 117 additions and 72 deletions
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
.gradle/
.idea/
build/**/
*.iml
*.ipr
*.iws
### IntelliJ IDEA ###
.idea
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
\ No newline at end of file
# TP 1 : tests boîte noire
# TP 2 : tests unitaires et couverture de test
Les exécutables à tester sont dans le répertoire `executables`.
Les fichiers images correspondant au cas de test sont à mettre dans le répertoire `ìmages`.
Les commandes gradle les plus utiles :
- `gradle test` pour lancer les tests (rapports dans `build/reports/tests/test`),
- `gradle jacocoTestReport` pour lancer la couverture de code via l'outil [Jacoco](https://www.eclemma.org/jacoco/) (rapport accessible en html à `build/reports/jacoco/test/html/index.html`).
Pour lancer les tests, il suffit d'utiliser la commande :
Le fichier `build.gradle` contient la configuration du projet avec notamment la définition de la classe contenant la méthode `main` à exécuter pour l'application.
```bash
gradle run
```
## Membre(s) du projet
- NOM, prénom du premier membre du projet
- NOM, prénom du deuxième membre du projet (optionnel)
plugins {
id("java")
}
group = "fr.univ_amu.m1info"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.4")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.4")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.assertj:assertj-core:3.27.0")
}
tasks.test {
useJUnitPlatform()
}
File moved
No preview for this file type
#Tue Dec 05 18:16:17 CET 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
......@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
......@@ -80,13 +80,13 @@ do
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
......@@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
......@@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
......
rootProject.name = 'tp_1_test_blackbox'
rootProject.name = 'tp_1_unit_test_and_coverage'
# TP 2 : tests unitaires et couverture de test
# Projet
Modèle de projet gradle pour les tests unitaires avec mock grace à [Mockito](https://site.mockito.org/).
Les commandes gradle les plus utiles :
- `gradle test` pour lancer les tests (rapports dans `build/reports/tests/test`),
- `gradle jacocoTestReport` pour lancer la couverture de code via l'outil [Jacoco](https://www.eclemma.org/jacoco/) (rapport accessible en html à `build/reports/jacoco/test/html/index.html`).
- `gradle run` pour lancer le programme,
- `gradle jacocoTestReport` pour lancer la couverture de code via l'outil [Jacoco](https://www.eclemma.org/jacoco/) (rapports dans `build/reports/jacoco/test`).
Le fichier `build.gradle` contient la configuration du projet avec notamment la définition de la classe contenant la méthode `main` à exécuter pour l'application.
Le projet est configuré (via le fichier `.gitlab-ci.yml`) pour produire un jar et lancer les tests sur le serveur à chaque *push*. Si la suite de tests échoue, vous recevrez un mail avec `Failed pipeline` dans l'intitulé de la part d'etulab.
## Membre(s) du projet
- NOM, prénom du premier membre du projet
- NOM, prénom du deuxième membre du projet (optionnel)
plugins {
id 'java'
id 'application'
id 'jacoco'
}
group 'fr.univ_amu'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation("org.assertj:assertj-core:3.24.2")
}
test {
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required = true
}
}
test {
useJUnitPlatform()
}
plugins {
id("java")
id("jacoco")
}
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.4")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.4")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.assertj:assertj-core:3.27.0")
testImplementation("org.mockito:mockito-core:5.15.2")
}
tasks.test {
finalizedBy("jacocoTestReport")
}
tasks.jacocoTestReport {
dependsOn("test")
reports {
xml.required = true
html.outputLocation = layout.buildDirectory.dir("jacocoHtml")
}
}
tasks.test {
useJUnitPlatform()
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
rootProject.name = 'tp_2_unit_test_and_coverage'
rootProject.name = 'tp_2_mocking'
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment