Skip to content

Commit e232ae2

Browse files
committed
Remove long time not needed ICU4J references in tests
These are not referenced at all thus simply deleted.
1 parent 3b49502 commit e232ae2

File tree

3 files changed

+1
-66
lines changed

3 files changed

+1
-66
lines changed

tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import static org.junit.Assert.assertEquals;
1919

20-
import java.lang.reflect.Constructor;
2120
import java.math.BigDecimal;
2221
import java.math.BigInteger;
2322
import java.text.Format;
@@ -127,16 +126,6 @@ public void testConvertBigIntegerToString() throws Exception {
127126
assertEquals(expected, result);
128127
}
129128

130-
Class<?> icuBigDecimal = null;
131-
Constructor<?> icuBigDecimalCtr = null;
132-
{
133-
try {
134-
icuBigDecimal = Class.forName("com.ibm.icu.math.BigDecimal");
135-
icuBigDecimalCtr = icuBigDecimal.getConstructor(BigInteger.class, int.class);
136-
}
137-
catch(ClassNotFoundException | NoSuchMethodException e) {}
138-
}
139-
140129
@Test
141130
public void testConvertBigDecimalToString() throws Exception {
142131
NumberToStringConverter converter = NumberToStringConverter.fromBigDecimal();

tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static org.junit.Assert.assertNull;
2020
import static org.junit.Assert.assertThrows;
2121

22-
import java.lang.reflect.Constructor;
2322
import java.math.BigDecimal;
2423
import java.math.BigInteger;
2524
import java.text.Format;
@@ -83,16 +82,6 @@ public void testConvertsToBigInteger() throws Exception {
8382
assertEquals(input, result);
8483
}
8584

86-
Class<?> icuBigDecimal = null;
87-
Constructor<?> icuBigDecimalCtr = null;
88-
{
89-
try {
90-
icuBigDecimal = Class.forName("com.ibm.icu.math.BigDecimal");
91-
icuBigDecimalCtr = icuBigDecimal.getConstructor(BigInteger.class, int.class);
92-
}
93-
catch(ClassNotFoundException | NoSuchMethodException e) {}
94-
}
95-
9685
@Test
9786
public void testConvertsToBigDecimal() throws Exception {
9887
StringToNumberConverter<BigDecimal> converter = StringToNumberConverter.toBigDecimal(numberFormat);

tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package org.eclipse.core.tests.internal.databinding.conversion;
1616

17-
import static org.junit.Assert.assertEquals;
1817
import static org.junit.Assert.assertFalse;
1918
import static org.junit.Assert.assertTrue;
2019

@@ -152,49 +151,7 @@ public void testRanges() throws Exception {
152151
assertFalse("invalid BigDecimal min", assertValid(bigDecimalMin));
153152
assertFalse("invalid BigDecimal max", assertValid(bigDecimalMax));
154153

155-
/**
156-
* The ICU4J plugin's NumberFormat will return it's own BigDecimal
157-
* implementation, com.ibm.icu.math.BigDecimal. The issue this causes is
158-
* that we can't reference this class as it's not part of the
159-
* replacement plugin. So in order to ensure that we handle Number's
160-
* that are not part of the JDK stub a number implemenation and ensure
161-
* that the double representation of this number is used.
162-
*/
163-
class MyNumber extends Number {
164-
double value;
165-
int count;
166-
167-
MyNumber(double value) {
168-
this.value = value;
169-
}
170-
171-
private static final long serialVersionUID = 1L;
172-
173-
@Override
174-
public double doubleValue() {
175-
count++;
176-
return value;
177-
}
178-
179-
@Override
180-
public float floatValue() {
181-
return 0;
182-
}
183-
184-
@Override
185-
public int intValue() {
186-
return 0;
187-
}
188-
189-
@Override
190-
public long longValue() {
191-
return 0;
192-
}
193-
}
194-
195-
MyNumber number = new MyNumber(1);
196-
assertEquals(0, number.count);
154+
Number number = BigDecimal.valueOf((double) 1);
197155
assertTrue(StringToNumberParser.inIntegerRange(number));
198-
assertTrue("double value retrieved", number.count > 0);
199156
}
200157
}

0 commit comments

Comments
 (0)