10 Commits

Author SHA1 Message Date
6e8f63e2c0 Actualiser .gitignore 2025-09-26 10:36:52 +02:00
sio
22bce1d53b màj javadoc 2025-09-26 09:45:12 +02:00
6ec5d152eb Merge pull request 'màj LivreValidTest.java' (#3) from Prof into developpement
Reviewed-on: #3
2025-09-26 08:58:04 +02:00
sio
f1571ced27 màj LivreValidTest.java 2025-09-26 08:56:57 +02:00
ca3338fe1a Merge pull request 'Prof' (#2) from Prof into developpement
Reviewed-on: #2
2025-09-26 08:38:36 +02:00
sio
0eac6c497d nouveau message choix 2025-09-26 08:36:50 +02:00
sio
980fc1cc7c nouveau message choix 2025-09-26 08:35:00 +02:00
bec1ca9f04 Merge pull request 'master' (#1) from master into developpement
Reviewed-on: #1
2025-09-24 21:35:51 +02:00
fd2f9066b7 màj pour version initialeV2 2025-09-24 21:25:32 +02:00
d92fa2649e màj pour version initialeV2 2025-09-24 18:14:21 +02:00
12 changed files with 136 additions and 33 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/target/
*.xml

View File

@@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>GestionBibliotheque</artifactId>
<artifactId>bibliotheque</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
@@ -19,7 +19,6 @@
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<!-- Configuration du build -->
@@ -29,10 +28,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.1.2</version>
</plugin>
</plugins>
</build>
<name>GestionBibliotheque</name>
</project>

View File

@@ -11,7 +11,7 @@ package com.mycompany.bibliotheque.Contrôle;
public class LivreValide {
// 1. ISBN : exactement 13 chiffres
public static boolean isValidIsbn(String isbn) {
// TODO: implémenter la validation
// TODO Emile: implémenter la validation
return false;
}
@@ -29,7 +29,13 @@ public class LivreValide {
// 4. Titre : longueur maximale 200 caractères
public static boolean isLongueurTitreValid(String titre) {
// TODO: implémenter la validation
// TODO Morgann: implémenter la validation
return false;
}
// 5. Titre : non null et au moins 2 caractères
public static boolean isContenuTitreValide(String titre) {
// TODO Steve: implémenter la validation
return false;
}
}

View File

@@ -1,19 +1,21 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.mycompany.bibliotheque;
/**
* Classe principale
* @author dthev
*/
import com.mycompany.bibliotheque.Métier.Bibliotheque;
import com.mycompany.bibliotheque.Métier.Emprunt;
import com.mycompany.bibliotheque.Métier.Utilisateur;
import com.mycompany.bibliotheque.Métier.Livre;
import java.util.Scanner;
/**
*
* @author dthev
*/
public class GestionBibliotheque {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
@@ -25,10 +27,10 @@ public class GestionBibliotheque {
System.out.println("Bienvenue dans la bibliothèque !");
while (choix!=4){
System.out.println("1. Afficher un livre");
System.out.println("3. Ajouter un livre");
System.out.println("2. Ajouter un livre");
System.out.println("3. Afficher les livres");
System.out.println("4. Quitter");
System.out.println("Votre choix : ");
System.out.print("Merci de faire votre choix : ");
choix = sc.nextInt();
switch (choix) {
case 1 :

View File

@@ -8,7 +8,7 @@ import java.util.ArrayList;
import java.util.List;
/**
*
* Classe métier
* @author dthev
*/
public class Bibliotheque {
@@ -17,6 +17,7 @@ public class Bibliotheque {
// 5. ISBN doit être unique
public boolean addLivre(Livre b) {
//ajoute b si valide et si n'existe pas - à écrire
lesLivres.add(b);
return false;
}

View File

@@ -4,11 +4,16 @@
*/
package com.mycompany.bibliotheque.Métier;
import com.mycompany.bibliotheque.Métier.Utilisateur;
import com.mycompany.bibliotheque.Métier.Livre;
/**
*
* @author dthev
*/
public class Emprunt {
// TODO: logique métier d'emprunt
public static boolean effectuerEmprunt(Utilisateur u, Livre l) {
if (l.isEmprunte()) {

View File

@@ -5,9 +5,8 @@
package com.mycompany.bibliotheque.Métier;
/**
* Classe métier qui gère les livres
* @author dthev
*
* @author dthev
*/
public class Livre {

View File

@@ -4,14 +4,15 @@
*/
package com.mycompany.bibliotheque.Métier;
import com.mycompany.bibliotheque.Métier.Livre;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author dthev
*/
import com.mycompany.bibliotheque.Métier.Livre;
import java.util.ArrayList;
import java.util.List;
public class Utilisateur {
private String nom;
private List<Livre> emprunts;

View File

@@ -2,8 +2,10 @@
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/JUnit4TestClass.java to edit this template
*/
package com.mycompany.bibliotheque.Métier;
package com.mycompany.bibliotheque;
import com.mycompany.bibliotheque.Métier.Bibliotheque;
import com.mycompany.bibliotheque.Métier.Livre;
import java.util.List;
import org.junit.Before;
import org.junit.Test;

View File

@@ -2,16 +2,13 @@
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/JUnit4TestClass.java to edit this template
*/
package com.mycompany.bibliotheque.Métier;
package com.mycompany.bibliotheque;
import com.mycompany.bibliotheque.Métier.Livre;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author dthev
*/
public class LivreTest {
@Test
public void testCreationLivre() {
@@ -19,7 +16,7 @@ public void testCreationLivre() {
assertNotNull(b);
assertEquals("1984", b.getTitre());
assertEquals("George Orwell", b.getAuteur()); // corrigé
assertEquals("George Orwel", b.getAuteur()); // corrigé
assertEquals("1234567890123", b.getIsbn());
assertFalse(b.isEmprunte()); // si la méthode existe
}

View File

@@ -2,8 +2,9 @@
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/JUnit4TestClass.java to edit this template
*/
package com.mycompany.bibliotheque.Contrôle;
package com.mycompany.bibliotheque;
import com.mycompany.bibliotheque.Contrôle.LivreValide;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
@@ -23,6 +24,7 @@ public class LivreValideTest {
/**
* Test of isValidIsbn method, of class LivreValide.
* @author Emile
*/
@Test
public void testIsValidIsbn() {
@@ -37,6 +39,7 @@ public class LivreValideTest {
/**
* Test of isValidTitre method, of class LivreValide.
* @author Salomé/Emile
*/
@Test
public void testIsValidTitre() {
@@ -51,6 +54,7 @@ public class LivreValideTest {
/**
* Test of isValidAuteur method, of class LivreValide.
* @author Medhi/Steve
*/
@Test
public void testIsValidAuteur() {
@@ -65,6 +69,7 @@ public class LivreValideTest {
/**
* Test of isLongueurTitreValid method, of class LivreValide.
* @author Morgann
*/
@Test
public void testIsLongueurTitreValid() {
@@ -77,4 +82,19 @@ public class LivreValideTest {
fail("The test case is a prototype.");
}
/**
* Test of isTitreValid method, of class LivreValide.
* @author Steve
*/
@Test
public void testIsContenuTitreValide() {
System.out.println("isTitreValid");
String titre = "";
boolean expResult = false;
boolean result = LivreValide.isContenuTitreValide(titre);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}

View File

@@ -0,0 +1,70 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/JUnit4TestClass.java to edit this template
*/
package com.mycompany.bibliotheque;
import com.mycompany.bibliotheque.Métier.Utilisateur;
import com.mycompany.bibliotheque.Métier.Livre;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author dthev
*/
public class UtilisateurTest {
public UtilisateurTest() {
}
@Before
public void setUp() {
}
/**
* Test of getNom method, of class Utilisateur.
*/
@Test
public void testGetNom() {
System.out.println("getNom");
Utilisateur instance = null;
String expResult = "";
String result = instance.getNom();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of getEmprunts method, of class Utilisateur.
*/
@Test
public void testGetEmprunts() {
System.out.println("getEmprunts");
Utilisateur instance = null;
List<Livre> expResult = null;
List<Livre> result = instance.getEmprunts();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of emprunterLivre method, of class Utilisateur.
*/
@Test
public void testEmprunterLivre() {
System.out.println("emprunterLivre");
Livre livre = null;
Utilisateur instance = null;
boolean expResult = false;
boolean result = instance.emprunterLivre(livre);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}