This commit is contained in:
@@ -9,8 +9,6 @@ import javax.naming.Context;
|
|||||||
import javax.naming.InitialContext;
|
import javax.naming.InitialContext;
|
||||||
import javax.naming.NamingException;
|
import javax.naming.NamingException;
|
||||||
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.yacos.core.conferences.Conference;
|
import org.yacos.core.conferences.Conference;
|
||||||
@@ -40,6 +38,14 @@ public class ConferenceManagerTest {
|
|||||||
id = conf.getId();
|
id = conf.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void addConferenceTest(){
|
||||||
|
conf = cm.addConference("titi","desc conf","info en plus",new Date(),new Date(),new Date(),new Date(),new Date());
|
||||||
|
assertEquals("titi", cm.getConference(conf.getId()).getTitle());
|
||||||
|
cm.remove(conf);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -60,6 +66,7 @@ public class ConferenceManagerTest {
|
|||||||
public void removeConferenceTest(){
|
public void removeConferenceTest(){
|
||||||
conf = cm.getConference(id);
|
conf = cm.getConference(id);
|
||||||
cm.remove(conf);
|
cm.remove(conf);
|
||||||
|
cm.addConference("titre","desc conf","info en plus",new Date(),new Date(),new Date(),new Date(),new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -67,31 +74,34 @@ public class ConferenceManagerTest {
|
|||||||
conf = cm.addConference("titre2","desc conf","info en plus",new Date(),new Date(),new Date(),new Date(),new Date());
|
conf = cm.addConference("titre2","desc conf","info en plus",new Date(),new Date(),new Date(),new Date(),new Date());
|
||||||
List<Conference> list = cm.getConferences();
|
List<Conference> list = cm.getConferences();
|
||||||
assertFalse("liste vide",list.isEmpty());
|
assertFalse("liste vide",list.isEmpty());
|
||||||
|
cm.remove(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void addRoleForUserTest(){
|
public void addRoleForUserTest(){
|
||||||
User user = um.getUser("max");
|
User user = um.getUser("max");
|
||||||
|
conf = cm.getConference(id);
|
||||||
cm.addRole(Role.RoleType.AUTHOR, user , conf);
|
cm.addRole(Role.RoleType.AUTHOR, user , conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getRolesTest(){
|
public void getRolesForConfTest(){
|
||||||
User user = um.getUser("max");
|
User user = um.getUser("max");
|
||||||
List<Role> list = cm.getRoles(user,conf);
|
List<Role> list = cm.getRoles(user,conf);
|
||||||
assertFalse("liste vide",list.isEmpty());
|
assertFalse("liste vide",list.isEmpty());
|
||||||
Role role = list.get(0);
|
Role role = list.get(0);
|
||||||
System.out.println(role.getType());
|
|
||||||
assertNotNull(role);
|
assertNotNull(role);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getConferencesForUserTest(){
|
public void getConferencesForUserTest() throws PKAlreadyUsedException{
|
||||||
User user = um.getUser("max");
|
User user = um.getUser("max");
|
||||||
List<Conference> list = cm.getConferences(user);
|
List<Conference> list = cm.getConferences(user);
|
||||||
assertNotNull(conf);
|
assertFalse(list.isEmpty());
|
||||||
|
User user2 = um.addUser("max2","pw","maxime","dagn","ipint", "e@e.fr");
|
||||||
|
list = cm.getConferences(user2);
|
||||||
|
assertTrue(list.isEmpty());
|
||||||
|
um.removeUser(user2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -101,7 +111,5 @@ public class ConferenceManagerTest {
|
|||||||
assertFalse("liste vide",list.isEmpty());
|
assertFalse("liste vide",list.isEmpty());
|
||||||
Role role = list.get(0);
|
Role role = list.get(0);
|
||||||
assertNotNull(role);
|
assertNotNull(role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user