Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendu Labo TCP [Johanna Melly & Yohann Meyer ] #93

Open
wants to merge 119 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
5de7a9d
Adding 4 new tests for V2 protocol
Mar 25, 2018
32056c0
adding Tests for Protocol V2
yosra-harbaoui Mar 27, 2018
7c77d5a
Task 3 implemented, all tests passed
onicoleheig Mar 27, 2018
19d87e4
Test ProtocolV2 - SmithHeig
SmithHeig Mar 28, 2018
3d19ef0
add LionelNanchen V2 test
Mar 28, 2018
34bb3bd
Implementation of RouletteV1ClientImpl
christophe-joyet Mar 28, 2018
384a77e
adding test for protocol v2
Mar 31, 2018
83a84a9
Test for the Roulette protocol V2
mlabie Apr 1, 2018
cce4424
tests V2 impl added
onicoleheig Apr 3, 2018
d33ee1c
Added V2 tests
Angorance Apr 3, 2018
3da4065
adding tests
yannled Apr 3, 2018
2365dd4
implementation of Tests for the Roulette v2
LaghaOussama Apr 3, 2018
495c9ce
Adding some new tests
rlabinot Apr 3, 2018
5047a88
Adding tests for V2 protocol - Rochat Antoine & Schopfer Benoit
ouzgaga Apr 3, 2018
29436d1
2 tests added
romaingallay Apr 3, 2018
ade1984
Merge branch 'fb-lab02-v2-contrib' into fb-lab02-v2-tests
ouzgaga Apr 3, 2018
facb236
RouletteV2dorianekaffoTest
Apr 3, 2018
a2d1a9a
Rendu test personnalisé
shinopill Apr 3, 2018
68ddd3d
Adding tests for V2 protocol
ouzgaga Apr 3, 2018
b59aece
Merge branch 'fb-lab02-v2-contrib' into fb-lab02-v2-tests
ouzgaga Apr 3, 2018
c5f66ac
add test for v2
AdamZouari Apr 3, 2018
2100585
start of implementation. TODO finish all functions, and use return va…
Nyahon Apr 3, 2018
b06a7dd
Add tests methods name. Will be implemented
Apr 3, 2018
a523cf2
A few tests implemented
Schnoudli Apr 3, 2018
cc60bc3
A few tests are implemented
Schnoudli Apr 3, 2018
2d9bb13
add my own test for V2 protocol
Mantha32 Apr 3, 2018
66a7148
add V2 tests
ovesco Apr 4, 2018
7c46d65
Merge pull request #1 from romainSilvestri/fb-lab02-v2-contrib
wasadigi Apr 4, 2018
033701a
Merge pull request #3 from SmithHeig/fb-lab02-v2-tests
wasadigi Apr 4, 2018
a34835a
Merge pull request #4 from LionelNanchen/fb-lab02-v2-tests
wasadigi Apr 4, 2018
bb59dfc
Merge pull request #6 from olivierKopp/fb-lab02-v2-contrib
wasadigi Apr 4, 2018
36b4461
Merge pull request #15 from Angorance/fb-lab02-v2-contrib
wasadigi Apr 4, 2018
1bad178
Merge pull request #16 from yannled/test
wasadigi Apr 4, 2018
79b1ae0
Merge pull request #18 from rlabinot/fb-lab02-v2-tests
wasadigi Apr 4, 2018
1b74230
Merge pull request #19 from ouzgaga/fb-lab02-v2-tests
wasadigi Apr 4, 2018
379a55e
Merge pull request #21 from shinopill/fb-lab02-v2-contrib
wasadigi Apr 4, 2018
51ed056
Merge pull request #23 from AdamZouari/fb-lab02-v2-contrib
wasadigi Apr 4, 2018
498a94a
Merge pull request #24 from Mantha32/fb-lab02-v2-contrib
wasadigi Apr 4, 2018
6db3601
Merge pull request #27 from sysmoh/fb-lab02-v2-contrib
wasadigi Apr 4, 2018
07bd65a
Merge pull request #28 from tranqui793/fb-lab02-v2-contrib
wasadigi Apr 4, 2018
09f400e
implement of tests v2
christophe-joyet Apr 4, 2018
34b46fa
rm change from clientImpl
christophe-joyet Apr 4, 2018
e12cf50
rm change from impl file
christophe-joyet Apr 4, 2018
12d3d6a
rm change from file implClient
christophe-joyet Apr 4, 2018
de89e9e
...
christophe-joyet Apr 4, 2018
0f969e2
...
christophe-joyet Apr 4, 2018
c0f82dc
version_1_2
fabano237 Apr 4, 2018
de09a7a
First batch of student tests for v2; cleaned up; pass reference imple…
wasadigi Apr 4, 2018
173b1cc
6 Tests for the V2 Protocol added by Frueh and Muaremi
Ludwig9392 Apr 4, 2018
f7693e4
Test RouletteV2 Bryan Curchod/François Burgener
francoisburgener Apr 4, 2018
78d80a6
Récupération des testes
francoisburgener Apr 4, 2018
51da0f1
test v2
GZeed Apr 4, 2018
1e3c016
automated tests to specify the behaviour of the v2 protocol
Dumoria Apr 4, 2018
3770534
tests implemented
SachaKor Apr 4, 2018
37ea522
ajout des tests V2
johannamelly Apr 4, 2018
8963373
contenu des tests v2
johannamelly Apr 4, 2018
966651b
resotre files...
onicoleheig Apr 4, 2018
70d6d2d
ajout tests pour RouletteV2Protocol
Apr 4, 2018
aac4560
restore files.. again
onicoleheig Apr 4, 2018
089d287
V2 tests Schurch Kaufmann
Jokau Apr 4, 2018
551ddbb
Added tests Roulette v2 github id: nfluckiger and manalito
manalito Apr 4, 2018
7f2f5e2
update tests Roulette v2 github id: nfluckiger and manalito
manalito Apr 4, 2018
b459c9e
Protocol V2 Tests - Adrien Allemand, Loyse Krug
Grogath Apr 4, 2018
fb9a49f
enfin ?
Nortalle Apr 4, 2018
a231229
With correct file staged ^^'
Grogath Apr 4, 2018
3cb7c92
Merge branch 'fb-lab02-v2-tests' of https://github.com/Nortalle/Teach…
Nortalle Apr 4, 2018
ac2bbb3
Some more tests
Schnoudli Apr 4, 2018
79f7c0d
tests implemented
SachaKor Apr 4, 2018
d329bc6
Remove hardcoded port for V2 and useless unimplemented tests
Apr 4, 2018
51c8b67
Correct mistake
Apr 4, 2018
2df81dc
test implementations, and only them
Nyahon Apr 4, 2018
37bfff3
test implementations, and maybe only them
Nyahon Apr 4, 2018
c835f57
test v2
GZeed Apr 4, 2018
68662b2
Merge branch 'fb-labo02-v2-newcontrib' of https://github.com/GZeed/Te…
GZeed Apr 4, 2018
4f3d4a1
delete properties
GZeed Apr 4, 2018
9a0ae0d
Final commit
Apr 4, 2018
e2dadaf
tests v2 submitted
maxcaduff Apr 4, 2018
0b66499
Merge pull request #20 from dorianekaffo/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
9314ca7
Merge pull request #22 from francoisburgener/fb-lab02-v2-tests
wasadigi Apr 5, 2018
b44e6e2
Merge pull request #29 from christophe-joyet/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
18edde8
Merge pull request #30 from ericafabrice/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
42c9b5f
Merge pull request #31 from Ludwig9392/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
baaf06b
Merge pull request #32 from GZeed/fb-labo02-v2-newcontrib
wasadigi Apr 5, 2018
4b7016e
Merge pull request #33 from yosra-harbaoui/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
baec97b
Merge pull request #35 from Dumoria/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
2618c99
Merge pull request #40 from Jokau/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
db5891e
Merge pull request #41 from mathieujee/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
8350c1b
Merge pull request #42 from LoyseKrug/fb-lab02-v2-tests
wasadigi Apr 5, 2018
aae8eee
Merge pull request #43 from manalito/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
58754f9
Merge pull request #44 from Nortalle/fb-lab02-v2-tests
wasadigi Apr 5, 2018
5077abb
Merge pull request #10 from onicoleheig/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
6a10e91
Merge pull request #46 from mlabie/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
790c9a0
Merge pull request #47 from amadeous/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
8632d11
Merge pull request #49 from SachaKor/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
b953a22
Merge pull request #51 from p-stackouse/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
f48b078
Merge pull request #53 from maxcaduff/fb-lab02-v2-contrib
wasadigi Apr 5, 2018
660181f
Add second batch of curated student contributions; reference impl pas…
wasadigi Apr 5, 2018
5609e2f
on right branch, modif for V1clientImpl
Nyahon Apr 5, 2018
a619571
is this it ?
Nyahon Apr 5, 2018
a1396e0
Merge branch 'fb-lab02-v2-tests' of github.com:SoftEng-HEIGVD/Teachin…
Nyahon Apr 5, 2018
80ed2b3
Merge branch 'fb-lab02-v2-tests' of https://github.com/SoftEng-HEIGVD…
johannamelly Apr 5, 2018
b8c5785
?
Nyahon Apr 5, 2018
4b97257
temp
Nyahon Apr 5, 2018
da2402d
all good for compilation, included function names of tests added by o…
Nyahon Apr 5, 2018
571ae6e
Merge branch 'fb-lab02-v2-tests'
johannamelly Apr 5, 2018
5f14876
Merge branch 'master' of https://github.com/Nyahon/Teaching-HEIGVD-RE…
johannamelly Apr 5, 2018
a3df0fe
recuperation of V1impl
Nyahon Apr 5, 2018
091e3d2
Merge branch 'master' of https://github.com/Nyahon/Teaching-HEIGVD-RE…
johannamelly Apr 5, 2018
5b45565
All tests passing
Nyahon Apr 5, 2018
b07eb1f
Merge branch 'master' of https://github.com/Nyahon/Teaching-HEIGVD-RE…
johannamelly Apr 5, 2018
55c8620
début d'implémentation de la V2; handler à remanier complètement, cla…
johannamelly Apr 5, 2018
07f3a7e
problème avec les tests (null pointer exception). modification du mai…
johannamelly Apr 6, 2018
fa74ef5
bordel absolu niveau test pour des raisons que je ne comprends pas po…
johannamelly Apr 6, 2018
af5606b
C'était.. intéressant. :)
Nyahon Apr 8, 2018
cbfa784
moins de fail
johannamelly Apr 8, 2018
19097ca
30 tests failed, most of them due to nb of commands client-side.
Nyahon Apr 8, 2018
e01ebb8
same, but nicer
Nyahon Apr 8, 2018
dfa9294
tu vas pas aimer mais on a gagné 2 tests
johannamelly Apr 8, 2018
4b07715
tu vas pas aimer mais on a gagné 8 tests
johannamelly Apr 8, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions QuizRouletteServer-build/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,126 changes: 633 additions & 493 deletions QuizRouletteServer-build/.idea/workspace.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class QuizRouletteServer {
*/
public static void main(String[] args) throws IOException {
System.setProperty("java.util.logging.SimpleFormatter.format", "%5$s %n");
RouletteServer server = new RouletteServer(RouletteV1Protocol.DEFAULT_PORT, RouletteV1Protocol.VERSION);
RouletteServer server = new RouletteServer(RouletteV2Protocol.DEFAULT_PORT, RouletteV2Protocol.VERSION);
try {
server.startServer();
} catch (IOException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ public interface IRouletteV2Client extends IRouletteV1Client {
*/
public List<Student> listStudents() throws IOException;

public int getNumberOfStudentAdded();

public int getNumberOfCommands() throws IOException;

public boolean checkSuccessOfCommand();

}

Original file line number Diff line number Diff line change
Expand Up @@ -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 ch.heigvd.res.labs.roulette.net.protocol.RouletteV2Protocol;

import java.io.*;
import java.net.Socket;
import java.util.List;
import java.util.logging.Level;
Expand All @@ -23,46 +21,129 @@
*/
public class RouletteV1ClientImpl implements IRouletteV1Client {

private static final Logger LOG = Logger.getLogger(RouletteV1ClientImpl.class.getName());
private enum CONNECT {
RANDOM ("RANDOM"),
LOAD ("LOAD"),
HELP ("HELP"),
INFO ("INFO"),
BYE ("BYE"),
ENDOFDATA ("ENDOFDATA");

@Override
private final String name;
private CONNECT(String s) {
name = s;
}

public String toString() {
return this.name;
}}

protected static final Logger LOG = Logger.getLogger(RouletteV1ClientImpl.class.getName());
protected BufferedReader is;
protected PrintWriter os;
protected Socket socket;


@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.
socket = new Socket(server, port);
is = new BufferedReader( new InputStreamReader( socket.getInputStream() ) );
os = new PrintWriter( socket.getOutputStream() );
// String resp = is.readLine();
// System.out.println( resp );
LOG.info("Connected to server " + server + " on port " + port + "." );
is.readLine();

}

@Override
public void disconnect() throws IOException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.

os.println(RouletteV2Protocol.CMD_BYE);
os.flush();

is.close();
os.close();
socket.close();
LOG.info("Disconnected from server.");
}

@Override
public boolean isConnected() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.


return socket != null;


}

@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 " + fullname + "on server...");

os.println(CONNECT.LOAD.toString());
os.flush();

is.readLine();
os.println(fullname);
os.println(CONNECT.ENDOFDATA.toString());
os.flush();
is.readLine();

LOG.info("Loaded");

}

