Package com.vaadin.browserless.mocks
Class MockVaadinSession
-
- All Implemented Interfaces:
-
jakarta.servlet.http.HttpSessionBindingListener,java.io.Serializable,java.util.EventListener
public class MockVaadinSession extends VaadinSessionA Vaadin Session with one important difference:
Creates a new session when this one is closed. This is used to simulate a logout which closes the session - we need to have a new fresh session to be able to continue testing. In order to do that, simply override close, call
super.close()then call MockVaadin.afterSessionClose.
-
-
Field Summary
Fields Modifier and Type Field Description private final UIFactoryuiFactoryprivate final LongcumulativeRequestDurationprivate final VaadinSessionStatestateprivate final LonglastUnlockedprivate final Collection<RequestHandler>requestHandlersprivate final StreamResourceRegistryresourceRegistryprivate Localelocaleprivate final WrappedSessionsessionprivate final Collection<UI>uIsprivate LonglastRequestTimestampprivate final VaadinServiceserviceprivate LonglastRequestDurationprivate ErrorHandlererrorHandlerprivate final StringpushIdprivate final DeploymentConfigurationconfigurationprivate final IntegernextUIidprivate final Queue<FutureAccess>pendingAccessQueueprivate WebBrowserbrowserprivate final LocklockInstanceprivate final LonglastLocked
-
Constructor Summary
Constructors Constructor Description MockVaadinSession(VaadinService service, UIFactory uiFactory)
-
Method Summary
Modifier and Type Method Description final UIFactorygetUiFactory()Unitclose()-
Methods inherited from class com.vaadin.flow.server.VaadinSession
access, accessSynchronously, addRequestHandler, addSessionDestroyListener, addUI, checkHasLock, checkHasLock, findElement, getAttribute, getAttribute, getBrowser, getConfiguration, getCumulativeRequestDuration, getErrorHandler, getLastLocked, getLastRequestDuration, getLastRequestTimestamp, getLastUnlocked, getLocale, getLockInstance, getNextUIid, getPendingAccessQueue, getPushId, getRequestHandlers, getResourceRegistry, getService, getSession, getState, getUIById, getUIs, hasLock, localeSignal, lock, refreshTransients, removeRequestHandler, removeUI, setAttribute, setAttribute, setBrowser, setErrorHandler, setLastRequestDuration, setLastRequestTimestamp, setLocale, unlock -
Methods inherited from class jakarta.servlet.http.HttpSessionBindingListener
valueBound, valueUnbound -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MockVaadinSession
MockVaadinSession(VaadinService service, UIFactory uiFactory)
-
-
Method Detail
-
getUiFactory
final UIFactory getUiFactory()
-
-
-
-