Modification des tests pour prendre en compte lest modifications de la revision 240
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
<classpathentry kind="lib" path="/usr/local/debuire/bin/junit-4.4.jar"/>
|
|
||||||
<classpathentry combineaccessrules="false" kind="src" path="/YACOSCore"/>
|
<classpathentry combineaccessrules="false" kind="src" path="/YACOSCore"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@@ -89,8 +89,7 @@ public class ConferenceManagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getRolesForConfTest(){
|
public void getRolesForConfTest(){
|
||||||
User user = um.getUser("max");
|
List<Role> list = cm.getRoles("max",conf.getId());
|
||||||
List<Role> list = cm.getRoles(user,conf);
|
|
||||||
assertTrue("liste vide",list.isEmpty());
|
assertTrue("liste vide",list.isEmpty());
|
||||||
cm.addRole(Role.RoleType.AUTHOR, "max" , id);
|
cm.addRole(Role.RoleType.AUTHOR, "max" , id);
|
||||||
}
|
}
|
||||||
@@ -108,8 +107,7 @@ public class ConferenceManagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getRolesForUserAndConfTest(){
|
public void getRolesForUserAndConfTest(){
|
||||||
User user = um.getUser("max");
|
List<Role> list = cm.getRoles("max", conf.getId());
|
||||||
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);
|
||||||
assertNotNull(role);
|
assertNotNull(role);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import org.yacos.core.conferences.Conference;
|
|||||||
import org.yacos.core.conferences.IConferenceManager;
|
import org.yacos.core.conferences.IConferenceManager;
|
||||||
import org.yacos.core.exceptions.PKAlreadyUsedException;
|
import org.yacos.core.exceptions.PKAlreadyUsedException;
|
||||||
import org.yacos.core.users.IUserManager;
|
import org.yacos.core.users.IUserManager;
|
||||||
|
import org.yacos.core.users.Role;
|
||||||
import org.yacos.core.users.User;
|
import org.yacos.core.users.User;
|
||||||
import org.yacos.core.users.Role.RoleType;
|
import org.yacos.core.users.Role.RoleType;
|
||||||
|
|
||||||
@@ -113,6 +114,9 @@ public class UserTest {
|
|||||||
public void cleanup(){
|
public void cleanup(){
|
||||||
user = manager.getUser("testUser1");
|
user = manager.getUser("testUser1");
|
||||||
if(user != null){
|
if(user != null){
|
||||||
|
for(Role role : user.getRoles()){
|
||||||
|
manager.removeRole(user.getLogin(), role.getType(), role.getConference().getId());
|
||||||
|
}
|
||||||
manager.removeUser("testUser1");
|
manager.removeUser("testUser1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user