Class OsgiContextBuilder
- java.lang.Object
-
- org.apache.sling.testing.mock.osgi.junit.OsgiContextBuilder
-
@ProviderType public final class OsgiContextBuilder extends Object
Builder class for creatingOsgiContext
instances with different sets of parameters.
-
-
Constructor Summary
Constructors Constructor Description OsgiContextBuilder()
Create builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull OsgiContextBuilder
afterSetUp(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterSetUpCallback)
@NotNull OsgiContextBuilder
afterTearDown(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterTearDownCallback)
@NotNull OsgiContextBuilder
beforeSetUp(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeSetUpCallback)
@NotNull OsgiContextBuilder
beforeTearDown(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeTearDownCallback)
@NotNull OsgiContext
build()
@NotNull OsgiContextBuilder
plugin(@NotNull ContextPlugin<? extends OsgiContextImpl> @NotNull ... plugin)
-
-
-
Method Detail
-
plugin
@SafeVarargs @NotNull public final @NotNull OsgiContextBuilder plugin(@NotNull @NotNull ContextPlugin<? extends OsgiContextImpl> @NotNull ... plugin)
- Parameters:
plugin
- Context plugin which listens to context lifecycle events.- Returns:
- this
-
beforeSetUp
@SafeVarargs @NotNull public final @NotNull OsgiContextBuilder beforeSetUp(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeSetUpCallback)
- Parameters:
beforeSetUpCallback
- Allows the application to register an own callback function that is called before the built-in setup rules are executed.- Returns:
- this
-
afterSetUp
@SafeVarargs @NotNull public final @NotNull OsgiContextBuilder afterSetUp(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterSetUpCallback)
- Parameters:
afterSetUpCallback
- Allows the application to register an own callback function that is called after the built-in setup rules are executed.- Returns:
- this
-
beforeTearDown
@SafeVarargs @NotNull public final @NotNull OsgiContextBuilder beforeTearDown(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeTearDownCallback)
- Parameters:
beforeTearDownCallback
- Allows the application to register an own callback function that is called before the built-in teardown rules are executed.- Returns:
- this
-
afterTearDown
@SafeVarargs @NotNull public final @NotNull OsgiContextBuilder afterTearDown(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterTearDownCallback)
- Parameters:
afterTearDownCallback
- Allows the application to register an own callback function that is after before the built-in teardown rules are executed.- Returns:
- this
-
build
@NotNull public @NotNull OsgiContext build()
- Returns:
- Build
OsgiContext
instance.
-
-