@@ -0,0 +1,2852 @@
+package ch.heigvd.res.labs.roulette.net.client;%0A%0Aimport ch.heigvd.res.labs.roulette.data.EmptyStoreException;%0Aimport ch.heigvd.res.labs.roulette.data.Student;%0Aimport ch.heigvd.res.labs.roulette.net.protocol.RouletteV2Protocol;%0Aimport ch.heigvd.schoolpulse.TestAuthor;%0Aimport com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;%0Aimport org.junit.Ignore;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport static org.junit.Assert.*;%0Aimport org.junit.rules.ExpectedException;%0A%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * This class contains automated tests to validate the client and the server%0A * implementation of the Roulette Protocol (version 2)%0A *%0A * @author Benoit Gianinetti%0A */%0A@Ignore%0Apublic class RouletteV2Celestius010Test %7B%0A    @Rule%0A    public ExpectedException exception = ExpectedException.none();%0A%0A    @Rule%0A    public EphemeralClientServerPair roulettePair = new EphemeralClientServerPair(RouletteV2Protocol.VERSION);%0A%0A    @Test%0A    @TestAuthor(githubId = %22bgianinetti%22)%0A    public void theTestRouletteServerShouldRunDuringTests() throws IOException %7B%0A        assertTrue(roulettePair.getServer().isRunning());%0A    %7D%0A%0A    @Test%0A    @TestAuthor(githubId = %22bgianinetti%22)%0A    public void theTestRouletteClientShouldBeConnectedWhenATestStarts() throws IOException %7B%0A        assertTrue(roulettePair.getClient().isConnected());%0A    %7D%0A%0A    @Test%0A    @TestAuthor(githubId = %22bgianinetti%22)%0A    public void theServerShouldReturnTheCorrectVersionNumber() throws IOException %7B%0A        assertEquals(RouletteV2Protocol.VERSION, roulettePair.getClient().getProtocolVersion());%0A    %7D%0A%0A    @Test%0A    @TestAuthor(githubId = %22bgianinetti%22)%0A    public void theServerShouldHaveZeroStudentsAtStart() throws IOException %7B%0A        int port = roulettePair.getServer().getPort();%0A        IRouletteV2Client client = (IRouletteV2Client) roulettePair.getClient();%0A        client.connect(%22localhost%22, port);%0A        int numberOfStudents = client.getNumberOfStudents();%0A        assertEquals(0, numberOfStudents);%0A    %7D%0A%0A   @Test%0A   @TestAuthor(githubId = %22bgianinetti%22)%0A   public void theServerShouldResetTheDataAfterAClearCommand() throws IOException %7B%0A       IRouletteV2Client client = (IRouletteV2Client) roulettePair.getClient();%0A       client.loadStudent(%22John Doe%22);%0A       client.clearDataStore();%0A       assertEquals(0, client.getNumberOfStudents());%0A   %7D%0A%0A   @Test%0A   @TestAuthor(githubId = %22bgianinetti%22)%0A   public void theServerShouldReturnAListOfStudents() throws IOException %7B%0A       IRouletteV2Client client = (IRouletteV2Client) roulettePair.getClient();%0A       List%3CStudent%3E students = new ArrayList%3CStudent%3E();%0A%0A       students.add(new Student(%22John doe%22));%0A       students.add(new Student(%22Foo bar%22));%0A%0A       client.loadStudents(students);%0A       assertEquals(students, client.listStudents());%0A   %7D%0A%0A%7D%0A

Add test for roulette protocol version 2.0 (#129)