diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2020-12-24 18:42:29 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2020-12-24 18:42:29 +0000 |
commit | a0fa9e19b1196bc10034f15474d27ce23bf5865a (patch) | |
tree | 499c1eb427ebff72f7e447d13dd1de1552df8146 /src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java | |
parent | fb012041e8dd788637e68737199bc313b3e90098 (diff) | |
download | poi-a0fa9e19b1196bc10034f15474d27ce23bf5865a.tar.gz poi-a0fa9e19b1196bc10034f15474d27ce23bf5865a.zip |
#65026 - Migrate tests to Junit 5
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884783 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java')
-rw-r--r-- | src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java b/src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java index ec8359a46d..0ae728d52c 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java +++ b/src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java @@ -17,7 +17,8 @@ package org.apache.poi.ss.usermodel; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.io.BufferedReader; import java.io.File; @@ -27,8 +28,8 @@ import java.io.InputStreamReader; import org.apache.poi.hssf.HSSFTestDataSamples; import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; import org.apache.poi.util.LocaleUtil; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Tests for the Fraction Formatting part of DataFormatter. @@ -43,15 +44,12 @@ public final class TestFractionFormat { assertEquals("26027/81", ret); } - @Test(expected = IllegalStateException.class) + @Test public void testInvalid() { - FractionFormat f = new FractionFormat("", "9999999999999999999999999999"); - double val = 321.321; - String ret = f.format(val); - assertEquals("26027/81", ret); + assertThrows(IllegalStateException.class, () -> new FractionFormat("", "9999999999999999999999999999")); } - @Ignore("Runs for some longer time") + @Disabled("Runs for some longer time") @Test public void microBenchmark() { FractionFormat f = new FractionFormat("", "##"); @@ -105,7 +103,7 @@ public final class TestFractionFormat { String truth = clean(truths[j]); String testKey = truths[0] + ":" + truths[1] + ":" + headers[j]; - assertEquals(testKey, truth, formatted); + assertEquals(truth, formatted, testKey); } truthLine = reader.readLine(); } |