3 <link rel="stylesheet" type="text/css" href="doc.css">
7 <a name="Overview.of.tests.shipped.with.AFB-Daemon"></a>
8 <h1>Overview of tests shipped with AFB-Daemon</h1>
12 Author: Manuel Bachmann
15 <a name="List.of.tests"></a>
16 <h2>List of tests</h2>
18 <p>Here are the tests shipped in the source tree:</p>
21 <li><p><strong>afb-client-demo</strong> (command-line WebSockets)</p></li>
22 <li><p><strong>token-websock.qml</strong> (Qt/QML WebSockets)</p></li>
23 <li><p><strong>*.html</strong> (HTML5/JS HTTP-REST & WebSockets)</p></li>
27 <a name="Detail.of.tests"></a>
28 <h2>Detail of tests</h2>
30 <a name="afb-client-demo..command-line.WebSockets."></a>
31 <h3>afb-client-demo (command-line WebSockets)</h3>
33 <p>This clients interactively calls plugins APIs from the command line, using the binder
34 <a href="https://en.wikipedia.org/wiki/WebSocket">WebSockets</a> facility.</p>
36 <p>If <em>afb-daemon</em> has been launched with the following parameters:</p>
38 <pre><code>$ afb-daemon --port=1234 --token=123456 [...]
41 <p>Then run the client with :</p>
43 <pre><code>afb-client-demo ws://localhost:1234/api?token=123456 [<api> <verb> [<json-data>]]
46 <p>For instance, to initialize the Audio plugin from the command line :</p>
48 <pre><code>afb-client-demo ws://localhost:1234/api?token=123456
51 <p>The command doesn’t return. You should type requests of type <api> <verb> [<json-data>].
54 <pre><code>auth connect
60 <a name="token-websock.qml..Qt.QML.WebSockets."></a>
61 <h3>token-websock.qml (Qt/QML WebSockets)</h3>
63 <p>If <em>afb-daemon</em> has been launched with the following parameters:</p>
65 <pre><code>$ afb-daemon --port=1234 --token=123456 [...]
68 <p>and Qt5 is installed.</p>
70 <p>For installing Qt5 on <strong>Ubuntu 16.04</strong>:</p>
72 <pre><code>$ apt-get install qmlscene qml-module-qtwebsockets qml-module-qtquick-controls
75 <p>For installing Qt5 on <strong>Fedora 23</strong> :</p>
77 <pre><code>$ dnf install qt5-qtdeclarative-devel qt5-qtwebsockets-devel qt5-qtquickcontrols
80 <p>Then run the client with :</p>
82 <pre><code>qmlscene test/token-websock.qml
85 <p>and interactively press the buttons, “Connect”, “Refresh”, “Logout”.</p>
89 <a name="L..html..HTML5.JS.HTTP-REST..amp..WebSockets."></a>
90 <h3>*.html (HTML5/JS HTTP-REST & WebSockets)</h3>
92 <p>If <em>afb-daemon</em> has been launched with the following parameters:</p>
94 <pre><code>$ afb-daemon --port=1234 --rootdir=$PWD/test [...]
97 <p><em>(“$PWD/test</em>” being the “test” subdirectory of the source tree)_</p>
99 <p>Then open your preferred Web browser, connect to the following URL:</p>
101 <pre><code>http://localhost:1234
104 <p>and interactively run the various tests.</p>