Un peu de documentation
This commit is contained in:
parent
2b784817b1
commit
feb31e48f5
@ -12,7 +12,10 @@ import fr.univ_amu.iut.model.*;
|
|||||||
public class DataMain {
|
public class DataMain {
|
||||||
|
|
||||||
|
|
||||||
// A executer une seule fois, pour populate la base de données
|
/*
|
||||||
|
Code utilitaire que nous avons utilisé pendant le développement de l'application, afin de remplir la base de donnée
|
||||||
|
**SUPPRIMER LES TABLES DE LA BASE DE DONNEES AVANT D'EXECUTER**
|
||||||
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
DAOFactory daoFactory = DAOFactoryProducer.getFactory(DAOType.JPA);
|
DAOFactory daoFactory = DAOFactoryProducer.getFactory(DAOType.JPA);
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
package fr.univ_amu.iut;
|
package fr.univ_amu.iut;
|
||||||
|
|
||||||
public class Launcher {
|
public class Launcher {
|
||||||
|
|
||||||
|
/*
|
||||||
|
Déployer l'application au travers d'un fichier .jar exécutable nous demandait
|
||||||
|
une classe main sans extends (sans lien avec JavaFX)
|
||||||
|
*/
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
AppMain.main(args);
|
AppMain.main(args);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package fr.univ_amu.iut.dao.factory;
|
package fr.univ_amu.iut.dao.factory;
|
||||||
|
|
||||||
import fr.univ_amu.iut.dao.jpa.DAOFactoryJPA;
|
import fr.univ_amu.iut.dao.jpa.DAOFactoryJPA;
|
||||||
import fr.univ_amu.iut.test.DAOFactoryTest;
|
import fr.univ_amu.iut.dao.test.DAOFactoryTest;
|
||||||
|
|
||||||
public class DAOFactoryProducer {
|
public class DAOFactoryProducer {
|
||||||
public static DAOFactory getFactory(DAOType type) {
|
public static DAOFactory getFactory(DAOType type) {
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
package fr.univ_amu.iut.secret;
|
package fr.univ_amu.iut.secret;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
SecretProvider : API permettant de vérifier si le mot de passe entré est le bon
|
||||||
|
Nous avons fait une interface afin de pouvoir créer facilement d'autres implémentations dans le futur
|
||||||
|
(comme par exemple une implémentation faisant une requête web pour vérifier le mot de passe auprès d'un serveur)
|
||||||
|
*/
|
||||||
public interface SecretProvider {
|
public interface SecretProvider {
|
||||||
|
|
||||||
static SecretProvider getInstance(){
|
static SecretProvider getInstance(){
|
||||||
|
@ -17,5 +17,5 @@ open module francefx {
|
|||||||
exports fr.univ_amu.iut;
|
exports fr.univ_amu.iut;
|
||||||
exports fr.univ_amu.iut.dao;
|
exports fr.univ_amu.iut.dao;
|
||||||
exports fr.univ_amu.iut.dao.factory;
|
exports fr.univ_amu.iut.dao.factory;
|
||||||
exports fr.univ_amu.iut.test;
|
exports fr.univ_amu.iut.dao.test;
|
||||||
}
|
}
|
@ -11,6 +11,13 @@ import org.junit.jupiter.api.Test;
|
|||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Tests unitaires servants à tester le backend JPA de l'application
|
||||||
|
On utilise un JPA modifié (une persistenceUnit différente)
|
||||||
|
afin de faire une base de données en mémoire*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
public class BackendTest {
|
public class BackendTest {
|
||||||
|
|
||||||
private static DAOFactory daoFactory;
|
private static DAOFactory daoFactory;
|
||||||
@ -110,6 +117,10 @@ public class BackendTest {
|
|||||||
assertThat(list.get(0).getNom()).isEqualTo("Second usage");
|
assertThat(list.get(0).getNom()).isEqualTo("Second usage");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
On essaye d'insérer la même donnée de nouveau (2 fois pour être sûr,
|
||||||
|
après tout les tests sont faits pour vérifier que l'application est robuste)
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void should_not_insert_again(){
|
public void should_not_insert_again(){
|
||||||
daoFactory.createDAOThematique().insert(Thematique.ExpressionOrale);
|
daoFactory.createDAOThematique().insert(Thematique.ExpressionOrale);
|
||||||
|
Loading…
Reference in New Issue
Block a user