@Override
public void loadStudents(List<Student> students) throws IOException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
LOG.info("Loading list of Students on server...");

os.println(CONNECT.LOAD.toString());
LOG.info("server response " +is.readLine() );
for ( Student s: students) {
os.println( s.getFullname() );
}
os.println(CONNECT.ENDOFDATA.toString());
os.flush();
LOG.info("server response " +is.readLine() );

LOG.info("server response 2 " +is.readLine() );

LOG.info("Loaded");
}

@Override
public Student pickRandomStudent() throws EmptyStoreException, IOException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.


os.println(CONNECT.RANDOM.toString());
os.flush();
String rep = is.readLine();
if(getNumberOfStudents() == 0)
throw new EmptyStoreException();
return Student.fromJson( JsonObjectMapper.parseJson(rep, String.class) );
}

@Override
public int getNumberOfStudents() throws IOException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.

return InfoCmdRsp().getNumberOfStudents();

}

@Override
public String getProtocolVersion() throws IOException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.

return InfoCmdRsp().getProtocolVersion();
}

private InfoCommandResponse InfoCmdRsp() throws IOException{
os.println(RouletteV1Protocol.CMD_INFO);
os.flush();
//is.readLine();
//is.readLine();
InfoCommandResponse iCR = JsonObjectMapper.parseJson(is.readLine() , InfoCommandResponse.class);
return iCR;
}


Expand Down
Loading