A Perl script, catching and recording relevant signals (events). These are built up in a queue which is converted into json and sent to the client when it requests it
The client-side has a full copy of the model of windows, window items (channels,...), nicks,...
For most collections (lists of Windows in WindowManager, list of WindowItems in Window, list of Nicks in Channel,...) it uses Group
.
Group
is a sorted collection of items, identifiable by a String
id, where listeners can be added on receiving events for changes in the collection.
Synchronizers update the client-side model to match the one in irssi using the events encoded in json it receives.
The abstract Synchronizer
uses "xxx new" and "xxx remove" events to synchronize a Group
.
Concrete synchronizers (WindowSynchronizer
,...) listen for the other json events.
For the rest, it is a rather standard MVC design...
There's a framework to build asynchronous tests in org.irssi.webssi.client.expect
.
At the moment there are only integration tests (no unit tests). These require a running irssi to connect to and test both the client side, the communication, the Perl script and irssi. For example testJoin
sends a /join
command, which goes through the json link to the script, to irssi, to the irc server and back. This causes irssi to emit signals for a new window and channel being created, these signals are converted into json, sent client side, which updates its model; and the test checks if this model sends the expected events.