5 <meta name="generator" content="pandoc">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
7 <meta name="author" content="Manuel Bachmann">
8 <title>Overview of tests shipped with AFB-Daemon</title>
9 <style type="text/css">code{white-space: pre;}</style>
11 <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
13 <link rel="stylesheet" href="doc.css">
17 <h1 class="title">Overview of tests shipped with AFB-Daemon</h1>
18 <h2 class="author">Manuel Bachmann</h2>
19 <h3 class="date">30 mai 2016</h3>
23 <li><a href="#overview-of-tests-shipped-with-afb-daemon">Overview of tests shipped with AFB-Daemon</a><ul>
24 <li><a href="#list-of-tests">List of tests</a></li>
25 <li><a href="#detail-of-tests">Detail of tests</a><ul>
26 <li><a href="#afb-client-demo-command-line-websockets">afb-client-demo (command-line WebSockets)</a></li>
27 <li><a href="#token-websock.qml-qtqml-websockets">token-websock.qml (Qt/QML WebSockets)</a></li>
28 <li><a href="#html-html5js-http-rest-websockets">*.html (HTML5/JS HTTP-REST & WebSockets)</a></li>
33 <h1 id="overview-of-tests-shipped-with-afb-daemon">Overview of tests shipped with AFB-Daemon</h1>
36 Author: Manuel Bachmann</code></pre>
37 <h2 id="list-of-tests">List of tests</h2>
38 <p>Here are the tests shipped in the source tree:</p>
40 <li><p><strong>afb-client-demo</strong> (command-line WebSockets)</p></li>
41 <li><p><strong>token-websock.qml</strong> (Qt/QML WebSockets)</p></li>
42 <li><p>*<strong>.html</strong> (HTML5/JS HTTP-REST & WebSockets)</p></li>
44 <h2 id="detail-of-tests">Detail of tests</h2>
45 <h3 id="afb-client-demo-command-line-websockets">afb-client-demo (command-line WebSockets)</h3>
46 <p>This clients interactively calls plugins APIs from the command line, using the binder <a href="https://en.wikipedia.org/wiki/WebSocket">WebSockets</a> facility.</p>
47 <p>If <em>afb-daemon</em> has been launched with the following parameters:</p>
48 <pre><code>$ afb-daemon --port=1234 --token=123456 [...]</code></pre>
49 <p>Then run the client with :</p>
50 <pre><code>afb-client-demo ws://localhost:1234/api?token=123456 [<api> <verb> [<json-data>]]</code></pre>
51 <p>For instance, to initialize the Audio plugin from the command line :</p>
52 <pre><code>afb-client-demo ws://localhost:1234/api?token=123456</code></pre>
53 <p>The command doesn't return. You should type requests of type <api> <verb> [<json-data>]. So, try:</p>
54 <pre><code>auth connect
55 hello pingjson true</code></pre>
57 <h3 id="token-websock.qml-qtqml-websockets">token-websock.qml (Qt/QML WebSockets)</h3>
58 <p>If <em>afb-daemon</em> has been launched with the following parameters:</p>
59 <pre><code>$ afb-daemon --port=1234 --token=123456 [...]</code></pre>
60 <p>and Qt5 is installed.</p>
61 <p>For installing Qt5 on <strong>Ubuntu 16.04</strong>:</p>
62 <pre><code>$ apt-get install qmlscene qml-module-qtwebsockets qml-module-qtquick-controls</code></pre>
63 <p>For installing Qt5 on <strong>Fedora 23</strong> :</p>
64 <pre><code>$ dnf install qt5-qtdeclarative-devel qt5-qtwebsockets-devel qt5-qtquickcontrols</code></pre>
65 <p>Then run the client with :</p>
66 <pre><code>qmlscene test/token-websock.qml</code></pre>
67 <p>and interactively press the buttons, "Connect", "Refresh", "Logout".</p>
69 <h3 id="html-html5js-http-rest-websockets">*.html (HTML5/JS HTTP-REST & WebSockets)</h3>
70 <p>If <em>afb-daemon</em> has been launched with the following parameters:</p>
71 <pre><code>$ afb-daemon --port=1234 --rootdir=$PWD/test [...]</code></pre>
72 <p><em>("$PWD/test</em>" being the "test" subdirectory of the source tree)_</p>
73 <p>Then open your preferred Web browser, connect to the following URL:</p>
74 <pre><code>http://localhost:1234</code></pre>
75 <p>and interactively run the various tests.</p>