File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
hipparchus-core/src/test/java/org/hipparchus/random Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1818
1919import org .hipparchus .distribution .RealDistribution ;
2020import org .hipparchus .distribution .continuous .GammaDistribution ;
21+ import org .hipparchus .exception .LocalizedCoreFormats ;
22+ import org .hipparchus .exception .MathIllegalStateException ;
2123import org .junit .jupiter .api .Assertions ;
2224import org .junit .jupiter .api .Test ;
2325
@@ -83,4 +85,15 @@ public void testVariance()
8385 }
8486 }
8587
88+ @ Test
89+ public void testMaxRejection ()
90+ {
91+ try {
92+ new GammaGenerator (new RandomAdaptorTest .ConstantGenerator (1.23 ), 2.3 , 4.5 ).nextVariate ();
93+ Assertions .fail ("an exception should have been thrown" );
94+ } catch (MathIllegalStateException mise ) {
95+ Assertions .assertEquals (LocalizedCoreFormats .INTERNAL_ERROR , mise .getSpecifier ());
96+ }
97+ }
98+
8699}
You can’t perform that action at this time.
0 commit comments