harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r395476 [3/3] - in /incubator/harmony/enhanced/classlib/trunk/modules/math/src: main/java/java/math/ test/java/org/apache/harmony/tests/java/math/ test/java/tests/api/java/math/
Date Thu, 20 Apr 2006 04:13:47 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java Wed Apr 19 21:13:44 2006
@@ -15,14 +15,17 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.5.4.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;
 
-import junit.framework.TestCase;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.math.MathContext;
+import java.math.RoundingMode;
+
+import junit.framework.TestCase;
 
 /**
  * Class:  java.math.BigDecimal
@@ -35,8 +38,8 @@
     public void testFieldONE() {
         String oneS = "1";
         double oneD = 1.0;
-        assertTrue("incorrect string value", BigDecimal.ONE.toString().equals(oneS));
-        assertTrue("incorrect double value", BigDecimal.ONE.doubleValue() == oneD);
+        assertEquals("incorrect string value", oneS, BigDecimal.ONE.toString());
+        assertEquals("incorrect double value", oneD, BigDecimal.ONE.doubleValue(), 0);
     }
 
     /**
@@ -45,8 +48,8 @@
     public void testFieldTEN() {
         String oneS = "10";
         double oneD = 10.0;
-        assertTrue("incorrect string value", BigDecimal.TEN.toString().equals(oneS));
-        assertTrue("incorrect double value", BigDecimal.TEN.doubleValue() == oneD);
+        assertEquals("incorrect string value", oneS, BigDecimal.TEN.toString());
+        assertEquals("incorrect double value", oneD, BigDecimal.TEN.doubleValue(), 0);
     }
 
     /**
@@ -55,8 +58,8 @@
     public void testFieldZERO() {
         String oneS = "0";
         double oneD = 0.0;
-        assertTrue("incorrect string value", BigDecimal.ZERO.toString().equals(oneS));
-        assertTrue("incorrect double value", BigDecimal.ZERO.doubleValue() == oneD);
+        assertEquals("incorrect string value", oneS, BigDecimal.ZERO.toString());
+        assertEquals("incorrect double value", oneD, BigDecimal.ZERO.doubleValue(), 0);
     }
 
     /**
@@ -66,8 +69,8 @@
         String a = "1231212478987482988429808779810457634781384756794987";
         BigInteger bA = new BigInteger(a);
         BigDecimal aNumber = new BigDecimal(bA);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == 0);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", 0, aNumber.scale());
     }
      
     /**
@@ -78,21 +81,132 @@
         BigInteger bA = new BigInteger(a);
         int aScale = 10;
         BigDecimal aNumber = new BigDecimal(bA, aScale);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
+    }
+
+    /**
+     * new BigDecimal(BigInteger value, MathContext)
+     */
+    public void testConstrBigIntegerMathContext() {
+        String a = "1231212478987482988429808779810457634781384756794987";
+        BigInteger bA = new BigInteger(a);
+        int precision = 46;
+        RoundingMode rm = RoundingMode.CEILING;
+        MathContext mc = new MathContext(precision, rm);
+        String res = "1231212478987482988429808779810457634781384757";
+        int resScale = -6;
+        BigDecimal result = new BigDecimal(bA, mc);
+        assertEquals("incorrect value", res, result.unscaledValue().toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
+     * new BigDecimal(BigInteger value, int scale, MathContext)
+     */
+    public void testConstrBigIntegerScaleMathContext() {
+        String a = "1231212478987482988429808779810457634781384756794987";
+        BigInteger bA = new BigInteger(a);
+        int aScale = 10;
+        int precision = 46;
+        RoundingMode rm = RoundingMode.CEILING;
+        MathContext mc = new MathContext(precision, rm);
+        String res = "1231212478987482988429808779810457634781384757";
+        int resScale = 4;
+        BigDecimal result = new BigDecimal(bA, aScale, mc);
+        assertEquals("incorrect value", res, result.unscaledValue().toString());
+        assertEquals("incorrect scale", resScale, result.scale());
     }
 
     /**
+     * new BigDecimal(char[] value); 
+     */
+    public void testConstrChar() {
+        char value[] = {'-', '1', '2', '3', '8', '0', '.', '4', '7', '3', '8', 'E', '-', '4', '2', '3'};
+        BigDecimal result = new BigDecimal(value);
+        String res = "-1.23804738E-419";
+        int resScale = 427;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+     }
+    
+    /**
+     * new BigDecimal(char[] value, int offset, int len); 
+     */
+    public void testConstrCharIntInt() {
+        char value[] = {'-', '1', '2', '3', '8', '0', '.', '4', '7', '3', '8', 'E', '-', '4', '2', '3'};
+        int offset = 3;
+        int len = 12;
+        BigDecimal result = new BigDecimal(value, offset, len);
+        String res = "3.804738E-40";
+        int resScale = 46;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+     }
+    
+    /**
+     * new BigDecimal(char[] value, int offset, int len, MathContext mc); 
+     */
+    public void testConstrCharIntIntMathContext() {
+        char value[] = {'-', '1', '2', '3', '8', '0', '.', '4', '7', '3', '8', 'E', '-', '4', '2', '3'};
+        int offset = 3;
+        int len = 12;
+        int precision = 4;
+        RoundingMode rm = RoundingMode.CEILING;
+        MathContext mc = new MathContext(precision, rm);
+        BigDecimal result = new BigDecimal(value, offset, len, mc);
+        String res = "3.805E-40";
+        int resScale = 43;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+     }
+    
+    /**
+     * new BigDecimal(char[] value, int offset, int len, MathContext mc); 
+     */
+    public void testConstrCharIntIntMathContextException1() {
+        char value[] = {'-', '1', '2', '3', '8', '0', '.', '4', '7', '3', '8', 'E', '-', '4', '2', '3'};
+        int offset = 3;
+        int len = 120;
+        int precision = 4;
+        RoundingMode rm = RoundingMode.CEILING;
+        MathContext mc = new MathContext(precision, rm);
+        try {
+            new BigDecimal(value, offset, len, mc);
+            fail("NumberFormatException has not been thrown");
+        } catch (NumberFormatException e) {
+        }
+     }
+    
+    /**
+     * new BigDecimal(char[] value, int offset, int len, MathContext mc); 
+     */
+    public void testConstrCharIntIntMathContextException2() {
+        char value[] = {'-', '1', '2', '3', '8', '0', ',', '4', '7', '3', '8', 'E', '-', '4', '2', '3'};
+        int offset = 3;
+        int len = 120;
+        int precision = 4;
+        RoundingMode rm = RoundingMode.CEILING;
+        MathContext mc = new MathContext(precision, rm);
+        try {
+            new BigDecimal(value, offset, len, mc);
+            fail("NumberFormatException has not been thrown");
+        } catch (NumberFormatException e) {
+        }
+     }
+    
+    /**
      * new BigDecimal(double value) when value is NaN
      */
     public void testConstrDoubleNaN() {
         double a = Double.NaN;
         try {
-            BigDecimal aNumber = new BigDecimal(a);
-           fail("NumberFormatException has not been caught");
-       } catch (NumberFormatException e) {
-           assertTrue("Improper exception message", e.getMessage().equals("argument is NaN"));
-       }
+            new BigDecimal(a);
+            fail("NumberFormatException has not been caught");
+        } catch (NumberFormatException e) {
+            assertEquals("Improper exception message", "argument is NaN", e
+                    .getMessage());
+        }
     }
 
     /**
@@ -101,11 +215,12 @@
     public void testConstrDoublePosInfinity() {
         double a = Double.POSITIVE_INFINITY;
         try {
-            BigDecimal aNumber = new BigDecimal(a);
-           fail("NumberFormatException has not been caught");
-       } catch (NumberFormatException e) {
-           assertTrue("Improper exception message", e.getMessage().equals("argument is infinite"));
-       }
+            new BigDecimal(a);
+            fail("NumberFormatException has not been caught");
+        } catch (NumberFormatException e) {
+            assertEquals("Improper exception message", "argument is infinite",
+                    e.getMessage());
+        }
     }
 
     /**
@@ -114,11 +229,12 @@
     public void testConstrDoubleNegInfinity() {
         double a = Double.NEGATIVE_INFINITY;
         try {
-            BigDecimal aNumber = new BigDecimal(a);
-           fail("NumberFormatException has not been caught");
-       } catch (NumberFormatException e) {
-           assertTrue("Improper exception message", e.getMessage().equals("argument is infinite"));
-       }
+            new BigDecimal(a);
+            fail("NumberFormatException has not been caught");
+        } catch (NumberFormatException e) {
+            assertEquals("Improper exception message", "argument is infinite",
+                    e.getMessage());
+        }
     }
 
     /**
@@ -129,8 +245,23 @@
         int aScale = 0;
         BigInteger bA = new BigInteger("732546982374982285073458350476230656");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
+    }
+
+    /**
+     * new BigDecimal(double, MathContext)
+     */
+    public void testConstrDoubleMathContext() {
+        double a = 732546982374982347892379283571094797.287346782359284756;
+        int precision = 21;
+        RoundingMode rm = RoundingMode.CEILING;
+        MathContext mc = new MathContext(precision, rm);
+        String res = "732546982374982285074";
+        int resScale = -15;
+        BigDecimal result = new BigDecimal(a, mc);
+        assertEquals("incorrect value", res, result.unscaledValue().toString());
+        assertEquals("incorrect scale", resScale, result.scale());
     }
 
     /**
@@ -141,8 +272,8 @@
         int aScale = 55;
         BigInteger bA = new BigInteger("1000000000000000055511151231257827021181583404541015625");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
 
     /**
@@ -153,8 +284,8 @@
         int aScale = 53;
         BigInteger bA = new BigInteger("55500000000000004884981308350688777863979339599609375");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
 
     /**
@@ -165,8 +296,62 @@
         int aScale = 55;
         BigInteger bA = new BigInteger("-1000000000000000055511151231257827021181583404541015625");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
+    }
+
+    /**
+     * new BigDecimal(int value)
+     */
+    public void testConstrInt() {
+        int a = 732546982;
+        String res = "732546982";
+        int resScale = 0;
+        BigDecimal result = new BigDecimal(a);
+        assertEquals("incorrect value", res, result.unscaledValue().toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
+     * new BigDecimal(int, MathContext)
+     */
+    public void testConstrIntMathContext() {
+        int a = 732546982;
+        int precision = 21;
+        RoundingMode rm = RoundingMode.CEILING;
+        MathContext mc = new MathContext(precision, rm);
+        String res = "732546982";
+        int resScale = 0;
+        BigDecimal result = new BigDecimal(a, mc);
+        assertEquals("incorrect value", res, result.unscaledValue().toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
+     * new BigDecimal(long value)
+     */
+    public void testConstrLong() {
+        long a = 4576578677732546982L;
+        String res = "4576578677732546982";
+        int resScale = 0;
+        BigDecimal result = new BigDecimal(a);
+        assertEquals("incorrect value", res, result.unscaledValue().toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
+     * new BigDecimal(long, MathContext)
+     */
+    public void testConstrLongMathContext() {
+        long a = 4576578677732546982L;
+        int precision = 5;
+        RoundingMode rm = RoundingMode.CEILING;
+        MathContext mc = new MathContext(precision, rm);
+        String res = "45766";
+        int resScale = -14;
+        BigDecimal result = new BigDecimal(a, mc);
+        assertEquals("incorrect value", res, result.unscaledValue().toString());
+        assertEquals("incorrect scale", resScale, result.scale());
     }
 
     /**
@@ -177,8 +362,8 @@
         int aScale = 1073;
         BigInteger bA = new BigInteger("227434132265897633950269241702666687639731047124115603942986140264569528085692462493371029187342478828091760934014851133733918639492582043963243759464684978401240614084312038547315281016804838374623558434472007664427140169018817050565150914041833284370702366055678057809362286455237716100382057360123091641959140448783514464639706721250400288267372238950016114583259228262046633530468551311769574111763316146065958042194569102063373243372766692713192728878701004405568459288708477607744497502929764155046100964958011009313090462293046650352146796805866786767887226278836423536035611825593567576424943331337401071583562754098901412372708947790843318760718495117047155597276492717187936854356663665005157041552436478744491526494952982062613955349661409854888916015625");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
      
     /**
@@ -188,66 +373,67 @@
     public void testConstrStringException() {
         String a = "-238768.787678287a+10";
         try {
-            BigDecimal aNumber = new BigDecimal(a);
-           fail("NumberFormatException has not been caught");
-       } catch (NumberFormatException e) {
-       }
+            new BigDecimal(a);
+            fail("NumberFormatException has not been caught");
+        } catch (NumberFormatException e) {}
     }
 
     /**
-     * new BigDecimal(String value)
-     * when exponent is empty.
+     * new BigDecimal(String value) when exponent is empty.
      */
     public void testConstrStringExceptionEmptyExponent1() {
         String a = "-238768.787678287e";
         try {
-            BigDecimal aNumber = new BigDecimal(a);
-           fail("NumberFormatException has not been caught");
-       } catch (NumberFormatException e) {
-           assertTrue("Improper exception message", e.getMessage().equals("empty exponent"));
-       }
+            new BigDecimal(a);
+            fail("NumberFormatException has not been caught");
+        } catch (NumberFormatException e) {
+            assertEquals("Improper exception message", "empty exponent", e
+                    .getMessage());
+        }
     }
 
     /**
-     * new BigDecimal(String value)
-     * when exponent is empty.
+     * new BigDecimal(String value) when exponent is empty.
      */
     public void testConstrStringExceptionEmptyExponent2() {
         String a = "-238768.787678287e-";
         try {
-            BigDecimal aNumber = new BigDecimal(a);
-           fail("NumberFormatException has not been caught");
-       } catch (NumberFormatException e) {
-           assertTrue("Improper exception message", e.getMessage().equals("empty exponent"));
-       }
+            new BigDecimal(a);
+            fail("NumberFormatException has not been caught");
+        } catch (NumberFormatException e) {
+            assertEquals("Improper exception message", "empty exponent", e
+                    .getMessage());
+        }
     }
 
     /**
-     * new BigDecimal(String value)
-     * when exponent is greater than Integer.MAX_VALUE.
+     * new BigDecimal(String value) when exponent is greater than
+     * Integer.MAX_VALUE.
      */
     public void testConstrStringExceptionExponentGreaterIntegerMax() {
         String a = "-238768.787678287e214748364767876";
         try {
-            BigDecimal aNumber = new BigDecimal(a);
-           fail("NumberFormatException has not been caught");
-       } catch (NumberFormatException e) {
-           assertTrue("Improper exception message", e.getMessage().equals("exponent is not signed integer"));
-       }
+            new BigDecimal(a);
+            fail("NumberFormatException has not been caught");
+        } catch (NumberFormatException e) {
+            assertEquals("Improper exception message",
+                    "exponent is not signed integer", e.getMessage());
+        }
     }
 
     /**
-     * new BigDecimal(String value)
-     * when exponent is less than Integer.MIN_VALUE.
+     * new BigDecimal(String value) when exponent is less than
+     * Integer.MIN_VALUE.
      */
     public void testConstrStringExceptionExponentLessIntegerMin() {
         String a = "-238768.787678287e-214748364767876";
         try {
             BigDecimal aNumber = new BigDecimal(a);
-           fail("NumberFormatException has not been caught");
-       } catch (NumberFormatException e) {
-           assertTrue("Improper exception message", e.getMessage().equals("exponent is not signed integer"));
-       }
+            fail("NumberFormatException has not been caught");
+        } catch (NumberFormatException e) {
+            assertEquals("Improper exception message",
+                    "exponent is not signed integer", e.getMessage());
+        }
     }
 
     /**
@@ -259,8 +445,8 @@
         int aScale = -2147483638;
         BigInteger bA = new BigInteger("-238768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
 
     /**
@@ -272,10 +458,11 @@
         int aScale = -2147483638;
         BigInteger bA = new BigInteger("-238768787678287");
         try {
-           BigDecimal aNumber = new BigDecimal(a);
+           new BigDecimal(a);
+           fail("NumberFormatException expected");
        } catch (NumberFormatException e) {
-           assertTrue("Improper exception message", 
-               e.getMessage().equals("resulting scale out of range"));
+           assertEquals("Improper exception message","resulting scale out of range", 
+               e.getMessage());
        }
     }
 
@@ -287,8 +474,8 @@
         int aScale = 18;
         BigInteger bA = new BigInteger("732546982374982347892379283571094797287346782359284756");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
 
     /**
@@ -299,8 +486,8 @@
         int aScale = 18;
         BigInteger bA = new BigInteger("732546982374982347892379283571094797287346782359284756");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
        
     /**
@@ -311,8 +498,8 @@
         int aScale = 18;
         BigInteger bA = new BigInteger("-732546982374982347892379283571094797287346782359284756");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
        
     /**
@@ -324,22 +511,22 @@
         int aScale = 0;
         BigInteger bA = new BigInteger("-732546982374982347892379283571094797287346782359284756");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
        
-    /**
-     * new BigDecimal(String value); value contains exponent
-     * and does not contain decimal point
-     */
-    public void testConstrStringWithExponentWithoutPoint1() {
-        String a = "-238768787678287e214";
-        int aScale = -214;
-        BigInteger bA = new BigInteger("-238768787678287");
-        BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
-    }
+      /**
+       * new BigDecimal(String value); value contains exponent
+       * and does not contain decimal point
+       */
+      public void testConstrStringWithExponentWithoutPoint1() {
+          String a = "-238768787678287e214";
+          int aScale = -214;
+          BigInteger bA = new BigInteger("-238768787678287");
+          BigDecimal aNumber = new BigDecimal(a);
+          assertEquals("incorrect value", bA, aNumber.unscaledValue());
+          assertEquals("incorrect scale", aScale, aNumber.scale());
+      }
 
     /**
      * new BigDecimal(String value); value contains exponent
@@ -350,8 +537,8 @@
         int aScale = 214;
         BigInteger bA = new BigInteger("-238768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
      
     /**
@@ -363,8 +550,8 @@
         int aScale = 214;
         BigInteger bA = new BigInteger("238768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
 
     /**
@@ -376,8 +563,8 @@
         int aScale = -214;
         BigInteger bA = new BigInteger("238768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
 
     /**
@@ -389,8 +576,8 @@
         int aScale = -214;
         BigInteger bA = new BigInteger("238768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
 
     /**
@@ -402,8 +589,8 @@
         int aScale = -207;
         BigInteger bA = new BigInteger("239854398379847824356524245238768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
 
     /**
@@ -415,8 +602,8 @@
         int aScale = 221;
         BigInteger bA = new BigInteger("2380964839238475457356735674573563567890295784902768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
 
     /**
@@ -428,8 +615,8 @@
         int aScale = 0;
         BigInteger bA = new BigInteger("2380964839238475457356735674573563567890295784902768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
      
     /**
@@ -441,8 +628,8 @@
         int aScale = 2;
         BigInteger bA = new BigInteger("2380964839238475457356735674573563567890295784902768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
     }
      
     /**
@@ -454,7 +641,22 @@
         int aScale = -2;
         BigInteger bA = new BigInteger("2380964839238475457356735674573563567890295784902768787678287");
         BigDecimal aNumber = new BigDecimal(a);
-        assertTrue("incorrect value", aNumber.unscaledValue().equals(bA));
-        assertTrue("incorrect scale", aNumber.scale() == aScale);
+        assertEquals("incorrect value", bA, aNumber.unscaledValue());
+        assertEquals("incorrect scale", aScale, aNumber.scale());
+    }
+    
+    /**
+     * new BigDecimal(String value, MathContext)
+     */
+    public void testConstrStringMathContext() {
+        String a = "-238768787678287e214";
+        int precision = 5;
+        RoundingMode rm = RoundingMode.CEILING;
+        MathContext mc = new MathContext(precision, rm);
+        String res = "-23876";
+        int resScale = -224;
+        BigDecimal result = new BigDecimal(a, mc);
+        assertEquals("incorrect value", res, result.unscaledValue().toString());
+        assertEquals("incorrect scale", resScale, result.scale());
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConvertTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConvertTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConvertTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConvertTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.4.4.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;
@@ -37,7 +37,7 @@
         String a = "-123809648392384754573567356745735.63567890295784902768787678287E+21";
         BigDecimal aNumber = new BigDecimal(a);
         double result = -1.2380964839238476E53;
-        assertTrue("incorrect value", aNumber.doubleValue() == result);
+        assertEquals("incorrect value", result, aNumber.doubleValue(), 0);
     }
 
     /**
@@ -47,7 +47,7 @@
         String a = "123809648392384754573567356745735.63567890295784902768787678287E+21";
         BigDecimal aNumber = new BigDecimal(a);
         double result = 1.2380964839238476E53;
-        assertTrue("incorrect value", aNumber.doubleValue() == result);
+        assertEquals("incorrect value", result, aNumber.doubleValue(), 0);
     }
 
     /**
@@ -57,7 +57,7 @@
         String a = "123809648392384754573567356745735.63567890295784902768787678287E+400";
         BigDecimal aNumber = new BigDecimal(a);
         double result = Double.POSITIVE_INFINITY;
-        assertTrue("incorrect value", aNumber.doubleValue() == result);
+        assertEquals("incorrect value", result, aNumber.doubleValue(), 0);
     }
 
     /**
@@ -67,7 +67,7 @@
         String a = "-123809648392384754573567356745735.63567890295784902768787678287E+400";
         BigDecimal aNumber = new BigDecimal(a);
         double result = Double.NEGATIVE_INFINITY;
-        assertTrue("incorrect value", aNumber.doubleValue() == result);
+        assertEquals("incorrect value", result, aNumber.doubleValue(), 0);
     }
 
     /**
@@ -195,6 +195,34 @@
     }
 
     /**
+     * scaleByPowerOfTen(int n)
+     */
+    public void testScaleByPowerOfTen1() {
+        String a = "1231212478987482988429808779810457634781384756794987";
+        int aScale = 13;
+        BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale);
+        BigDecimal result = aNumber.scaleByPowerOfTen(10);
+        String res = "1231212478987482988429808779810457634781384756794.987";
+        int resScale = 3;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
+     * scaleByPowerOfTen(int n)
+     */
+    public void testScaleByPowerOfTen2() {
+        String a = "1231212478987482988429808779810457634781384756794987";
+        int aScale = -13;
+        BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale);
+        BigDecimal result = aNumber.scaleByPowerOfTen(10);
+        String res = "1.231212478987482988429808779810457634781384756794987E+74";
+        int resScale = -23;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
      * Convert a positive BigDecimal to BigInteger
      */
     public void testToBigIntegerPos1() {
@@ -272,9 +300,74 @@
     }
 
     /**
-     * Convert a negative BigDecimal with a negative exponent 
-     * to a plain string representation;
-     * scale == 0.
+     * toBigIntegerExact()
+     */
+    public void testToBigIntegerExact1() {
+        String a = "-123809648392384754573567356745735.63567890295784902768787678287E+45";
+        BigDecimal aNumber = new BigDecimal(a);
+        String res = "-123809648392384754573567356745735635678902957849027687876782870000000000000000";
+        BigInteger result = aNumber.toBigIntegerExact();
+        assertEquals("incorrect value", res, result.toString());
+    }
+
+    /**
+     * toBigIntegerExact()
+     */
+    public void testToBigIntegerExactException() {
+        String a = "-123809648392384754573567356745735.63567890295784902768787678287E-10";
+        BigDecimal aNumber = new BigDecimal(a);
+        String res = "-123809648392384754573567356745735635678902957849027687876782870000000000000000";
+        try {
+            BigInteger result = aNumber.toBigIntegerExact();
+            fail("java.lang.ArithmeticException has not been thrown");
+        } catch (java.lang.ArithmeticException e) {
+            return;
+        }
+    }
+
+    /**
+     * Convert a positive BigDecimal to an engineering string representation
+     */
+    public void testToEngineeringStringPos() {
+        String a = "123809648392384754573567356745735.63567890295784902768787678287E-501";
+        BigDecimal aNumber = new BigDecimal(a);
+        String result = "123.80964839238475457356735674573563567890295784902768787678287E-471";
+        assertEquals("incorrect value", result, aNumber.toEngineeringString());
+    }
+
+    /**
+     * Convert a negative BigDecimal to an engineering string representation
+     */
+    public void testToEngineeringStringNeg() {
+        String a = "-123809648392384754573567356745735.63567890295784902768787678287E-501";
+        BigDecimal aNumber = new BigDecimal(a);
+        String result = "-123.80964839238475457356735674573563567890295784902768787678287E-471";
+        assertEquals("incorrect value", result, aNumber.toEngineeringString());
+    }
+
+    /**
+     * Convert a negative BigDecimal to an engineering string representation
+     */
+    public void testToEngineeringStringZeroPosExponent() {
+        String a = "0.0E+16";
+        BigDecimal aNumber = new BigDecimal(a);
+        String result = "0E+15";
+        assertEquals("incorrect value", result, aNumber.toEngineeringString());
+    }
+
+    /**
+     * Convert a negative BigDecimal to an engineering string representation
+     */
+    public void testToEngineeringStringZeroNegExponent() {
+        String a = "0.0E-16";
+        BigDecimal aNumber = new BigDecimal(a);
+        String result = "0.00E-15";
+        assertEquals("incorrect value", result, aNumber.toEngineeringString());
+    }
+
+    /**
+     * Convert a negative BigDecimal with a negative exponent to a plain string
+     * representation; scale == 0.
      */
      public void testToPlainStringNegNegExp() {
         String a = "-123809648392384754573567356745735.63567890295784902768787678287E-100";
@@ -393,7 +486,7 @@
     }
 
     /**
-     * Create a BigDecimal from a negative long value; scale == 0
+     * Create a BigDecimal from a negative long value; scale is positive
      */
     public void testValueOfPosScalePos() {
         long a = 98374823947823578L;
@@ -404,7 +497,7 @@
     }
 
     /**
-     * Create a BigDecimal from a negative long value; scale == 0
+     * Create a BigDecimal from a negative long value; scale is negative
      */
     public void testValueOfPosScaleNeg() {
         long a = 98374823947823578L;
@@ -412,5 +505,66 @@
         BigDecimal aNumber = BigDecimal.valueOf(a, scale);
         String result = "9.8374823947823578E+28";
         assertTrue("incorrect value", aNumber.toString().equals(result));
+    }
+
+    /**
+     * Create a BigDecimal from a negative double value
+     */
+    public void testValueOfDoubleNeg() {
+        double a = -65678765876567576.98788767;
+        BigDecimal result = BigDecimal.valueOf(a);
+        String res = "-65678765876567576";
+        int resScale = 0;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
+     * Create a BigDecimal from a positive double value
+     */
+    public void testValueOfDoublePos1() {
+        double a = 65678765876567576.98788767;
+        BigDecimal result = BigDecimal.valueOf(a);
+        String res = "65678765876567576";
+        int resScale = 0;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
+     * Create a BigDecimal from a positive double value
+     */
+    public void testValueOfDoublePos2() {
+        double a = 12321237576.98788767;
+        BigDecimal result = BigDecimal.valueOf(a);
+        String res = "12321237576.987888";
+        int resScale = 6;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
+     * Create a BigDecimal from a positive double value
+     */
+    public void testValueOfDoublePos3() {
+        double a = 12321237576.9878838;
+        BigDecimal result = BigDecimal.valueOf(a);
+        String res = "12321237576.987885";
+        int resScale = 6;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+
+    /**
+     * valueOf(Double.NaN)
+     */
+    public void testValueOfDoubleNaN() {
+        double a = Double.NaN;
+        try {
+            BigDecimal result = BigDecimal.valueOf(a);
+            fail("NumberFormatException has not been thrown for Double.NaN");
+        } catch (NumberFormatException e) {
+            return;
+        }
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalScaleOperationsTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalScaleOperationsTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalScaleOperationsTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalScaleOperationsTest.java Wed Apr 19 21:13:44 2006
@@ -15,14 +15,13 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.4.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;
 
 import junit.framework.TestCase;
-import java.math.BigDecimal;
-import java.math.BigInteger;
+import java.math.*;
 
 /**
  * Class:  java.math.BigDecimal
@@ -237,6 +236,21 @@
     }
     
     /**
+     * SetScale(int, RoundingMode)
+     */
+    public void testSetScaleIntRoundingMode() {
+        String a = "1231212478987482988429808779810457634781384756794987";
+        int aScale = 28;
+        int newScale = 18;
+        BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale);
+        BigDecimal result = aNumber.setScale(newScale, RoundingMode.HALF_EVEN);
+        String res = "123121247898748298842980.877981045763478138";
+        int resScale = 18;
+        assertEquals("incorrect value", res, result.toString());
+        assertEquals("incorrect scale", resScale, result.scale());
+    }
+    
+    /**
      * Move the decimal point to the left; the shift value is positive
      */
     public void testMovePointLeftPos() {
@@ -321,5 +335,16 @@
         } catch (ArithmeticException e) {
             assertTrue("Improper exception message", e.getMessage().equals("scale outside the range of a 32-bit integer"));
         }
+    }
+
+    /**
+     * precision()
+     */
+    public void testPrecision() {
+        String a = "12312124789874829887348723648726347429808779810457634781384756794987";
+        int aScale = 14;
+        BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale);
+        int prec = aNumber.precision();
+        assertEquals(68, prec);
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAddTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAddTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAddTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAddTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.5.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAndTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAndTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAndTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAndTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.3.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerCompareTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerCompareTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerCompareTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerCompareTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.6.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;
@@ -238,55 +238,6 @@
         BigInteger aNumber = BigInteger.ZERO;
         BigInteger bNumber = BigInteger.ZERO;
         assertTrue(aNumber.compareTo(bNumber) == 0);
-    }
-
-    /**
-     * compareTo(Object obj).
-     * Verify throwing an exception if obj is not a BigInteger
-     */
-    public void testCompareToObjectException() {
-        byte aBytes[] = {12, 56, 100, -2, -76, 89, 45, 91, 3, -15, 35, 26, 3, 91};
-        int aSign = 1;
-        BigInteger aNumber = new BigInteger(aSign, aBytes);
-        Object obj = new Object();
-        try {
-            int result = aNumber.compareTo(obj);
-            fail("ClassCastException has not been caught");
-        } catch (ClassCastException e) {
-            assertTrue("Improper exception class", e.getClass().getName().equals("java.lang.ClassCastException"));
-        }
-    }
-    
-    /**
-     * compareTo(Object obj).
-     * if obj is not a BigInteger, the exception should be thrown
-     */
-    public void testCompareToObject() {
-        byte aBytes[] = {10, 20, 30, 40, 50, 60, 70, 10, 20, 30};
-        byte bBytes[] = {12, 56, 100, -2, -76, 89, 45, 91, 3, -15, 35, 26, 3, 91};
-        int aSign = 1;
-        int bSign = 1;        
-        BigInteger aNumber = new BigInteger(aSign, aBytes);
-        Object hello = (Object)new String("Hello, World");
-        try {
-            aNumber.compareTo(hello);
-            fail("ClassCastException has not been caught");
-        } catch (ClassCastException e) {
-        }
-    }
-
-    /**
-     * compareTo(Object obj).
-     * obj should be a BigInteger
-     */
-    public void testCompareToObjectBI() {
-        byte aBytes[] = {10, 20, 30, 40, 50, 60, 70, 10, 20, 30};
-        byte bBytes[] = {12, 56, 100, -2, -76, 89, 45, 91, 3, -15, 35, 26, 3, 91};
-        int aSign = 1;
-        int bSign = 1;        
-        BigInteger aNumber = new BigInteger(aSign, aBytes);
-        Object bNumber = (Object)new BigInteger(bSign, bBytes);
-        assertTrue(aNumber.compareTo(bNumber) == -1);
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.6.2.3 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConvertTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConvertTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConvertTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConvertTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.8.2.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.7.2.3 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerHashCodeTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerHashCodeTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerHashCodeTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerHashCodeTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.3.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerModPowTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerModPowTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerModPowTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerModPowTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.5.2.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerMultiplyTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerMultiplyTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerMultiplyTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerMultiplyTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.6.2.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerNotTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerNotTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerNotTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerNotTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.3.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOperateBitsTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOperateBitsTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOperateBitsTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOperateBitsTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.10.2.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOrTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOrTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOrTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOrTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.4.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerSubtractTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerSubtractTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerSubtractTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerSubtractTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.4.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerToStringTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerToStringTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerToStringTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerToStringTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.3.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerXorTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerXorTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerXorTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerXorTest.java Wed Apr 19 21:13:44 2006
@@ -15,7 +15,7 @@
  */
 /**
  * @author Elena Semukhina
- * @version $Revision: 1.3.6.2 $
+ * @version $Revision$
  */
 
 package org.apache.harmony.tests.java.math;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java Wed Apr 19 21:13:44 2006
@@ -194,23 +194,6 @@
 	}
 
 	/**
-	 * @tests java.math.BigDecimal#compareTo(java.lang.Object)
-	 */
-	public void test_compareToLjava_lang_Object() {
-		BigDecimal comp1 = new BigDecimal("23456");
-		BigDecimal comp2 = new BigDecimal(23456D);
-		assertTrue("23456 and 23456 should be equal",
-				comp1.compareTo(comp2) == 0);
-		int r = 0;
-		try {
-			comp1.compareTo("23456");
-		} catch (ClassCastException e) {
-			r = 1;
-		}
-		assertTrue("ClassCastException is not caught", r == 1);
-	}
-
-	/**
 	 * @tests java.math.BigDecimal#divide(java.math.BigDecimal, int)
 	 */
 	public void test_divideLjava_math_BigDecimalI() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java?rev=395476&r1=395475&r2=395476&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java Wed Apr 19 21:13:44 2006
@@ -237,27 +237,6 @@
 	}
 
 	/**
-	 * @tests java.math.BigInteger#compareTo(java.lang.Object)
-	 */
-	public void test_compareToLjava_lang_Object() {
-		assertTrue("Smaller number returned >= 0",
-				one.compareTo((Object) two) < 0);
-		assertTrue("Larger number returned >= 0",
-				two.compareTo((Object) one) > 0);
-		assertTrue("Equal numbers did not return 0", one
-				.compareTo((Object) one) == 0);
-		assertTrue("Neg number messed things up", two.negate().compareTo(
-				(Object) one) < 0);
-		try {
-			one.compareTo("babelFish");
-		} catch (ClassCastException e) {
-			// Correct
-			return;
-		}
-		fail("Exception not thrown");
-	}
-
-	/**
 	 * @tests java.math.BigInteger#intValue()
 	 */
 	public void test_intValue() {



Mime
View raw message