Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TestUtils: EventCounterHandler #1005

Merged
merged 1 commit into from
May 17, 2019
Merged

Conversation

weissi
Copy link
Member

@weissi weissi commented May 17, 2019

Motivation:

In many unit tests, it's important to count the events. So far we have
many many ad-hoc handlers to do so but having one that counts all events
would be handy.

Modifications:

Add EventCounterHandler to count all events travelling the
ChannelPipeline.

Result:

Easier unit testing

@weissi weissi requested a review from Lukasa May 17, 2019 08:14
@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label May 17, 2019
@Lukasa Lukasa added this to the 2.2.0 milestone May 17, 2019
}
}

private let _channelRegisteredCalls = Atomic<Int>(value: 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jees, I really want some property delegates now to ease all of this boilerplate!

@weissi weissi force-pushed the jw-event-counter-handler branch 2 times, most recently from 51fc673 to c8c4c9a Compare May 17, 2019 11:26
Motivation:

In many unit tests, it's important to count the events. So far we have
many many ad-hoc handlers to do so but having one that counts all events
would be handy.

Modifications:

Add `EventCounterHandler` to count all events travelling the
`ChannelPipeline`.

Result:

Easier unit testing
@weissi weissi force-pushed the jw-event-counter-handler branch from c8c4c9a to d7d8fff Compare May 17, 2019 11:29
@weissi weissi requested a review from Lukasa May 17, 2019 11:30
@Lukasa Lukasa merged commit ccc459a into apple:master May 17, 2019
@weissi weissi deleted the jw-event-counter-handler branch May 17, 2019 13:27
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants