You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "René Cordier (Jira)" <se...@james.apache.org> on 2020/01/14 09:05:00 UTC
[jira] [Closed] (JAMES-3025) ConcurrentTestRunner could support
basic distribution patterns
[ https://issues.apache.org/jira/browse/JAMES-3025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
René Cordier closed JAMES-3025.
-------------------------------
Fix Version/s: 3.5.0
Resolution: Done
> 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
> Fix For: 3.5.0
>
>
> 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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org