harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479418 [32/43] - in /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common: javax/swing/ javax/swing/border/ javax/swing/colorchooser/ javax/swing/event/ javax/swing/filechooser/ javax/swing/plaf/ javax/swing/plaf/basic/ j...
Date Sun, 26 Nov 2006 20:15:55 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_IMTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_IMTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_IMTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_IMTest.java Sun Nov 26 12:15:43 2006
@@ -26,84 +26,87 @@
 import java.awt.im.InputMethodRequests;
 import java.text.AttributedCharacterIterator;
 import java.text.AttributedString;
+import java.text.AttributedCharacterIterator.Attribute;
 import java.util.HashMap;
 import java.util.Map;
-
 import javax.swing.JFrame;
 import javax.swing.JTextArea;
 import javax.swing.SwingTestCase;
-
 import org.apache.harmony.awt.text.ComposedTextParams;
 import org.apache.harmony.awt.text.PropertyNames;
 
 public class JTextComponent_IMTest extends SwingTestCase {
     JTextArea jta;
+
     JFrame jf;
+
     InputMethodEvent ime;
-    Map map;
+
+    Map<Attribute, Object> map;
+
     AbstractDocument doc;
+
     AttributedCharacterIterator iter;
+
     AttributedString attrString;
-    static final AttributedCharacterIterator.Attribute SEGMENT_ATTRIBUTE =
-        AttributedCharacterIterator.Attribute.INPUT_METHOD_SEGMENT;
+
+    static final AttributedCharacterIterator.Attribute SEGMENT_ATTRIBUTE = AttributedCharacterIterator.Attribute.INPUT_METHOD_SEGMENT;
+
     static final String initialContent = "IM test";
+
     boolean bWasException;
+
     InputMethodRequests imr;
-    String message;
 
+    String message;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-        map = new HashMap();
+        map = new HashMap<Attribute, Object>();
         jf = new JFrame();
         jta = new JTextArea();
         jta.setText(initialContent);
-        doc = (AbstractDocument)jta.getDocument();
+        doc = (AbstractDocument) jta.getDocument();
         imr = jta.getInputMethodRequests();
         bWasException = false;
         message = null;
         jf.getContentPane().add(jta);
         jf.setSize(200, 300);
         jf.pack();
-
     }
 
+    @Override
     protected void tearDown() throws Exception {
         jf.dispose();
         super.tearDown();
     }
 
     private InputMethodEvent getCaretEvent(AttributedCharacterIterator text,
-                                          int committedCharacterCount,
-                                          TextHitInfo caret,
-                                          TextHitInfo visiblePosition) {
-         return getEvent(InputMethodEvent.CARET_POSITION_CHANGED,
-                         text, committedCharacterCount,
-                         caret, visiblePosition);
+            int committedCharacterCount, TextHitInfo caret, TextHitInfo visiblePosition) {
+        return getEvent(InputMethodEvent.CARET_POSITION_CHANGED, text, committedCharacterCount,
+                caret, visiblePosition);
     }
 
     private InputMethodEvent getTextEvent(AttributedCharacterIterator text,
-                                          int committedCharacterCount,
-                                          TextHitInfo caret,
-                                          TextHitInfo visiblePosition) {
-         return getEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
-                         text, committedCharacterCount,
-                         caret, visiblePosition);
-    }
-    private InputMethodEvent getEvent(final int id,
-                                      final AttributedCharacterIterator text,
-                                      final int committedCharacterCount,
-                                      final TextHitInfo caret,
-                                      final TextHitInfo visiblePosition) {
-        return new InputMethodEvent(jta, id, text, committedCharacterCount,
-                             caret, visiblePosition);
+            int committedCharacterCount, TextHitInfo caret, TextHitInfo visiblePosition) {
+        return getEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED, text,
+                committedCharacterCount, caret, visiblePosition);
+    }
+
+    private InputMethodEvent getEvent(final int id, final AttributedCharacterIterator text,
+            final int committedCharacterCount, final TextHitInfo caret,
+            final TextHitInfo visiblePosition) {
+        return new InputMethodEvent(jta, id, text, committedCharacterCount, caret,
+                visiblePosition);
     }
