public class MockEnvironment extends Object
| Constructor and Description |
|---|
MockEnvironment()
Creates a mock environment for unit testing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Cleans up all application contexts and invalidates the session.
|
protected org.springframework.web.context.support.XmlWebApplicationContext |
createApplicationContext() |
boolean |
flushEvents()
Flushes and processes any event on the event queue.
|
org.springframework.context.ApplicationContext |
getChildContext() |
org.springframework.context.ApplicationContext |
getRootContext() |
MockSession |
getSession() |
void |
init(MockConfig rootConfig,
MockConfig childConfig)
Initializes the mock environment.
|
protected org.springframework.web.context.support.XmlWebApplicationContext |
initAppContext(MockConfig config,
org.springframework.context.ApplicationContext parent)
Initialize the app context.
|
protected void |
initBrowserInfoMap(Map<String,Object> browserInfo)
Initialize browserInfo map.
|
protected void |
initClientRequestMap(Map<String,Object> map) |
protected void |
initExecutionContext() |
protected org.fujion.component.Page |
initPage(org.fujion.component.Page page)
Initialize the page.
|
protected MockServletContext |
initServletContext(MockServletContext servletContext)
Initialize the mock servlet context.
|
public MockEnvironment()
public void init(MockConfig rootConfig, MockConfig childConfig) throws Exception
rootConfig - Root container configuration.childConfig - Child container configuration.Exception - Unspecified exception.public void close()
protected org.springframework.web.context.support.XmlWebApplicationContext createApplicationContext()
protected MockServletContext initServletContext(MockServletContext servletContext)
servletContext - The mock servlet context.protected void initExecutionContext()
protected org.springframework.web.context.support.XmlWebApplicationContext initAppContext(MockConfig config, org.springframework.context.ApplicationContext parent)
config - Configuration data.parent - If creating a child context, this will be its parent. Otherwise, will be null.protected void initBrowserInfoMap(Map<String,Object> browserInfo)
browserInfo - The browser info map.protected org.fujion.component.Page initPage(org.fujion.component.Page page)
page - The page.public org.springframework.context.ApplicationContext getRootContext()
public org.springframework.context.ApplicationContext getChildContext()
public MockSession getSession()
public boolean flushEvents()
Copyright © 2023 Fujion Framework. All rights reserved.