Package com.vaadin.testbench.unit.mocks
Class MockWebApplicationContext
-
- All Implemented Interfaces:
-
org.springframework.beans.factory.BeanFactory,org.springframework.beans.factory.HierarchicalBeanFactory,org.springframework.beans.factory.ListableBeanFactory,org.springframework.context.ApplicationContext,org.springframework.context.ApplicationEventPublisher,org.springframework.context.MessageSource,org.springframework.core.env.EnvironmentCapable,org.springframework.core.io.ResourceLoader,org.springframework.core.io.support.ResourcePatternResolver,org.springframework.web.context.WebApplicationContext
public class MockWebApplicationContext implements WebApplicationContextAn adapter to make a generic Spring ApplicationContext act like a WebApplicationContext. For internal use only.
-
-
Field Summary
Fields Modifier and Type Field Description public final ServletContextservletContextpublic final static StringROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTEpublic final static StringSCOPE_REQUESTpublic final static StringSCOPE_SESSIONpublic final static StringSCOPE_APPLICATIONpublic final static StringSERVLET_CONTEXT_BEAN_NAMEpublic final static StringCONTEXT_PARAMETERS_BEAN_NAMEpublic final static StringCONTEXT_ATTRIBUTES_BEAN_NAMEpublic final static StringCLASSPATH_ALL_URL_PREFIXpublic final static StringFACTORY_BEAN_PREFIXpublic final static StringCLASSPATH_URL_PREFIX
-
Constructor Summary
Constructors Constructor Description MockWebApplicationContext(ApplicationContext appCtx, ServletContext servletContext)
-
Method Summary
Modifier and Type Method Description ServletContextgetServletContext()StringgetId()StringgetApplicationName()StringgetDisplayName()longgetStartupDate()ApplicationContextgetParent()AutowireCapableBeanFactorygetAutowireCapableBeanFactory()BeanFactorygetParentBeanFactory()booleancontainsLocalBean(String name)booleancontainsBeanDefinition(String beanName)intgetBeanDefinitionCount()Array<String>getBeanDefinitionNames()<T> ObjectProvider<T>getBeanProvider(Class<T> requiredType, boolean allowEagerInit)<T> ObjectProvider<T>getBeanProvider(ResolvableType requiredType, boolean allowEagerInit)Array<String>getBeanNamesForType(ResolvableType type)Array<String>getBeanNamesForType(ResolvableType type, boolean includeNonSingletons, boolean allowEagerInit)Array<String>getBeanNamesForType(Class<out Object> type)Array<String>getBeanNamesForType(Class<out Object> type, boolean includeNonSingletons, boolean allowEagerInit)<T> Map<String, T>getBeansOfType(Class<T> type)<T> Map<String, T>getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)Array<String>getBeanNamesForAnnotation(Class<out Annotation> annotationType)Map<String, Object>getBeansWithAnnotation(Class<out Annotation> annotationType)<A extends Annotation> AfindAnnotationOnBean(String beanName, Class<A> annotationType)<A extends Annotation> AfindAnnotationOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit)ObjectgetBean(String name)<T> TgetBean(String name, Class<T> requiredType)ObjectgetBean(String name, Array<Object> args)<T> TgetBean(Class<T> requiredType)<T> TgetBean(Class<T> requiredType, Array<Object> args)<T> ObjectProvider<T>getBeanProvider(Class<T> requiredType)<T> ObjectProvider<T>getBeanProvider(ResolvableType requiredType)booleancontainsBean(String name)booleanisSingleton(String name)booleanisPrototype(String name)booleanisTypeMatch(String name, ResolvableType typeToMatch)booleanisTypeMatch(String name, Class<out Object> typeToMatch)Class<out Object>getType(String name)Class<out Object>getType(String name, boolean allowFactoryBeanInit)Array<String>getAliases(String name)voidpublishEvent(Object event)StringgetMessage(String code, Array<Object> args, String defaultMessage, Locale locale)StringgetMessage(String code, Array<Object> args, Locale locale)StringgetMessage(MessageSourceResolvable resolvable, Locale locale)EnvironmentgetEnvironment()Array<Resource>getResources(String locationPattern)ResourcegetResource(String location)ClassLoadergetClassLoader()<A extends Annotation> Set<A>findAllAnnotationsOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit)-
Methods inherited from class org.springframework.web.context.WebApplicationContext
getServletContext -
Methods inherited from class org.springframework.context.ApplicationEventPublisher
publishEvent -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getServletContext
ServletContext getServletContext()
-
getApplicationName
String getApplicationName()
-
getDisplayName
String getDisplayName()
-
getStartupDate
long getStartupDate()
-
getParent
ApplicationContext getParent()
-
getAutowireCapableBeanFactory
AutowireCapableBeanFactory getAutowireCapableBeanFactory()
-
getParentBeanFactory
BeanFactory getParentBeanFactory()
-
containsLocalBean
boolean containsLocalBean(String name)
-
containsBeanDefinition
boolean containsBeanDefinition(String beanName)
-
getBeanDefinitionCount
int getBeanDefinitionCount()
-
getBeanDefinitionNames
Array<String> getBeanDefinitionNames()
-
getBeanProvider
<T> ObjectProvider<T> getBeanProvider(Class<T> requiredType, boolean allowEagerInit)
-
getBeanProvider
<T> ObjectProvider<T> getBeanProvider(ResolvableType requiredType, boolean allowEagerInit)
-
getBeanNamesForType
Array<String> getBeanNamesForType(ResolvableType type)
-
getBeanNamesForType
Array<String> getBeanNamesForType(ResolvableType type, boolean includeNonSingletons, boolean allowEagerInit)
-
getBeanNamesForType
Array<String> getBeanNamesForType(Class<out Object> type)
-
getBeanNamesForType
Array<String> getBeanNamesForType(Class<out Object> type, boolean includeNonSingletons, boolean allowEagerInit)
-
getBeansOfType
<T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
-
getBeanNamesForAnnotation
Array<String> getBeanNamesForAnnotation(Class<out Annotation> annotationType)
-
getBeansWithAnnotation
Map<String, Object> getBeansWithAnnotation(Class<out Annotation> annotationType)
-
findAnnotationOnBean
<A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
-
findAnnotationOnBean
<A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit)
-
getBeanProvider
<T> ObjectProvider<T> getBeanProvider(Class<T> requiredType)
-
getBeanProvider
<T> ObjectProvider<T> getBeanProvider(ResolvableType requiredType)
-
containsBean
boolean containsBean(String name)
-
isSingleton
boolean isSingleton(String name)
-
isPrototype
boolean isPrototype(String name)
-
isTypeMatch
boolean isTypeMatch(String name, ResolvableType typeToMatch)
-
isTypeMatch
boolean isTypeMatch(String name, Class<out Object> typeToMatch)
-
getAliases
Array<String> getAliases(String name)
-
publishEvent
void publishEvent(Object event)
-
getMessage
String getMessage(MessageSourceResolvable resolvable, Locale locale)
-
getEnvironment
Environment getEnvironment()
-
getResources
Array<Resource> getResources(String locationPattern)
-
getResource
Resource getResource(String location)
-
getClassLoader
ClassLoader getClassLoader()
-
findAllAnnotationsOnBean
<A extends Annotation> Set<A> findAllAnnotationsOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit)
-
-
-
-