I'm using JCEF to display a custom HTML GUI in a kiosk application. The entire application is written in Java, and we have several automated tests using JUnit, and some integration tests using Groovy.
Starting and stopping JCEF along with the application works well, but when running automated tests which launches the GUI we encounter a problem. The first test will work, but all consecutive tests will fail because JCEF throws an IllegalStateException when trying to re-launch the GUI:
- Code: Select all
java.lang.IllegalStateException: Must be called before CefApp is initialized
at org.cef.CefApp.addAppHandler(CefApp.java:205)
at view.html.ChromiumFrame.<init>(ChromiumFrame.java:46)
So seems that the CefApp is somehow not re-initialized on each test, staying in the TERMINATED state.
Any pointers on how to solve this would be much appreciated!