peholmst / vaadin4spring

Vaadin integration for Spring and Spring Boot
Apache License 2.0
265 stars 131 forks source link

Problem when testing security-sample-shared with TestBench #301

Open jcgueriaud opened 7 years ago

jcgueriaud commented 7 years ago

I tried to test this application with Vaadin TestBench and I've got this error when I try to go on a secured view.

2017-02-20 16:38:50.003 WARN 5392 --- [o-auto-1-exec-8] com.vaadin.ui.ConnectorTracker : org.vaadin.spring.samples.security.shared.views.AdminView$$EnhancerBySpringCGLIB$$d3aac251(19) claims that com.vaadin.ui.Button(20) is its child, but the child claims org.vaadin.spring.samples.security.shared.views.AdminView(19) is its parent. 2017-02-20 16:38:50.003 WARN 5392 --- [o-auto-1-exec-8] com.vaadin.ui.ConnectorTracker : org.vaadin.spring.samples.security.shared.views.AdminView(19) claims that com.vaadin.ui.CssLayout(12) is its parent, but the parent does not acknowledge the parenthood. 2017-02-20 16:38:50.005 ERROR 5392 --- [o-auto-1-exec-8] com.vaadin.server.DefaultErrorHandler : java.lang.AssertionError: The connector hierarchy is corrupted. Check for missing calls to super.setParent(), super.attach() and super.detach() and that all custom component containers call child.setParent(this) when a child is added and child.setParent(null) when the child is no longer used. See previous log messages for details.

I don't understand what the "real" problem.

I attached the edited security sample shared (you need to copy chromedriver inside the project)

security-sample-shared.zip

ghost commented 7 years ago

Have you tried to run your tests with disabled JVM Assertions? Surefire runs all tests with -ea flag by default, configure Surefire with <enableAssertions>false</enableAssertions>.

jcgueriaud commented 7 years ago

Thanks a lot. It's working if I change my pom.xml.

I don't understand why the connector hierarchy is corrupted but I can run my tests.