File tree Expand file tree Collapse file tree 10 files changed +55
-3
lines changed Expand file tree Collapse file tree 10 files changed +55
-3
lines changed Original file line number Diff line number Diff line change 1
- gradlew --no-daemon run > output.txt 2 > errors.txt
1
+ gradlew --parallel --daemon run > output.txt 2 > errors.txt
2
+ START /min " C:\Program Files\Windows Media Player\wmplayer.exe" %windir% \media\Alarm07.wav
2
3
rem find . -size 0 -type f
Original file line number Diff line number Diff line change 5
5
// {ValidateByHand}
6
6
// Tests the ChatterServer by starting multiple
7
7
// clients, each of which sends datagrams.
8
+ package network ;
8
9
import java .net .*;
9
10
import java .io .*;
10
11
import onjava .*;
Original file line number Diff line number Diff line change 4
4
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5
5
// {ValidateByHand}
6
6
// A server that echoes datagrams
7
+ package network ;
7
8
import java .net .*;
8
9
import java .io .*;
9
10
import onjava .*;
Original file line number Diff line number Diff line change 3
3
// We make no guarantees that this code is fit for any purpose.
4
4
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5
5
// Converts between Strings and DataGramPackets
6
+ package network ;
6
7
import java .net .*;
7
8
8
9
public class Dgram {
Original file line number Diff line number Diff line change 4
4
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5
5
// Testing MultiSimpleServer with multiple clients.
6
6
// {ValidateByHand}
7
+ package network ;
7
8
import java .net .*;
8
9
import java .io .*;
9
10
import onjava .*;
Original file line number Diff line number Diff line change 4
4
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5
5
// Uses threads to handle any number of clients.
6
6
// {ValidateByHand}
7
+ package network ;
7
8
import java .io .*;
8
9
import java .net .*;
9
10
import onjava .*;
Original file line number Diff line number Diff line change 5
5
// Sends lines to the server and
6
6
// reads lines the server sends.
7
7
// {ValidateByHand}
8
+ package network ;
8
9
import java .net .*;
9
10
import java .io .*;
10
11
Original file line number Diff line number Diff line change 4
4
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5
5
// Echoes what the client sends.
6
6
// {ValidateByHand}
7
+ package network ;
7
8
import java .io .*;
8
9
import java .net .*;
9
10
Original file line number Diff line number Diff line change 2
2
// (c)2016 MindView LLC: see Copyright.txt
3
3
// We make no guarantees that this code is fit for any purpose.
4
4
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5
- // Finds out your machine name and network address
6
- // when you're connected to the Internet
5
+ // Discovers your machine name and network address.
7
6
import java .net .*;
8
7
9
8
public class WhoAmI {
Original file line number Diff line number Diff line change
1
+ // network/tests/SimpleTcpTests.java
2
+ // (c)2016 MindView LLC: see Copyright.txt
3
+ // We make no guarantees that this code is fit for any purpose.
4
+ // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5
+ package network ;
6
+ import java .util .*;
7
+ import java .util .stream .*;
8
+ import org .junit .jupiter .api .*;
9
+ import static org .junit .jupiter .api .Assertions .*;
10
+ import onjava .*;
11
+
12
+ public class SimpleTcpTests {
13
+
14
+ @ BeforeAll
15
+ static void startMsg () {
16
+ System .out .println (">>> Network Tests <<<" );
17
+ }
18
+
19
+ @ BeforeEach
20
+ void setupServer () { }
21
+
22
+ @ Test
23
+ void basicTest () throws Exception {
24
+ SimpleServer server = new SimpleServer ();
25
+ SimpleClient client = new SimpleClient ();
26
+ client .main (null );
27
+ assertTrue (false ); // Fail until there are good assertions in the test
28
+ }
29
+
30
+ @ Test
31
+ void multiTest () throws Exception {
32
+ MultiSimpleClient client = new MultiSimpleClient ();
33
+ MultiSimpleServer server = new MultiSimpleServer ();
34
+ client .main (null );
35
+ assertTrue (false ); // Fail until there are good assertions in the test
36
+ }
37
+
38
+ @ Test
39
+ void chatterTest () throws Exception {
40
+ ChatterServer server = new ChatterServer ();
41
+ ChatterClient .main (null );
42
+ assertTrue (false ); // Fail until there are good assertions in the test
43
+ }
44
+
45
+ }
You can’t perform that action at this time.
0 commit comments