This commit is contained in:
Maxime Dagnicourt
2008-01-22 12:42:04 +00:00
parent b3a2cbc528
commit be2445e8fb

View File

@@ -0,0 +1,64 @@
package org.yacos.tests.core;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import java.util.Date;
import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
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.exceptions.PKAlreadyUsedException;
public class EvaluationManagerTest {
private static IEvaluationManager em;
private static IConferenceManager cm;
private int confId;
@BeforeClass
public static void setUpManager() throws NamingException, PKAlreadyUsedException {
Context context = new InitialContext();
cm = (IConferenceManager) context.lookup("ConferenceManagerBean/remote");
em = (IEvaluationManager) context.lookup("EvaluationManagerBean/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();
}
@Test
public void addCriterionsTest(){
Criterion crit;
crit = em.addCriterion("name", 0, 4, confId);
assertEquals(crit.getName(), "");
}
@Test
public void getCriterionsTest(){
List<Criterion> list = em.getCriterions(confId);
assertFalse("liste vide",list.isEmpty());
}
@Test
public void AddEvaluationTest(){
assertEquals("null","null");
}
}