Policy failures:
Code warning - failed on resource EvaluationManagerTest.java. Reason: The field EvaluationManagerTest.article is never read locally, line 36 - failed on resource EvaluationManagerTest.java. Reason: The field EvaluationManagerTest.um is never read locally, line 34 - failed on resource EvaluationManagerTest.java. Reason: The import org.yacos.core.evaluation.Report is never used, line 25 - failed on resource Filler.java. Reason: The local variable article is never read, line 54 - failed on resource Filler.java. Reason: The local variable membre is never read, line 47 ... and more. Override reason: f
This commit is contained in:
@@ -14,6 +14,7 @@ import org.yacos.core.conferences.IConferenceManager;
|
||||
import org.yacos.core.exceptions.PKAlreadyUsedException;
|
||||
import org.yacos.core.users.IUserManager;
|
||||
import org.yacos.core.users.User;
|
||||
import org.yacos.core.users.Role.RoleType;
|
||||
|
||||
/*
|
||||
* fill the database for developpement and test
|
||||
@@ -45,6 +46,9 @@ public class Filler {
|
||||
User author2 = um.addUser("toto","pw","toto","titu","ipint", "toto@e.fr");
|
||||
User membre = um.addUser("login_membre","pw","nom_membre","meme","ipint", "meme@e.fr");
|
||||
|
||||
//ajout des roles pr les users
|
||||
cm.addRole(RoleType.AUTHOR, author.getLogin(), conf.getId());
|
||||
|
||||
|
||||
//ajout d'un article pr le user "max"
|
||||
Article article = am.addArticle("title article max","topic","url_article",
|
||||
|
||||
@@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,29 +16,40 @@ import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.yacos.core.article.Article;
|
||||
import org.yacos.core.article.IArticleManager;
|
||||
import org.yacos.core.conferences.Conference;
|
||||
import org.yacos.core.conferences.IConferenceManager;
|
||||
import org.yacos.core.evaluation.Criterion;
|
||||
import org.yacos.core.evaluation.IEvaluationManager;
|
||||
import org.yacos.core.evaluation.Report;
|
||||
import org.yacos.core.exceptions.PKAlreadyUsedException;
|
||||
import org.yacos.core.users.IUserManager;
|
||||
|
||||
public class EvaluationManagerTest {
|
||||
|
||||
private static IEvaluationManager em;
|
||||
private static IArticleManager am;
|
||||
private static IConferenceManager cm;
|
||||
private static IUserManager um;
|
||||
private int confId;
|
||||
private Article article;
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpManager() throws NamingException, PKAlreadyUsedException {
|
||||
Context context = new InitialContext();
|
||||
cm = (IConferenceManager) context.lookup("ConferenceManagerBean/remote");
|
||||
em = (IEvaluationManager) context.lookup("EvaluationManagerBean/remote");
|
||||
am = (IArticleManager) context.lookup("ArticleManagerBean/remote");
|
||||
um = (IUserManager) context.lookup("UserManagerBean/remote");
|
||||
}
|
||||
|
||||
@Before
|
||||
public void initDB(){
|
||||
Conference conf = cm.addConference("titre","desc conf","info en plus",new Date(),new Date(),new Date(),new Date(),new Date());
|
||||
confId = conf.getId();
|
||||
confId = conf.getId();
|
||||
article = am.addArticle("title article max","topic","url_article",
|
||||
"max", new ArrayList<String>(), Article.State.SUMMARY, confId);
|
||||
}
|
||||
|
||||
@After
|
||||
@@ -83,8 +95,8 @@ public class EvaluationManagerTest {
|
||||
|
||||
@Test
|
||||
public void AddReportTest(){
|
||||
//TODO
|
||||
//Report report = em.addReport(articleId);
|
||||
List<Criterion> ratings = new ArrayList<Criterion>();
|
||||
//Report report = em.addReport(article, "commentPCMember", "commentAuthor", ratings, um.getUser("max"));
|
||||
//assertNotNull();
|
||||
//assertEquals(report.getCommentAuthor(), em.getReport(report.getId()).getCommentAuthor());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user