This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
The following commit(s) were added to refs/heads/master by this push: new 62ddebb6 Remove redundant throws Exception from test methods 62ddebb6 is described below commit 62ddebb6d9698735ef8e530d29e7f6c193518f10 Author: aherbert <aherb...@apache.org> AuthorDate: Tue Oct 18 13:22:42 2022 +0100 Remove redundant throws Exception from test methods --- .../org/apache/commons/numbers/fraction/BigFractionTest.java | 6 +++--- .../commons/numbers/fraction/ContinuedFractionTest.java | 12 ++++++------ .../org/apache/commons/numbers/fraction/FractionTest.java | 6 +++--- .../java/org/apache/commons/numbers/primes/PrimesTest.java | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java index 551fd0e6..cc3eb7f2 100644 --- a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java +++ b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java @@ -114,7 +114,7 @@ class BigFractionTest { // MATH-179 @Test - void testDoubleConstructor() throws Exception { + void testDoubleConstructor() { for (final CommonTestCases.DoubleToFractionTestCase testCase : CommonTestCases.doubleConstructorTestCases()) { assertFraction( testCase.expectedNumerator, @@ -148,7 +148,7 @@ class BigFractionTest { // MATH-181 // NUMBERS-147 @Test - void testDoubleConstructorWithMaxDenominator() throws Exception { + void testDoubleConstructorWithMaxDenominator() { for (final CommonTestCases.DoubleToFractionTestCase testCase : CommonTestCases.doubleMaxDenomConstructorTestCases()) { assertFraction( testCase.expectedNumerator, @@ -218,7 +218,7 @@ class BigFractionTest { } @Test - void testDoubleConstructorWithEpsilonLimit() throws Exception { + void testDoubleConstructorWithEpsilonLimit() { assertFraction(2, 5, BigFraction.from(0.4, 1.0e-5, 100)); assertFraction(3, 5, BigFraction.from(0.6152, 0.02, 100)); diff --git a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/ContinuedFractionTest.java b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/ContinuedFractionTest.java index 3bfccc25..ac5db9cb 100644 --- a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/ContinuedFractionTest.java +++ b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/ContinuedFractionTest.java @@ -71,7 +71,7 @@ class ContinuedFractionTest { } @Test - void testGoldenRatio() throws Exception { + void testGoldenRatio() { final double eps = 1e-8; final double gr = GoldenRatio.getInstance().evaluate(0, eps); Assertions.assertEquals(GOLDEN_RATIO, gr, GOLDEN_RATIO * eps); @@ -82,7 +82,7 @@ class ContinuedFractionTest { * Evaluates the reciprocal of the golden ratio. */ @Test - void testGoldenRatioReciprocal() throws Exception { + void testGoldenRatioReciprocal() { final double eps = 1e-8; final ContinuedFraction cf = new ContinuedFraction() { @Override @@ -118,7 +118,7 @@ class ContinuedFractionTest { } @Test - void test415Over93() throws Exception { + void test415Over93() { // https://en.wikipedia.org/wiki/Continued_fraction // 415 1 // --- = 4 + --------- @@ -158,7 +158,7 @@ class ContinuedFractionTest { } @Test - void testMaxIterationsThrows() throws Exception { + void testMaxIterationsThrows() { final ContinuedFraction cf = GoldenRatio.getInstance(); final double eps = 1e-8; @@ -168,7 +168,7 @@ class ContinuedFractionTest { } @Test - void testNaNThrows() throws Exception { + void testNaNThrows() { // Create a NaN during the iteration final ContinuedFraction cf = new ContinuedFraction() { @Override @@ -188,7 +188,7 @@ class ContinuedFractionTest { } @Test - void testInfThrows() throws Exception { + void testInfThrows() { // Create an infinity during the iteration: // a / cPrev => a_1 / b_0 => Double.MAX_VALUE / 0.5 final ContinuedFraction cf = new ContinuedFraction() { diff --git a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/FractionTest.java b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/FractionTest.java index beaf7a92..a0dd2ff3 100644 --- a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/FractionTest.java +++ b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/FractionTest.java @@ -80,7 +80,7 @@ class FractionTest { // MATH-179 @Test - void testDoubleConstructor() throws Exception { + void testDoubleConstructor() { for (final CommonTestCases.DoubleToFractionTestCase testCase : CommonTestCases.doubleConstructorTestCases()) { assertFraction( testCase.expectedNumerator, @@ -101,7 +101,7 @@ class FractionTest { // MATH-181 // NUMBERS-147 @Test - void testDoubleConstructorWithMaxDenominator() throws Exception { + void testDoubleConstructorWithMaxDenominator() { for (final CommonTestCases.DoubleToFractionTestCase testCase : CommonTestCases.doubleMaxDenomConstructorTestCases()) { assertFraction( testCase.expectedNumerator, @@ -170,7 +170,7 @@ class FractionTest { } @Test - void testDoubleConstructorWithEpsilonLimit() throws Exception { + void testDoubleConstructorWithEpsilonLimit() { assertFraction(2, 5, Fraction.from(0.4, 1.0e-5, 100)); assertFraction(3, 5, Fraction.from(0.6152, 0.02, 100)); diff --git a/commons-numbers-primes/src/test/java/org/apache/commons/numbers/primes/PrimesTest.java b/commons-numbers-primes/src/test/java/org/apache/commons/numbers/primes/PrimesTest.java index 5b4504b4..d1140faf 100644 --- a/commons-numbers-primes/src/test/java/org/apache/commons/numbers/primes/PrimesTest.java +++ b/commons-numbers-primes/src/test/java/org/apache/commons/numbers/primes/PrimesTest.java @@ -114,14 +114,14 @@ class PrimesTest { } @Test - void testIsPrime() throws Exception { + void testIsPrime() { for (int i : BELOW_2) { Assertions.assertFalse(Primes.isPrime(i)); } - for (int i:NOT_PRIMES) { + for (int i : NOT_PRIMES) { Assertions.assertFalse(Primes.isPrime(i)); } - for (int i:PRIMES) { + for (int i : PRIMES) { Assertions.assertTrue(Primes.isPrime(i)); } } @@ -151,7 +151,7 @@ class PrimesTest { } @Test - void testPrimeFactors() throws Exception { + void testPrimeFactors() { for (int i : BELOW_2) { assertPrimeFactorsException(i, MessageFormat.format(Primes.NUMBER_TOO_SMALL, i, 2)); }