Skip to content

Commit 51058a7

Browse files
Extend the client testing script and create a unix version of it
1 parent b8e038c commit 51058a7

File tree

2 files changed

+78
-4
lines changed

2 files changed

+78
-4
lines changed

client_test.bat

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
11
@echo off
22

3+
:: Create a message, write something into it and read the content
34
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 0 -n Test -d 2
45
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 1 -n Test -d 2 -c bla
5-
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test -d 2
6-
:: Create duplicate message
6+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test
7+
echo.
8+
9+
:: Set a different content and read it
10+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 1 -n Test -d 2 -c "Something completely different!"
11+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test
12+
echo.
13+
14+
:: Create a duplicate message
715
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 0 -n Test -d 2
16+
echo.
817

18+
::Read a not existing messages
19+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n test
20+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test2
21+
echo.
922

10-
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test
11-
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Moron
23+
:: Clear a not existing message
24+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 2 -n Test
25+
echo.
1226

1327
:: Clear message and read the content
1428
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 2 -n Test
1529
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test
30+
echo.
1631

32+
:: Delete the message
33+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 5 -n Test
34+
echo.
1735

36+
:: Delete the message a second time
1837
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 5 -n Test
38+
echo.
39+
40+
:: Read the deleted message
41+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test
42+
echo.
43+
44+
:: Use an unknown method
45+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 6 -n Test
46+
echo.

client_test.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# Create a message, write something into it and read the content
4+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 0 -n Test -d 2
5+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 1 -n Test -d 2 -c bla
6+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test
7+
echo
8+
9+
# Set a different content and read it
10+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 1 -n Test -d 2 -c "Something completely different!"
11+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test
12+
echo
13+
14+
# Create a duplicate message
15+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 0 -n Test -d 2
16+
echo
17+
18+
#Read a not existing messages
19+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n test
20+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test2
21+
echo
22+
23+
# Clear a not existing message
24+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 2 -n Test
25+
echo
26+
27+
# Clear message and read the content
28+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 2 -n Test
29+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test
30+
echo
31+
32+
# Delete the message
33+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 5 -n Test
34+
echo
35+
36+
# Delete the message a second time
37+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 5 -n Test
38+
echo
39+
40+
# Read the deleted message
41+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 3 -n Test
42+
echo
43+
44+
# Use an unknown method
45+
java -jar sampling-message-client/target/sampling-message-client-0.1-jar-with-dependencies.jar -p 8080 -a 127.0.0.1 -m 6 -n Test
46+
echo

0 commit comments

Comments
 (0)