@@ -20,6 +20,10 @@ public void twoHops() throws IOException, ASAPException, InterruptedException {
20
20
21
21
ui .doResetASAPStorages ();
22
22
23
+ ui .doCreateASAPPeer ("Alice" );
24
+ ui .doCreateASAPPeer ("Bob" );
25
+ ui .doCreateASAPPeer ("Clara" );
26
+
23
27
// create storages
24
28
ui .doCreateASAPApp ("Alice twoHops" );
25
29
ui .doCreateASAPApp ("Bob twoHops" );
@@ -42,11 +46,9 @@ public void twoHops() throws IOException, ASAPException, InterruptedException {
42
46
System .out .println ("** connect Alice with Bob **" );
43
47
System .out .println ("**************************************************************************" );
44
48
// connect alice with bob
45
- ui .doCreateASAPPeer ("Alice" );
46
49
ui .doOpen ("7070 Alice" );
47
50
// wait a moment to give server socket time to be created
48
51
Thread .sleep (10 );
49
- ui .doCreateASAPPeer ("Bob" );
50
52
51
53
ui .doConnect ("7070 Bob" );
52
54
@@ -66,7 +68,6 @@ public void twoHops() throws IOException, ASAPException, InterruptedException {
66
68
System .out .println ("**************************************************************************" );
67
69
System .out .println ("** connect Bob with Clara **" );
68
70
System .out .println ("**************************************************************************" );
69
- ui .doCreateASAPPeer ("Clara" );
70
71
ui .doOpen ("8080 Clara" );
71
72
// wait a moment to give server socket time to be created
72
73
Thread .sleep (10 );
@@ -135,6 +136,11 @@ public void closedChannelTest() throws IOException, ASAPException, InterruptedEx
135
136
CmdLineUI ui = new CmdLineUI (System .out );
136
137
ui .doResetASAPStorages ();
137
138
139
+ ui .doCreateASAPPeer ("Alice" );
140
+ ui .doCreateASAPPeer ("Bob" );
141
+ ui .doCreateASAPPeer ("Clara" );
142
+ ui .doCreateASAPPeer ("David" );
143
+
138
144
// create app on each peer
139
145
ui .doCreateASAPApp ("Alice chat" );
140
146
ui .doCreateASAPApp ("Bob chat" );
@@ -164,11 +170,9 @@ public void closedChannelTest() throws IOException, ASAPException, InterruptedEx
164
170
System .out .println ("** connect Alice with Bob **" );
165
171
System .out .println ("**************************************************************************" );
166
172
// connect alice with bob
167
- ui .doCreateASAPPeer ("Alice" );
168
173
ui .doOpen ("7070 Alice" );
169
174
// wait a moment to give server socket time to be created
170
175
Thread .sleep (10 );
171
- ui .doCreateASAPPeer ("Bob" );
172
176
ui .doConnect ("7070 Bob" );
173
177
174
178
// alice should be in era 1 (content has changed before connection) and bob era is 0 - no changes
@@ -214,11 +218,9 @@ public void closedChannelTest() throws IOException, ASAPException, InterruptedEx
214
218
System .out .println ("** connect Bob with Clara **" );
215
219
System .out .println ("**************************************************************************" );
216
220
// connect alice with bob
217
- ui .doCreateASAPPeer ("Bob" );
218
221
ui .doOpen ("7071 Bob" );
219
222
// wait a moment to give server socket time to be created
220
223
Thread .sleep (10 );
221
- ui .doCreateASAPPeer ("Clara" );
222
224
ui .doConnect ("7071 Clara" );
223
225
224
226
// alice should be in era 1 (content has changed before connection) and bob era is 0 - no changes
@@ -264,11 +266,9 @@ public void closedChannelTest() throws IOException, ASAPException, InterruptedEx
264
266
System .out .println ("** connect Clara with David **" );
265
267
System .out .println ("**************************************************************************" );
266
268
// connect alice with bob
267
- ui .doCreateASAPPeer ("Clara" );
268
269
ui .doOpen ("7072 Clara" );
269
270
// wait a moment to give server socket time to be created
270
271
Thread .sleep (10 );
271
- ui .doCreateASAPPeer ("David" );
272
272
ui .doConnect ("7072 David" );
273
273
274
274
// wait a moment
0 commit comments