Package io.qameta.allure.internal
Class AllureThreadContext
java.lang.Object
io.qameta.allure.internal.AllureThreadContext
Thread-local binding for the current Allure execution context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all the data stored for current thread.copy()Returns a copy of the current thread context.get()Returns the current execution context.Returns last (most recent) key.Returns the executable key new executable items should be attached to.Returns the current step key, that is the current key unless it is the root test or fixture.Returns a snapshot of the current binding's locally bound keys, most recent first.getRoot()Returns first (oldest) key.pop()Removes latest execution context binding.voidpush(AllureExecutionContext executionContext) Adds execution context binding to the current thread.pushBinding(AllureExecutionContext executionContext) Adds execution context binding to the current thread and returns a handle for removing that exact binding.voidset(AllureExecutionContext executionContext) Restores the current thread context binding from a snapshot.voidstart(AllureExternalKey key) Adds new key.stop()Removes latest added key.
-
Constructor Details
-
AllureThreadContext
public AllureThreadContext()
-
-
Method Details
-
getCurrent
Returns last (most recent) key. -
getRoot
Returns first (oldest) key. -
getCurrentStep
Returns the current step key, that is the current key unless it is the root test or fixture. Empty when no step is running above the root. -
getCurrentExecutable
Returns the executable key new executable items should be attached to. -
getLocalKeys
Returns a snapshot of the current binding's locally bound keys, most recent first.- Returns:
- local keys, top of the stack first
-
start
Adds new key. -
copy
Returns a copy of the current thread context.- Returns:
- context snapshot
-
get
Returns the current execution context.- Returns:
- current execution context
-
set
Restores the current thread context binding from a snapshot.- Parameters:
executionContext- the context snapshot
-
push
Adds execution context binding to the current thread.- Parameters:
executionContext- the context to bind
-
pushBinding
Adds execution context binding to the current thread and returns a handle for removing that exact binding.- Parameters:
executionContext- the context to bind- Returns:
- a binding that removes this exact context when closed, including when another thread closes it
-
pop
Removes latest execution context binding. Ignores base context.- Returns:
- removed execution context.
-
stop
Removes latest added key. Ignores empty context.- Returns:
- removed key.
-
clear
public void clear()Removes all the data stored for current thread.
-