diff --git a/YACOSTest/src/org/yacos/tests/core/EvaluationManagerTest.java b/YACOSTest/src/org/yacos/tests/core/EvaluationManagerTest.java new file mode 100644 index 0000000..652998c --- /dev/null +++ b/YACOSTest/src/org/yacos/tests/core/EvaluationManagerTest.java @@ -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 list = em.getCriterions(confId); + assertFalse("liste vide",list.isEmpty()); + } + + @Test + public void AddEvaluationTest(){ + + assertEquals("null","null"); + + } + + +}