Skip to content

Extract Bootstrap and ServerBootstrap setup to a common method - #15134

Merged
normanmaurer merged 1 commit into
netty:4.2from
diegolovison:b42
May 13, 2025
Merged

normanmaurer merged 1 commit into
netty:4.2from
diegolovison:b42

Conversation

@diegolovison

@diegolovison diegolovison commented May 7, 2025 •

Copy link
Copy Markdown
Contributor

This commit refactors the FixedChannelPoolTest class to extract the repetitive setup of Bootstrap and ServerBootstrap into a private bootstrap() method. This improves code readability and reduces redundancy across multiple test methods.

Motivation:

The FixedChannelPoolTest class contained repetitive code for setting up Bootstrap and ServerBootstrap instances in multiple test methods.

This will also reduce the effort to create new tests that are coming as part of

Modification:

A new private method bootstrap() was introduced within the FixedChannelPoolTest class. This method encapsulates the creation and configuration of a LocalAddress, a Bootstrap configured for LocalChannel, and a ServerBootstrap configured for LocalServerChannel.

This commit refactors the FixedChannelPoolTest class to extract the repetitive setup of Bootstrap and ServerBootstrap into a private bootstrap() method. This improves code readability and reduces redundancy across multiple test methods.
@normanmaurer
normanmaurer merged commit 817c7aa into netty:4.2 May 13, 2025
@normanmaurer normanmaurer added this to the 4.2.2.Final milestone May 13, 2025
@normanmaurer

Copy link
Copy Markdown
Member

@diegolovison thanks

@diegolovison

Copy link
Copy Markdown
Contributor Author

@normanmaurer can you please take a look at #15133 ?

normanmaurer added a commit that referenced this pull request Aug 14, 2026
… (#17289)

This commit refactors the `FixedChannelPoolTest` class to extract the
repetitive setup of Bootstrap and ServerBootstrap into a private
`bootstrap()` method. This improves code readability and reduces
redundancy across multiple test methods.

**Motivation:**

The `FixedChannelPoolTest` class contained repetitive code for setting
up `Bootstrap` and `ServerBootstrap` instances in multiple test methods.

This will also reduce the effort to create new tests that are coming as
part of
* #14723
* #15133

**Modification:**

A new private method `bootstrap()` was introduced within the
`FixedChannelPoolTest` class. This method encapsulates the creation and
configuration of a `LocalAddress`, a `Bootstrap` configured for
`LocalChannel`, and a `ServerBootstrap` configured for
`LocalServerChannel`.

Co-authored-by: Diego Lovison <[email protected]>
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
…#15134) (netty#17289)

This commit refactors the `FixedChannelPoolTest` class to extract the
repetitive setup of Bootstrap and ServerBootstrap into a private
`bootstrap()` method. This improves code readability and reduces
redundancy across multiple test methods.

**Motivation:**

The `FixedChannelPoolTest` class contained repetitive code for setting
up `Bootstrap` and `ServerBootstrap` instances in multiple test methods.

This will also reduce the effort to create new tests that are coming as
part of
* netty#14723
* netty#15133

**Modification:**

A new private method `bootstrap()` was introduced within the
`FixedChannelPoolTest` class. This method encapsulates the creation and
configuration of a `LocalAddress`, a `Bootstrap` configured for
`LocalChannel`, and a `ServerBootstrap` configured for
`LocalServerChannel`.

Co-authored-by: Diego Lovison <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants