@@ -20,6 +20,10 @@ public void twoHops() throws IOException, ASAPException, InterruptedException {
2020
2121 ui .doResetASAPStorages ();
2222
23+ ui .doCreateASAPPeer ("Alice" );
24+ ui .doCreateASAPPeer ("Bob" );
25+ ui .doCreateASAPPeer ("Clara" );
26+
2327 // create storages
2428 ui .doCreateASAPApp ("Alice twoHops" );
2529 ui .doCreateASAPApp ("Bob twoHops" );
@@ -42,11 +46,9 @@ public void twoHops() throws IOException, ASAPException, InterruptedException {
4246 System .out .println ("** connect Alice with Bob **" );
4347 System .out .println ("**************************************************************************" );
4448 // connect alice with bob
45- ui .doCreateASAPPeer ("Alice" );
4649 ui .doOpen ("7070 Alice" );
4750 // wait a moment to give server socket time to be created
4851 Thread .sleep (10 );
49- ui .doCreateASAPPeer ("Bob" );
5052
5153 ui .doConnect ("7070 Bob" );
5254
@@ -66,7 +68,6 @@ public void twoHops() throws IOException, ASAPException, InterruptedException {
6668 System .out .println ("**************************************************************************" );
6769 System .out .println ("** connect Bob with Clara **" );
6870 System .out .println ("**************************************************************************" );
69- ui .doCreateASAPPeer ("Clara" );
7071 ui .doOpen ("8080 Clara" );
7172 // wait a moment to give server socket time to be created
7273 Thread .sleep (10 );
@@ -135,6 +136,11 @@ public void closedChannelTest() throws IOException, ASAPException, InterruptedEx
135136 CmdLineUI ui = new CmdLineUI (System .out );
136137 ui .doResetASAPStorages ();
137138
139+ ui .doCreateASAPPeer ("Alice" );
140+ ui .doCreateASAPPeer ("Bob" );
141+ ui .doCreateASAPPeer ("Clara" );
142+ ui .doCreateASAPPeer ("David" );
143+
138144 // create app on each peer
139145 ui .doCreateASAPApp ("Alice chat" );
140146 ui .doCreateASAPApp ("Bob chat" );
@@ -164,11 +170,9 @@ public void closedChannelTest() throws IOException, ASAPException, InterruptedEx
164170 System .out .println ("** connect Alice with Bob **" );
165171 System .out .println ("**************************************************************************" );
166172 // connect alice with bob
167- ui .doCreateASAPPeer ("Alice" );
168173 ui .doOpen ("7070 Alice" );
169174 // wait a moment to give server socket time to be created
170175 Thread .sleep (10 );
171- ui .doCreateASAPPeer ("Bob" );
172176 ui .doConnect ("7070 Bob" );
173177
174178 // 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
214218 System .out .println ("** connect Bob with Clara **" );
215219 System .out .println ("**************************************************************************" );
216220 // connect alice with bob
217- ui .doCreateASAPPeer ("Bob" );
218221 ui .doOpen ("7071 Bob" );
219222 // wait a moment to give server socket time to be created
220223 Thread .sleep (10 );
221- ui .doCreateASAPPeer ("Clara" );
222224 ui .doConnect ("7071 Clara" );
223225
224226 // 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
264266 System .out .println ("** connect Clara with David **" );
265267 System .out .println ("**************************************************************************" );
266268 // connect alice with bob
267- ui .doCreateASAPPeer ("Clara" );
268269 ui .doOpen ("7072 Clara" );
269270 // wait a moment to give server socket time to be created
270271 Thread .sleep (10 );
271- ui .doCreateASAPPeer ("David" );
272272 ui .doConnect ("7072 David" );
273273
274274 // wait a moment
0 commit comments