ok
This commit is contained in:
@@ -17,8 +17,8 @@ public class TestTexteMNP{
|
||||
// i.e. entre les versions non persistantes (qui terminent par NP) et votre implémentation éventuelle persistante, le seul changement de comportement devrait être la persistance.
|
||||
//
|
||||
|
||||
System.out.println("Test de l\'API");
|
||||
System.out.print("Création des étudiants");
|
||||
////System.out.println("Test de l\'API");
|
||||
//System.out.print("Création des étudiants");
|
||||
MaFenetre fenetre=new MaFenetre();
|
||||
fenetre.setVisible(true);
|
||||
Etudiant e1=new EtudiantNP("césar","lycurgus");
|
||||
@@ -32,7 +32,7 @@ public class TestTexteMNP{
|
||||
Etudiant e9=new EtudiantNP("renard","elikapeka");
|
||||
Etudiant e10=new EtudiantNP("achille","haukea");
|
||||
|
||||
System.out.print(".");
|
||||
//System.out.print(".");
|
||||
|
||||
Etudiant e11=new EtudiantNP("agathe","iakopa");
|
||||
Etudiant e12=new EtudiantNP("sabine","spartacus");
|
||||
@@ -45,7 +45,7 @@ public class TestTexteMNP{
|
||||
Etudiant e19=new EtudiantNP("diane","ladislas");
|
||||
Etudiant e20=new EtudiantNP("christine","mahatma");
|
||||
|
||||
System.out.print(".");
|
||||
//System.out.print(".");
|
||||
|
||||
Etudiant e21=new EtudiantNP("francine","napoleon");
|
||||
Etudiant e22=new EtudiantNP("louise","lalita");
|
||||
@@ -58,7 +58,7 @@ public class TestTexteMNP{
|
||||
Etudiant e29=new EtudiantNP("jacqueline","madhav");
|
||||
Etudiant e30=new EtudiantNP("denise","turlough");
|
||||
|
||||
System.out.print(".");
|
||||
//System.out.print(".");
|
||||
|
||||
Etudiant e31=new EtudiantNP("gabrielle","uaithne");
|
||||
Etudiant e32=new EtudiantNP("julie","uilleag");
|
||||
@@ -71,7 +71,7 @@ public class TestTexteMNP{
|
||||
Etudiant e39=new EtudiantNP("jeanine","javed");
|
||||
Etudiant e40=new EtudiantNP("roxane","naveed");
|
||||
|
||||
System.out.print(".");
|
||||
//System.out.print(".");
|
||||
|
||||
Etudiant e41=new EtudiantNP("adeline","shahnaz");
|
||||
Etudiant e42=new EtudiantNP("dion","ardashir");
|
||||
@@ -84,7 +84,7 @@ public class TestTexteMNP{
|
||||
Etudiant e49=new EtudiantNP("natalie","marcellino");
|
||||
Etudiant e50=new EtudiantNP("aline","mariangela");
|
||||
|
||||
System.out.print(".");
|
||||
//System.out.print(".");
|
||||
|
||||
Etudiant e51=new EtudiantNP("prosper","marzio");
|
||||
Etudiant e52=new EtudiantNP("mirabelle","massimiliano");
|
||||
@@ -94,17 +94,17 @@ public class TestTexteMNP{
|
||||
Etudiant e56=new EtudiantNP("evette","michela");
|
||||
Etudiant e57=new EtudiantNP("gisselle","michelangela");
|
||||
|
||||
System.out.println("terminé.");
|
||||
////System.out.println("terminé.");
|
||||
|
||||
System.out.print("Création de l\'usine à groupe");
|
||||
//System.out.print("Création de l\'usine à groupe");
|
||||
AbstractGroupeFactory agf = new AbstractGroupeFactoryNP("BUT2 FI", 15, 92);
|
||||
System.out.println("terminé.");
|
||||
////System.out.println("terminé.");
|
||||
|
||||
System.out.print("Création de l\'usine à changement");
|
||||
//System.out.print("Création de l\'usine à changement");
|
||||
AbstractChangementFactory acf = new AbstractChangementFactoryNP(agf);
|
||||
System.out.println("terminé.");
|
||||
////System.out.println("terminé.");
|
||||
|
||||
System.out.print("Ajout des étudiants dans le groupe de la promotion racine");
|
||||
//System.out.print("Ajout des étudiants dans le groupe de la promotion racine");
|
||||
|
||||
agf.addToGroupe(agf.getPromotion(),e1);
|
||||
agf.addToGroupe(agf.getPromotion(),e2);
|
||||
@@ -117,7 +117,7 @@ public class TestTexteMNP{
|
||||
agf.addToGroupe(agf.getPromotion(),e9);
|
||||
agf.addToGroupe(agf.getPromotion(),e10);
|
||||
|
||||
System.out.print(".");
|
||||
////System.out.print(".");
|
||||
|
||||
agf.addToGroupe(agf.getPromotion(),e11);
|
||||
agf.addToGroupe(agf.getPromotion(),e12);
|
||||
@@ -130,7 +130,7 @@ public class TestTexteMNP{
|
||||
agf.addToGroupe(agf.getPromotion(),e19);
|
||||
agf.addToGroupe(agf.getPromotion(),e20);
|
||||
|
||||
System.out.print(".");
|
||||
//System.out.print(".");
|
||||
|
||||
agf.addToGroupe(agf.getPromotion(),e21);
|
||||
agf.addToGroupe(agf.getPromotion(),e22);
|
||||
@@ -152,7 +152,7 @@ public class TestTexteMNP{
|
||||
agf.addToGroupe(agf.getPromotion(),e38);
|
||||
agf.addToGroupe(agf.getPromotion(),e39);
|
||||
|
||||
System.out.print(".");
|
||||
//System.out.print(".");
|
||||
|
||||
agf.addToGroupe(agf.getPromotion(),e40);
|
||||
agf.addToGroupe(agf.getPromotion(),e41);
|
||||
@@ -172,49 +172,51 @@ public class TestTexteMNP{
|
||||
agf.addToGroupe(agf.getPromotion(),e55);
|
||||
agf.addToGroupe(agf.getPromotion(),e56);
|
||||
agf.addToGroupe(agf.getPromotion(),e57);
|
||||
System.out.println("terminé.");
|
||||
////System.out.println("terminé.");
|
||||
|
||||
System.out.println("Initialisation complète.");
|
||||
////System.out.println("Initialisation complète.");
|
||||
|
||||
System.out.println("==========================");
|
||||
System.out.println("Le groupe promotion");
|
||||
System.out.println(agf.getPromotion().monPrint());
|
||||
////System.out.println("==========================");
|
||||
////System.out.println("Le groupe promotion");
|
||||
////System.out.println(agf.getPromotion().monPrint());
|
||||
|
||||
System.out.println("==========================");
|
||||
System.out.println("Partition du groupe racine en 3 groupes TD.");
|
||||
////System.out.println("==========================");
|
||||
////System.out.println("Partition du groupe racine en 3 groupes TD.");
|
||||
agf.createPartition(agf.getPromotion(), "TD",4);
|
||||
//System.out.println(agf.getPromotion().monPrint());
|
||||
//////System.out.println(agf.getPromotion().monPrint());
|
||||
|
||||
Groupe racineDeLaPartition = agf.getPromotion().getSousGroupes().iterator().next();
|
||||
System.out.println(racineDeLaPartition.monPrint());
|
||||
////System.out.println(racineDeLaPartition.monPrint());
|
||||
|
||||
System.out.println("== Cette version ajoute les étudiants automatiquement pour une partition ");
|
||||
////System.out.println("== Cette version ajoute les étudiants automatiquement pour une partition ");
|
||||
for(Groupe g : racineDeLaPartition.getSousGroupes()){
|
||||
System.out.println(g.monPrint());
|
||||
////System.out.println(g.monPrint());
|
||||
}
|
||||
|
||||
System.out.println("==========================");
|
||||
System.out.println("Création d'un changement");
|
||||
////System.out.println("==========================");
|
||||
////System.out.println("Création d'un changement");
|
||||
Iterator<Groupe> itgr = racineDeLaPartition.getSousGroupes().iterator();
|
||||
Groupe A = itgr.next(); // premier sous-groupe
|
||||
Groupe B = itgr.next(); // second sous-groupe
|
||||
fenetre.addGroupe(B);
|
||||
System.out.println(B.getName());
|
||||
B = itgr.next(); // troisième sous-groupe
|
||||
Etudiant e = A.getEtudiants().iterator().next();// premier étudiant du premier sous-groupe.
|
||||
acf.createChangement(A,e,B);
|
||||
System.out.println("Récupération des changements (en fait un seul pour l'instant)");
|
||||
////System.out.println("Récupération des changements (en fait un seul pour l'instant)");
|
||||
Iterator<Changement> itch = acf.getAllChangements().iterator();
|
||||
Changement c = itch.next();
|
||||
System.out.println(c.monPrint());
|
||||
System.out.println("Application du changement");
|
||||
////System.out.println(c.monPrint());
|
||||
////System.out.println("Application du changement");
|
||||
acf.applyChangement(c);
|
||||
System.out.println("==========================");
|
||||
System.out.println("== nouveau contenu des groupes de la partition ");
|
||||
////System.out.println("==========================");
|
||||
////System.out.println("== nouveau contenu des groupes de la partition ");
|
||||
for(Groupe g : racineDeLaPartition.getSousGroupes()){
|
||||
System.out.println(g.monPrint());
|
||||
////System.out.println(g.monPrint());
|
||||
}
|
||||
|
||||
System.out.println("==========================");
|
||||
System.out.println("Création de 2 changements");
|
||||
////System.out.println("==========================");
|
||||
////System.out.println("Création de 2 changements");
|
||||
itgr = racineDeLaPartition.getSousGroupes().iterator();
|
||||
A = itgr.next(); // premier sous-groupe
|
||||
B = itgr.next(); // second sous-groupe
|
||||
@@ -224,14 +226,14 @@ public class TestTexteMNP{
|
||||
acf.createChangement(B,etu2,A);
|
||||
// Impression des changements.
|
||||
for (Changement cgt : acf.getAllChangements()){
|
||||
System.out.println(cgt.monPrint());
|
||||
////System.out.println(cgt.monPrint());
|
||||
}
|
||||
itch = acf.getAllChangements().iterator();
|
||||
c = itch.next();
|
||||
System.out.println("Suppression d'un changement. Il reste :");
|
||||
////System.out.println("Suppression d'un changement. Il reste :");
|
||||
acf.deleteChangement(itch.next());
|
||||
for (Changement cgt : acf.getAllChangements()){
|
||||
System.out.println(cgt.monPrint());
|
||||
////System.out.println(cgt.monPrint());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user