Skip to content

Commit e41f416

Browse files
committed
added test - test on stable connection even without data exchange - works
1 parent 7719aba commit e41f416

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/net/sharksystem/asap/MultihopTests.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,38 @@ public void twoHops() throws IOException, ASAPException, InterruptedException {
9898
Assert.assertTrue(same);
9999
}
100100

101+
@Test
102+
public void connectionWithNoDataExchange() throws IOException, ASAPException, InterruptedException {
103+
CmdLineUI ui = new CmdLineUI(System.out);
104+
105+
ui.doResetASAPStorages();
106+
107+
// create storages
108+
ui.doCreateASAPApp("Alice silent");
109+
ui.doCreateASAPApp("Bob silent");
110+
111+
System.out.println("**************************************************************************");
112+
System.out.println("** connect Alice with Bob **");
113+
System.out.println("**************************************************************************");
114+
// connect alice with bob
115+
ui.doCreateASAPMultiEngine("Alice");
116+
ui.doOpen("7070 Alice");
117+
// wait a moment to give server socket time to be created
118+
Thread.sleep(10);
119+
ui.doCreateASAPMultiEngine("Bob");
120+
121+
ui.doConnect("7070 Bob");
122+
123+
// wait a moment
124+
Thread.sleep(1000);
125+
System.out.println("**************************************************************************");
126+
System.out.println("** going to kill connection **");
127+
System.out.println("**************************************************************************");
128+
129+
// kill connections
130+
ui.doKill("all");
131+
}
132+
101133
@Test
102134
public void closedChannelTest() throws IOException, ASAPException, InterruptedException {
103135
CmdLineUI ui = new CmdLineUI(System.out);

0 commit comments

Comments
 (0)