Skip to content

Commit

Permalink
qquechose
Browse files Browse the repository at this point in the history
  • Loading branch information
ltearno committed Nov 14, 2017
1 parent 151ebd0 commit 4af5397
Show file tree
Hide file tree
Showing 40 changed files with 41 additions and 9 deletions.
20 changes: 12 additions & 8 deletions formation-programmation-java/cours/slides-javaee.ad
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ Un ensemble d'annotations (package `org.junit`) est utilisé pour configurer une
|Méthode exécutée avant et après chaque test
|===

=== Annotations
=== JUnit 4 - Annotations

[cols="2*"]
|===
Expand All @@ -1416,7 +1416,12 @@ Un ensemble d'annotations (package `org.junit`) est utilisé pour configurer une

|`@Ignore`
|Ignore un test
|===

=== JUnit 4 - Annotations

[cols="2*"]
|===
|`@Test(expected=SQLException.class)`
|Le test échoue si l'exception n'est pas levée

Expand Down Expand Up @@ -1492,15 +1497,14 @@ l'application dans un environnement _équivalent_ à celui de production (base d

_Arquillian_ (http://arquillian.org/invasion/[site]) est un outil qui facilite la mise en place des tests d'intégration :

- Gère le lancement et l'arrêt d'un AS complet.
- Produit une archive contenant le code à tester à la volée.
- Déploie l'archive dans le conteneur de test.
- Exécute les tests d'intégration.
- Produit un rapport d'exécution.
- Produit une archive contenant le code à tester
- Gère le lancement et l'arrêt d'un AS complet
- Déploie l'archive dans le conteneur de test
- Exécute les tests d'intégration

S'intègre à `JUnit` et `TestNG`.
S'intègre à `JUnit` et `TestNG` pour exécuter les tests.

Avantanges : on n'a plus besoin de mocker les dépendances, tout est en place !
Avantanges : on n'a plus besoin de mocker les dépendances.

Inconvénients : lent puisque qu'on bootstrappe tout l'environnement de l'application.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
<modelVersion>4.0.0</modelVersion>

<groupId>fr.lteconsulting.training</groupId>
<artifactId>movie-db</artifactId>
<artifactId>jpa-101</artifactId>
<version>1.0-SNAPSHOT</version>

<name>jpa-101</name>

<packaging>war</packaging>

<properties>
Expand All @@ -17,6 +19,7 @@
<maven.compiler.target>1.8</maven.compiler.target>

<version.wildfly>11.0.0.Final</version.wildfly>
<version.arquillian>1.1.13.Final</version.arquillian>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -44,6 +47,12 @@
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package fr.lteconsulting.training.moviedb;

import fr.lteconsulting.training.moviedb.ejb.GestionCategories;
import fr.lteconsulting.training.moviedb.model.Categorie;
import org.junit.Assert;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class GestionCategoriesTest {
@Test
public void testGestionCategorie() {
GestionCategories gestionCategories = new GestionCategories();

gestionCategories.add(new Categorie());

assertTrue(true);
}
}

0 comments on commit 4af5397

Please sign in to comment.