I am migrating a fairly complex vaadin application from 6 to 7. I need to unit-test the presentation layer logic: initial configuration of session variables, and then the behavior of my presentation layer instances. All that is java server-side code and the logic I want to test is quite distinct from visual aspect (which involves css, browser behavior, etc). So TestBench, which I have tried extensively, is not an answer.
In my vaadin 6 application I used ServletUnit
http://httpunit.sourceforge.net/doc/servletunit-intro.html
, which allowed me to unit test properly. However I can’t seem to make it work with vaadin 7.3.1, even though I can start the application manually in a browser.
When I run a test, my servlet’s init() and servletInitialized() methods are called, my class defined as a SessionInitListener has its sessionInit() method called (and it sets variables on the VaadinSession), however thereafter VaadinSession.getCurrent() returns null.
Any clues on where/how to locate the error? Thank you!