import gestionProc.ProcessusFactory; import gestionProc.Processus; import gestionProc.ProcessusList; import gestionProc.ProcessusFIFO; import gestionProc.ProcessusPrio; import gestionProc.PlusDePlaceException; public class Test { public static void main(String args[]) { System.out.println("Tests avec FIFO"); ProcessusList plist = new ProcessusFIFO(); testerListe(plist); System.out.println("Tests avec Prio"); plist = new ProcessusPrio(); testerListe(plist); } private static void testerListe(ProcessusList plist) { ProcessusFactory fac = new ProcessusFactory(); // Tests de Processus Processus p1 = null; Processus p2 = null; Processus p3 = null; try { p1 = fac.creerProcessus(10); p2 = fac.creerProcessus(5); p3 = fac.creerProcessus(1); } catch ( PlusDePlaceException e ) { System.out.println("fuck"); } // Proc manuel Processus pman; //pman = new Processus(-10, "3995"); //pman = new Processus(1000, "3995"); //pman = new Processus(1, "395"); //pman = new Processus(1, "39A5"); pman = new Processus(1, "3995"); // Tests de ProcessusList System.out.println("Liste vide ? : " + plist.empty()); /* Tentative d'ajout de deux procs */ System.out.println("ajout de processus..."); plist.ajouterProcessus(p1); //plist.ajouterProcessus(p1); plist.ajouterProcessus(p2); System.out.println("Taille (= 2) : " + plist.nbElem()); System.out.println("Liste : " + plist); System.out.println("Contient proc1 (oui) : " + plist.contientProcessus(p1)); System.out.println("Contient proc3 (non) : " + plist.contientProcessus(p3)); System.out.println("Retrait de processus..."); plist.retirerProcessus(); plist.retirerProcessus(); //plist.retirerProcessus(); } }