TestRuntime (Grails 3.2.9)
Date: 2017-04-26

Package: grails.test.runtime

## [Groovy] Class TestRuntime

- grails.test.runtime.TestRuntime

- TestRuntime is the container for the test runtime state it has methods for getting and setting values to the registry and for sending events

  Authors:
    Lari Hotari
  Since:
    2.4.0

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `static class` | `TestRuntime.LazyValue` |

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected TestEvent` | `currentInitialEvent` |
    `protected java.util.List<TestEvent>` | `deferredEvents` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `java.util.Set<java.lang.String>` | `features`
    `java.util.List<TestPlugin>` | `plugins`
    `boolean` | `shared`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `protected TestRuntime (java.util.Set<java.lang.String> features, java.util.List<TestPlugin> plugins, SharedRuntimeConfigurer sharedRuntimeConfigurer)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `addInterceptor(TestEventInterceptor interceptor)`
    `` | `void` | `changeFeaturesAndPlugins(java.util.Set<java.lang.String> features, java.util.List<TestPlugin> plugins)`
    `` | `protected void` | `close()`
    `` | `boolean` | `containsValueFor(java.lang.String name)`
    `` | `protected TestEvent` | `createEvent(java.util.Map properties)`
    `` | `protected void` | `deliverEvent(TestEvent event)`
    `` | `protected void` | `doPublishEvent(TestEvent event)`
    `` | `protected java.util.List<TestEvent>` | `executeEventLoop(TestEvent initialEvent)`
    `` | `SharedRuntimeConfigurer` | `getSharedRuntimeConfigurer()`
    `` | `java.lang.Object` | `getValue(java.lang.String name, java.util.Map callerInfo = [:])`
    `<T>` | `T` | `getValue(java.lang.String name, java.lang.Class<T> requiredType, java.util.Map callerInfo = [:])`
    `` | `java.lang.Object` | `getValueIfExists(java.lang.String name, java.util.Map callerInfo = [:])`
    `<T>` | `T` | `getValueIfExists(java.lang.String name, java.lang.Class<T> requiredType, java.util.Map callerInfo = [:])`
    `` | `java.lang.Object` | `getValueOrCreate(java.lang.String name, groovy.lang.Closure valueCreator)`
    `<T>` | `T` | `getValueOrCreate(java.lang.String name, java.lang.Class<T> requiredType, groovy.lang.Closure valueCreator)`
    `` | `boolean` | `isClosed()`
    `` | `void` | `publishEvent(java.lang.String name, java.util.Map arguments = [:], java.util.Map extraEventProperties = [:])`
    `` | `void` | `putLazyValue(java.lang.String name, groovy.lang.Closure closure)`
    `` | `void` | `putValue(java.lang.String name, java.lang.Object value)`
    `` | `void` | `removeInterceptor(TestEventInterceptor interceptor)`
    `` | `java.lang.Object` | `removeValue(java.lang.String name)`
    `<T>` | `T` | `removeValue(java.lang.String name, java.lang.Class<T> requiredType)`
    `` | `void` | `requestClose()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `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()`

- - ### Field Detail

    - #### protected TestEvent currentInitialEvent

    - #### protected java.util.List<TestEvent> deferredEvents

  - ### Property Detail

    - #### java.util.Set<java.lang.String> features

    - #### java.util.List<TestPlugin> plugins

    - #### boolean shared

  - ### Constructor Detail

    - #### protected TestRuntime(java.util.Set<java.lang.String> features, java.util.List<TestPlugin> plugins, SharedRuntimeConfigurer sharedRuntimeConfigurer)

  - ### Method Detail

    - #### void addInterceptor(TestEventInterceptor interceptor)

    - #### void changeFeaturesAndPlugins(java.util.Set<java.lang.String> features, java.util.List<TestPlugin> plugins)

    - #### protected void close()

    - #### boolean containsValueFor(java.lang.String name)

    - #### @groovy.transform.CompileStatic(TypeCheckingMode.SKIP) protected TestEvent createEvent(java.util.Map properties)

    - #### protected void deliverEvent(TestEvent event)

    - #### protected void doPublishEvent(TestEvent event)

    - #### protected java.util.List<TestEvent> executeEventLoop(TestEvent initialEvent)

    - #### SharedRuntimeConfigurer getSharedRuntimeConfigurer()

    - #### java.lang.Object getValue(java.lang.String name, java.util.Map callerInfo = [:])

    - #### <T> T getValue(java.lang.String name, java.lang.Class<T> requiredType, java.util.Map callerInfo = [:])

    - #### java.lang.Object getValueIfExists(java.lang.String name, java.util.Map callerInfo = [:])

    - #### <T> T getValueIfExists(java.lang.String name, java.lang.Class<T> requiredType, java.util.Map callerInfo = [:])

    - #### java.lang.Object getValueOrCreate(java.lang.String name, groovy.lang.Closure valueCreator)

    - #### <T> T getValueOrCreate(java.lang.String name, java.lang.Class<T> requiredType, groovy.lang.Closure valueCreator)

    - #### boolean isClosed()

    - #### void publishEvent(java.lang.String name, java.util.Map arguments = [:], java.util.Map extraEventProperties = [:])

    - #### void putLazyValue(java.lang.String name, groovy.lang.Closure closure)

    - #### void putValue(java.lang.String name, java.lang.Object value)

    - #### void removeInterceptor(TestEventInterceptor interceptor)

    - #### java.lang.Object removeValue(java.lang.String name)

    - #### <T> T removeValue(java.lang.String name, java.lang.Class<T> requiredType)

    - #### void requestClose()