Création du projet YACOSTest
This commit is contained in:
8
YACOSTest/.classpath
Normal file
8
YACOSTest/.classpath
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="/usr/local/debuire/bin/junit-4.4.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/YACOSCore"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
17
YACOSTest/.project
Normal file
17
YACOSTest/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>YACOSTest</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.yacos.tests.core;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.yacos.core.conferences.Conference;
|
||||
import org.yacos.core.conferences.ConferenceManagerBean;
|
||||
import org.yacos.core.conferences.IConferenceManager;
|
||||
|
||||
|
||||
public class TestConferenceManager {
|
||||
IConferenceManager conferenceManager;
|
||||
|
||||
@BeforeClass
|
||||
public void setUpManager() {
|
||||
conferenceManager = new ConferenceManagerBean();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUpConferences() {
|
||||
conferenceManager.getConferences();
|
||||
Conference conf = new Conference();
|
||||
conferenceManager.addConference(conf);
|
||||
}
|
||||
}
|
||||
15
YACOSTest/src/org/yacos/tests/core/TestRole.java
Normal file
15
YACOSTest/src/org/yacos/tests/core/TestRole.java
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.yacos.tests.core;
|
||||
|
||||
|
||||
/**
|
||||
* @author christiancorsano
|
||||
*
|
||||
*/
|
||||
public class TestRole {
|
||||
public void aRoleShouldBeUnique(){
|
||||
// TODO : look for roles of the same type, same user and same conference
|
||||
}
|
||||
}
|
||||
44
YACOSTest/src/org/yacos/tests/core/TestUser.java
Normal file
44
YACOSTest/src/org/yacos/tests/core/TestUser.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package org.yacos.tests.core;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.yacos.core.users.IUsersManager;
|
||||
import org.yacos.core.users.User;
|
||||
|
||||
public class TestUser {
|
||||
private IUsersManager manager;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
Context context = new InitialContext();
|
||||
manager = (IUsersManager) context.lookup("UsersManagerBean/remote");
|
||||
|
||||
manager.removeUser(manager.getUser("toto"));
|
||||
|
||||
User toto = new User();
|
||||
toto.setLogin("toto");
|
||||
toto.setFirstName("Toto");
|
||||
toto.setLastName("John");
|
||||
manager.addUser(toto);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testManagerPresence(){
|
||||
assertNotNull(manager);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUserWritingReading(){
|
||||
|
||||
User user = manager.getUser("toto");
|
||||
assertNotNull(user);
|
||||
assertEquals("toto", user.getLogin());
|
||||
assertEquals("Toto", user.getLastName());
|
||||
assertEquals("John", user.getFirstName());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user