Need to fail if the exception is not generated
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1200394 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e92986db74
commit
3d866e964d
|
@ -96,6 +96,7 @@ public class StableRandomGeneratorTest extends TestCase {
|
||||||
try {
|
try {
|
||||||
new StableRandomGenerator(rg,
|
new StableRandomGenerator(rg,
|
||||||
-1.0, 0.0);
|
-1.0, 0.0);
|
||||||
|
fail("Expected OutOfRangeException");
|
||||||
} catch (OutOfRangeException e) {
|
} catch (OutOfRangeException e) {
|
||||||
assertEquals(-1.0, e.getArgument());
|
assertEquals(-1.0, e.getArgument());
|
||||||
}
|
}
|
||||||
|
@ -105,6 +106,7 @@ public class StableRandomGeneratorTest extends TestCase {
|
||||||
try {
|
try {
|
||||||
new StableRandomGenerator(rg,
|
new StableRandomGenerator(rg,
|
||||||
3.0, 0.0);
|
3.0, 0.0);
|
||||||
|
fail("Expected OutOfRangeException");
|
||||||
} catch (OutOfRangeException e) {
|
} catch (OutOfRangeException e) {
|
||||||
assertEquals(3.0, e.getArgument());
|
assertEquals(3.0, e.getArgument());
|
||||||
}
|
}
|
||||||
|
@ -114,6 +116,7 @@ public class StableRandomGeneratorTest extends TestCase {
|
||||||
try {
|
try {
|
||||||
new StableRandomGenerator(rg,
|
new StableRandomGenerator(rg,
|
||||||
1.0, -2.0);
|
1.0, -2.0);
|
||||||
|
fail("Expected OutOfRangeException");
|
||||||
} catch (OutOfRangeException e) {
|
} catch (OutOfRangeException e) {
|
||||||
assertEquals(-2.0, e.getArgument());
|
assertEquals(-2.0, e.getArgument());
|
||||||
}
|
}
|
||||||
|
@ -123,6 +126,7 @@ public class StableRandomGeneratorTest extends TestCase {
|
||||||
try {
|
try {
|
||||||
new StableRandomGenerator(rg,
|
new StableRandomGenerator(rg,
|
||||||
1.0, 2.0);
|
1.0, 2.0);
|
||||||
|
fail("Expected OutOfRangeException");
|
||||||
} catch (OutOfRangeException e) {
|
} catch (OutOfRangeException e) {
|
||||||
assertEquals(2.0, e.getArgument());
|
assertEquals(2.0, e.getArgument());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue