afb-hreq.c: fix etag size (fixes stack smashing detected by stack protector)
[src/app-framework-binder.git] / doc / afb-tests-overview.html
1 <html>
2 <head>
3   <link rel="stylesheet" type="text/css" href="doc.css">
4   <meta charset="UTF-8">
5 </head>
6 <body>
7 <a name="Overview.of.tests.shipped.with.AFB-Daemon"></a>
8 <h1>Overview of tests shipped with AFB-Daemon</h1>
9
10 <pre><code>Version: 1
11 Date:    30 mai 2016
12 Author:  Manuel Bachmann
13 </code></pre>
14
15 <a name="List.of.tests"></a>
16 <h2>List of tests</h2>
17
18 <p>Here are the tests shipped in the source tree:</p>
19
20 <ul>
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 &amp; WebSockets)</p></li>
24 </ul>
25
26
27 <a name="Detail.of.tests"></a>
28 <h2>Detail of tests</h2>
29
30 <a name="afb-client-demo..command-line.WebSockets."></a>
31 <h3>afb-client-demo (command-line WebSockets)</h3>
32
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>
35
36 <p>If <em>afb-daemon</em> has been launched with the following parameters:</p>
37
38 <pre><code>$ afb-daemon --port=1234 --token=123456 [...]
39 </code></pre>
40
41 <p>Then run the client with :</p>
42
43 <pre><code>afb-client-demo ws://localhost:1234/api?token=123456 [&lt;api&gt; &lt;verb&gt; [&lt;json-data&gt;]]
44 </code></pre>
45
46 <p>For instance, to initialize the Audio plugin from the command line :</p>
47
48 <pre><code>afb-client-demo ws://localhost:1234/api?token=123456
49 </code></pre>
50
51 <p>The command doesn&rsquo;t return. You should type requests of type <api> <verb> [&lt;json-data>].
52 So, try:</p>
53
54 <pre><code>auth connect
55 hello pingjson true
56 </code></pre>
57
58 <p><br /></p>
59
60 <a name="token-websock.qml..Qt.QML.WebSockets."></a>
61 <h3>token-websock.qml (Qt/QML WebSockets)</h3>
62
63 <p>If <em>afb-daemon</em> has been launched with the following parameters:</p>
64
65 <pre><code>$ afb-daemon --port=1234 --token=123456 [...]
66 </code></pre>
67
68 <p>and Qt5 is installed.</p>
69
70 <p>For installing Qt5 on <strong>Ubuntu 16.04</strong>:</p>
71
72 <pre><code>$ apt-get install qmlscene qml-module-qtwebsockets qml-module-qtquick-controls
73 </code></pre>
74
75 <p>For installing Qt5 on <strong>Fedora 23</strong> :</p>
76
77 <pre><code>$ dnf install qt5-qtdeclarative-devel qt5-qtwebsockets-devel qt5-qtquickcontrols
78 </code></pre>
79
80 <p>Then run the client with :</p>
81
82 <pre><code>qmlscene test/token-websock.qml
83 </code></pre>
84
85 <p>and interactively press the buttons, &ldquo;Connect&rdquo;, &ldquo;Refresh&rdquo;, &ldquo;Logout&rdquo;.</p>
86
87 <p><br /></p>
88
89 <a name="L..html..HTML5.JS.HTTP-REST..amp..WebSockets."></a>
90 <h3>*.html (HTML5/JS HTTP-REST &amp; WebSockets)</h3>
91
92 <p>If <em>afb-daemon</em> has been launched with the following parameters:</p>
93
94 <pre><code>$ afb-daemon --port=1234 --rootdir=$PWD/test [...]
95 </code></pre>
96
97 <p><em>(&ldquo;$PWD/test</em>&rdquo; being the &ldquo;test&rdquo; subdirectory of the source tree)_</p>
98
99 <p>Then open your preferred Web browser, connect to the following URL:</p>
100
101 <pre><code>http://localhost:1234
102 </code></pre>
103
104 <p>and interactively run the various tests.</p>
105 </body>
106 </html>