harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r430790 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/Formatter.java test/api/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java
Date Fri, 11 Aug 2006 13:57:36 GMT
Author: tellison
Date: Fri Aug 11 06:57:34 2006
New Revision: 430790

URL: http://svn.apache.org/viewvc?rev=430790&view=rev
Log:
Added definition and tests for Formatter.BigDecimalLayoutForm.

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java
  (with props)
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java?rev=430790&r1=430789&r2=430790&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java
Fri Aug 11 06:57:34 2006
@@ -50,6 +50,10 @@
  */
 public final class Formatter implements Closeable, Flushable {
 
+    public enum BigDecimalLayoutForm {
+        SCIENTIFIC, DECIMAL_FLOAT
+    };
+
     private Appendable out;
 
     private Locale locale;

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java?rev=430790&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java
Fri Aug 11 06:57:34 2006
@@ -0,0 +1,44 @@
+/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.luni.tests.java.util;
+
+import java.util.Formatter.BigDecimalLayoutForm;
+
+import junit.framework.TestCase;
+
+public class FormatterTest extends TestCase {
+
+    /**
+     * @tests java.util.Formatter.BigDecimalLayoutForm#values()
+     */
+    public void test_values() {
+        BigDecimalLayoutForm[] vals = BigDecimalLayoutForm.values();
+        assertEquals("Invalid length of enum values", 2, vals.length);
+        assertEquals("Wrong scientific value in enum", BigDecimalLayoutForm.SCIENTIFIC, vals[0]);
+        assertEquals("Wrong dec float value in enum", BigDecimalLayoutForm.DECIMAL_FLOAT,
vals[1]);
+    }
+    
+    /**
+     * @tests java.util.Formatter.BigDecimalLayoutForm#valueOf(String)
+     */
+    public void test_valueOfLjava_lang_String() {
+        BigDecimalLayoutForm sci = BigDecimalLayoutForm.valueOf("SCIENTIFIC");
+        assertEquals("Wrong scientific value in enum", BigDecimalLayoutForm.SCIENTIFIC, sci);
+
+        BigDecimalLayoutForm decFloat = BigDecimalLayoutForm.valueOf("DECIMAL_FLOAT");
+        assertEquals("Wrong dec float value from valueOf ", BigDecimalLayoutForm.DECIMAL_FLOAT,
decFloat);
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message