Skip to content

Commit 41bafea

Browse files
committed
docs: improve instructions
1 parent 8336aa3 commit 41bafea

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,41 @@ Modify [App.java](src/main/java/com/cbfacademy/App.java) to connect to the main
1616

1717
You will need to use `HttpURLConnection`, `BufferedReader` and `InputStreamReader` classes.
1818

19-
Whenever possible, use the try-with-resources construct we saw earlier in the course, and ensure to release all resources.
19+
Whenever possible, use the try-with-resources construct we saw earlier in the course, and ensure all resources are released.
20+
21+
## :white_check_mark: Verify Your Implementation
22+
23+
To verify that your code works as expected, run the tests. In your terminal, ensure that you are in the root of this repository, then run the following command:
24+
25+
```shell
26+
./mvnw clean test
27+
```
2028

2129
## :phone: Client & Server
2230

23-
Create a simple program with two classes:
24-
- a `ExerciseServer` class which uses a `ServerSocket` to listen for connections on `localhost:4040`, then prints message it receives on the screen.
25-
- a `ExerciseClient` class which requests a connection to server, sends a simple text message to the server.
31+
Create two executable classes:
32+
- a `SocketServer` class which uses a `ServerSocket` to listen for connections on `localhost:4040`, then prints message it receives on the screen.
33+
- a `SocketClient` class which requests a connection to server, sends a simple text message to the server.
34+
35+
Ensure all resources created in your programmes are released appropriately. To test your code manually, you'll need to run each application in a separate terminal:
36+
37+
Terminal 1:
38+
```shell
39+
./mvnw compile exec:java -Dexec.mainClass="com.cbfacademy.SocketServer"
40+
```
41+
42+
Terminal 2:
43+
```shell
44+
./mvnw compile exec:java -Dexec.mainClass="com.cbfacademy.SocketClient"
45+
```
46+
47+
## :white_check_mark: Verify Your Implementation
48+
49+
To verify that your code works as expected, run the tests:
2650

27-
Ensure to release all resources at the end of your program.
51+
```shell
52+
./mvnw clean test
53+
```
2854

2955
[1]: https://docs.oracle.com/javase/21/docs/api/index.html
3056
[2]: https://junit.org/junit5/

0 commit comments

Comments
 (0)