OpenLegacy provides great offline support by using Trail files. Trail files are XML based, which record incoming/outgoing session snapshots. To work in offline mode, the following Spring beans should be configured in the relevant Spring context file.

applicationContext.xml – for web server runtime
applicationContext-test.xml – for JUnit tests

The following bean configures a mock up connection to “demo_session.trail” – relative to a resource folder (/trails):

Code Snippet:

The following bean configures a mock terminal session. The reason for this extra configuration is that it serves as a state machine, which serves the application for the requested screen class (only TerminalSession is aware of the screen entity classes):

Code Snippet: