[
https://issues.apache.org/jira/browse/RNG-60?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16689408#comment-16689408
]
Alex D Herbert commented on RNG-60:
-----------------------------------
A simpler approach would be to split them into hardcoded methods:
{code:java}
@Test
public void testUniformNextIntegerInRange10() {
checkNextIntegerInRange(10, 1000);
}
@Test
public void testUniformNextIntegerInRange12() {
checkNextIntegerInRange(12, 1000);
}
@Test
public void testUniformNextIntegerInRange31() {
checkNextIntegerInRange(31, 1000);
}
// etc ...
{code}
This is so ugly. But it allows better control over the probability of failures
as the expected fail rate for each test can be set.
Using JUnit 5 it would be easy to do a {{ParameterizedTest}}.
However any further modifications to the test suite may not be needed as the
change for RNG-57 now passes fine.
> Random seeds in "ProvidersList" (unit tests)
> --------------------------------------------
>
> Key: RNG-60
> URL: https://issues.apache.org/jira/browse/RNG-60
> Project: Commons RNG
> Issue Type: Task
> Components: core
> Affects Versions: 1.1
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Labels: unit-test
> Fix For: 1.2
>
>
> Unit tests for the RNG "providers" should demonstrate some robustness wrt the
> seed passed to them.
> The currently fixed seeds will be replaced by values obtained from a JDK's
> {{SecureRandom}} instance.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)