public void testDivideExceptionInvalidRM(){
  String a="1231212478987482988429808779810457634781384756794987";
  int aScale=15;
  String b="747233429293018787918347987234564568";
  int bScale=10;
  BigDecimal aNumber=new BigDecimal(new BigInteger(a),aScale);
  BigDecimal bNumber=new BigDecimal(new BigInteger(b),bScale);
  try {
    aNumber.divide(bNumber,100);
    fail("IllegalArgumentException has not been caught");
  }
 catch (  IllegalArgumentException e) {
    assertEquals("Improper exception message","Invalid rounding mode",e.getMessage());
  }
}

public void testDivideExceptionInvalidRM ( ) { String a = "1231212478987482988429808779810457634781384756794987" ; int aScale = 15 ; String b = "747233429293018787918347987234564568" ; int bScale = 10 ; BigDecimal aNumber = new BigDecimal ( new BigInteger ( a ) , aScale ) ; BigDecimal bNumber = new BigDecimal ( new BigInteger ( b ) , bScale ) ; try { aNumber . divide ( bNumber , 100 ) ; fail ( "IllegalArgumentException has not been caught" ) ; } catch ( IllegalArgumentException e ) { assertEquals ( "Improper exception message" , "Invalid rounding mode" , e . getMessage ( ) ) ; } }
divide with invalid rounding mode
