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