I'm currently trying to test the UI of an Eclipse RCP application. When executed manually, the application starts fine and can be used correctly. However, when QF-Test launches the application, I get a ClassCastException
in a 3pp module:
java.lang.ClassCastException: java.io.File cannot be cast to java.lang.String
at com.solarmetric.conf.ConfigurationImpl.fromProperties(ConfigurationImpl.java:560)
at com.solarmetric.conf.ConfigurationImpl.loadDefaults(ConfigurationImpl.java:186)
After analyzing the code of the 3pp library I see that the exception occurs when trying to cast a System's property value to a String
. This shouldn't be a problem because all properties values should be String
(see this answer). However, QF-Test is adding 3 properties which their values are File
(java.io.File
) objects. More precisely:
jython.home = C:\Program Files\qfs\qftest\qftest-4.2.0\jython
groovy.home = C:\Program Files\qfs\qftest\qftest-4.2.0\groovy
javascript.home = C:\Program Files\qfs\qftest\qftest-4.2.0\javascript
I would like to remove those wrong property values. I've already tried to define them manually as parameters of the QF-Test command line call without success.
Some help would be very appreciated.
This behaviour of QF-Test was fixed with QF-Test 4.2.1 (released February 26, 2018), see https://www.qfs.de/en/qf-test-manual/lc/manual-en-history.html#sec_N1D715:
Bug fixed:
In a few cases a broken system property set by QF-Test could interfere with SUT startup.
So the answer is to simply update your QF-Test!