Policy failures:
Code warning - failed on resource UserManagerTest.java. Reason: The local variable role is never read, line 7 Override reason: x
This commit is contained in:
@@ -153,6 +153,14 @@ public class ArticleManagerTest {
|
||||
//TODO
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void getArticleforMemberTest(){
|
||||
am.assignArticleToPCMember(articleId,"max");
|
||||
List<Article> list = am.getArticlesOfMember(conf.getId(), "max");
|
||||
assertFalse(list.isEmpty());
|
||||
|
||||
}
|
||||
/*
|
||||
* test des preferences
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,6 @@ public class UserManagerTest {
|
||||
Conference conf = cm.addConference("titi","desc conf","info en plus",new Date(),new Date(),new Date(),new Date(),new Date());
|
||||
conf_id = conf.getId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Before
|
||||
@@ -57,7 +56,7 @@ public class UserManagerTest {
|
||||
|
||||
@Test
|
||||
public void addUserTest() throws PKAlreadyUsedException, UserEMailAlreadyExistsException{
|
||||
User user = um.addUser("maxmax",User.hashPassword("pw"),"maxime","dagn","ipint", "e@e.fr");
|
||||
User user = um.addUser("maxmax",User.hashPassword("pw"),"maxime","dagn","ipint", "uie@e.fr");
|
||||
assertEquals(User.hashPassword("pw"), user.getPassword());
|
||||
um.removeUser("maxmax");
|
||||
}
|
||||
@@ -79,17 +78,21 @@ public class UserManagerTest {
|
||||
assertEquals("truc",user.getLogin());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void getPCMemberForArticleTest(){
|
||||
cm.addRole(RoleType.PCMEMBER, "truc", conf_id);
|
||||
Article article = am.addArticle("title","topic","url_article","truc",
|
||||
Article article = am.addArticle("title","topic","url_article","admin",
|
||||
new ArrayList<String>(),Article.State.SUMMARY,conf_id);
|
||||
am.assignArticleToPCMember(article.getId(), "truc");
|
||||
List <User> list = um.getPCMemberForArticle(article.getId());
|
||||
assertFalse("liste vide",list.isEmpty());
|
||||
assertEquals("truc",list.get(list.size()-1).getLogin());
|
||||
am.unassignArticleToPCMember(article.getId(), "truc");
|
||||
am.removeArticle(article.getId());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void getRefereesForArticleTest(){
|
||||
cm.addRole(RoleType.PCMEMBER, "truc", conf_id);
|
||||
|
||||
Reference in New Issue
Block a user