vaadin / testbench

Vaadin TestBench is a tool for automated user interface testing of Vaadin applications.
https://vaadin.com/testbench
Other
20 stars 22 forks source link

fix: fallback to context classloader when loading class #1728

Closed mcollovati closed 10 months ago

mcollovati commented 10 months ago

Description

Currently classes are loaded with Class.forName, that uses the classloader from the calling class. However, this might not work on all environments because of different class loading setup (e.g in Quarkus testing). This change uses the current thread context class loader as fallback when Class.forName is not able to load a class.

Fixes vaadin/quarkus#139 Part of #1655

Type of change

Checklist

Additional for Feature type of change

mcollovati commented 10 months ago

Fix can be tested by running a UI Unit test on a Quarkus based application. Running MainViewTest should fail with a ClassNotFoundException, whereas it should pass when using the patched Testbench artifacts.