diff --git a/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java b/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java index a45d6d169e9e..4efef2f623d4 100644 --- a/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java +++ b/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java @@ -1392,33 +1392,6 @@ class ConstantDenominatorTestCase { } } - @Test - public void TestNonAcceptableConstantDenominator() { - class NonAcceptableConstantDenominatorTestCase { - String identifier; - - NonAcceptableConstantDenominatorTestCase(String identifier) { - this.identifier = identifier; - } - } - - List testCases = Arrays.asList( - new NonAcceptableConstantDenominatorTestCase("meter-and-second"), - new NonAcceptableConstantDenominatorTestCase("meter-per--20--second"), - new NonAcceptableConstantDenominatorTestCase("meter-per-1000-1e9-second"), - new NonAcceptableConstantDenominatorTestCase("meter-per-1e20-second")); - - for (NonAcceptableConstantDenominatorTestCase testCase : testCases) { - try { - MeasureUnit unit = MeasureUnit.forIdentifier(testCase.identifier); - unit.getConstantDenominator(); - Assert.fail("An IllegalArgumentException must be thrown"); - } catch (Exception e) { - continue; - } - } - } - @Test public void TestInvalidIdentifiers() { final String inputs[] = { @@ -1458,6 +1431,9 @@ public void TestInvalidIdentifiers() { "kilonewton-meter-and-newton-meter", // Invalid units because of invalid constant denominator + "meter-per--20--second", + "meter-per-1000-1e9-second", + "meter-per-1e20-second", "per-1000", "meter-per-1000-1000", "meter-per-1000-second-1000-kilometer", @@ -1466,7 +1442,6 @@ public void TestInvalidIdentifiers() { "meter-per-1000-1000", "meter-per-1000-second-1000-kilometer", "per-1000-and-per-1000", - }; for (String input : inputs) {