use of com.vaadin.flow.uitest.servlet.ViewClassLocator in project flow by vaadin.
the class ToStringTest method testViewsElementsStringable.
@Test
public void testViewsElementsStringable() throws Exception {
Collection<Class<? extends Component>> viewClasses = new ViewClassLocator(getClass().getClassLoader()).getAllViewClasses();
for (Class<? extends Component> viewClass : viewClasses) {
Component view = viewClass.newInstance();
String string = view.getElement().toString();
Assert.assertNotNull(string);
Assert.assertNotEquals("", string);
}
}
use of com.vaadin.flow.uitest.servlet.ViewClassLocator in project flow by vaadin.
the class SerializationTest method testViewsSerializable.
@Test
public void testViewsSerializable() throws Exception {
UI ui = new UI();
UI.setCurrent(ui);
try {
Collection<Class<? extends Component>> viewClasses = new ViewClassLocator(getClass().getClassLoader()).getAllViewClasses();
for (Class<? extends Component> viewClass : viewClasses) {
Component view = viewClass.newInstance();
// Collections.emptyList(), Collections.emptyMap()));
try {
Assert.assertNotNull(serializeDeserialize(view));
} catch (Exception e) {
throw new AssertionError("Can't serialize view " + viewClass.getName(), e);
}
}
} finally {
UI.setCurrent(null);
}
}
Aggregations