Matthieu Baechler created JAMES-3025:
----------------------------------------
Summary: 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
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]