Package: org.codehaus.groovy.grails.support

## [Java] Class MockApplicationContext

- org.codehaus.groovy.grails.support.MockApplicationContext

- All Implemented Interfaces and Traits:
    org.springframework.web.context.WebApplicationContext

      public class MockApplicationContext
      extends groovy.lang.GroovyObjectSupport

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `class` | `MockApplicationContext.MockResource` |

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `boolean` | `containsBean(java.lang.String name)`
    `boolean` | `containsBeanDefinition(java.lang.String beanName)`
    `boolean` | `containsLocalBean(java.lang.String arg0)`
    `A` | `findAnnotationOnBean(java.lang.String name, java.lang.Class<A> annotation)`
    `java.lang.String[]` | `getAliases(java.lang.String name)`
    `java.lang.String` | `getApplicationName()`
    `org.springframework.beans.factory.config.AutowireCapableBeanFactory` | `getAutowireCapableBeanFactory()`
    `java.lang.Object` | `getBean(java.lang.String name)`
    `T` | `getBean(java.lang.String name, java.lang.Class<T> requiredType)`
    `T` | `getBean(java.lang.Class<T> tClass)`
    `java.lang.Object` | `getBean(java.lang.String name, java.lang.Object... args)`
    `int` | `getBeanDefinitionCount()`
    `java.lang.String[]` | `getBeanDefinitionNames()`
    `java.lang.String[]` | `getBeanNamesForAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)` Find all names of beans whose `Class` has the supplied java.lang.annotation.Annotation type, without creating any bean instances yet.
    `java.lang.String[]` | `getBeanNamesForType(java.lang.Class type)`
    `java.lang.String[]` | `getBeanNamesForType(java.lang.Class type, boolean includePrototypes, boolean includeFactoryBeans)`
    `java.util.Map<java.lang.String, T>` | `getBeansOfType(java.lang.Class<T> type)`
    `java.util.Map<java.lang.String, T>` | `getBeansOfType(java.lang.Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)`
    `java.util.Map<java.lang.String, java.lang.Object>` | `getBeansWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)`
    `java.lang.ClassLoader` | `getClassLoader()`
    `java.lang.String` | `getDisplayName()`
    `org.springframework.core.env.Environment` | `getEnvironment()`
    `java.lang.String` | `getId()`
    `java.lang.String` | `getMessage(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage, java.util.Locale locale)`
    `java.lang.String` | `getMessage(java.lang.String code, java.lang.Object[] args, java.util.Locale locale)`
    `java.lang.String` | `getMessage(org.springframework.context.MessageSourceResolvable resolvable, java.util.Locale locale)`
    `org.springframework.context.ApplicationContext` | `getParent()`
    `org.springframework.beans.factory.BeanFactory` | `getParentBeanFactory()`
    `java.lang.Object` | `getProperty(java.lang.String name)`
    `org.springframework.core.io.Resource` | `getResource(java.lang.String location)`
    `org.springframework.core.io.Resource[]` | `getResources(java.lang.String locationPattern)`
    `javax.servlet.ServletContext` | `getServletContext()`
    `long` | `getStartupDate()`
    `java.lang.Class` | `getType(java.lang.String name)`
    `boolean` | `isPrototype(java.lang.String s)`
    `boolean` | `isSingleton(java.lang.String name)`
    `boolean` | `isTypeMatch(java.lang.String name, java.lang.Class aClass)`
    `void` | `publishEvent(org.springframework.context.ApplicationEvent event)`
    `void` | `registerIgnoredClassPathLocation(java.lang.String location)` Registers a resource that should not be found on the classpath.
    `void` | `registerMockBean(java.lang.String name, java.lang.Object instance)`
    `void` | `registerMockResource(java.lang.String location)` Registers a mock resource.
    `void` | `registerMockResource(java.lang.String location, java.lang.String contents)` Registers a mock resource.
    `void` | `setServletContext(javax.servlet.ServletContext servletContext)`
    `void` | `unregisterIgnoredClassPathLocation(java.lang.String location)` Unregisters a resource that should not be found on the classpath.
    `void` | `unregisterMockResource(java.lang.String location)` Unregisters a mock resource.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class groovy.lang.GroovyObjectSupport` | `groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()`
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Method Detail

    - #### public boolean containsBean(java.lang.String name)

    - #### public boolean containsBeanDefinition(java.lang.String beanName)

    - #### public boolean containsLocalBean(java.lang.String arg0)

    - #### public A findAnnotationOnBean(java.lang.String name, java.lang.Class<A> annotation)

    - #### public java.lang.String[] getAliases(java.lang.String name)

    - #### public java.lang.String getApplicationName()

    - #### public org.springframework.beans.factory.config.AutowireCapableBeanFactory getAutowireCapableBeanFactory()

    - #### public java.lang.Object getBean(java.lang.String name)

    - #### @java.lang.SuppressWarnings("unchecked") public T getBean(java.lang.String name, java.lang.Class<T> requiredType)

    - #### public T getBean(java.lang.Class<T> tClass)

    - #### public java.lang.Object getBean(java.lang.String name, java.lang.Object... args)

    - #### public int getBeanDefinitionCount()

    - #### public java.lang.String[] getBeanDefinitionNames()

    - #### public java.lang.String[] getBeanNamesForAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)

      Find all names of beans whose `Class` has the supplied java.lang.annotation.Annotation type, without creating any bean instances yet.

      Parameters:
        `annotationType` - the type of annotation to look for
      Returns:
        the names of all matching beans
      Since:
        2.4

    - #### @java.lang.SuppressWarnings({ "unchecked", "rawtypes" }) public java.lang.String[] getBeanNamesForType(java.lang.Class type)

    - #### @java.lang.SuppressWarnings("rawtypes") public java.lang.String[] getBeanNamesForType(java.lang.Class type, boolean includePrototypes, boolean includeFactoryBeans)

    - #### @java.lang.SuppressWarnings("unchecked") public java.util.Map<java.lang.String, T> getBeansOfType(java.lang.Class<T> type)

    - #### public java.util.Map<java.lang.String, T> getBeansOfType(java.lang.Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)

    - #### public java.util.Map<java.lang.String, java.lang.Object> getBeansWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)

    - #### public java.lang.ClassLoader getClassLoader()

    - #### public java.lang.String getDisplayName()

    - #### public org.springframework.core.env.Environment getEnvironment()

    - #### public java.lang.String getId()

    - #### public java.lang.String getMessage(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage, java.util.Locale locale)

    - #### public java.lang.String getMessage(java.lang.String code, java.lang.Object[] args, java.util.Locale locale)

    - #### public java.lang.String getMessage(org.springframework.context.MessageSourceResolvable resolvable, java.util.Locale locale)

    - #### public org.springframework.context.ApplicationContext getParent()

    - #### public org.springframework.beans.factory.BeanFactory getParentBeanFactory()

    - #### @java.lang.Override public java.lang.Object getProperty(java.lang.String name)

    - #### public org.springframework.core.io.Resource getResource(java.lang.String location)

    - #### public org.springframework.core.io.Resource[] getResources(java.lang.String locationPattern)

    - #### public javax.servlet.ServletContext getServletContext()

    - #### public long getStartupDate()

    - #### @java.lang.SuppressWarnings({ "unchecked", "rawtypes" }) public java.lang.Class getType(java.lang.String name)

    - #### public boolean isPrototype(java.lang.String s)

    - #### public boolean isSingleton(java.lang.String name)

    - #### @java.lang.SuppressWarnings("rawtypes") public boolean isTypeMatch(java.lang.String name, java.lang.Class aClass)

    - #### public void publishEvent(org.springframework.context.ApplicationEvent event)

    - #### public void registerIgnoredClassPathLocation(java.lang.String location)

      Registers a resource that should not be found on the classpath. Path separator: "/"

      Parameters:
        `location` - the location of the resource. Example: /WEB-INF/grails-app/i18n/messages.properties

    - #### public void registerMockBean(java.lang.String name, java.lang.Object instance)

    - #### public void registerMockResource(java.lang.String location)

      Registers a mock resource. Path separator: "/"

      Parameters:
        `location` - the location of the resource. Example: /WEB-INF/grails-app/i18n/messages.properties

    - #### public void registerMockResource(java.lang.String location, java.lang.String contents)

      Registers a mock resource. Path separator: "/"

      Parameters:
        `location` - the location of the resource. Example: /WEB-INF/grails-app/i18n/messages.properties

    - #### public void setServletContext(javax.servlet.ServletContext servletContext)

    - #### public void unregisterIgnoredClassPathLocation(java.lang.String location)

      Unregisters a resource that should not be found on the classpath. Path separator: "/"

      Parameters:
        `location` - the location of the resource. Example: /WEB-INF/grails-app/i18n/messages.properties

    - #### public void unregisterMockResource(java.lang.String location)

      Unregisters a mock resource. Path separator: "/"

      Parameters:
        `location` - the location of the resource. Example: /WEB-INF/grails-app/i18n/messages.properties