1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.rng.sampling.distribution;
18
19 import org.apache.commons.rng.RandomProviderState;
20 import org.apache.commons.rng.RestorableUniformRandomProvider;
21 import org.apache.commons.rng.simple.RandomSource;
22 import org.junit.Assert;
23 import org.junit.Test;
24
25
26
27
28
29 public class SmallMeanPoissonSamplerTest {
30
31
32
33
34
35
36 @Test(expected=IllegalArgumentException.class)
37 public void testConstructorThrowsWithMeanLargerThanUpperBound() {
38 final RestorableUniformRandomProvider rng =
39 RandomSource.create(RandomSource.SPLIT_MIX_64);
40 @SuppressWarnings("unused")
41 SmallMeanPoissonSampler sampler = new SmallMeanPoissonSampler(rng, Integer.MAX_VALUE / 2 + 1);
42 }
43
44
45
46
47 @Test(expected=IllegalArgumentException.class)
48 public void testConstructorThrowsWithZeroMean() {
49 final RestorableUniformRandomProvider rng =
50 RandomSource.create(RandomSource.SPLIT_MIX_64);
51 @SuppressWarnings("unused")
52 SmallMeanPoissonSampler sampler = new SmallMeanPoissonSampler(rng, 0);
53 }
54 }