[
https://issues.apache.org/jira/browse/JAMES-3025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17014945#comment-17014945
]
René Cordier commented on JAMES-3025:
-------------------------------------
https://github.com/linagora/james-project/pull/3040 contributed to enhance
ConcurrentTestRunner with basic distribution patterns
> ConcurrentTestRunner could support basic distribution patterns
> --------------------------------------------------------------
>
> Key: JAMES-3025
> URL: https://issues.apache.org/jira/browse/JAMES-3025
> Project: James Server
> Issue Type: New Feature
> Components: tests
> Reporter: Matthieu Baechler
> Priority: Major
>
> In James, we often want to check that under concurrent workload, our
> components behave correctly at a unit level.
> For that, we implemented ConcurrentTestRunner that helps dealing with
> defining the scenarios we want.
> However, in case we want operations to be run in a pseudo-random way while
> respecting an even distribution, we write similar code:
> {code}
> switch (random(numberOfCases)) {
> case 0: firstOperation
> case 1: secondOperation
> case 2: thirdOperation
> ...
> }
> {code}
> We can enhance this situation a bit by providing a method that make the
> intent more obvious:
> {code}
> randomlyDistributedOperations(
> firstOperation,
> secondOperation,
> thirdOperation
> )
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]