GUI Based Test Suite for JavaPOS Devices.
This test suite has been implemented to allow testing JavaPOS devices developed with the JavaPOS-SPF framework. Nevertheless, it can be used for testing any other JavaPOS device, too, as long as the device class is supported. The advantage compared with other test suites are
-
It is possible to hold several devices open at the same time.
-
Methods that potentially need some time to complete run in the background. Therefore, the GUI and event handling remains possible in the meantime.
-
There are only very few plausibility checks to allow calling methods with invalid parameters or under invalid conditions, e.g. when the device has not been claimed or enabled. For example, with other test suites, it might not be possible to test whether a LineDisplay service implementation throws a JposException with ErrorCode JPOS_E_NOTCLAIMED when you try to set DeviceEnabled because the test suite blocks setting DeviceEnabled while the device has not been claimed.
-
The GUI is very compact. Only devices specified in Jpos.xml will be shown.
The first picture shows you the GUI after starting JavaPOS-SPF-Test:
During startup, JavaPOS-SPF-Test reads the jpos.xml and fills an internal list with all configured devices. The Device Category combobox will be filled with those categories where at least one device is available. After category selection, the Logical Name combobox will be filled with the locical device names of that category.
To start testing a specific device, you have to select its device category first, then select the logical device name and start testing. If there is only one logical device name per category, or if you want to test the first one in the list, you do not need to select it explicitly. After category selection, the first one is selected by default.
After selecting a device category, the test screen for the selected category will be shown. In the upper area, you have methods and properties common for all device categories and a table view where you can find all available property values.
Before you press any method button, you should enter any valid value. Valid means numeric for integer values or one of the string values offered by a combobox. Currency, quantity and percentage values will be shown and shall be entered with decimal point. Whether a value is really valid of whether a method call is valid depends almost always on the context and if the service generate an error message or not should be a part of your test. For example, before the device has been opened, only invoking method Open should generate no error message.
To set writable properties, simply select the new value in case of setting via combobox or checkbox (checkboxes will be used only for boolean values). If a property can be set via text field, the new value will be set after leaving the field. Keep in mind: If you click into a property text field, you will get an error message when you leave the field without a valid value or if writing the property is invalid in the current device state!
The following screen shots show some kinds of parameter passing for different methods. Which type of method passing has been used, depended on things like number of methods, number of parameters, number of common parameters for different methods, possible size of parameters...
Look and marvel:
A guide how to install JavaPOS-SPF-Test is here.