harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r408566 - /incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java
Date Mon, 22 May 2006 04:22:42 GMT
Author: smishura
Date: Sun May 21 21:22:41 2006
New Revision: 408566

URL: http://svn.apache.org/viewvc?rev=408566&view=rev
Log:
Reformatting code to 4 space indent

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java?rev=408566&r1=408565&r2=408566&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java
Sun May 21 21:22:41 2006
@@ -24,128 +24,128 @@
 
 public class NumberFormatTest extends junit.framework.TestCase {
 
-	/**
-	 * @tests java.text.NumberFormat#format(java.lang.Object,
-	 *        java.lang.StringBuffer, java.text.FieldPosition)
-	 */
-	public void test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
{
-		FieldPosition pos;
-		StringBuffer out;
-		DecimalFormat format = (DecimalFormat) NumberFormat
-				.getInstance(Locale.US);
+    /**
+     * @tests java.text.NumberFormat#format(java.lang.Object,
+     *        java.lang.StringBuffer, java.text.FieldPosition)
+     */
+    public void test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
{
+        FieldPosition pos;
+        StringBuffer out;
+        DecimalFormat format = (DecimalFormat) NumberFormat
+                .getInstance(Locale.US);
 
-		pos = new FieldPosition(0);
-		out = format.format(new Long(Long.MAX_VALUE), new StringBuffer(), pos);
+        pos = new FieldPosition(0);
+        out = format.format(new Long(Long.MAX_VALUE), new StringBuffer(), pos);
         assertEquals("Wrong result L1: " + out, "9,223,372,036,854,775,807",
                 out.toString());
 
-		pos = new FieldPosition(0);
-		out = format.format(new Long(Long.MIN_VALUE), new StringBuffer(), pos);
+        pos = new FieldPosition(0);
+        out = format.format(new Long(Long.MIN_VALUE), new StringBuffer(), pos);
         assertEquals("Wrong result L2: " + out, "-9,223,372,036,854,775,808",
                 out.toString());
 
-		pos = new FieldPosition(0);
-		out = format.format(new java.math.BigInteger(String
-				.valueOf(Long.MAX_VALUE)), new StringBuffer(), pos);
+        pos = new FieldPosition(0);
+        out = format.format(new java.math.BigInteger(String
+                .valueOf(Long.MAX_VALUE)), new StringBuffer(), pos);
         assertEquals("Wrong result BI1: " + out, "9,223,372,036,854,775,807",
                 out.toString());
 
-		pos = new FieldPosition(0);
-		out = format.format(new java.math.BigInteger(String
-				.valueOf(Long.MIN_VALUE)), new StringBuffer(), pos);
+        pos = new FieldPosition(0);
+        out = format.format(new java.math.BigInteger(String
+                .valueOf(Long.MIN_VALUE)), new StringBuffer(), pos);
         assertEquals("Wrong result BI2: " + out, "-9,223,372,036,854,775,808",
                 out.toString());
 
-		java.math.BigInteger big;
-		pos = new FieldPosition(0);
-		big = new java.math.BigInteger(String.valueOf(Long.MAX_VALUE))
-				.add(new java.math.BigInteger("1"));
-		out = format.format(big, new StringBuffer(), pos);
+        java.math.BigInteger big;
+        pos = new FieldPosition(0);
+        big = new java.math.BigInteger(String.valueOf(Long.MAX_VALUE))
+                .add(new java.math.BigInteger("1"));
+        out = format.format(big, new StringBuffer(), pos);
         assertEquals("Wrong result BI3: " + out, "9,223,372,036,854,775,808",
                 out.toString());
 
-		pos = new FieldPosition(0);
-		big = new java.math.BigInteger(String.valueOf(Long.MIN_VALUE))
-				.add(new java.math.BigInteger("-1"));
-		out = format.format(big, new StringBuffer(), pos);
-		assertEquals("Wrong result BI4: " + out, "-9,223,372,036,854,775,809",
-                out.toString());
-
-		pos = new FieldPosition(0);
-		out = format.format(new java.math.BigDecimal("51.348"),
-				new StringBuffer(), pos);
-		assertEquals("Wrong result BD1: " + out, "51.348", out.toString());
-
-		pos = new FieldPosition(0);
-		out = format.format(new java.math.BigDecimal("51"), new StringBuffer(),
-				pos);
-		assertEquals("Wrong result BD2: " + out, "51", out.toString());
-
-	}
-
-	/**
-	 * @tests java.text.NumberFormat#getIntegerInstance()
-	 */
-	public void test_getIntegerInstance() throws ParseException {
-		// Test for method java.text.NumberFormat getIntegerInstance()
-		Locale origLocale = Locale.getDefault();
-		Locale.setDefault(Locale.US);
-
-		DecimalFormat format = (DecimalFormat) NumberFormat
-				.getIntegerInstance();
-
-		assertEquals(
-				"Test1: NumberFormat.getIntegerInstance().toPattern() returned wrong pattern",
-				"#,##0", format.toPattern());
-		assertEquals(
-				"Test2: NumberFormat.getIntegerInstance().format(35.76) returned wrong value",
-				"36", format.format(35.76));
+        pos = new FieldPosition(0);
+        big = new java.math.BigInteger(String.valueOf(Long.MIN_VALUE))
+                .add(new java.math.BigInteger("-1"));
+        out = format.format(big, new StringBuffer(), pos);
+        assertEquals("Wrong result BI4: " + out, "-9,223,372,036,854,775,809",
+                out.toString());
+
+        pos = new FieldPosition(0);
+        out = format.format(new java.math.BigDecimal("51.348"),
+                new StringBuffer(), pos);
+        assertEquals("Wrong result BD1: " + out, "51.348", out.toString());
+
+        pos = new FieldPosition(0);
+        out = format.format(new java.math.BigDecimal("51"), new StringBuffer(),
+                pos);
+        assertEquals("Wrong result BD2: " + out, "51", out.toString());
+
+    }
+
+    /**
+     * @tests java.text.NumberFormat#getIntegerInstance()
+     */
+    public void test_getIntegerInstance() throws ParseException {
+        // Test for method java.text.NumberFormat getIntegerInstance()
+        Locale origLocale = Locale.getDefault();
+        Locale.setDefault(Locale.US);
+
+        DecimalFormat format = (DecimalFormat) NumberFormat
+                .getIntegerInstance();
+
+        assertEquals(
+                "Test1: NumberFormat.getIntegerInstance().toPattern() returned wrong pattern",
+                "#,##0", format.toPattern());
+        assertEquals(
+                "Test2: NumberFormat.getIntegerInstance().format(35.76) returned wrong value",
+                "36", format.format(35.76));
         assertEquals(
                 "Test3: NumberFormat.getIntegerInstance().parse(\"35.76\") returned wrong
number",
                 new Long(35), format.parse("35.76"));
         assertEquals(
                 "Test4: NumberFormat.getIntegerInstance().parseObject(\"35.76\") returned
wrong number",
                 new Long(35), format.parseObject("35.76"));
-		Locale.setDefault(origLocale);
-	}
+        Locale.setDefault(origLocale);
+    }
 
-	/**
-	 * @tests java.text.NumberFormat#getIntegerInstance(java.util.Locale)
-	 */
-	public void test_getIntegerInstanceLjava_util_Locale()
+    /**
+     * @tests java.text.NumberFormat#getIntegerInstance(java.util.Locale)
+     */
+    public void test_getIntegerInstanceLjava_util_Locale()
             throws ParseException {
-		// Test for method java.text.NumberFormat
-		// getIntegerInstance(java.util.Locale)
-		Locale usLocale = Locale.US;
-		Locale arLocale = new Locale("ar", "AE");
-
-		DecimalFormat format = (DecimalFormat) NumberFormat
-				.getIntegerInstance(usLocale);
-		assertEquals(
-				"Test1: NumberFormat.getIntegerInstance().toPattern() returned wrong pattern",
-				"#,##0", format.toPattern());
-		assertEquals(
-				"Test2: NumberFormat.getIntegerInstance().format(-35.76) returned wrong value",
-				"-36", format.format(-35.76));
+        // Test for method java.text.NumberFormat
+        // getIntegerInstance(java.util.Locale)
+        Locale usLocale = Locale.US;
+        Locale arLocale = new Locale("ar", "AE");
+
+        DecimalFormat format = (DecimalFormat) NumberFormat
+                .getIntegerInstance(usLocale);
+        assertEquals(
+                "Test1: NumberFormat.getIntegerInstance().toPattern() returned wrong pattern",
+                "#,##0", format.toPattern());
+        assertEquals(
+                "Test2: NumberFormat.getIntegerInstance().format(-35.76) returned wrong value",
+                "-36", format.format(-35.76));
         assertEquals(
                 "Test3: NumberFormat.getIntegerInstance().parse(\"-36\") returned wrong number",
                 new Long(-36), format.parse("-36"));
         assertEquals(
                 "Test4: NumberFormat.getIntegerInstance().parseObject(\"-36\") returned wrong
number",
                 new Long(-36), format.parseObject("-36"));
-		assertEquals(
-				"Test5: NumberFormat.getIntegerInstance().getMaximumFractionDigits() returned wrong value",
-				0, format.getMaximumFractionDigits());
-		assertEquals(
-				"Test6: NumberFormat.getIntegerInstance().isParseIntegerOnly() returned wrong value",
-				true, format.isParseIntegerOnly());
-
-		// try with a locale that has a different integer pattern
-		format = (DecimalFormat) NumberFormat.getIntegerInstance(arLocale);
-		assertEquals(
-				"Test7: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).toPattern() returned
wrong pattern",
-				"#,##0;#,##0-", format.toPattern());
-       // The following "assert" fails on RI. It should be a bug of RI.
+        assertEquals(
+                "Test5: NumberFormat.getIntegerInstance().getMaximumFractionDigits() returned
wrong value",
+                0, format.getMaximumFractionDigits());
+        assertEquals(
+                "Test6: NumberFormat.getIntegerInstance().isParseIntegerOnly() returned wrong
value",
+                true, format.isParseIntegerOnly());
+
+        // try with a locale that has a different integer pattern
+        format = (DecimalFormat) NumberFormat.getIntegerInstance(arLocale);
+        assertEquals(
+                "Test7: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).toPattern()
returned wrong pattern",
+                "#,##0;#,##0-", format.toPattern());
+        // The following "assert" fails on RI. It should be a bug of RI.
         // Reason: RI does not change European digits (U+0030...U+0039)
         // to Arabic-Indic digits (U+0660...U+0669).
         assertEquals(
@@ -157,69 +157,69 @@
         assertEquals(
                 "Test10: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).parseObject(\"36-\")
returned wrong number",
                 new Long(-36), format.parseObject("36-"));
-		
-		assertEquals(
-				"Test11: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).getMaximumFractionDigits()
returned wrong value",
-				0, format.getMaximumFractionDigits());
-		assertEquals(
-				"Test12: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).isParseIntegerOnly()
returned wrong value",
-				true, format.isParseIntegerOnly());
-	}
-
-	/**
-	 * @tests java.text.NumberFormat#getCurrency()
-	 */
-	public void test_getCurrency() {
-		// Test for method java.util.Currency getCurrency()
-
-		// a subclass that supports currency formatting
-		Currency currH = Currency.getInstance("HUF");
-		NumberFormat format = NumberFormat.getInstance(new Locale("hu", "HU"));
-		assertSame("Returned incorrect currency", currH, format.getCurrency());
-
-		// a subclass that doesn't support currency formatting
-		ChoiceFormat cformat = new ChoiceFormat(
-				"0#Less than one|1#one|1<Between one and two|2<Greater than two");
-		try {
-			((NumberFormat) cformat).getCurrency();
-			fail("Expected UnsupportedOperationException");
-		} catch (UnsupportedOperationException e) {
-		}
-	}
-
-	/**
-	 * @tests java.text.NumberFormat#getMaximumIntegerDigits()
-	 */
-	public void test_getMaximumIntegerDigits() {
-		NumberFormat format = NumberFormat.getInstance();
-		format.setMaximumIntegerDigits(2);
-		assertEquals("Wrong result", "23", format.format(123));
-	}
-
-	/**
-	 * @tests java.text.NumberFormat#setCurrency(java.util.Currency)
-	 */
-	public void test_setCurrencyLjava_util_Currency() {
-		// Test for method void setCurrency(java.util.Currency)
-		// a subclass that supports currency formatting
-		Currency currA = Currency.getInstance("ARS");
-		NumberFormat format = NumberFormat.getInstance(new Locale("hu", "HU"));
-		format.setCurrency(currA);
-		assertSame("Returned incorrect currency", currA, format.getCurrency());
-
-		// a subclass that doesn't support currency formatting
-		ChoiceFormat cformat = new ChoiceFormat(
-				"0#Less than one|1#one|1<Between one and two|2<Greater than two");
-		try {
-			((NumberFormat) cformat).setCurrency(currA);
-			fail("Expected UnsupportedOperationException");
-		} catch (UnsupportedOperationException e) {
-		}
-	}
 
-	protected void setUp() {
-	}
+        assertEquals(
+                "Test11: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).getMaximumFractionDigits()
returned wrong value",
+                0, format.getMaximumFractionDigits());
+        assertEquals(
+                "Test12: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).isParseIntegerOnly()
returned wrong value",
+                true, format.isParseIntegerOnly());
+    }
+
+    /**
+     * @tests java.text.NumberFormat#getCurrency()
+     */
+    public void test_getCurrency() {
+        // Test for method java.util.Currency getCurrency()
+
+        // a subclass that supports currency formatting
+        Currency currH = Currency.getInstance("HUF");
+        NumberFormat format = NumberFormat.getInstance(new Locale("hu", "HU"));
+        assertSame("Returned incorrect currency", currH, format.getCurrency());
+
+        // a subclass that doesn't support currency formatting
+        ChoiceFormat cformat = new ChoiceFormat(
+                "0#Less than one|1#one|1<Between one and two|2<Greater than two");
+        try {
+            ((NumberFormat) cformat).getCurrency();
+            fail("Expected UnsupportedOperationException");
+        } catch (UnsupportedOperationException e) {
+        }
+    }
+
+    /**
+     * @tests java.text.NumberFormat#getMaximumIntegerDigits()
+     */
+    public void test_getMaximumIntegerDigits() {
+        NumberFormat format = NumberFormat.getInstance();
+        format.setMaximumIntegerDigits(2);
+        assertEquals("Wrong result", "23", format.format(123));
+    }
+
+    /**
+     * @tests java.text.NumberFormat#setCurrency(java.util.Currency)
+     */
+    public void test_setCurrencyLjava_util_Currency() {
+        // Test for method void setCurrency(java.util.Currency)
+        // a subclass that supports currency formatting
+        Currency currA = Currency.getInstance("ARS");
+        NumberFormat format = NumberFormat.getInstance(new Locale("hu", "HU"));
+        format.setCurrency(currA);
+        assertSame("Returned incorrect currency", currA, format.getCurrency());
+
+        // a subclass that doesn't support currency formatting
+        ChoiceFormat cformat = new ChoiceFormat(
+                "0#Less than one|1#one|1<Between one and two|2<Greater than two");
+        try {
+            ((NumberFormat) cformat).setCurrency(currA);
+            fail("Expected UnsupportedOperationException");
+        } catch (UnsupportedOperationException e) {
+        }
+    }
+
+    protected void setUp() {
+    }
 
-	protected void tearDown() {
-	}
+    protected void tearDown() {
+    }
 }



Mime
View raw message