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
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getArticleforMemberTest(){
|
||||||
|
am.assignArticleToPCMember(articleId,"max");
|
||||||
|
List<Article> list = am.getArticlesOfMember(conf.getId(), "max");
|
||||||
|
assertFalse(list.isEmpty());
|
||||||
|
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* test des preferences
|
* 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());
|
Conference conf = cm.addConference("titi","desc conf","info en plus",new Date(),new Date(),new Date(),new Date(),new Date());
|
||||||
conf_id = conf.getId();
|
conf_id = conf.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
@@ -57,7 +56,7 @@ public class UserManagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void addUserTest() throws PKAlreadyUsedException, UserEMailAlreadyExistsException{
|
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());
|
assertEquals(User.hashPassword("pw"), user.getPassword());
|
||||||
um.removeUser("maxmax");
|
um.removeUser("maxmax");
|
||||||
}
|
}
|
||||||
@@ -79,17 +78,21 @@ public class UserManagerTest {
|
|||||||
assertEquals("truc",user.getLogin());
|
assertEquals("truc",user.getLogin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getPCMemberForArticleTest(){
|
public void getPCMemberForArticleTest(){
|
||||||
cm.addRole(RoleType.PCMEMBER, "truc", conf_id);
|
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);
|
new ArrayList<String>(),Article.State.SUMMARY,conf_id);
|
||||||
am.assignArticleToPCMember(article.getId(), "truc");
|
am.assignArticleToPCMember(article.getId(), "truc");
|
||||||
List <User> list = um.getPCMemberForArticle(article.getId());
|
List <User> list = um.getPCMemberForArticle(article.getId());
|
||||||
assertFalse("liste vide",list.isEmpty());
|
assertFalse("liste vide",list.isEmpty());
|
||||||
assertEquals("truc",list.get(list.size()-1).getLogin());
|
assertEquals("truc",list.get(list.size()-1).getLogin());
|
||||||
|
am.unassignArticleToPCMember(article.getId(), "truc");
|
||||||
|
am.removeArticle(article.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getRefereesForArticleTest(){
|
public void getRefereesForArticleTest(){
|
||||||
cm.addRole(RoleType.PCMEMBER, "truc", conf_id);
|
cm.addRole(RoleType.PCMEMBER, "truc", conf_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user