Corrections travail en groupe

This commit is contained in:
2008-02-24 18:26:02 +00:00
parent 459770e802
commit 6bae365791

View File

@@ -44,12 +44,16 @@ public class UserManagerTest {
um = (IUserManager) context.lookup("UserManagerBean/remote"); um = (IUserManager) context.lookup("UserManagerBean/remote");
am = (IArticleManager) context.lookup("ArticleManagerBean/remote"); am = (IArticleManager) context.lookup("ArticleManagerBean/remote");
cm = (IConferenceManager) context.lookup("ConferenceManagerBean/remote"); cm = (IConferenceManager) context.lookup("ConferenceManagerBean/remote");
}
@Before
public void setup()throws PKAlreadyUsedException, UserEMailAlreadyExistsException, NoConferenceCreationTokenLeftException{
um.addUser("userManagerTestChairman", "", "First", "Last", "Yacos", "articleManagerTestChairman@yacos.com"); um.addUser("userManagerTestChairman", "", "First", "Last", "Yacos", "articleManagerTestChairman@yacos.com");
if (cm.exists(1)){ if (cm.exists(1)){
conf_id = 1; conf_id = 1;
}else{ }else{
cm.addConferenceCreationToken("userManagerTestChairman"); cm.addConferenceCreationToken("userManagerTestChairman");
Conference conf = cm.addConference("titi","articleManagerTestChairman","desc conf","info en plus",new Date(),new Date(),new Date(),new Date(),new Date(), Conference conf = cm.addConference("titi","userManagerTestChairman","desc conf","info en plus",new Date(),new Date(),new Date(),new Date(),new Date(),
0, 0,
false, false,
false, false,
@@ -58,10 +62,6 @@ public class UserManagerTest {
"Other infos"); "Other infos");
conf_id = conf.getId(); conf_id = conf.getId();
} }
}
@Before
public void setup()throws PKAlreadyUsedException, UserEMailAlreadyExistsException{
if(!um.exists("truc")){ if(!um.exists("truc")){
um.addUser("truc",User.hashPassword("pw"),"maxime","dagn","ipint", "e@ee.fr"); um.addUser("truc",User.hashPassword("pw"),"maxime","dagn","ipint", "e@ee.fr");
} }
@@ -91,7 +91,7 @@ public class UserManagerTest {
assertFalse(list.isEmpty()); assertFalse(list.isEmpty());
Speciality spe = list.get(list.size()-1); Speciality spe = list.get(list.size()-1);
assertEquals("xml", spe.getName()); assertEquals("xml", spe.getName());
//test que l'on ne peut pas ajouter 2 fois la meme specialit<EFBFBD> // Test : we shouldn't be able to add twice the same speciality
int size = list.size(); int size = list.size();
um.addSpeciality("xml"); um.addSpeciality("xml");
list = um.getSpecialities(); list = um.getSpecialities();
@@ -191,8 +191,13 @@ public class UserManagerTest {
if(um.exists("admin")){ if(um.exists("admin")){
um.removeUser("admin"); um.removeUser("admin");
} }
if(cm.exists(conf_id)){
cm.remove(conf_id);
}
if(um.exists("userManagerTestChairman")){
um.removeUser("userManagerTestChairman"); um.removeUser("userManagerTestChairman");
} }
}
} }