Class TestEnvironmentClientSession
- java.lang.Object
-
- org.eclipse.scout.rt.platform.reflect.AbstractPropertyObserver
-
- org.eclipse.scout.rt.client.AbstractClientSession
-
- org.eclipse.scout.rt.client.testenvironment.TestEnvironmentClientSession
-
- All Implemented Interfaces:
IClientSession
,org.eclipse.scout.rt.platform.reflect.IPropertyObserver
,org.eclipse.scout.rt.shared.extension.IExtensibleObject
,org.eclipse.scout.rt.shared.ISession
@IgnoreBean public class TestEnvironmentClientSession extends AbstractClientSession
IClientSession
for Client Test Environment- Author:
- jbr
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.scout.rt.client.AbstractClientSession
AbstractClientSession.LocalClientSessionExtension<OWNER extends AbstractClientSession>
-
-
Field Summary
-
Fields inherited from class org.eclipse.scout.rt.platform.reflect.AbstractPropertyObserver
propertySupport
-
Fields inherited from interface org.eclipse.scout.rt.client.IClientSession
PROP_LOCALE
-
-
Constructor Summary
Constructors Constructor Description TestEnvironmentClientSession()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
execLoadSession()
static TestEnvironmentClientSession
get()
IDesktop
getDesktop()
String
getUserId()
void
replaceDesktop(IDesktop desktop)
Replace the desktop with an other instance (m_testDesktop
).protected void
simulateDesktopOpened(IDesktop desktop)
Simulates that the desktop has been opened.-
Methods inherited from class org.eclipse.scout.rt.client.AbstractClientSession
computeDataIfAbsent, createLocalExtension, execStoreSession, fireSessionChangedEvent, getAllExtensions, getBrowserURI, getConfiguredSingleThreadSession, getData, getDesktopElseVirtualDesktop, getExitCode, getExtension, getId, getLocale, getMemoryPolicy, getModelJobSemaphore, getSharedContextVariable, getSharedVariableMap, getStateLock, getSubject, getUserAgent, handleSessionEvent, inactivateSession, initConfig, initializeSharedVariables, interceptInitConfig, interceptLoadSession, interceptStoreSession, isActive, isStopping, replaceSharedVariableMapInternal, resolveBrowserUri, resolveMemoryPolicy, sessionListeners, setData, setDesktop, setLocale, setMemoryPolicy, setSubject, setUserAgent, start, stop, stop, toString
-
Methods inherited from class org.eclipse.scout.rt.platform.reflect.AbstractPropertyObserver
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getSpecificPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
get
public static TestEnvironmentClientSession get()
- Returns:
- session in current ThreadContext
-
execLoadSession
protected void execLoadSession()
- Overrides:
execLoadSession
in classAbstractClientSession
-
getUserId
public String getUserId()
- Specified by:
getUserId
in interfaceorg.eclipse.scout.rt.shared.ISession
- Overrides:
getUserId
in classAbstractClientSession
-
getDesktop
public IDesktop getDesktop()
- Specified by:
getDesktop
in interfaceIClientSession
- Overrides:
getDesktop
in classAbstractClientSession
-
replaceDesktop
public void replaceDesktop(IDesktop desktop)
Replace the desktop with an other instance (m_testDesktop
). Can be used to install a mock or a spy. UnlikeAbstractClientSession.setDesktop(IDesktop)
it will not check if the desktop is already active. If a test desktop (m_testDesktop
) is set,getDesktop()
will return this instance. Do not forget to set the test desktop to null at the end of your test.- Parameters:
desktop
- the test desktop
-
simulateDesktopOpened
protected void simulateDesktopOpened(IDesktop desktop)
Simulates that the desktop has been opened.
-
-