Home / Function/ beforeEach() — netty Function Reference

beforeEach() — netty Function Reference

Architecture documentation for the beforeEach() function in LeakPresenceExtension.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2714d0d3_3165_1afd_de67_d9b39f0dcf90["beforeEach()"]
  4aa8c5e8_067e_2569_2cc8_34469837e207["LeakPresenceExtension"]
  2714d0d3_3165_1afd_de67_d9b39f0dcf90 -->|defined in| 4aa8c5e8_067e_2569_2cc8_34469837e207
  style 2714d0d3_3165_1afd_de67_d9b39f0dcf90 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

testsuite-common/src/main/java/io/netty/util/test/LeakPresenceExtension.java lines 67–86

    @Override
    public void beforeEach(ExtensionContext context) {
        LeakPresenceDetector.ResourceScope outerScope;
        ExtensionContext outerContext = context;
        while (true) {
            outerScope = (LeakPresenceDetector.ResourceScope)
                    outerContext.getStore(ExtensionContext.Namespace.GLOBAL).get(SCOPE_KEY);
            if (outerScope != null) {
                break;
            }
            outerContext = outerContext.getParent()
                    .orElseThrow(() -> new IllegalStateException("No resource scope found"));
        }

        LeakPresenceDetector.ResourceScope previousScope = WithTransferableScope.SCOPE.get();
        WithTransferableScope.SCOPE.set(outerScope);
        if (previousScope != null) {
            context.getStore(ExtensionContext.Namespace.GLOBAL).put(PREVIOUS_SCOPE_KEY, previousScope);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does beforeEach() do?
beforeEach() is a function in the netty codebase, defined in testsuite-common/src/main/java/io/netty/util/test/LeakPresenceExtension.java.
Where is beforeEach() defined?
beforeEach() is defined in testsuite-common/src/main/java/io/netty/util/test/LeakPresenceExtension.java at line 67.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free