Comment lancer les tests ?
Bonjour,
Dans notre pom.xml
nous avons la dépendance junit
, le plugin surefire
, et notre dossier de test
est bien positionné.
Pourtant le plugin surefire
ne lance pas notre test JPATest.java
et écrit No tests to run.
sur la sortie.
En comparant notre pom.xml
avec ceux des projets d'autre UEs, nous ne trouvons pas la raison à ce problème.
Comment faire pour lancer nos tests unitaire ?
Merci d'avance !
-
junit
dans lepom.xml
:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
-
surefire
dans lepom.xml
:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
- Position de notre dossier
test/
dans un arbre (simplifié) du projet :
.
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ │ ├── config
│ │ │ │ └── checkstyle.xml
│ │ │ └── fr
│ │ │ └── univ
│ │ │ └── lyon1
│ │ │ └── m1if10
│ │ │ └── gr02
│ │ │ └── razed
│ │ │ └── berries
│ │ │ └── outflow
│ │ │ ├── modele
│ │ │ │ └── Hello.java
│ │ │ └── servlet
│ │ ├── resources
│ │ │ └── META-INF
│ │ │ └── persistence.xml
│ │ └── webapp
│ │ ├── index.jsp
│ │ └── WEB-INF
│ │ └── web.xml
│ └── test
│ └── fr
│ └── univ
│ └── lyon1
│ └── m1if10
│ └── gr02
│ └── razed
│ └── berries
│ └── outflow
│ └── java
│ └── JPATest.java