Fazecast / jSerialComm

Platform-independent serial port access for Java
GNU Lesser General Public License v3.0
1.34k stars 287 forks source link

Testability #376

Closed vibpe closed 2 years ago

vibpe commented 3 years ago

Hello,

unfortunately this code and applications using this library are not testable because all important classes are final and therefore can not be mocked.

It would be of great help if at least SerialPortEvent is not declared final anymore. Then one can pass a mock to listener.serialEvent() and test the logic.

Thanks

hedgecrw commented 3 years ago

No problem - this change has been checked in.

An updated test JAR can be found here until a formal release is made: https://drive.google.com/file/d/1l9vNw1OPLeoJI9_h3XA3nPoPiDFDKOgM/view?usp=sharing

vibpe commented 2 years ago

Thank you