-    private Map putSegmentAttribute(final Map map, final Object value) {
+
+    private Map<Attribute, Object> putSegmentAttribute(final Map<Attribute, Object> map, final Object value) {
         map.put(SEGMENT_ATTRIBUTE, value);
         return map;
     }
-    private AttributedCharacterIterator getIterator(final String text,
-                                                    final Map map) {
+
+    private AttributedCharacterIterator getIterator(final String text, final Map<Attribute, Object> map) {
         attrString = new AttributedString(text, map);
         return attrString.getIterator();
     }
@@ -111,59 +114,48 @@
     private void setComposedText() {
         String content = "12345";
         iter = getIterator(content, putSegmentAttribute(map, Color.RED));
-        ime = getTextEvent(iter,0,TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 0, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(7, jta.getCaretPosition());
         checkComposedTextParams(true, 7, 5);
         assertEquals(initialContent + content, jta.getText());
     }
 
-    private void checkComposedTextParams(final boolean shouldBe,
-                                         final int start,
-                                         final int length) {
+    private void checkComposedTextParams(final boolean shouldBe, final int start,
+            final int length) {
         if (isHarmony()) {
             Object value = doc.getProperty(PropertyNames.COMPOSED_TEXT_PROPERTY);
-            if (! shouldBe) {
+            if (!shouldBe) {
                 if (value != null) {
-                    ComposedTextParams params = (ComposedTextParams)value;
+                    ComposedTextParams params = (ComposedTextParams) value;
                     assertNull(params.getComposedText());
                     assertEquals(0, params.getComposedTextLength());
                 }
                 return;
             }
             assertTrue(value instanceof ComposedTextParams);
-
             ComposedTextParams params = (ComposedTextParams) value;
             assertEquals(start, params.getComposedTextStart());
             assertEquals(length, params.getComposedTextLength());
             AttributedString text = params.getComposedText();
             AttributedCharacterIterator iter1 = attrString.getIterator();
             AttributedCharacterIterator iter2 = text.getIterator();
-
             assertEquals(iter1.getAttributes(), iter2.getAttributes());
-
-            assertEquals(iter1.getRunStart(SEGMENT_ATTRIBUTE),
-                         iter2.getRunStart(SEGMENT_ATTRIBUTE));
-
-            assertEquals(Math.min(iter1.getRunLimit(SEGMENT_ATTRIBUTE),
-                                  iter2.getEndIndex()),
-                         iter2.getRunLimit(SEGMENT_ATTRIBUTE));
+            assertEquals(iter1.getRunStart(SEGMENT_ATTRIBUTE), iter2
+                    .getRunStart(SEGMENT_ATTRIBUTE));
+            assertEquals(Math.min(iter1.getRunLimit(SEGMENT_ATTRIBUTE), iter2.getEndIndex()),
+                    iter2.getRunLimit(SEGMENT_ATTRIBUTE));
         }
     }
 
     public void testProcessItME_Caret() {
         setComposedText();
-
-        for(int i = 0; i < 10; i ++) {
+        for (int i = 0; i < 10; i++) {
             int pos = Math.min(12, i + 7);
-            ime = getCaretEvent(null, 0, TextHitInfo.afterOffset(i),
-                                null);
+            ime = getCaretEvent(null, 0, TextHitInfo.afterOffset(i), null);
             jta.processInputMethodEvent(ime);
             assertEquals(pos, jta.getCaretPosition());
-
-            ime = getCaretEvent(null, 0, TextHitInfo.beforeOffset(i),
-                                null);
+            ime = getCaretEvent(null, 0, TextHitInfo.beforeOffset(i), null);
             jta.processInputMethodEvent(ime);
             assertEquals(pos, jta.getCaretPosition());
         }
@@ -172,8 +164,7 @@
     public void testProcessIME_Text_NPE() {
         String content = "12345";
         iter = getIterator(content, putSegmentAttribute(map, Color.RED));
-        ime = getTextEvent(null, 0, null,
-                           null);
+        ime = getTextEvent(null, 0, null, null);
         jta.processInputMethodEvent(ime);
         checkComposedTextParams(false, 7, 5);
     }
@@ -181,30 +172,26 @@
     public void testProcessIME_Text() {
         String content = "12345";
         iter = getIterator(content, putSegmentAttribute(map, Color.RED));
-        ime = getTextEvent(iter,0,TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 0, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(7, jta.getCaretPosition());
         checkComposedTextParams(true, 7, 5);
         assertEquals(initialContent + content, jta.getText());
-
         content = "abcdett";
         iter = getIterator(content, putSegmentAttribute(map, Color.BLUE));
-        ime = getTextEvent(iter,0,TextHitInfo.afterOffset(1),
-                           TextHitInfo.afterOffset(1));
+        ime = getTextEvent(iter, 0, TextHitInfo.afterOffset(1), TextHitInfo.afterOffset(1));
         jta.processInputMethodEvent(ime);
         assertEquals(8, jta.getCaretPosition());
         checkComposedTextParams(true, 7, 7);
         assertEquals(initialContent + content, jta.getText());
         //====================================================
         content = "composite attributes";
-        Map map1 = new HashMap();
+        Map<Attribute, Object> map1 = new HashMap<Attribute, Object>();
         putSegmentAttribute(map1, Color.GRAY);
         attrString = new AttributedString(content, map1);
         attrString.addAttribute(SEGMENT_ATTRIBUTE, Color.YELLOW);
         iter = attrString.getIterator();
-        ime = getTextEvent(iter, 0, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 0, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(7, jta.getCaretPosition());
         checkComposedTextParams(true, 7, 20);
@@ -212,56 +199,43 @@
         //====================================================
         content = "fghij";
         iter = getIterator(content, putSegmentAttribute(map, Color.BLACK));
-        ime = getTextEvent(iter,5,TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(12, jta.getCaretPosition());
         checkComposedTextParams(false, 0, 0);
         assertEquals(initialContent + content, jta.getText());
         String lastCommited = content;
-
         content = "finish";
         iter = getIterator(content, putSegmentAttribute(map, Color.PINK));
-        ime = getTextEvent(iter, 2,
-                           TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 2, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(14, jta.getCaretPosition());
         checkComposedTextParams(true, 14, 4);
-        assertEquals(initialContent + lastCommited + content,
-                     jta.getText());
+        assertEquals(initialContent + lastCommited + content, jta.getText());
     }
 
     //InputMethodRequest tests==========================================
-
     public void testCancelLatestCommittedText() {
-        AttributedCharacterIterator.Attribute[] attributes =
-            new AttributedCharacterIterator.Attribute[]{SEGMENT_ATTRIBUTE};
-
+        AttributedCharacterIterator.Attribute[] attributes = new AttributedCharacterIterator.Attribute[] { SEGMENT_ATTRIBUTE };
         assertNull(imr.cancelLatestCommittedText(attributes));
         String content = "fghij";
         iter = getIterator(content, putSegmentAttribute(map, Color.BLACK));
-        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(initialContent + content, jta.getText());
         imr.cancelLatestCommittedText(attributes);
         assertEquals(initialContent, jta.getText());
         content = "klnoprst";
         iter = getIterator(content, putSegmentAttribute(map, Color.BLACK));
-        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(initialContent + content, jta.getText());
         imr.cancelLatestCommittedText(attributes);
-        assertEquals(initialContent + content.substring(5, content.length()),
-                           jta.getText());
+        assertEquals(initialContent + content.substring(5, content.length()), jta.getText());
     }
 
     private void checkIterator(final AttributedCharacterIterator iterator,
-                                  final int attributesCount,
-                                  final int start,
-                                  final int end) {
+            final int attributesCount, final int start, final int end) {
         assertEquals(attributesCount, iterator.getAttributes().size());
         assertEquals(start, iterator.getBeginIndex());
         assertEquals(end, iterator.getEndIndex());
@@ -278,37 +252,32 @@
         assertEquals(7, imr.getCommittedTextLength());
         String content = "fghij";
         iter = getIterator(content, putSegmentAttribute(map, Color.BLACK));
-        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         checkIterator(imr.getCommittedText(0, 12, null), 0, 0, 12);
         checkIterator(imr.getCommittedText(2, 6, null), 0, 0, 4);
-
         jta.setCaretPosition(3);
         iter = getIterator("finish", putSegmentAttribute(map, Color.PINK));
-        ime = getTextEvent(iter, 2, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 2, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         checkIterator(imr.getCommittedText(0, 14, null), 0, 0, 14);
         AttributedCharacterIterator it = imr.getCommittedText(0, 14, null);
         String committedText = "IM fitestfghij";
-        for (int i = 0; i < 14; i ++) {
+        for (int i = 0; i < 14; i++) {
             it.setIndex(i);
-            assertEquals(committedText.charAt(i),it.current());
+            assertEquals(committedText.charAt(i), it.current());
         }
         checkIterator(imr.getCommittedText(3, 8, null), 0, 0, 5);
-
         try {
             imr.getCommittedText(2, 20, null);
-        } catch(IllegalArgumentException e) {
+        } catch (IllegalArgumentException e) {
             bWasException = true;
             message = e.getMessage();
         }
         checkException("Invalid range");
-
         try {
             imr.getCommittedText(5, 2, null);
-        } catch(IllegalArgumentException e) {
+        } catch (IllegalArgumentException e) {
             bWasException = true;
             message = e.getMessage();
         }
@@ -318,14 +287,11 @@
     public void testGetCommittedTextLength() {
         assertEquals(7, imr.getCommittedTextLength());
         iter = getIterator("fghij", putSegmentAttribute(map, Color.BLACK));
-        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(12, imr.getCommittedTextLength());
-
         iter = getIterator("finish", putSegmentAttribute(map, Color.PINK));
-        ime = getTextEvent(iter, 2, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 2, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(14, imr.getCommittedTextLength());
     }
@@ -334,8 +300,7 @@
         setComposedText();
         assertEquals(7, imr.getInsertPositionOffset());
         iter = getIterator("finish", putSegmentAttribute(map, Color.PINK));
-        ime = getTextEvent(iter, 2, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 2, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertEquals(9, imr.getInsertPositionOffset());
     }
@@ -348,21 +313,18 @@
         setComposedText();
         jta.select(9, 11);
         checkIterator(imr.getSelectedText(null), 0, 0, 2);
-        jta.select(2,10);
+        jta.select(2, 10);
         checkIterator(imr.getSelectedText(null), 0, 0, 8);
     }
 
     public void testDoubleCancelLatestCommittedText() {
         String content = "fghij";
         iter = getIterator(content, putSegmentAttribute(map, Color.BLACK));
-        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
-
         content = "klnoprst";
         iter = getIterator(content, putSegmentAttribute(map, Color.BLACK));
-        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0),
-                           TextHitInfo.afterOffset(0));
+        ime = getTextEvent(iter, 5, TextHitInfo.afterOffset(0), TextHitInfo.afterOffset(0));
         jta.processInputMethodEvent(ime);
         assertNotNull(imr.cancelLatestCommittedText(null));
         assertNull(imr.cancelLatestCommittedText(null));

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_MultithreadedRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_MultithreadedRTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_MultithreadedRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_MultithreadedRTest.java Sun Nov 26 12:15:43 2006
@@ -21,15 +21,15 @@
 package javax.swing.text;
 
 import javax.swing.JTextField;
-
 import junit.framework.TestCase;
 
 public class JTextComponent_MultithreadedRTest extends TestCase {
-
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_MultithreadedTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_MultithreadedTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_MultithreadedTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_MultithreadedTest.java Sun Nov 26 12:15:43 2006
@@ -22,15 +22,13 @@
 
 import java.awt.Point;
 import java.awt.Rectangle;
-
+import javax.swing.BasicSwingTestCase;
 import javax.swing.JFrame;
 import javax.swing.JTextArea;
 import javax.swing.JTextField;
 import javax.swing.SwingConstants;
-import javax.swing.SwingTestCase;
 import javax.swing.SwingUtilities;
 import javax.swing.SwingWaitTestCase;
-
 import junit.framework.TestCase;
 
 public class JTextComponent_MultithreadedTest extends TestCase {
@@ -50,6 +48,7 @@
 
     Rectangle rect;
 
+    @Override
     protected void setUp() throws Exception {
         jf = new JFrame();
         bWasException = false;
@@ -60,9 +59,9 @@
         jf.setSize(300, 200);
         jf.pack();
         super.setUp();
-
     }
 
+    @Override
     protected void tearDown() throws Exception {
         jf.dispose();
         super.tearDown();
@@ -79,16 +78,13 @@
         jtc.replaceSelection(null);
         assertEquals("JTextponent", jtc.getText());
         assertEquals("pon", jtc.getSelectedText());
-
         jtc.replaceSelection("XXX");
         assertEquals("XXX", jtc.getSelectedText());
         assertEquals("JTextXXXent", jtc.getText());
-
         setCaretsAlwaysUpdatePolicy();
         jtc.replaceSelection("XXX");
         assertEquals("JTextXXXent", jtc.getText());
         assertEquals(8, jtc.getCaretPosition());
-
         Runnable test1 = new Runnable() {
             public void run() {
                 jtc.setText("JTextComponent");
@@ -96,15 +92,14 @@
             }
         };
         SwingUtilities.invokeAndWait(test1);
-
         jtc.replaceSelection("XXX");
         assertNull(jtc.getSelectedText());
         assertEquals("JTXXXextComponent", jtc.getText());
     }
 
     private void setCaretsAlwaysUpdatePolicy() {
-        DefaultCaret caret = (DefaultCaret)jtc.getCaret();
-        if (SwingTestCase.isHarmony()) {
+        DefaultCaret caret = (DefaultCaret) jtc.getCaret();
+        if (BasicSwingTestCase.isHarmony()) {
             caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
         } else {
             caret.setAsynchronousMovement(true);
@@ -118,25 +113,19 @@
             }
         };
         SwingUtilities.invokeAndWait(test);
-
         Rectangle sample = null;
         rect = null;
-
         try {
             rect = jtc.modelToView(2);
             sample = jtc.getUI().modelToView(jtc, 2);
-
             assertNotNull(sample);
             assertNotNull(rect);
             assertEquals(sample, rect);
-
             rect = jtc.modelToView(3);
-
             sample = jtc.getUI().modelToView(jtc, 3);
         } catch (BadLocationException e) {
             assertFalse("Unexpected exception: " + e.getMessage(), true);
         }
-
         assertNotNull(sample);
         assertNotNull(rect);
         assertEquals(sample, rect);
@@ -153,12 +142,11 @@
         try {
             r = jtc.modelToView(2);
             assertNotNull(r);
-            assertEquals(2,jtc.viewToModel(new Point(r.x, r.y)));
+            assertEquals(2, jtc.viewToModel(new Point(r.x, r.y)));
             r = jtc.modelToView(4);
             assertNotNull(r);
-            assertEquals(4,jtc.viewToModel(new Point(r.x, r.y)));
-        }
-        catch (BadLocationException e){
+            assertEquals(4, jtc.viewToModel(new Point(r.x, r.y)));
+        } catch (BadLocationException e) {
         }
     }
 
@@ -175,7 +163,6 @@
                 SwingConstants.VERTICAL, 0));
         assertEquals(rect.height / 10, jtc.getScrollableUnitIncrement(rect,
                 SwingConstants.VERTICAL, 1));
-
         assertEquals(rect.width, jtc.getScrollableBlockIncrement(rect,
                 SwingConstants.HORIZONTAL, -1));
         assertEquals(rect.width, jtc.getScrollableBlockIncrement(rect,
@@ -205,70 +192,54 @@
         jf.getContentPane().add(jep);
         jf.setLocation(200, 300);
         jf.setSize(500, 500);
-
         Runnable test = new Runnable() {
             public void run() {
-                jep.setText(bigString((bigString("a", 10)
-                        + bigString("\u05DC", 10) + "\n"), 10));
+                jep
+                        .setText(bigString(
+                                (bigString("a", 10) + bigString("\u05DC", 10) + "\n"), 10));
             }
         };
         SwingUtilities.invokeAndWait(test);
-        if (!SwingTestCase.isHarmony()) {
+        if (!BasicSwingTestCase.isHarmony()) {
             jf.setVisible(true);
             SwingWaitTestCase.isRealized(jf);
         } else {
             jf.pack();
         }
-
         assertFalse(jep.getScrollableTracksViewportHeight());
         assertFalse(jep.getScrollableTracksViewportWidth());
-        assertEquals(jep.getPreferredSize(), jep
-                .getPreferredScrollableViewportSize());
-
+        assertEquals(jep.getPreferredSize(), jep.getPreferredScrollableViewportSize());
         Rectangle rect = null;
         try {
             rect = jep.modelToView(20);
-
             assertNotNull(rect);
             scrollableIncrementTest(jep, rect);
-
             rect = jep.modelToView(101);
         } catch (BadLocationException e) {
             assertFalse("Unexpected exception :" + e.getMessage(), true);
         }
-
         scrollableIncrementTest(jep, rect);
-
         rect.x = rect.x + 2;
         scrollableIncrementTest(jep, rect);
-
         rect.y = rect.y + 14;
         rect.x = rect.x - 2;
         scrollableIncrementTest(jep, rect);
-
         rect.height = rect.height + 6;
         scrollableIncrementTest(jep, rect);
-
         rect.height = rect.height - 10;
         scrollableIncrementTest(jep, rect);
-
         rect.width = rect.width + 3;
         scrollableIncrementTest(jep, rect);
-
         rect.width = rect.width - 7;
         scrollableIncrementTest(jep, rect);
-
         rect.x = rect.x + 1000;
         rect.y = rect.y + 4000;
         rect.height = rect.height + 1013;
         scrollableIncrementTest(jep, rect);
-
         rect.height = rect.height - 3013;
         scrollableIncrementTest(jep, rect);
-
         rect.width = rect.width + 5011;
         scrollableIncrementTest(jep, rect);
-
         rect.width = rect.width - 8011;
         scrollableIncrementTest(jep, rect);
         try {
@@ -277,10 +248,8 @@
             bWasException = true;
             s = e.getMessage();
         }
-
         assertTrue(bWasException);
         assertEquals("Invalid orientation: 4", s);
-
         bWasException = false;
         s = null;
         try {
@@ -289,7 +258,6 @@
             bWasException = true;
             s = e.getMessage();
         }
-
         assertTrue(bWasException);
         assertEquals("Invalid orientation: 4", s);
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_byAuxiliaryComponentTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_byAuxiliaryComponentTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_byAuxiliaryComponentTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/JTextComponent_byAuxiliaryComponentTest.java Sun Nov 26 12:15:43 2006
@@ -35,7 +35,6 @@
 import javax.swing.plaf.basic.BasicTextUI;
 import javax.swing.plaf.basic.TextCompUI;
 
-
 public class JTextComponent_byAuxiliaryComponentTest extends SwingTestCase {
     JFrame jf;
 
@@ -59,8 +58,11 @@
     }
 
     class JTextComp extends JTextComponent {
+        private static final long serialVersionUID = 1L;
+
         String UIClassId = "TextCompUIFirst";
 
+        @Override
         public String getUIClassID() {
             return (UIClassId != null) ? UIClassId : "TextCompUIFirst";
         }
@@ -73,7 +75,6 @@
             if (e.getPropertyName() != "ancestor") {
                 event = e;
             }
-
         }
 
         PropertyChangeEvent getEvent() {
@@ -83,15 +84,14 @@
         }
     }
 
-
     public JTextComponent_byAuxiliaryComponentTest() {
         setIgnoreNotImplemented(true);
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-        UIManager.put("TextCompUISecond",
-                "javax.swing.plaf.basic.BasicTextAreaUI");
+        UIManager.put("TextCompUISecond", "javax.swing.plaf.basic.BasicTextAreaUI");
         UIManager.put("TextCompUIFirst", "javax.swing.plaf.basic.TextCompUI");
         jf = new JFrame();
         jtComp = new JTextComp();
@@ -101,6 +101,7 @@
         jf.pack();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         jf.dispose();
         super.tearDown();
@@ -113,7 +114,6 @@
         assertEquals(ac, jtComp.getAccessibleContext());
     }
 
-
     public void testGetActions() {
         Action actions[] = new DefaultEditorKit().getActions();
         Action actions1[] = jtComp.getActions();
@@ -123,44 +123,29 @@
         for (int i = 0; i < actions.length; i++) {
             assertEquals(actions1[i], actions2[i]);
         }
-
     }
 
     public void testUpdateUI() throws Exception {
-
         assertTrue(jtComp.getUI() instanceof TextCompUI);
-
         TextUI textUI1 = jtComp.getUI();
         SimplePropertyChangeListener listener = new SimplePropertyChangeListener();
-
         jtComp.addPropertyChangeListener(listener);
         jtComp.UIClassId = "TextCompUISecond";
-
         TextUI textUI2 = (TextUI) UIManager.getUI(jtComp);
-
+        assertNotNull(textUI2);
         jtComp.updateUI();
-
-        assertEqualsPropertyChangeEvent("UI", textUI1, jtComp.getUI(),
-                listener.event);
+        assertEqualsPropertyChangeEvent("UI", textUI1, jtComp.getUI(), listener.event);
         assertTrue(jtComp.getUI() instanceof BasicTextAreaUI);
-
     }
 
     public void testJTextComponent() {
-
-        String str;
-
         jtComp = new JTextComp();
         assertNotNull(jtComp);
         assertTrue(jtComp.getUI() instanceof TextCompUI);
-
         assertTrue(jtComp.getCaret() instanceof BasicTextUI.BasicCaret);
-        assertEquals("Dot=(0, Forward) Mark=(0, Forward)", jtComp.getCaret()
-                .toString());
-
+        assertEquals("Dot=(0, Forward) Mark=(0, Forward)", jtComp.getCaret().toString());
         assertTrue(jtComp.getHighlighter() instanceof BasicTextUI.BasicHighlighter);
-        assertEquals(ComponentOrientation.UNKNOWN, jtComp
-                .getComponentOrientation());
+        assertEquals(ComponentOrientation.UNKNOWN, jtComp.getComponentOrientation());
         assertTrue(jtComp.isEditable());
         assertFalse(jtComp.getDragEnabled());
         assertEquals('\0', jtComp.getFocusAccelerator());
@@ -170,10 +155,8 @@
         assertEquals(new InsetsUIResource(0, 0, 0, 0), jtComp.getMargin());
     }
 
-   public void testSetGetUITextUI() throws Exception {
-
+    public void testSetGetUITextUI() throws Exception {
         assertTrue(jtComp.getUI() instanceof TextCompUI);
-
         TextUI textUI1 = jtComp.getUI();
         SimplePropertyChangeListener listener = new SimplePropertyChangeListener();
         jtComp.addPropertyChangeListener(listener);
@@ -182,7 +165,5 @@
         jtComp.setUI(textUI2);
         assertEqualsPropertyChangeEvent("UI", textUI1, textUI2, listener.event);
         assertEquals(textUI2, jtComp.getUI());
-
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/LabelViewRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/LabelViewRTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/LabelViewRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/LabelViewRTest.java Sun Nov 26 12:15:43 2006
@@ -23,42 +23,36 @@
 import java.awt.Color;
 import java.awt.Rectangle;
 import java.awt.Shape;
-
 import javax.swing.BasicSwingTestCase;
 import javax.swing.event.DocumentEvent;
 
-
 public class LabelViewRTest extends BasicSwingTestCase {
-
     private DefaultStyledDocument styledDoc;
+
     private LabelView labelView;
 
     public LabelViewRTest() {
         super();
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         styledDoc = new DefaultStyledDocument();
         styledDoc.insertString(0, "Hello world", null);
-        labelView = new LabelView(
-                styledDoc.getDefaultRootElement().getElement(0).getElement(0));
+        labelView = new LabelView(styledDoc.getDefaultRootElement().getElement(0).getElement(0));
     }
 
     public void testSetPropertiesFromAttributes() {
         final Marker backgroundColorSetterMarker = new Marker();
-
-        labelView = new LabelView(styledDoc.getDefaultRootElement().getElement(
-                0).getElement(0)) {
-
+        labelView = new LabelView(styledDoc.getDefaultRootElement().getElement(0).getElement(0)) {
+            @Override
             protected void setBackground(Color bg) {
                 super.setBackground(bg);
                 backgroundColorSetterMarker.setOccurred();
             }
         };
-
         labelView.setPropertiesFromAttributes();
-
         if (isHarmony()) {
             assertTrue(backgroundColorSetterMarker.isOccurred());
         } else {
@@ -68,26 +62,19 @@
 
     public void testChangedUpdate() {
         final Marker preferenceChangeMarker = new Marker();
-
-        labelView = new LabelView(styledDoc.getDefaultRootElement().getElement(
-                0).getElement(0)) {
-
-            public void preferenceChanged(View child, boolean width,
-                    boolean height) {
-
+        labelView = new LabelView(styledDoc.getDefaultRootElement().getElement(0).getElement(0)) {
+            @Override
+            public void preferenceChanged(View child, boolean width, boolean height) {
                 preferenceChangeMarker.setOccurred();
                 super.preferenceChanged(child, width, height);
             }
 
-            public void changedUpdate(DocumentEvent event, Shape allocation,
-                    ViewFactory factory) {
-
+            @Override
+            public void changedUpdate(DocumentEvent event, Shape allocation, ViewFactory factory) {
                 // Do nothing.
             }
         };
-
         DocumentEvent event = new DocumentEvent() {
-
             public int getOffset() {
                 return labelView.getStartOffset();
             }
@@ -107,11 +94,8 @@
             public ElementChange getChange(Element elem) {
                 return null;
             }
-
         };
-
         Rectangle rectangle = new Rectangle();
-
         labelView.changedUpdate(event, rectangle, null);
         assertFalse(preferenceChangeMarker.isOccurred());
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/LabelViewTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/LabelViewTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/LabelViewTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/LabelViewTest.java Sun Nov 26 12:15:43 2006
@@ -25,77 +25,94 @@
 import java.awt.Font;
 import java.awt.FontMetrics;
 import java.awt.Rectangle;
-
 import javax.swing.BasicSwingTestCase;
 import javax.swing.JTextArea;
 import javax.swing.event.DocumentEvent;
 
 public class LabelViewTest extends BasicSwingTestCase {
-
     private final Marker backgroundColorSetterMarker = new Marker();
+
     private final Marker strikeThroughSetterMarker = new Marker();
+
     private final Marker subscriptSetterMarker = new Marker();
+
     private final Marker superscriptSetterMarker = new Marker();
+
     private final Marker underlineSetterMarker = new Marker();
+
     private final Marker propertiesFromAttributesSetter = new Marker();
+
     private final Marker fontMetricsGetter = new Marker();
+
     private final Marker containerFontMetricsGetter = new Marker();
 
     private class TestLabelView extends LabelView {
-
         public TestLabelView(Element element) {
             super(element);
         }
 
+        @Override
         protected void setBackground(Color bg) {
             super.setBackground(bg);
             backgroundColorSetterMarker.setOccurred();
         }
 
+        @Override
         protected void setStrikeThrough(boolean strike) {
             super.setStrikeThrough(strike);
             strikeThroughSetterMarker.setOccurred();
         }
 
+        @Override
         protected void setSubscript(boolean subscript) {
             super.setSubscript(subscript);
             subscriptSetterMarker.setOccurred();
         }
 
+        @Override
         protected void setSuperscript(boolean superscript) {
             super.setSuperscript(superscript);
             superscriptSetterMarker.setOccurred();
         }
 
+        @Override
         protected void setUnderline(boolean underline) {
             super.setUnderline(underline);
             underlineSetterMarker.setOccurred();
         }
 
+        @Override
         protected FontMetrics getFontMetrics() {
             fontMetricsGetter.setOccurred();
-            return  super.getFontMetrics();
+            return super.getFontMetrics();
         }
 
+        @Override
         protected void setPropertiesFromAttributes() {
             propertiesFromAttributesSetter.setOccurred();
             super.setPropertiesFromAttributes();
         }
 
+        @Override
         public Container getContainer() {
             return textArea;
         }
-
     }
 
     private DefaultStyledDocument styledDoc;
+
     private LabelView labelView;
+
     private MutableAttributeSet attrs;
+
     private final JTextArea textArea;
 
     public LabelViewTest() {
         super();
         textArea = new JTextArea() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public FontMetrics getFontMetrics(Font f) {
                 containerFontMetricsGetter.setOccurred();
                 return super.getFontMetrics(f);
@@ -103,6 +120,7 @@
         };
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         styledDoc = new DefaultStyledDocument();
@@ -110,15 +128,12 @@
         attrs = new SimpleAttributeSet();
         StyleConstants.setBold(attrs, true);
         styledDoc.insertString(styledDoc.getLength(), "bold \n string", attrs);
-        labelView = new LabelView(
-            styledDoc.getDefaultRootElement().getElement(0).getElement(0));
+        labelView = new LabelView(styledDoc.getDefaultRootElement().getElement(0).getElement(0));
     }
 
     public void testChangedUpdate() {
         StyleConstants.setUnderline(attrs, true);
-
         DocumentEvent event = new DocumentEvent() {
-
             public int getOffset() {
                 return labelView.getStartOffset();
             }
@@ -138,18 +153,14 @@
             public ElementChange getChange(Element elem) {
                 return null;
             }
-
         };
-
         Rectangle rectangle = new Rectangle();
-
         StyleConstants.setUnderline(attrs, true);
         StyleConstants.setBackground(attrs, Color.BLUE);
         setLabelViewAttributeSet(attrs);
         labelView.changedUpdate(event, rectangle, null);
         assertTrue(labelView.isUnderline());
         assertEquals(Color.BLUE, labelView.getBackground());
-
         labelView.setUnderline(false);
         labelView.changedUpdate(event, rectangle, null);
         assertTrue(labelView.isUnderline());
@@ -159,25 +170,19 @@
         StyleConstants.setSuperscript(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isSuperscript());
-
         StyleConstants.setSuperscript(attrs, true);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isSuperscript());
-
         labelView.setPropertiesFromAttributes();
         assertTrue(labelView.isSuperscript());
-
         StyleConstants.setSuperscript(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertTrue(labelView.isSuperscript());
-
         labelView.setPropertiesFromAttributes();
         assertFalse(labelView.isSuperscript());
-
         labelView = createTestLabelView();
         labelView.isSuperscript();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
-
         clearMarkers();
         labelView.isSuperscript();
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -185,32 +190,23 @@
 
     public void testSetSuperscript() {
         boolean defaultSuperscript = false;
-
         assertEquals(defaultSuperscript, labelView.isSuperscript());
-
         StyleConstants.setSuperscript(attrs, !defaultSuperscript);
         assertEquals(defaultSuperscript, labelView.isSuperscript());
-
         labelView.setSuperscript(true);
         assertTrue(labelView.isSuperscript());
-
         labelView.setSuperscript(false);
         assertFalse(labelView.isSuperscript());
-
         StyleConstants.setSuperscript(attrs, true);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isSuperscript());
-
         labelView.setPropertiesFromAttributes();
         assertTrue(labelView.isSuperscript());
-
         StyleConstants.setSuperscript(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertTrue(labelView.isSuperscript());
-
         labelView.setPropertiesFromAttributes();
         assertFalse(labelView.isSuperscript());
-
         labelView = createTestLabelView();
         labelView.setSuperscript(true);
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -220,25 +216,19 @@
         StyleConstants.setSubscript(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isSubscript());
-
         StyleConstants.setSubscript(attrs, true);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isSubscript());
-
         labelView.setPropertiesFromAttributes();
         assertTrue(labelView.isSubscript());
-
         StyleConstants.setSubscript(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertTrue(labelView.isSubscript());
-
         labelView.setPropertiesFromAttributes();
         assertFalse(labelView.isSubscript());
-
         labelView = createTestLabelView();
         labelView.isSuperscript();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
-
         clearMarkers();
         labelView.isSuperscript();
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -246,60 +236,45 @@
 
     public void testSetSubscript() {
         boolean defaultSubscript = false;
-
         assertEquals(defaultSubscript, labelView.isSubscript());
-
         StyleConstants.setSubscript(attrs, !defaultSubscript);
         assertEquals(defaultSubscript, labelView.isSubscript());
-
         labelView.setSubscript(true);
         assertTrue(labelView.isSubscript());
-
         labelView.setSubscript(false);
         assertFalse(labelView.isSubscript());
-
         StyleConstants.setSubscript(attrs, true);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isSubscript());
-
         labelView.setPropertiesFromAttributes();
         assertTrue(labelView.isSubscript());
-
         StyleConstants.setSubscript(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertTrue(labelView.isSubscript());
-
         labelView.setPropertiesFromAttributes();
         assertFalse(labelView.isSubscript());
-
         labelView = createTestLabelView();
         labelView.setSubscript(true);
         assertFalse(propertiesFromAttributesSetter.isOccurred());
-     }
+    }
 
     public void testIsStrikeThrough() {
         StyleConstants.setStrikeThrough(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isStrikeThrough());
-
         StyleConstants.setStrikeThrough(attrs, true);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isStrikeThrough());
-
         labelView.setPropertiesFromAttributes();
         assertTrue(labelView.isStrikeThrough());
-
         StyleConstants.setStrikeThrough(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertTrue(labelView.isStrikeThrough());
-
         labelView.setPropertiesFromAttributes();
         assertFalse(labelView.isStrikeThrough());
-
         labelView = createTestLabelView();
         labelView.isStrikeThrough();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
-
         clearMarkers();
         labelView.isStrikeThrough();
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -307,32 +282,23 @@
 
     public void testSetStrikeThrough() {
         boolean defaultStrikeThrough = false;
-
         assertEquals(defaultStrikeThrough, labelView.isStrikeThrough());
-
         StyleConstants.setStrikeThrough(attrs, !defaultStrikeThrough);
         assertEquals(defaultStrikeThrough, labelView.isStrikeThrough());
-
         labelView.setStrikeThrough(true);
         assertTrue(labelView.isStrikeThrough());
-
         labelView.setStrikeThrough(false);
         assertFalse(labelView.isStrikeThrough());
-
         StyleConstants.setStrikeThrough(attrs, true);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isStrikeThrough());
-
         labelView.setPropertiesFromAttributes();
         assertTrue(labelView.isStrikeThrough());
-
         StyleConstants.setStrikeThrough(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertTrue(labelView.isStrikeThrough());
-
         labelView.setPropertiesFromAttributes();
         assertFalse(labelView.isStrikeThrough());
-
         labelView = createTestLabelView();
         labelView.setStrikeThrough(true);
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -342,25 +308,19 @@
         StyleConstants.setUnderline(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isUnderline());
-
         StyleConstants.setUnderline(attrs, true);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isUnderline());
-
         labelView.setPropertiesFromAttributes();
         assertTrue(labelView.isUnderline());
-
         StyleConstants.setUnderline(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertTrue(labelView.isUnderline());
-
         labelView.setPropertiesFromAttributes();
         assertFalse(labelView.isUnderline());
-
         labelView = createTestLabelView();
         labelView.isUnderline();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
-
         clearMarkers();
         labelView.isUnderline();
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -368,32 +328,23 @@
 
     public void testSetUnderline() {
         boolean defaultUnderline = false;
-
         assertEquals(defaultUnderline, labelView.isUnderline());
-
         StyleConstants.setUnderline(attrs, !defaultUnderline);
         assertEquals(defaultUnderline, labelView.isUnderline());
-
         labelView.setUnderline(true);
         assertTrue(labelView.isUnderline());
-
         labelView.setUnderline(false);
         assertFalse(labelView.isUnderline());
-
         StyleConstants.setUnderline(attrs, true);
         setLabelViewAttributeSet(attrs);
         assertFalse(labelView.isUnderline());
-
         labelView.setPropertiesFromAttributes();
         assertTrue(labelView.isUnderline());
-
         StyleConstants.setUnderline(attrs, false);
         setLabelViewAttributeSet(attrs);
         assertTrue(labelView.isUnderline());
-
         labelView.setPropertiesFromAttributes();
         assertFalse(labelView.isUnderline());
-
         labelView = createTestLabelView();
         labelView.setUnderline(true);
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -403,27 +354,21 @@
         Font font = labelView.getFont();
         assertSame(styledDoc.getFont(labelView.getAttributes()), font);
         assertSame(styledDoc.getFont(labelView.getAttributes()), font);
-
         StyleConstants.setFontSize(attrs, font.getSize() + 1);
         setLabelViewAttributeSet(attrs);
         assertSame(font, labelView.getFont());
         assertSame(font, labelView.getFont());
-
-
         labelView.setPropertiesFromAttributes();
         font = labelView.getFont();
         assertSame(styledDoc.getFont(labelView.getAttributes()), font);
         assertSame(font, labelView.getFont());
-
         StyleConstants.setFontSize(attrs, font.getSize() + 1);
         labelView.setPropertiesFromAttributes();
         assertSame(font, labelView.getFont());
         assertSame(font, styledDoc.getFont(labelView.getAttributes()));
-
         labelView = createTestLabelView();
         labelView.getFont();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
-
         clearMarkers();
         labelView.getFont();
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -434,20 +379,16 @@
         FontMetrics fontMetrics = labelView.getFontMetrics();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
         propertiesFromAttributesSetter.setOccurred(false);
-
         fontMetrics = labelView.getFontMetrics();
         assertFalse(propertiesFromAttributesSetter.isOccurred());
         propertiesFromAttributesSetter.setOccurred(false);
-
         assertEquals(labelView.getFont(), fontMetrics.getFont());
-
         labelView = createTestLabelView();
         labelView.getFont();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
         assertFalse(fontMetricsGetter.isOccurred());
         assertFalse(containerFontMetricsGetter.isOccurred());
         clearMarkers();
-
         labelView.getFontMetrics();
         assertFalse(propertiesFromAttributesSetter.isOccurred());
         assertTrue(containerFontMetricsGetter.isOccurred());
@@ -455,30 +396,23 @@
 
     public void testGetForeground() {
         Color defaultColor;
-
         defaultColor = labelView.getForeground();
         assertNotNull(defaultColor);
-
         StyleConstants.setForeground(attrs, Color.RED);
         setLabelViewAttributeSet(attrs);
         assertEquals(defaultColor, labelView.getForeground());
         assertEquals(defaultColor, labelView.getForeground());
-
         labelView.setPropertiesFromAttributes();
         assertEquals(Color.RED, labelView.getForeground());
-
         StyleConstants.setForeground(attrs, Color.BLUE);
         setLabelViewAttributeSet(attrs);
         assertEquals(Color.RED, labelView.getForeground());
         assertEquals(Color.RED, labelView.getForeground());
-
         labelView.setPropertiesFromAttributes();
         assertEquals(Color.BLUE, labelView.getForeground());
-
         labelView = createTestLabelView();
         labelView.getForeground();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
-
         clearMarkers();
         labelView.getForeground();
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -486,29 +420,22 @@
 
     public void testGetBackground() {
         Color defaultColor = labelView.getBackground();
-
         assertNull(defaultColor);
-
         StyleConstants.setBackground(attrs, Color.RED);
         setLabelViewAttributeSet(attrs);
         assertEquals(defaultColor, labelView.getBackground());
         assertEquals(defaultColor, labelView.getBackground());
-
         labelView.setPropertiesFromAttributes();
         assertEquals(Color.RED, labelView.getBackground());
-
         StyleConstants.setBackground(attrs, Color.BLUE);
         setLabelViewAttributeSet(attrs);
         assertEquals(Color.RED, labelView.getBackground());
         assertEquals(Color.RED, labelView.getBackground());
-
         labelView.setPropertiesFromAttributes();
         assertEquals(Color.BLUE, labelView.getBackground());
-
         labelView = createTestLabelView();
         labelView.getBackground();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
-
         clearMarkers();
         labelView.getBackground();
         assertFalse(propertiesFromAttributesSetter.isOccurred());
@@ -524,13 +451,10 @@
         labelView.getBackground();
         labelView.setBackground(Color.RED);
         assertEquals(Color.RED, labelView.getBackground());
-
         StyleConstants.setBackground(attrs, Color.RED);
         assertEquals(Color.RED, labelView.getBackground());
-
         labelView.setBackground(Color.BLUE);
         assertEquals(Color.BLUE, labelView.getBackground());
-
         labelView = createTestLabelView();
         labelView.getBackground();
         assertTrue(propertiesFromAttributesSetter.isOccurred());
@@ -540,36 +464,28 @@
         // SuperscriptReSync
         StyleConstants.setSuperscript(attrs, true);
         assertFalse(labelView.isSuperscript());
-
         setLabelViewAttributeSet(attrs);
         labelView.setPropertiesFromAttributes();
         assertTrue(labelView.isSuperscript());
-
         // BackgroundReSync
         StyleConstants.setBackground(attrs, Color.BLUE);
         assertNull(labelView.getBackground());
-
         setLabelViewAttributeSet(attrs);
         assertNull(labelView.getBackground());
-
         labelView.setPropertiesFromAttributes();
         StyleConstants.setBackground(attrs, Color.RED);
         assertSame(Color.BLUE, labelView.getBackground());
-
         setLabelViewAttributeSet(attrs);
         labelView.setPropertiesFromAttributes();
         assertSame(Color.RED, labelView.getBackground());
-
         labelView = createTestLabelView();
         labelView.setPropertiesFromAttributes();
-
         assertFalse(fontMetricsGetter.isOccurred());
         if (isHarmony()) {
             assertTrue(backgroundColorSetterMarker.isOccurred());
         } else {
             assertFalse(backgroundColorSetterMarker.isOccurred());
         }
-
         assertTrue(strikeThroughSetterMarker.isOccurred());
         assertTrue(subscriptSetterMarker.isOccurred());
         assertTrue(superscriptSetterMarker.isOccurred());
@@ -577,12 +493,10 @@
     }
 
     private void setLabelViewAttributeSet(MutableAttributeSet attrs) {
-        styledDoc.setCharacterAttributes(labelView.getStartOffset(),
-                                         labelView.getEndOffset()
-                                         - labelView.getStartOffset(),
-                                         attrs, true);
-        assertSame(labelView.getElement(), styledDoc.getDefaultRootElement()
-                .getElement(0).getElement(0));
+        styledDoc.setCharacterAttributes(labelView.getStartOffset(), labelView.getEndOffset()
+                - labelView.getStartOffset(), attrs, true);
+        assertSame(labelView.getElement(), styledDoc.getDefaultRootElement().getElement(0)
+                .getElement(0));
     }
 
     private void clearMarkers() {
@@ -598,7 +512,6 @@
 
     private TestLabelView createTestLabelView() {
         clearMarkers();
-        return new TestLabelView(styledDoc.getDefaultRootElement().getElement(
-                0).getElement(0));
+        return new TestLabelView(styledDoc.getDefaultRootElement().getElement(0).getElement(0));
     }
- }
\ No newline at end of file
+}
\ No newline at end of file

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/MaskFormatterTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/MaskFormatterTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/MaskFormatterTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/MaskFormatterTest.java Sun Nov 26 12:15:43 2006
@@ -25,16 +25,17 @@
 
 public class MaskFormatterTest extends SwingTestCase {
     MaskFormatter formatter;
-    boolean bWasException;
 
+    boolean bWasException;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         formatter = new MaskFormatter();
         bWasException = false;
-
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -62,7 +63,6 @@
             formatter = new MaskFormatter(mask);
             assertEquals(mask, formatter.getMask());
             checkMainProperties();
-
             mask = "#`ula?*h";
             formatter = new MaskFormatter(mask);
             assertEquals(mask, formatter.getMask());
@@ -83,7 +83,6 @@
         } catch (ParseException e) {
             assertFalse("Unexpected exception: " + e.getMessage(), true);
         }
-
         try {
             formatter.stringToValue("ddd");
         } catch (ParseException e) {
@@ -92,7 +91,6 @@
         assertTrue(bWasException);
     }
 
-
     public void testSetGetInvalidCharacters() {
         try {
             formatter.setMask("*****");
@@ -102,13 +100,11 @@
         } catch (ParseException e) {
             assertFalse("Unexpected exception: " + e.getMessage(), true);
         }
-
         try {
             formatter.stringToValue("#rra");
         } catch (ParseException e) {
             bWasException = true;
         }
-
         assertTrue(bWasException);
     }
 
@@ -122,8 +118,7 @@
             assertEquals("111$%$fff^^^fff", formatter.valueToString("111"));
             formatter.setPlaceholder("123$%$abc");
             assertEquals("123$%$abc", formatter.getPlaceholder());
-            assertEquals("AAA$%$abc^^^***",
-                         formatter.valueToString("AAA"));
+            assertEquals("AAA$%$abc^^^***", formatter.valueToString("AAA"));
         } catch (ParseException e) {
             assertFalse("Unexpected exception: " + e.getMessage(), true);
         }
@@ -134,11 +129,9 @@
             formatter.setMask("HHH$%$HHH^^^HHH");
             formatter.setPlaceholderCharacter('&');
             assertEquals('&', formatter.getPlaceholderCharacter());
-            assertEquals("456$%$6&&^^^&&&",
-                         formatter.valueToString("456$%$6"));
+            assertEquals("456$%$6&&^^^&&&", formatter.valueToString("456$%$6"));
             formatter.setPlaceholder("123$%$abc");
-            assertEquals("456$%$6bc^^^&&&",
-                         formatter.valueToString("456$%$6"));
+            assertEquals("456$%$6bc^^^&&&", formatter.valueToString("456$%$6"));
         } catch (ParseException e) {
             assertFalse("Unexpected exception: " + e.getMessage(), true);
         }
@@ -153,13 +146,11 @@
         } catch (ParseException e) {
             assertFalse("Unexpected exception: " + e.getMessage(), true);
         }
-
         try {
             formatter.stringToValue("rra");
         } catch (ParseException e) {
             bWasException = true;
         }
-
         assertTrue(bWasException);
     }
 
@@ -182,7 +173,6 @@
             assertEquals(text, formatter.stringToValue(text));
             formatter.setValueContainsLiteralCharacters(false);
             assertEquals("4155551212", formatter.stringToValue(text));
-
         } catch (ParseException e) {
             assertFalse("Unexpected exception: " + e.getMessage(), true);
         }
@@ -278,7 +268,6 @@
             bWasException = true;
         }
         checkException();
-
         try {
             formatter.setValueContainsLiteralCharacters(false);
             formatter.valueToString("y3");
@@ -299,9 +288,9 @@
 
     public void testStringToValue_InvalidPlaceHolderChar() {
         try {
-           formatter.setMask("UUU-UUU");
-           formatter.setPlaceholder("aaaaa");
-           formatter.setPlaceholderCharacter('x');
+            formatter.setMask("UUU-UUU");
+            formatter.setPlaceholder("aaaaa");
+            formatter.setPlaceholderCharacter('x');
         } catch (ParseException e) {
             assertTrue("Unexpected exception: " + e.getMessage(), false);
         }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/MutableAttributeSetTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/MutableAttributeSetTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/MutableAttributeSetTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/MutableAttributeSetTest.java Sun Nov 26 12:15:43 2006
@@ -24,7 +24,6 @@
 import java.util.NoSuchElementException;
 
 public class MutableAttributeSetTest extends AttributeSetTest {
-
     public MutableAttributeSetTest() {
         super();
     }
@@ -32,6 +31,7 @@
     public MutableAttributeSetTest(final String name) {
         super(name);
     }
+
     /**
      * The interface MutableAttributeSet for test cases.
      */
@@ -41,9 +41,10 @@
         junit.textui.TestRunner.run(MutableAttributeSetTest.class);
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-        mas = (MutableAttributeSet)as;
+        mas = (MutableAttributeSet) as;
     }
 
     public void testRemoveAttribute() {
@@ -102,13 +103,12 @@
         assertEquals(count, mas.getAttributeCount());
     }
 
+    @SuppressWarnings("unchecked")
     public void testRemoveAttributesEnumeration() {
         int count = mas.getAttributeCount();
-
         assertTrue(mas.isDefined(keys[0]));
         assertTrue(mas.isDefined(keys[1]));
         assertFalse(mas.isDefined(keyInResolver));
-
         mas.removeAttributes(new Enumeration() {
             private int count = 0;
 
@@ -127,7 +127,6 @@
                 }
             }
         });
-
         assertEquals(count - 2, mas.getAttributeCount());
         assertFalse(mas.isDefined(keys[0]));
         assertFalse(mas.isDefined(keys[1]));

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/NumberFormatterTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/NumberFormatterTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/NumberFormatterTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/NumberFormatterTest.java Sun Nov 26 12:15:43 2006
@@ -26,11 +26,13 @@
 public class NumberFormatterTest extends SwingTestCase {
     NumberFormatter formatter;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         formatter = new NumberFormatter();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -49,7 +51,6 @@
         NumberFormat numberFormat = NumberFormat.getInstance();
         formatter.setFormat(numberFormat);
         checkBaseProperties(numberFormat);
-
         formatter.setFormat(null);
         checkBaseProperties(null);
     }



Mime
View raw message