From 5de7a9d576bf2a92c7a414dfaaa4663c53149409 Mon Sep 17 00:00:00 2001 From: romain_silvestri Date: Sun, 25 Mar 2018 11:08:31 +0200 Subject: [PATCH 01/73] Adding 4 new tests for V2 protocol --- .../client/RouletteV2romainSilvestriTest.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2romainSilvestriTest.java diff --git a/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2romainSilvestriTest.java b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2romainSilvestriTest.java new file mode 100644 index 0000000..fa8d122 --- /dev/null +++ b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2romainSilvestriTest.java @@ -0,0 +1,63 @@ +package ch.heigvd.res.labs.roulette.net.client; + +import ch.heigvd.res.labs.roulette.net.protocol.RouletteV2Protocol; +import ch.heigvd.schoolpulse.TestAuthor; +import java.io.IOException; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.rules.ExpectedException; + +/** + * This class contains automated tests to validate the client and the server + * implementation of the Roulette Protocol (version 1) + * + * @author Romain Silvestri + */ +public class RouletteV2romainSilvestriTest { + + @Rule + public ExpectedException exception = ExpectedException.none(); + + @Rule + public EphemeralClientServerPair roulettePair = new EphemeralClientServerPair(RouletteV2Protocol.VERSION); + + @Test + @TestAuthor(githubId = "romainSilvestri") + public void theServerShouldReturnTheCorrectVersionNumber() throws IOException { + assertEquals(RouletteV2Protocol.VERSION, roulettePair.getClient().getProtocolVersion()); + } + + @Test + @TestAuthor(githubId = "romainSilvestri") + public void theServerShouldReturnTheCorrectNumberOfStudents() throws IOException{ + IRouletteV2Client client = (IRouletteV2Client) roulettePair.getClient(); + assertEquals(0, client.getNumberOfStudents()); + client.loadStudent("romain"); + assertEquals(1, client.getNumberOfStudents()); + client.loadStudent("florent"); + client.loadStudent("loic"); + assertEquals(3, client.getNumberOfStudents()); + } + + @Test + @TestAuthor(githubId = "romainSilvestri") + public void theServerShouldBeAbleToClearAllHisData() throws IOException{ + IRouletteV2Client client = (IRouletteV2Client) roulettePair.getClient(); + client.loadStudent("romain"); + client.loadStudent("florent"); + assertEquals(2, client.getNumberOfStudents()); + client.clearDataStore(); + assertEquals(0, client.getNumberOfStudents()); + } + + @Test + @TestAuthor(githubId = "romainSilvestri") + public void itShouldBePossibleForARouletteClientToConnectToARouletteServer() throws IOException{ + int port = roulettePair.getServer().getPort(); + IRouletteV2Client client = new RouletteV2ClientImpl(); + assertFalse(client.isConnected()); + client.connect("localhost", port); + assertTrue(client.isConnected()); + } +} \ No newline at end of file From 32056c045510e63610a2cce9593dfac4d94a7e9e Mon Sep 17 00:00:00 2001 From: yosra-harbaoui Date: Tue, 27 Mar 2018 11:35:48 +0200 Subject: [PATCH 02/73] adding Tests for Protocol V2 --- .../client/RouletteV2yosraharbaouiTest.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2yosraharbaouiTest.java diff --git a/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2yosraharbaouiTest.java b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2yosraharbaouiTest.java new file mode 100644 index 0000000..774f56b --- /dev/null +++ b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2yosraharbaouiTest.java @@ -0,0 +1,59 @@ +package ch.heigvd.res.labs.roulette.net.client; + +import ch.heigvd.res.labs.roulette.net.protocol.RouletteV2Protocol; +import ch.heigvd.schoolpulse.TestAuthor; +import java.io.IOException; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.rules.ExpectedException; + +/** + * This class contains automated tests to validate the client and the server + * implementation of the Roulette Protocol (version 2) + * + * @author Yosra Harbaoui + */ +public class RouletteV2yosraharbaouiTest { + @Rule + public ExpectedException exception = ExpectedException.none(); + + @Rule + public EphemeralClientServerPair roulettePair = new EphemeralClientServerPair(RouletteV2Protocol.VERSION); + + @Test + @TestAuthor(githubId = "yosra-harbaoui") + public void theTestRouletteServerShouldRunDuringTests() throws IOException { + assertTrue(roulettePair.getServer().isRunning()); + } + + @Test + @TestAuthor(githubId = "yosra-harbaoui") + public void theServerListSouldBeEmptyAtSetup() throws IOException { + IRouletteV2Client clientV2 = (IRouletteV2Client) roulettePair.getClient(); + assertTrue(clientV2.listStudents().isEmpty()); + } + + @Test + @TestAuthor(githubId = "yosra-harbaoui") + public void theServerShouldGetTheNumberOfStudentsInTheStore() throws IOException { + IRouletteV2Client clientV2 = (IRouletteV2Client) roulettePair.getClient(); + clientV2.loadStudent("Yosra"); + clientV2.loadStudent("Olivier"); + clientV2.loadStudent("Miguel"); + assertEquals(3 , clientV2.getNumberOfStudents()); + } + + @Test + @TestAuthor(githubId = "yosra-harbaoui") + public void theServerListShouldBeEmptyAfterClearDataStore() throws IOException { + IRouletteV2Client clientV2 = (IRouletteV2Client) roulettePair.getClient(); + clientV2.loadStudent("Yosra"); + clientV2.loadStudent("Olivier"); + clientV2.loadStudent("Miguel"); + assertEquals(3, clientV2.getNumberOfStudents()); + clientV2.clearDataStore(); + assertEquals(0, clientV2.getNumberOfStudents()); + + } +} From 7c77d5ab34e2da510adbd29695e9e970d474ab22 Mon Sep 17 00:00:00 2001 From: Olivier Nicole Date: Tue, 27 Mar 2018 19:30:13 +0200 Subject: [PATCH 03/73] Task 3 implemented, all tests passed --- .../net/client/RouletteV1ClientImpl.java | 131 +++++++++++++++--- ...st.java => RouletteV1onicoleheigTest.java} | 14 +- ...st.java => RouletteV2onicoleheigTest.java} | 2 +- 3 files changed, 123 insertions(+), 24 deletions(-) rename QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/{RouletteV1WasadigiTest.java => RouletteV1onicoleheigTest.java} (90%) rename QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/{RouletteV2WasadigiTest.java => RouletteV2onicoleheigTest.java} (93%) diff --git a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java index f2df5cd..528a590 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java +++ b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java @@ -6,11 +6,9 @@ import ch.heigvd.res.labs.roulette.data.Student; import ch.heigvd.res.labs.roulette.net.protocol.InfoCommandResponse; import ch.heigvd.res.labs.roulette.net.protocol.RandomCommandResponse; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; +import sun.awt.SunToolkit; + +import java.io.*; import java.net.Socket; import java.util.List; import java.util.logging.Level; @@ -18,53 +16,154 @@ /** * This class implements the client side of the protocol specification (version 1). - * + * * @author Olivier Liechti + * @author Olivier Nicole */ public class RouletteV1ClientImpl implements IRouletteV1Client { private static final Logger LOG = Logger.getLogger(RouletteV1ClientImpl.class.getName()); + private Socket socket = null; + private BufferedReader bufferedReader = null; + private PrintWriter printWriter = null; + @Override public void connect(String server, int port) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + + LOG.info("Client try to start the connection to the server"); + + //create the socket + socket = new Socket(server, port); + + try { + //create the writer and the reader + bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream(), "utf-8")); + printWriter = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), "utf-8")); + } catch (IOException ex) { + LOG.severe("IO Exception : " + ex); + } + + //read the welcome message "Hello..." + read(); + + LOG.info("Client connected"); } @Override public void disconnect() throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + + if(isConnected()) { + //send the bye command to the server and close all allocated ressources + write(RouletteV1Protocol.CMD_BYE); + socket.close(); + bufferedReader.close(); + printWriter.close(); + LOG.info("Client disconnected"); + } else { + LOG.info("Client already disconnected"); + } } @Override public boolean isConnected() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + return socket != null && socket.isConnected() && !socket.isClosed(); + } + + /** + * method used to read the bufferedReader + * + * @return the value of readLine from the bufferedReader + * @throws IOException + */ + private String read() throws IOException { + return bufferedReader.readLine(); + } + + /** + * method used to write into the printWriter, and flush + * + * @param message the message that will be sent to the server + */ + private void write(String message) { + printWriter.println(message); + printWriter.flush(); } @Override public void loadStudent(String fullname) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + + LOG.info("Loading student"); + + write(RouletteV1Protocol.CMD_LOAD); + read(); + + //send the new student to the server + write(fullname); + + write(RouletteV1Protocol.CMD_LOAD_ENDOFDATA_MARKER); + read(); } @Override public void loadStudents(List students) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + + LOG.info("Loading students"); + + write(RouletteV1Protocol.CMD_LOAD); + read(); + + //sent all students to the server + for(Student student : students){ + write(student.getFullname()); + } + + write(RouletteV1Protocol.CMD_LOAD_ENDOFDATA_MARKER); + read(); } @Override public Student pickRandomStudent() throws EmptyStoreException, IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + + LOG.info("Pick random student"); + + write(RouletteV1Protocol.CMD_RANDOM); + + RandomCommandResponse response = JsonObjectMapper.parseJson(read(), RandomCommandResponse.class); + + if(response.getError() != null){ + LOG.info("Error while parsing Json"); + throw new EmptyStoreException(); + } + + return Student.fromJson(response.getFullname()); + } + + /** + * method used to send the command info to the server + * + * @return the InfoCommandResponse given by JsonObjectMapper.parseJson(...) + * @throws IOException + */ + private InfoCommandResponse getInfoResponse() throws IOException { + + write(RouletteV1Protocol.CMD_INFO); + return JsonObjectMapper.parseJson(read(), InfoCommandResponse.class); } @Override public int getNumberOfStudents() throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + + LOG.info("Get the number of students"); + + return getInfoResponse().getNumberOfStudents(); } @Override public String getProtocolVersion() throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - + LOG.info("Get protocol version"); + return getInfoResponse().getProtocolVersion(); + } } diff --git a/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1WasadigiTest.java b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1onicoleheigTest.java similarity index 90% rename from QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1WasadigiTest.java rename to QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1onicoleheigTest.java index f7d0380..40951ac 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1WasadigiTest.java +++ b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1onicoleheigTest.java @@ -24,19 +24,19 @@ public class RouletteV1WasadigiTest { public EphemeralClientServerPair roulettePair = new EphemeralClientServerPair(RouletteV1Protocol.VERSION); @Test - @TestAuthor(githubId = "wasadigi") + @TestAuthor(githubId = "onicoleheig") public void theTestRouletteServerShouldRunDuringTests() throws IOException { assertTrue(roulettePair.getServer().isRunning()); } @Test - @TestAuthor(githubId = "wasadigi") + @TestAuthor(githubId = "onicoleheig") public void theTestRouletteClientShouldBeConnectedWhenATestStarts() throws IOException { assertTrue(roulettePair.getClient().isConnected()); } @Test - @TestAuthor(githubId = "wasadigi") + @TestAuthor(githubId = "onicoleheig") public void itShouldBePossibleForARouletteClientToConnectToARouletteServer() throws Exception { int port = roulettePair.getServer().getPort(); IRouletteV1Client client = new RouletteV1ClientImpl(); @@ -46,13 +46,13 @@ public void itShouldBePossibleForARouletteClientToConnectToARouletteServer() thr } @Test - @TestAuthor(githubId = "wasadigi") + @TestAuthor(githubId = "onicoleheig") public void theServerShouldReturnTheCorrectVersionNumber() throws IOException { assertEquals(RouletteV1Protocol.VERSION, roulettePair.getClient().getProtocolVersion()); } @Test - @TestAuthor(githubId = "wasadigi") + @TestAuthor(githubId = "onicoleheig") public void theServerShouldHaveZeroStudentsAtStart() throws IOException { int port = roulettePair.getServer().getPort(); IRouletteV1Client client = new RouletteV1ClientImpl(); @@ -62,7 +62,7 @@ public void theServerShouldHaveZeroStudentsAtStart() throws IOException { } @Test - @TestAuthor(githubId = {"wasadigi", "SoftEng-HEIGVD"}) + @TestAuthor(githubId = {"onicoleheig", "SoftEng-HEIGVD"}) public void theServerShouldStillHaveZeroStudentsAtStart() throws IOException { assertEquals(0, roulettePair.getClient().getNumberOfStudents()); } @@ -81,7 +81,7 @@ public void theServerShouldCountStudents() throws IOException { } @Test - @TestAuthor(githubId = "wasadigi") + @TestAuthor(githubId = "onicoleheig") public void theServerShouldSendAnErrorResponseWhenRandomIsCalledAndThereIsNoStudent() throws IOException, EmptyStoreException { IRouletteV1Client client = roulettePair.getClient(); exception.expect(EmptyStoreException.class); diff --git a/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2WasadigiTest.java b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2onicoleheigTest.java similarity index 93% rename from QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2WasadigiTest.java rename to QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2onicoleheigTest.java index c166664..a952242 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2WasadigiTest.java +++ b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2onicoleheigTest.java @@ -10,7 +10,7 @@ * * @author Olivier Liechti */ -public class RouletteV2WasadigiTest { +public class RouletteV2onicoleheigTest { @Rule public ExpectedException exception = ExpectedException.none(); From 19d87e42e1d9ac286775a5c18d89daf1999db9e3 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 28 Mar 2018 08:51:35 +0200 Subject: [PATCH 04/73] Test ProtocolV2 - SmithHeig --- .../net/client/RouletteV2SmithHeigTest.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2SmithHeigTest.java diff --git a/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2SmithHeigTest.java b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2SmithHeigTest.java new file mode 100644 index 0000000..7b300f5 --- /dev/null +++ b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2SmithHeigTest.java @@ -0,0 +1,72 @@ +package ch.heigvd.res.labs.roulette.net.client; +s +import ch.heigvd.res.labs.roulette.data.Student; +import ch.heigvd.res.labs.roulette.net.protocol.RouletteV2Protocol; +import ch.heigvd.schoolpulse.TestAuthor; +import org.junit.*; +import org.junit.rules.ExpectedException; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.Socket; + +import static org.junit.Assert.*; + +public class RouletteV2SmithHeigTest { + @Rule + public ExpectedException exception = ExpectedException.none(); + + @Rule + public EphemeralClientServerPair roulettePair = new EphemeralClientServerPair(RouletteV2Protocol.VERSION); + + /** + * When the server clear, should have 0 students after that + * @throws IOException + */ + @Test + @TestAuthor(githubId = "smithheig") + public void theServerShouldHaveZeroStudentAfterClear() throws IOException { + roulettePair.getClient().loadStudent("bob"); + IRouletteV2Client client = (IRouletteV2Client)roulettePair.getClient(); + client.clearDataStore(); // test clear data + assertEquals(0,roulettePair.getClient().getNumberOfStudents()); + } + + /** + * Test if the client revieved the list of the current students on the server + * @throws IOException + */ + @Test + @TestAuthor(githubId = "smithheig") + public void testClientReceivedCorrectListOfStudentFromServer() throws IOException { + IRouletteV2Client client = (IRouletteV2Client)roulettePair.getClient(); + client.loadStudent("bob"); + client.loadStudent("john"); + + assertTrue(client.listStudents().contains(new Student("bob"))); + assertTrue(client.listStudents().contains(new Student("john"))); + } + + /** + * Test if the server give you a Bye message correct + * @throws IOException + */ + @Test + @TestAuthor(githubId = "smithheig") + public void testResponseFromServerWhenExitWithBye() throws IOException{ + Socket client = new Socket("localhost",roulettePair.getServer().getPort()); + BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream())); + PrintWriter out = new PrintWriter(client.getOutputStream()); + + in.readLine(); + + out.println("BYE"); + out.flush(); + + String s = in.readLine(); + assertEquals(s, "{\"status\":\"success\",\"nbCommands\":1}"); + } + +} From 3d19ef0ca2a1ab8ece39b51b2a306adc22baff75 Mon Sep 17 00:00:00 2001 From: lionelnanchen Date: Wed, 28 Mar 2018 09:38:22 +0200 Subject: [PATCH 05/73] add LionelNanchen V2 test --- .../client/RouletteV2LionelNanchenTest.java | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2LionelNanchenTest.java diff --git a/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2LionelNanchenTest.java b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2LionelNanchenTest.java new file mode 100644 index 0000000..06611e3 --- /dev/null +++ b/QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2LionelNanchenTest.java @@ -0,0 +1,97 @@ +package ch.heigvd.res.labs.roulette.net.client; + +import ch.heigvd.res.labs.roulette.data.EmptyStoreException; +import ch.heigvd.res.labs.roulette.data.Student; +import ch.heigvd.res.labs.roulette.net.protocol.RouletteV2Protocol; +import ch.heigvd.schoolpulse.TestAuthor; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +import java.io.*; +import java.net.Socket; +import java.util.LinkedList; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class RouletteV2LionelNanchenTest { + + @Rule + public ExpectedException exception = ExpectedException.none(); + + @Rule + public EphemeralClientServerPair roulettePair = new EphemeralClientServerPair(RouletteV2Protocol.VERSION); + + @Test + @TestAuthor(githubId = "LionelNanchen") + public void theServerShouldBeEmptyAfterClearCommand() throws IOException, EmptyStoreException{ + IRouletteV2Client client = (IRouletteV2Client) roulettePair.getClient(); + client.loadStudent("sacha"); + client.loadStudent("olivier"); + client.clearDataStore(); + assertEquals(0, client.getNumberOfStudents()); + } + + @Test + @TestAuthor(githubId = "LionelNanchen") + public void theServerShouldFetchTheListOfStudents() throws IOException, EmptyStoreException { + IRouletteV2Client client = (IRouletteV2Client) roulettePair.getClient(); + LinkedList students = new LinkedList<>(); + students.add(new Student("sacha")); + students.add(new Student("olivier")); + students.add(new Student("fabienne")); + client.loadStudents(students); + assertEquals(students, client.listStudents()); + } + + @Test + @TestAuthor(githubId = "LionelNanchen") + public void theServerShouldCountNumberOfStudentCreated() throws IOException { + Socket clientSocket = new Socket("localhost", roulettePair.getServer().getPort()); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream()), true); + + bufferedReader.readLine(); + printWriter.println(RouletteV2Protocol.CMD_LOAD); + bufferedReader.readLine(); + printWriter.println("sacha"); + printWriter.println("olivier"); + printWriter.println("fabienne"); + printWriter.println(RouletteV2Protocol.CMD_LOAD_ENDOFDATA_MARKER); + String status = bufferedReader.readLine(); + boolean b = false; + if (status.contains("3")) { + b = true; + } + assertTrue(b); + } + + @Test + @TestAuthor(githubId = "LionelNanchen") + public void theServerShouldCountAllCommmands() throws IOException { + Socket clientSocket = new Socket("localhost", roulettePair.getServer().getPort()); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream()), true); + + bufferedReader.readLine(); + printWriter.println(RouletteV2Protocol.CMD_LOAD); + bufferedReader.readLine(); + printWriter.println("sacha"); + printWriter.println(RouletteV2Protocol.CMD_LOAD_ENDOFDATA_MARKER); + bufferedReader.readLine(); + printWriter.println(RouletteV2Protocol.CMD_RANDOM); + bufferedReader.readLine(); + printWriter.println(RouletteV2Protocol.CMD_INFO); + bufferedReader.readLine(); + printWriter.println(RouletteV2Protocol.CMD_BYE); + + String status = bufferedReader.readLine(); + boolean b = false; + if (status.contains("4")) { + b = true; + } + assertTrue(b); + } + +} From 34bb3bdc55972863dcc16e5c25999a0977e71588 Mon Sep 17 00:00:00 2001 From: Christophe Joyet Date: Wed, 28 Mar 2018 09:52:52 +0200 Subject: [PATCH 06/73] Implementation of RouletteV1ClientImpl --- .../net/client/RouletteV1ClientImpl.java | 73 +++++++++++++++---- 1 file changed, 58 insertions(+), 15 deletions(-) diff --git a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java index f2df5cd..326f0f5 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java +++ b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java @@ -6,65 +6,108 @@ import ch.heigvd.res.labs.roulette.data.Student; import ch.heigvd.res.labs.roulette.net.protocol.InfoCommandResponse; import ch.heigvd.res.labs.roulette.net.protocol.RandomCommandResponse; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; + +import java.io.*; import java.net.Socket; import java.util.List; +import java.util.Random; import java.util.logging.Level; import java.util.logging.Logger; /** * This class implements the client side of the protocol specification (version 1). - * + * * @author Olivier Liechti + * @author Christophe Joyet */ public class RouletteV1ClientImpl implements IRouletteV1Client { private static final Logger LOG = Logger.getLogger(RouletteV1ClientImpl.class.getName()); + Socket clientSocket = null; //creation of client socket + private BufferedReader bufferedReader = null; + private PrintWriter printWriter = null; + + @Override public void connect(String server, int port) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //Declaration of the variables + clientSocket = new Socket(server, port); + bufferedReader = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + printWriter = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream()), true); + bufferedReader.readLine(); // read first lign with "Hello" } @Override public void disconnect() throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + printWriter.println(RouletteV1Protocol.CMD_BYE); + //close socket, BufferedReader and PrintWriter + clientSocket.close(); + bufferedReader.close(); + printWriter.close(); } @Override public boolean isConnected() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + return clientSocket != null && clientSocket.isConnected(); } @Override public void loadStudent(String fullname) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + printWriter.println(RouletteV1Protocol.CMD_LOAD); + bufferedReader.readLine(); + printWriter.println(fullname); + printWriter.println(RouletteV1Protocol.CMD_LOAD_ENDOFDATA_MARKER); + bufferedReader.readLine(); + } @Override public void loadStudents(List students) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + printWriter.println(RouletteV1Protocol.CMD_LOAD); + bufferedReader.readLine(); + for (Student s : students) { + printWriter.println(s.getFullname()); + } + printWriter.println(RouletteV1Protocol.CMD_LOAD_ENDOFDATA_MARKER); + bufferedReader.readLine(); + } @Override public Student pickRandomStudent() throws EmptyStoreException, IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + printWriter.println(RouletteV1Protocol.CMD_RANDOM); + RandomCommandResponse response = JsonObjectMapper.parseJson(bufferedReader.readLine(), RandomCommandResponse.class); + + if (!response.getError().isEmpty()) { + LOG.log(Level.SEVERE, "There is no student"); + throw new EmptyStoreException(); + } + + return Student.fromJson(response.getFullname()); } @Override public int getNumberOfStudents() throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + printWriter.println(RouletteV1Protocol.CMD_INFO); + InfoCommandResponse response = JsonObjectMapper.parseJson(bufferedReader.readLine(), InfoCommandResponse.class); + return response.getNumberOfStudents(); } @Override public String getProtocolVersion() throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + printWriter.println(RouletteV1Protocol.CMD_INFO); + InfoCommandResponse response = JsonObjectMapper.parseJson(bufferedReader.readLine(), InfoCommandResponse.class); + return response.getProtocolVersion(); } - } From 2ba0afa49c59acc503c9e2495e7696294229c547 Mon Sep 17 00:00:00 2001 From: joelschar Date: Thu, 29 Mar 2018 08:42:28 +0200 Subject: [PATCH 07/73] connect-deconnect --- .../net/client/RouletteV1ClientImpl.java | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java index f2df5cd..8cf418f 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java +++ b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java @@ -25,19 +25,42 @@ public class RouletteV1ClientImpl implements IRouletteV1Client { private static final Logger LOG = Logger.getLogger(RouletteV1ClientImpl.class.getName()); + private Socket socket; + private BufferedReader in; + private PrintWriter out; + @Override public void connect(String server, int port) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + + try{ + socket = new Socket(server, port); + in = new BufferedReader(new InputStreamReader(socket.getInputStream())); + out = new PrintWriter(socket.getOutputStream()); + }catch(IOException e){ + LOG.log(Level.SEVERE, "Client could not create socket exit: {0}", e.getMessage()); + } + } @Override public void disconnect() throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + LOG.info("Client disconnect"); + in.close(); + out.close(); + socket.close(); + } @Override public boolean isConnected() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + + if(socket == null){ + return false; + } + return socket.isConnected(); } @Override @@ -65,6 +88,4 @@ public String getProtocolVersion() throws IOException { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } - - } From bca49a5d70bbce1ffb1312e4f801a81fd62ec01f Mon Sep 17 00:00:00 2001 From: zutt Date: Thu, 29 Mar 2018 09:13:32 +0200 Subject: [PATCH 08/73] adding load students and version protocol --- .../roulette/net/client/RouletteV1ClientImpl.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java index 8cf418f..d5f26a4 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java +++ b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java @@ -65,12 +65,20 @@ public boolean isConnected() { @Override public void loadStudent(String fullname) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + out.print(RouletteV1Protocol.CMD_LOAD); + out.print(fullname); + out.print(RouletteV1Protocol.CMD_LOAD_ENDOFDATA_MARKER); } @Override public void loadStudents(List students) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + out.print(RouletteV1Protocol.CMD_LOAD); + + for(Student student : students) + out.print(student.getFullname()); + + out.print(RouletteV1Protocol.CMD_LOAD_ENDOFDATA_MARKER); } @Override @@ -85,7 +93,8 @@ public int getNumberOfStudents() throws IOException { @Override public String getProtocolVersion() throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + return RouletteV1Protocol.VERSION; } } From cd11e4500e3f8da4a3663b91f50cde0852eae069 Mon Sep 17 00:00:00 2001 From: joelschar Date: Thu, 29 Mar 2018 09:20:26 +0200 Subject: [PATCH 09/73] nb students --- .../net/client/RouletteV1ClientImpl.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java index 8cf418f..1233a41 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java +++ b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java @@ -6,6 +6,8 @@ import ch.heigvd.res.labs.roulette.data.Student; import ch.heigvd.res.labs.roulette.net.protocol.InfoCommandResponse; import ch.heigvd.res.labs.roulette.net.protocol.RandomCommandResponse; +import com.fasterxml.jackson.databind.ObjectMapper; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -37,6 +39,9 @@ public void connect(String server, int port) throws IOException { socket = new Socket(server, port); in = new BufferedReader(new InputStreamReader(socket.getInputStream())); out = new PrintWriter(socket.getOutputStream()); + + LOG.info(in.readLine()); + }catch(IOException e){ LOG.log(Level.SEVERE, "Client could not create socket exit: {0}", e.getMessage()); } @@ -80,7 +85,18 @@ public Student pickRandomStudent() throws EmptyStoreException, IOException { @Override public int getNumberOfStudents() throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + + // ask server for info + out.println(RouletteV1Protocol.CMD_INFO); + out.flush(); + + // process answer + String response = in.readLine(); + InfoCommandResponse infoResponse = JsonObjectMapper.parseJson(response, InfoCommandResponse.class); + + // extract value + return infoResponse.getNumberOfStudents(); + } @Override From 372e6585b30e29298f1b6590a13fdf5abea86ce6 Mon Sep 17 00:00:00 2001 From: joelschar Date: Thu, 29 Mar 2018 09:58:45 +0200 Subject: [PATCH 10/73] all test v1 ok --- .../libraries/Maven__junit_junit_4_12.xml | 1 + QuizRouletteServer-build/.idea/misc.xml | 15 +- QuizRouletteServer-build/.idea/workspace.xml | 1326 ++++++++++------- .../net/client/RouletteV1ClientImpl.java | 63 +- .../QuizRouletteServer-test/test-stats.json | 2 +- 5 files changed, 818 insertions(+), 589 deletions(-) diff --git a/QuizRouletteServer-build/.idea/libraries/Maven__junit_junit_4_12.xml b/QuizRouletteServer-build/.idea/libraries/Maven__junit_junit_4_12.xml index d411041..7fd65ef 100644 --- a/QuizRouletteServer-build/.idea/libraries/Maven__junit_junit_4_12.xml +++ b/QuizRouletteServer-build/.idea/libraries/Maven__junit_junit_4_12.xml @@ -8,6 +8,7 @@ + \ No newline at end of file diff --git a/QuizRouletteServer-build/.idea/misc.xml b/QuizRouletteServer-build/.idea/misc.xml index 9f266be..e028f18 100644 --- a/QuizRouletteServer-build/.idea/misc.xml +++ b/QuizRouletteServer-build/.idea/misc.xml @@ -1,8 +1,5 @@ - - - - - - - - - - - - - - + diff --git a/QuizRouletteServer-build/.idea/workspace.xml b/QuizRouletteServer-build/.idea/workspace.xml index 2c77f66..9b97429 100644 --- a/QuizRouletteServer-build/.idea/workspace.xml +++ b/QuizRouletteServer-build/.idea/workspace.xml @@ -2,7 +2,11 @@ - + + + + + @@ -17,114 +21,102 @@ - - - - - + + + - - - + + - - + + - - - + + - - + + - - - + + - - + + - - - + + - - + + - - - + + - - + + - - - + + + + + + - - + + - - - + + - - + + - - - + + - - + + - - - + + - - - - - - - - + + + @@ -132,391 +124,382 @@ - - - - + + true - - - - - - + DEFINITION_ORDER - - - - - - - - - - - + + + - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -844,7 +836,8 @@ - + + @@ -881,7 +874,7 @@ - @@ -889,7 +882,6 @@ - @@ -897,12 +889,12 @@ - + - + @@ -910,6 +902,7 @@ + @@ -927,7 +920,7 @@ - @@ -935,6 +928,13 @@ + + + + + + + @@ -954,8 +954,6 @@ - - @@ -1200,13 +1198,6 @@ - - - - - - - @@ -1227,9 +1218,6 @@ - - - @@ -1246,15 +1234,15 @@ - + - - + + @@ -1271,7 +1259,7 @@ - + @@ -1279,14 +1267,14 @@ - + - - + + @@ -1297,10 +1285,17 @@ + + + + + + + - - + + diff --git a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java index acec102..3609a5f 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java +++ b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java @@ -45,10 +45,15 @@ public void connect(String server, int port) throws IOException { @Override public void disconnect() throws IOException { LOG.info("Client disconnect"); - in.close(); - out.close(); - socket.close(); + if(in != null) + in.close(); + + if(out != null) + out.close(); + + if(socket != null) + socket.close(); } @Override @@ -64,6 +69,8 @@ public void loadStudent(String fullname) throws IOException { List students = new ArrayList<>(); students.add(new Student(fullname)); this.loadStudents(students); + + LOG.info("load studend : " + fullname); } @Override @@ -75,6 +82,7 @@ public void loadStudents(List students) throws IOException { for(Student student : students) out.println(student.getFullname()); + out.println(RouletteV1Protocol.CMD_LOAD_ENDOFDATA_MARKER); out.flush(); From 177e94315903ec9002710359d0c8185ac6d58947 Mon Sep 17 00:00:00 2001 From: joelschar Date: Mon, 2 Apr 2018 20:40:03 +0200 Subject: [PATCH 14/73] template tests V2 --- QuizRouletteServer-build/.idea/workspace.xml | 443 ++++++++++-------- .../net/client/RouletteV2YannledTest.java | 63 +++ 2 files changed, 306 insertions(+), 200 deletions(-) create mode 100644 QuizRouletteServer-build/QuizRouletteServer-test/src/test/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2YannledTest.java diff --git a/QuizRouletteServer-build/.idea/workspace.xml b/QuizRouletteServer-build/.idea/workspace.xml index 0b6f738..d0db396 100644 --- a/QuizRouletteServer-build/.idea/workspace.xml +++ b/QuizRouletteServer-build/.idea/workspace.xml @@ -2,8 +2,8 @@ + - @@ -25,93 +25,113 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -940,19 +753,11 @@ + - - - - - - - - - @@ -974,66 +779,52 @@ + + + + + + + + + - - - + - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + - - - + + + + + + - - - - + + + + - + + + + + + + @@ -1060,10 +851,10 @@ - + - - + + @@ -1249,9 +1040,6 @@ - - - @@ -1276,13 +1064,6 @@ - - - - - - - @@ -1304,69 +1085,58 @@ - - - - + - - - - - + + - + - - - - - - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + @@ -1374,67 +1144,81 @@ - + - - - - - - - - - - + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + - + - + - - + + - + - - + + - + - - + + + + + + + - + - - + + diff --git a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/IRouletteV2Client.java b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/IRouletteV2Client.java index f99672f..73b1c76 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/IRouletteV2Client.java +++ b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/IRouletteV2Client.java @@ -28,10 +28,24 @@ public interface IRouletteV2Client extends IRouletteV1Client { */ public List listStudents() throws IOException; - + /** + * The last LOAD command has stored the number of students entered in the store + * @return number of students added + * @throws IOException + */ public int getNumberOfStudentAdded() throws IOException; + /** + * the client keeps track for the number of used commands + * @return number of commands used in this session + * @throws IOException + */ public int getNumberOfCommands() throws IOException; + /** + * the variable successCommand is updated each time the server ansewers wis a success + * @return value of the successCommand variable + * @throws IOException + */ public boolean checkSuccessOfCommand() throws IOException; } diff --git a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java index 537b933..c40b7bd 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java +++ b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV1ClientImpl.java @@ -33,7 +33,6 @@ public class RouletteV1ClientImpl implements IRouletteV1Client { private Socket socket; BufferedReader in; PrintWriter out; - private Boolean successCommand = true; @Override public void connect(String server, int port) throws IOException { @@ -107,7 +106,6 @@ public Student pickRandomStudent() throws EmptyStoreException, IOException { if(randomResponse.getError() != null){ LOG.info(randomResponse.getError()); - successCommand = false; throw new EmptyStoreException(); } @@ -136,8 +134,4 @@ public String getProtocolVersion() throws IOException { return RouletteV1Protocol.VERSION; } - public boolean checkSuccessOfCommand() throws IOException{ - return successCommand; - } - } diff --git a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2ClientImpl.java b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2ClientImpl.java index d9e54f6..e5e01e8 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2ClientImpl.java +++ b/QuizRouletteServer-build/QuizRouletteServer-code/src/main/java/ch/heigvd/res/labs/roulette/net/client/RouletteV2ClientImpl.java @@ -13,11 +13,14 @@ * This class implements the client side of the protocol specification (version 2). * * @author Olivier Liechti + * @author edited by Joel Schar and Yann Lederrey */ public class RouletteV2ClientImpl extends RouletteV1ClientImpl implements IRouletteV2Client { private int nbCommandsUsed = 0; private int nbStudentsLoaded = 0; + private Boolean successCommand = true; + @Override public void clearDataStore() throws IOException { @@ -58,7 +61,7 @@ public String getProtocolVersion() throws IOException { } public boolean checkSuccessOfCommand() throws IOException{ - return super.checkSuccessOfCommand(); + return successCommand; } public void disconnect() throws IOException{ @@ -75,6 +78,7 @@ public void loadStudent(String fullname) throws IOException { LOG.info("load student : " + fullname); } + @Override public void loadStudents(List students) throws IOException{ nbCommandsUsed++; out.println(RouletteV2Protocol.CMD_LOAD); @@ -93,13 +97,30 @@ public void loadStudents(List students) throws IOException{ LOG.info(response); LoadCommandResponse ldResponse = JsonObjectMapper.parseJson(response, LoadCommandResponse.class); + successCommand = ldResponse.getStatus().equals("success"); + nbStudentsLoaded = ldResponse.getNumberOfNewStudents(); } + @Override public Student pickRandomStudent() throws EmptyStoreException, IOException{ nbCommandsUsed++; - return super.pickRandomStudent(); - } + + out.println(RouletteV1Protocol.CMD_RANDOM); + out.flush(); + + String response = in.readLine(); + LOG.info(response); + RandomCommandResponse randomResponse = JsonObjectMapper.parseJson(response, RandomCommandResponse.class); + + if(randomResponse.getError() != null){ + LOG.info(randomResponse.getError()); + successCommand = false; + throw new EmptyStoreException(); + } + + return new Student(randomResponse.getFullname()); + } public int getNumberOfStudents() throws IOException{ nbCommandsUsed++; diff --git a/QuizRouletteServer-build/QuizRouletteServer-test/test-stats.json b/QuizRouletteServer-build/QuizRouletteServer-test/test-stats.json index 0414b93..50fc258 100644 --- a/QuizRouletteServer-build/QuizRouletteServer-test/test-stats.json +++ b/QuizRouletteServer-build/QuizRouletteServer-test/test-stats.json @@ -1 +1 @@ -{"numberOfTestsByAuthor":{"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest#wasadigi":7,"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest#SoftEng-HEIGVD":2},"testResults":{"ignoreCount":0,"failures":[{"testHeader":"theServerShouldSendAnErrorResponseWhenRandomIsCalledAndThereIsNoStudent(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","description":{"displayName":"theServerShouldSendAnErrorResponseWhenRandomIsCalledAndThereIsNoStudent(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","children":[],"suite":false,"test":true,"testClass":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","empty":false,"annotations":[{},{}],"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","methodName":"theServerShouldSendAnErrorResponseWhenRandomIsCalledAndThereIsNoStudent"},"trace":"java.lang.UnsupportedOperationException: Not supported yet.\n\tat ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl.connect(RouletteV1ClientImpl.java:30)\n\tat ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair.before(EphemeralClientServerPair.java:33)\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)\n\tat org.junit.rules.RunRules.evaluate(RunRules.java:20)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\n","message":"Not supported yet.","exception":{"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"connect","fileName":"RouletteV1ClientImpl.java","lineNumber":30,"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"before","fileName":"EphemeralClientServerPair.java","lineNumber":33,"className":"ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ExternalResource.java","lineNumber":46,"className":"org.junit.rules.ExternalResource$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"RunRules.java","lineNumber":20,"className":"org.junit.rules.RunRules","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runLeaf","fileName":"ParentRunner.java","lineNumber":325,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":78,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":57,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":290,"className":"org.junit.runners.ParentRunner$3","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"schedule","fileName":"ParentRunner.java","lineNumber":71,"className":"org.junit.runners.ParentRunner$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChildren","fileName":"ParentRunner.java","lineNumber":288,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"access$000","fileName":"ParentRunner.java","lineNumber":58,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ParentRunner.java","lineNumber":268,"className":"org.junit.runners.ParentRunner$2","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":363,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"execute","fileName":"JUnit4Provider.java","lineNumber":283,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeWithRerun","fileName":"JUnit4Provider.java","lineNumber":173,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeTestSet","fileName":"JUnit4Provider.java","lineNumber":153,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invoke","fileName":"JUnit4Provider.java","lineNumber":128,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invokeProviderInSameClassLoader","fileName":"ForkedBooter.java","lineNumber":203,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runSuitesInProcess","fileName":"ForkedBooter.java","lineNumber":155,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"main","fileName":"ForkedBooter.java","lineNumber":103,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false}],"suppressed":[],"message":"Not supported yet.","localizedMessage":"Not supported yet."}},{"testHeader":"theTestRouletteClientShouldBeConnectedWhenATestStarts(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","description":{"displayName":"theTestRouletteClientShouldBeConnectedWhenATestStarts(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","children":[],"suite":false,"test":true,"testClass":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","empty":false,"annotations":[{},{}],"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","methodName":"theTestRouletteClientShouldBeConnectedWhenATestStarts"},"trace":"java.lang.UnsupportedOperationException: Not supported yet.\n\tat ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl.connect(RouletteV1ClientImpl.java:30)\n\tat ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair.before(EphemeralClientServerPair.java:33)\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)\n\tat org.junit.rules.RunRules.evaluate(RunRules.java:20)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\n","message":"Not supported yet.","exception":{"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"connect","fileName":"RouletteV1ClientImpl.java","lineNumber":30,"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"before","fileName":"EphemeralClientServerPair.java","lineNumber":33,"className":"ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ExternalResource.java","lineNumber":46,"className":"org.junit.rules.ExternalResource$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"RunRules.java","lineNumber":20,"className":"org.junit.rules.RunRules","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runLeaf","fileName":"ParentRunner.java","lineNumber":325,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":78,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":57,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":290,"className":"org.junit.runners.ParentRunner$3","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"schedule","fileName":"ParentRunner.java","lineNumber":71,"className":"org.junit.runners.ParentRunner$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChildren","fileName":"ParentRunner.java","lineNumber":288,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"access$000","fileName":"ParentRunner.java","lineNumber":58,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ParentRunner.java","lineNumber":268,"className":"org.junit.runners.ParentRunner$2","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":363,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"execute","fileName":"JUnit4Provider.java","lineNumber":283,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeWithRerun","fileName":"JUnit4Provider.java","lineNumber":173,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeTestSet","fileName":"JUnit4Provider.java","lineNumber":153,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invoke","fileName":"JUnit4Provider.java","lineNumber":128,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invokeProviderInSameClassLoader","fileName":"ForkedBooter.java","lineNumber":203,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runSuitesInProcess","fileName":"ForkedBooter.java","lineNumber":155,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"main","fileName":"ForkedBooter.java","lineNumber":103,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false}],"suppressed":[],"message":"Not supported yet.","localizedMessage":"Not supported yet."}},{"testHeader":"theTestRouletteServerShouldRunDuringTests(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","description":{"displayName":"theTestRouletteServerShouldRunDuringTests(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","children":[],"suite":false,"test":true,"testClass":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","empty":false,"annotations":[{},{}],"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","methodName":"theTestRouletteServerShouldRunDuringTests"},"trace":"java.lang.UnsupportedOperationException: Not supported yet.\n\tat ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl.connect(RouletteV1ClientImpl.java:30)\n\tat ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair.before(EphemeralClientServerPair.java:33)\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)\n\tat org.junit.rules.RunRules.evaluate(RunRules.java:20)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\n","message":"Not supported yet.","exception":{"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"connect","fileName":"RouletteV1ClientImpl.java","lineNumber":30,"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"before","fileName":"EphemeralClientServerPair.java","lineNumber":33,"className":"ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ExternalResource.java","lineNumber":46,"className":"org.junit.rules.ExternalResource$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"RunRules.java","lineNumber":20,"className":"org.junit.rules.RunRules","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runLeaf","fileName":"ParentRunner.java","lineNumber":325,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":78,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":57,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":290,"className":"org.junit.runners.ParentRunner$3","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"schedule","fileName":"ParentRunner.java","lineNumber":71,"className":"org.junit.runners.ParentRunner$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChildren","fileName":"ParentRunner.java","lineNumber":288,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"access$000","fileName":"ParentRunner.java","lineNumber":58,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ParentRunner.java","lineNumber":268,"className":"org.junit.runners.ParentRunner$2","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":363,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"execute","fileName":"JUnit4Provider.java","lineNumber":283,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeWithRerun","fileName":"JUnit4Provider.java","lineNumber":173,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeTestSet","fileName":"JUnit4Provider.java","lineNumber":153,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invoke","fileName":"JUnit4Provider.java","lineNumber":128,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invokeProviderInSameClassLoader","fileName":"ForkedBooter.java","lineNumber":203,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runSuitesInProcess","fileName":"ForkedBooter.java","lineNumber":155,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"main","fileName":"ForkedBooter.java","lineNumber":103,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false}],"suppressed":[],"message":"Not supported yet.","localizedMessage":"Not supported yet."}},{"testHeader":"itShouldBePossibleForARouletteClientToConnectToARouletteServer(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","description":{"displayName":"itShouldBePossibleForARouletteClientToConnectToARouletteServer(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","children":[],"suite":false,"test":true,"testClass":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","empty":false,"annotations":[{},{}],"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","methodName":"itShouldBePossibleForARouletteClientToConnectToARouletteServer"},"trace":"java.lang.UnsupportedOperationException: Not supported yet.\n\tat ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl.connect(RouletteV1ClientImpl.java:30)\n\tat ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair.before(EphemeralClientServerPair.java:33)\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)\n\tat org.junit.rules.RunRules.evaluate(RunRules.java:20)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\n","message":"Not supported yet.","exception":{"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"connect","fileName":"RouletteV1ClientImpl.java","lineNumber":30,"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"before","fileName":"EphemeralClientServerPair.java","lineNumber":33,"className":"ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ExternalResource.java","lineNumber":46,"className":"org.junit.rules.ExternalResource$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"RunRules.java","lineNumber":20,"className":"org.junit.rules.RunRules","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runLeaf","fileName":"ParentRunner.java","lineNumber":325,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":78,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":57,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":290,"className":"org.junit.runners.ParentRunner$3","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"schedule","fileName":"ParentRunner.java","lineNumber":71,"className":"org.junit.runners.ParentRunner$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChildren","fileName":"ParentRunner.java","lineNumber":288,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"access$000","fileName":"ParentRunner.java","lineNumber":58,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ParentRunner.java","lineNumber":268,"className":"org.junit.runners.ParentRunner$2","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":363,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"execute","fileName":"JUnit4Provider.java","lineNumber":283,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeWithRerun","fileName":"JUnit4Provider.java","lineNumber":173,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeTestSet","fileName":"JUnit4Provider.java","lineNumber":153,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invoke","fileName":"JUnit4Provider.java","lineNumber":128,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invokeProviderInSameClassLoader","fileName":"ForkedBooter.java","lineNumber":203,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runSuitesInProcess","fileName":"ForkedBooter.java","lineNumber":155,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"main","fileName":"ForkedBooter.java","lineNumber":103,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false}],"suppressed":[],"message":"Not supported yet.","localizedMessage":"Not supported yet."}},{"testHeader":"theServerShouldStillHaveZeroStudentsAtStart(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","description":{"displayName":"theServerShouldStillHaveZeroStudentsAtStart(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","children":[],"suite":false,"test":true,"testClass":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","empty":false,"annotations":[{},{}],"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","methodName":"theServerShouldStillHaveZeroStudentsAtStart"},"trace":"java.lang.UnsupportedOperationException: Not supported yet.\n\tat ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl.connect(RouletteV1ClientImpl.java:30)\n\tat ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair.before(EphemeralClientServerPair.java:33)\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)\n\tat org.junit.rules.RunRules.evaluate(RunRules.java:20)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\n","message":"Not supported yet.","exception":{"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"connect","fileName":"RouletteV1ClientImpl.java","lineNumber":30,"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"before","fileName":"EphemeralClientServerPair.java","lineNumber":33,"className":"ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ExternalResource.java","lineNumber":46,"className":"org.junit.rules.ExternalResource$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"RunRules.java","lineNumber":20,"className":"org.junit.rules.RunRules","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runLeaf","fileName":"ParentRunner.java","lineNumber":325,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":78,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":57,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":290,"className":"org.junit.runners.ParentRunner$3","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"schedule","fileName":"ParentRunner.java","lineNumber":71,"className":"org.junit.runners.ParentRunner$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChildren","fileName":"ParentRunner.java","lineNumber":288,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"access$000","fileName":"ParentRunner.java","lineNumber":58,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ParentRunner.java","lineNumber":268,"className":"org.junit.runners.ParentRunner$2","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":363,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"execute","fileName":"JUnit4Provider.java","lineNumber":283,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeWithRerun","fileName":"JUnit4Provider.java","lineNumber":173,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeTestSet","fileName":"JUnit4Provider.java","lineNumber":153,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invoke","fileName":"JUnit4Provider.java","lineNumber":128,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invokeProviderInSameClassLoader","fileName":"ForkedBooter.java","lineNumber":203,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runSuitesInProcess","fileName":"ForkedBooter.java","lineNumber":155,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"main","fileName":"ForkedBooter.java","lineNumber":103,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false}],"suppressed":[],"message":"Not supported yet.","localizedMessage":"Not supported yet."}},{"testHeader":"theServerShouldCountStudents(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","description":{"displayName":"theServerShouldCountStudents(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","children":[],"suite":false,"test":true,"testClass":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","empty":false,"annotations":[{},{}],"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","methodName":"theServerShouldCountStudents"},"trace":"java.lang.UnsupportedOperationException: Not supported yet.\n\tat ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl.connect(RouletteV1ClientImpl.java:30)\n\tat ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair.before(EphemeralClientServerPair.java:33)\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)\n\tat org.junit.rules.RunRules.evaluate(RunRules.java:20)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\n","message":"Not supported yet.","exception":{"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"connect","fileName":"RouletteV1ClientImpl.java","lineNumber":30,"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"before","fileName":"EphemeralClientServerPair.java","lineNumber":33,"className":"ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ExternalResource.java","lineNumber":46,"className":"org.junit.rules.ExternalResource$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"RunRules.java","lineNumber":20,"className":"org.junit.rules.RunRules","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runLeaf","fileName":"ParentRunner.java","lineNumber":325,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":78,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":57,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":290,"className":"org.junit.runners.ParentRunner$3","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"schedule","fileName":"ParentRunner.java","lineNumber":71,"className":"org.junit.runners.ParentRunner$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChildren","fileName":"ParentRunner.java","lineNumber":288,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"access$000","fileName":"ParentRunner.java","lineNumber":58,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ParentRunner.java","lineNumber":268,"className":"org.junit.runners.ParentRunner$2","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":363,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"execute","fileName":"JUnit4Provider.java","lineNumber":283,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeWithRerun","fileName":"JUnit4Provider.java","lineNumber":173,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeTestSet","fileName":"JUnit4Provider.java","lineNumber":153,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invoke","fileName":"JUnit4Provider.java","lineNumber":128,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invokeProviderInSameClassLoader","fileName":"ForkedBooter.java","lineNumber":203,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runSuitesInProcess","fileName":"ForkedBooter.java","lineNumber":155,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"main","fileName":"ForkedBooter.java","lineNumber":103,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false}],"suppressed":[],"message":"Not supported yet.","localizedMessage":"Not supported yet."}},{"testHeader":"theServerShouldHaveZeroStudentsAtStart(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","description":{"displayName":"theServerShouldHaveZeroStudentsAtStart(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","children":[],"suite":false,"test":true,"testClass":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","empty":false,"annotations":[{},{}],"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","methodName":"theServerShouldHaveZeroStudentsAtStart"},"trace":"java.lang.UnsupportedOperationException: Not supported yet.\n\tat ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl.connect(RouletteV1ClientImpl.java:30)\n\tat ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair.before(EphemeralClientServerPair.java:33)\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)\n\tat org.junit.rules.RunRules.evaluate(RunRules.java:20)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\n","message":"Not supported yet.","exception":{"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"connect","fileName":"RouletteV1ClientImpl.java","lineNumber":30,"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"before","fileName":"EphemeralClientServerPair.java","lineNumber":33,"className":"ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ExternalResource.java","lineNumber":46,"className":"org.junit.rules.ExternalResource$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"RunRules.java","lineNumber":20,"className":"org.junit.rules.RunRules","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runLeaf","fileName":"ParentRunner.java","lineNumber":325,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":78,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":57,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":290,"className":"org.junit.runners.ParentRunner$3","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"schedule","fileName":"ParentRunner.java","lineNumber":71,"className":"org.junit.runners.ParentRunner$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChildren","fileName":"ParentRunner.java","lineNumber":288,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"access$000","fileName":"ParentRunner.java","lineNumber":58,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ParentRunner.java","lineNumber":268,"className":"org.junit.runners.ParentRunner$2","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":363,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"execute","fileName":"JUnit4Provider.java","lineNumber":283,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeWithRerun","fileName":"JUnit4Provider.java","lineNumber":173,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeTestSet","fileName":"JUnit4Provider.java","lineNumber":153,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invoke","fileName":"JUnit4Provider.java","lineNumber":128,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invokeProviderInSameClassLoader","fileName":"ForkedBooter.java","lineNumber":203,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runSuitesInProcess","fileName":"ForkedBooter.java","lineNumber":155,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"main","fileName":"ForkedBooter.java","lineNumber":103,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false}],"suppressed":[],"message":"Not supported yet.","localizedMessage":"Not supported yet."}},{"testHeader":"theServerShouldReturnTheCorrectVersionNumber(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","description":{"displayName":"theServerShouldReturnTheCorrectVersionNumber(ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest)","children":[],"suite":false,"test":true,"testClass":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","empty":false,"annotations":[{},{}],"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest","methodName":"theServerShouldReturnTheCorrectVersionNumber"},"trace":"java.lang.UnsupportedOperationException: Not supported yet.\n\tat ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl.connect(RouletteV1ClientImpl.java:30)\n\tat ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair.before(EphemeralClientServerPair.java:33)\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)\n\tat org.junit.rules.RunRules.evaluate(RunRules.java:20)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\n","message":"Not supported yet.","exception":{"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"connect","fileName":"RouletteV1ClientImpl.java","lineNumber":30,"className":"ch.heigvd.res.labs.roulette.net.client.RouletteV1ClientImpl","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"before","fileName":"EphemeralClientServerPair.java","lineNumber":33,"className":"ch.heigvd.res.labs.roulette.net.client.EphemeralClientServerPair","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ExternalResource.java","lineNumber":46,"className":"org.junit.rules.ExternalResource$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"RunRules.java","lineNumber":20,"className":"org.junit.rules.RunRules","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runLeaf","fileName":"ParentRunner.java","lineNumber":325,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":78,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChild","fileName":"BlockJUnit4ClassRunner.java","lineNumber":57,"className":"org.junit.runners.BlockJUnit4ClassRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":290,"className":"org.junit.runners.ParentRunner$3","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"schedule","fileName":"ParentRunner.java","lineNumber":71,"className":"org.junit.runners.ParentRunner$1","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runChildren","fileName":"ParentRunner.java","lineNumber":288,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"access$000","fileName":"ParentRunner.java","lineNumber":58,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"evaluate","fileName":"ParentRunner.java","lineNumber":268,"className":"org.junit.runners.ParentRunner$2","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"run","fileName":"ParentRunner.java","lineNumber":363,"className":"org.junit.runners.ParentRunner","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"execute","fileName":"JUnit4Provider.java","lineNumber":283,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeWithRerun","fileName":"JUnit4Provider.java","lineNumber":173,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"executeTestSet","fileName":"JUnit4Provider.java","lineNumber":153,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invoke","fileName":"JUnit4Provider.java","lineNumber":128,"className":"org.apache.maven.surefire.junit4.JUnit4Provider","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"invokeProviderInSameClassLoader","fileName":"ForkedBooter.java","lineNumber":203,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"runSuitesInProcess","fileName":"ForkedBooter.java","lineNumber":155,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"main","fileName":"ForkedBooter.java","lineNumber":103,"className":"org.apache.maven.surefire.booter.ForkedBooter","nativeMethod":false}],"suppressed":[],"message":"Not supported yet.","localizedMessage":"Not supported yet."}}],"runTime":891,"failureCount":8,"runCount":11}} \ No newline at end of file +{"numberOfTestsByAuthor":{"ch.heigvd.res.labs.roulette.net.client.RouletteV2YannledTest#yannled":3,"ch.heigvd.res.labs.roulette.net.client.RouletteV2SysmohTest#sysmoh":6,"ch.heigvd.res.labs.roulette.net.client.RouletteV2mathieujeeTest#mathieujee":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2mlabieTest#mlabie":6,"ch.heigvd.res.labs.roulette.net.client.RouletteV2ManalitoTest#nfluckiger":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2GZeedTest#GZeed":3,"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest#wasadigi":7,"ch.heigvd.res.labs.roulette.net.client.RouletteV2DumoriaTest#Dumoria":12,"ch.heigvd.res.labs.roulette.net.client.RouletteV2OuzgagaTest#ouzgaga":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2AmadeousTest#amadeous":7,"ch.heigvd.res.labs.roulette.net.client.RouletteV2LoyseKrugTest#AdrienAllemand":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2AngoranceTest#LNAline":6,"ch.heigvd.res.labs.roulette.net.client.RouletteV2JokauTest#jokau, loic-schurch":8,"ch.heigvd.res.labs.roulette.net.client.RouletteV2SachaKorTest#sachakor":6,"ch.heigvd.res.labs.roulette.net.client.RouletteV2SmithHeigTest#smithheig":3,"ch.heigvd.res.labs.roulette.net.client.RouletteV2NortalleTest#Nortalle":4,"ch.heigvd.res.labs.roulette.net.client.RouletteV2francoisburgenerTest#wasadigi":6,"ch.heigvd.res.labs.roulette.net.client.RouletteV2christophejoyetTest#christophe-joyet":3,"ch.heigvd.res.labs.roulette.net.client.RouletteV2AngoranceTest#Angorance":6,"ch.heigvd.res.labs.roulette.net.client.RouletteV2tranqui793Test#tranqui793":4,"ch.heigvd.res.labs.roulette.net.client.RouletteV2JokauTest#wasadigi, jokau, loic-schurch":1,"ch.heigvd.res.labs.roulette.net.client.RouletteV2shinopillTest#shinopill":3,"ch.heigvd.res.labs.roulette.net.client.RouletteV1WasadigiTest#SoftEng-HEIGVD":2,"ch.heigvd.res.labs.roulette.net.client.RouletteV2LionelNanchenTest#LionelNanchen":4,"ch.heigvd.res.labs.roulette.net.client.RouletteV2JokauTest#wasadigi":3,"ch.heigvd.res.labs.roulette.net.client.RouletteV2Mantha32Test#Mantha32":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2LoyseKrugTest#LoyseKrug":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2olivierKoppTest#olivierKopp":4,"ch.heigvd.res.labs.roulette.net.client.RouletteV2rlabinotTest#rlabinot":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2francoisburgenerTest#SoftEng-HEIGVD":2,"ch.heigvd.res.labs.roulette.net.client.RouletteV2YannledTest#wasadigi":2,"ch.heigvd.res.labs.roulette.net.client.RouletteV2SachaKorTest#Etnarion":1,"ch.heigvd.res.labs.roulette.net.client.RouletteV2mlabieTest#wasadigi":4,"ch.heigvd.res.labs.roulette.net.client.RouletteV2dorianekaffoTest#dorianekaffo":4,"ch.heigvd.res.labs.roulette.net.client.RouletteV2onicoleheigTest#onicoleheig":4,"ch.heigvd.res.labs.roulette.net.client.RouletteV2PstackouseTest#SoftEng-HEIGVD":2,"ch.heigvd.res.labs.roulette.net.client.RouletteV2ManalitoTest#manalito":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2JokauTest#SoftEng-HEIGVD":2,"ch.heigvd.res.labs.roulette.net.client.RouletteV2maxcaduffTest#maxcaduff":3,"ch.heigvd.res.labs.roulette.net.client.RouletteV2AdamZouariTest#AdamZouari":6,"ch.heigvd.res.labs.roulette.net.client.RouletteV2PstackouseTest#p-stackouse":6,"ch.heigvd.res.labs.roulette.net.client.RouletteV2Ludwig9392Test#Ludwig9392":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2francoisburgenerTest#BryCur":10,"ch.heigvd.res.labs.roulette.net.client.RouletteV2OuzgagaTest#Nooka10":5,"ch.heigvd.res.labs.roulette.net.client.RouletteV2romainSilvestriTest#romainSilvestri":4,"ch.heigvd.res.labs.roulette.net.client.RouletteV2francoisburgenerTest#francoisburgener":10},"testResults":{"ignoreCount":0,"failures":[],"runTime":2393,"failureCount":0,"runCount":183}} \ No newline at end of file From 1f8d9cd922c709ba5c12572a9f193a7b6aaf6f41 Mon Sep 17 00:00:00 2001 From: joelschar Date: Thu, 5 Apr 2018 15:59:39 +0200 Subject: [PATCH 73/73] ajout entete loadCommandResponse --- QuizRouletteServer-build/.idea/workspace.xml | 206 ++++++++++++------ .../net/protocol/LoadCommandResponse.java | 8 + .../QuizRouletteServer-test/test-stats.json | 2 +- 3 files changed, 148 insertions(+), 68 deletions(-) diff --git a/QuizRouletteServer-build/.idea/workspace.xml b/QuizRouletteServer-build/.idea/workspace.xml index 9cc46ec..b6965bd 100644 --- a/QuizRouletteServer-build/.idea/workspace.xml +++ b/QuizRouletteServer-build/.idea/workspace.xml @@ -3,9 +3,7 @@ - - - + @@ -28,7 +26,74 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -89,6 +154,9 @@ + + + @@ -152,6 +220,17 @@ + + + + + + + + + + + @@ -233,9 +312,6 @@