harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hindess <mark.hind...@googlemail.com>
Subject Re: svn commit: r396803 - in /incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math: BigDecimalTest.java BigIntegerTest.java
Date Tue, 25 Apr 2006 09:03:13 GMT

On 25 April 2006 at 7:34, mloenko@apache.org wrote:
> Author: mloenko
> Date: Tue Apr 25 00:34:21 2006
> New Revision: 396803
> 
> URL: http://svn.apache.org/viewcvs?rev=396803&view=rev
> Log:
> applied changes for the tests from HARMONY-319:
> BigDecimal and Biginteger test failures should be fixed
> 
> Modified:
>     incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/test
> s/api/java/math/BigDecimalTest.java
>     incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/test
> s/api/java/math/BigIntegerTest.java
> 
> Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/jav
> a/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=396803
> &r1=396802&r2=396803&view=diff
> =============================================================================
> =
> --- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/test
> s/api/java/math/BigDecimalTest.java (original)
> +++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/test
> s/api/java/math/BigDecimalTest.java Tue Apr 25 00:34:21 2006
> [ SNIP ]
> @@ -128,22 +127,48 @@
>  	/**
>  	 * @tests java.math.BigDecimal#BigDecimal(java.lang.String)
>  	 */
> +	public void test_constructor_String_empty() {
> +		boolean gotNFE = false;
> +		try {
> +			new BigDecimal("");			
> +		} catch (NumberFormatException e) {
> +			gotNFE = true;
> +		} catch (Throwable e) {
> +			fail("Unexpected exception for new BigDecimal(\"\") " +
>  e);
> +		}
> +		if (!gotNFE) { 
> +			fail("Expected NumberFormatException for new BigDecimal
> (\"\")");
> +		}
> +	}

I thought we'd agreed to write tests like this as:

  public void test_constructor_String_empty() {
    try {
      new BigDecimal("");
      fail("Expected NumberFormatException for new BigDecimal(\"\")");
    } catch (NumberFormatException e) {
      // expected
    }
  }

and let junit handle the "unexpected exception" cases?

Regards,
 Mark.





---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message