Avoid lock when child dies
[src/app-framework-binder.git] / old-docs / afb-tests-overview.md
1
2 Overview of tests shipped with AFB-Daemon
3 =========================================
4
5 List of tests
6 -------------
7
8 Here are the tests shipped in the source tree:
9
10 * **afb-client-demo** (command-line WebSockets)
11
12 * **token-websock.qml** (Qt/QML WebSockets)
13
14 * ***.html** (HTML5/JS HTTP-REST & WebSockets)
15
16
17 Detail of tests
18 ---------------
19
20 ### afb-client-demo (command-line WebSockets)
21
22 This clients interactively calls bindings APIs from the command line, using the binder
23 [WebSockets](https://en.wikipedia.org/wiki/WebSocket) facility.
24
25 If _afb-daemon_ has been launched with the following parameters:
26
27
28     $ afb-daemon --port=1234 --token=123456 [...]
29
30
31 Then run the client with :
32
33     afb-client-demo ws://localhost:1234/api?token=123456 [<api> <verb> [<json-data>]]
34
35 For instance, to initialize the Audio binding from the command line :
36
37     afb-client-demo ws://localhost:1234/api?token=123456
38
39 The command doesn't return. You should type requests of type <api> <verb> [<json-data>].
40 So, try:
41
42     auth connect
43     hello pingjson true
44
45 <br />
46
47
48
49 ### token-websock.qml (Qt/QML WebSockets)
50
51 If _afb-daemon_ has been launched with the following parameters:
52
53     $ afb-daemon --port=1234 --token=123456 [...]
54
55 and Qt5 is installed.
56
57 For installing Qt5 on **Ubuntu 16.04**:
58
59     $ apt-get install qmlscene qml-module-qtwebsockets qml-module-qtquick-controls
60
61 For installing Qt5 on **Fedora >= 22** :
62
63     $ dnf install qt5-qtdeclarative-devel qt5-qtwebsockets-devel qt5-qtquickcontrols
64
65
66 Then run the client with :
67
68     qmlscene test/token-websock.qml
69
70 and interactively press the buttons, "Connect", "Refresh", "Logout".
71
72 <br />
73
74
75 ### *.html (HTML5/JS HTTP-REST & WebSockets)
76
77 If _afb-daemon_ has been launched with the following parameters:
78
79     $ afb-daemon --port=1234 --rootdir=$PWD/test [...]
80
81 _("$PWD/test_" being the "test" subdirectory of the source tree)_
82
83
84 Then open your preferred Web browser, connect to the following URL:
85
86     http://localhost:1234
87
88 and interactively run the various tests.
89