Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb486c9

Browse files
author
bfrasure
committed
+SimpleTcpTests skeleton
1 parent e6dd219 commit cb486c9

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

network/tests/NetworkTests.java

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import java.util.*;
2+
import java.util.stream.*;
3+
import org.junit.jupiter.api.*;
4+
import static org.junit.jupiter.api.Assertions.*;
5+
import onjava.*;
6+
7+
/* >*
8+
Observation: I think some of the methods, such as ChatterClient.main,
9+
would be more appropriate written as a test case, rather than part of the
10+
actual class.
11+
*< */
12+
13+
public class SimpleTcpTests {
14+
15+
@BeforeAll
16+
static void startMsg() {
17+
System.out.println(">>> Network Tests <<<");
18+
}
19+
20+
@BeforeEach
21+
static void setupServer () {
22+
}
23+
24+
@Test
25+
void basicTest() throws Exception {
26+
SimpleServer server = new SimpleServer();
27+
SimpleClient client = new SimpleClient();
28+
client.main(null);
29+
assertTrue(false); // Fail until there are good assertions in the test
30+
}
31+
32+
@Test
33+
void multiTest() throws Exception {
34+
MultiSimpleClient client = new MultiSimpleClient();
35+
MultiSimpleServer server = new MultiSimpleServer();
36+
client.main(null);
37+
assertTrue(false); // Fail until there are good assertions in the test
38+
}
39+
40+
@Test
41+
void chatterTest() throws Exception {
42+
ChatterServer server = new ChatterServer();
43+
ChatterClient.main(null);
44+
assertTrue(false); // Fail until there are good assertions in the test
45+
}
46+
47+
}

0 commit comments

Comments
 (0)