harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479418 [37/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/StyleContext_SerializableTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_SerializableTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_SerializableTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_SerializableTest.java Sun Nov 26 12:15:43 2006
@@ -14,7 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Alexey A. Ivanov
  * @version $Revision$
@@ -22,7 +21,6 @@
 package javax.swing.text;
 
 import java.util.Enumeration;
-
 import javax.swing.SerializableTestCase;
 
 /**
@@ -32,37 +30,32 @@
 public class StyleContext_SerializableTest extends SerializableTestCase {
     private StyleContext sc;
 
+    @Override
     public void testSerializable() throws Exception {
-        StyleContext loadedSC = (StyleContext)toLoad;
-
-        Enumeration names = loadedSC.getStyleNames();
+        StyleContext loadedSC = (StyleContext) toLoad;
+        Enumeration<?> names = loadedSC.getStyleNames();
         String name;
         assertTrue(names.hasMoreElements());
         while (names.hasMoreElements()) {
-            name = (String)names.nextElement();
+            name = (String) names.nextElement();
             Style original = sc.getStyle(name);
-            Style loaded   = loadedSC.getStyle(name);
-
-            assertTrue("Style name: '" + name +
-                       "' #original: " + original +
-                       "  #loaded: " + loaded,
-                    original.isEqual(loaded));
+            Style loaded = loadedSC.getStyle(name);
+            assertTrue("Style name: '" + name + "' #original: " + original + "  #loaded: "
+                    + loaded, original.isEqual(loaded));
         }
     }
 
+    @Override
     protected void setUp() throws Exception {
         sc = new StyleContext();
         Style style = sc.addStyle("aStyle", null);
         style.addAttribute(StyleConstants.Bold, Boolean.TRUE);
         style.addAttribute(StyleConstants.FontFamily, new String("Arial"));
-
         style = sc.getStyle(StyleContext.DEFAULT_STYLE);
         style.addAttribute(StyleConstants.FontSize, new Integer(24));
         style.addAttribute(new String("attrKey"), new String("attrValue"));
         style.addAttribute(new Integer(15), new Float(1.07));
-
         toSave = sc;
         super.setUp();
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_SmallAttributeSetTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_SmallAttributeSetTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_SmallAttributeSetTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_SmallAttributeSetTest.java Sun Nov 26 12:15:43 2006
@@ -20,38 +20,35 @@
  */
 package javax.swing.text;
 
-import javax.swing.SwingTestCase;
+import javax.swing.BasicSwingTestCase;
 import javax.swing.text.StyleContext.SmallAttributeSet;
 
 public class StyleContext_SmallAttributeSetTest extends AttributeSetTest {
     private StyleContext sc;
+
     private SmallAttributeSet attrSet;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-
         sc = new StyleContext();
-
         attrSet = sc.new SmallAttributeSet(as);
         as = attrSet;
-
         asWithResolver = sc.new SmallAttributeSet(asWithResolver);
     }
 
     public void testHashCode() {
         SmallAttributeSet aSet = sc.new SmallAttributeSet(as);
         assertNotSame(attrSet, aSet);
-        assertEquals("Hash codes must be equal for equal objects",
-                     attrSet.hashCode(), aSet.hashCode());
-
+        assertEquals("Hash codes must be equal for equal objects", attrSet.hashCode(), aSet
+                .hashCode());
         aSet = sc.new SmallAttributeSet(new Object[0]);
         assertEquals(0, aSet.hashCode());
-
         // Hash codes for equal objects must be equal
         // even if they are implemented by different classes
         SimpleAttributeSet simpleAS = new SimpleAttributeSet(as);
         assertEquals(simpleAS, attrSet);
-        if (SwingTestCase.isHarmony()) {
+        if (BasicSwingTestCase.isHarmony()) {
             assertEquals(attrSet.hashCode(), simpleAS.hashCode());
         }
     }
@@ -62,67 +59,47 @@
     }
 
     public void testEquals() {
-        AttributeSet newSet = sc.new SmallAttributeSet(new Object[] {
-            keys[0], values[0],
-            keys[1], values[1],
-            keys[2], values[2]
-        });
+        AttributeSet newSet = sc.new SmallAttributeSet(new Object[] { keys[0], values[0],
+                keys[1], values[1], keys[2], values[2] });
         assertEquals(attrSet, newSet);
-
-        newSet = sc.new SmallAttributeSet(new Object[] {
-            keys[0], values[0],
-            keys[1], values[1]
-        });
+        newSet = sc.new SmallAttributeSet(
+                new Object[] { keys[0], values[0], keys[1], values[1] });
         assertFalse(attrSet.equals(newSet));
-
         SimpleAttributeSet sas = new SimpleAttributeSet();
         for (int i = 0; i < keys.length; i++) {
             sas.addAttribute(keys[i], values[i]);
         }
         assertEquals(attrSet, sas);
-
         assertFalse(attrSet.equals(null));
     }
 
     public void testToString() {
-        assertAttributesSame("{key3=value3,key2=value2,key1=value1,}",
-                             attrSet.toString());
-
-        AttributeSet parent = sc.new SmallAttributeSet(new Object[] {
-            "key", "value"
-        });
-        attrSet = sc.new SmallAttributeSet(new Object[] {
-            keys[0], values[0],
-            keys[1], values[1],
-            AttributeSet.ResolveAttribute, parent
-        });
-        assertAttributesSame("{key1=value1,key2=value2,resolver=AttributeSet,}",
-                             attrSet.toString());
+        assertAttributesSame("{key3=value3,key2=value2,key1=value1,}", attrSet.toString());
+        AttributeSet parent = sc.new SmallAttributeSet(new Object[] { "key", "value" });
+        attrSet = sc.new SmallAttributeSet(new Object[] { keys[0], values[0], keys[1],
+                values[1], AttributeSet.ResolveAttribute, parent });
+        assertAttributesSame("{key1=value1,key2=value2,resolver=AttributeSet,}", attrSet
+                .toString());
     }
 
     /*
      * SmallAttributeSet(Object[])
      */
     public void testSmallAttributeSetObjectArray() {
-        Object[] array = new Object[] {
-            keys[0], values[0],
-            keys[1], values[1],
-            keys[2], values[2]
-        };
+        Object[] array = new Object[] { keys[0], values[0], keys[1], values[1], keys[2],
+                values[2] };
         attrSet = sc.new SmallAttributeSet(array);
         assertEquals(keys.length, attrSet.getAttributeCount());
         for (int i = 0; i < keys.length; i++) {
             assertTrue(attrSet.containsAttribute(keys[i], values[i]));
         }
-
         // AttributeSet must not depend on the passed array
         array[0] = "justKey";
-        if (SwingTestCase.isHarmony()) {
+        if (BasicSwingTestCase.isHarmony()) {
             assertFalse(attrSet.isDefined(array[0]));
         }
-        array = new Object[] {"key", "value"};
+        array = new Object[] { "key", "value" };
         assertEquals(3, attrSet.getAttributeCount());
-
         // Empty array
         array = new Object[0];
         attrSet = sc.new SmallAttributeSet(array);
@@ -152,32 +129,24 @@
         for (int i = 0; i < keys.length; i++) {
             assertTrue(attrSet.containsAttribute(keys[i], values[i]));
         }
-
         // Empty attribute set
         attrSet = sc.new SmallAttributeSet(SimpleAttributeSet.EMPTY);
         emptyTest(attrSet);
     }
 
+    @Override
     public void testGetResolveParent() {
         assertNull(attrSet.getResolveParent());
-
-        AttributeSet parent = sc.new SmallAttributeSet(new Object[] {
-            "key", "value"
-        });
-        Object[] array = new Object[] {
-            keys[0], values[0],
-            keys[1], values[1],
-            AttributeSet.ResolveAttribute, parent
-        };
+        AttributeSet parent = sc.new SmallAttributeSet(new Object[] { "key", "value" });
+        Object[] array = new Object[] { keys[0], values[0], keys[1], values[1],
+                AttributeSet.ResolveAttribute, parent };
         attrSet = sc.new SmallAttributeSet(array);
         assertEquals(parent, attrSet.getResolveParent());
     }
 
-    private static void assertAttributesSame(final String expected,
-                                             final String actual) {
+    private static void assertAttributesSame(final String expected, final String actual) {
         String[] splitExpected = StyleContextTest.trimEnds(expected).split(",");
-        String[] splitActual   = StyleContextTest.trimEnds(actual).split(",");
-        assertTrue(StyleContextTest.assertAttributes(splitExpected,
-                                                     splitActual));
+        String[] splitActual = StyleContextTest.trimEnds(actual).split(",");
+        assertTrue(StyleContextTest.assertAttributes(splitExpected, splitActual));
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_StaticAttrTests.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_StaticAttrTests.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_StaticAttrTests.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleContext_StaticAttrTests.java Sun Nov 26 12:15:43 2006
@@ -14,7 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Alexey A. Ivanov
  * @version $Revision$
@@ -36,88 +35,78 @@
     private static class SampleAttribute {
         String name = "sampleAttribute";
 
-            public boolean equals(final Object obj) {
-                if (obj instanceof SampleAttribute)
-                    return name == ((SampleAttribute)obj).name;
-                else
-                    return false;
+        @Override
+        public boolean equals(final Object obj) {
+            if (obj instanceof SampleAttribute) {
+                return name == ((SampleAttribute) obj).name;
             }
+            return false;
+        }
 
-            public int hashCode() {
-                return name.hashCode();
-            }
+        @Override
+        public int hashCode() {
+            return name.hashCode();
+        }
 
-            public String toString() {
-                return name;
-            }
+        @Override
+        public String toString() {
+            return name;
+        }
     }
 
     /**
      * Array of objects that are registered as static attribute keys.
      */
-    private static final Object keys[] = {
-            StyleConstants.Bold,
-            StyleConstants.Italic,
-            StyleConstants.Background,
-            StyleConstants.Underline,
-            StyleConstants.Alignment
-    };
+    private static final Object keys[] = { StyleConstants.Bold, StyleConstants.Italic,
+            StyleConstants.Background, StyleConstants.Underline, StyleConstants.Alignment };
 
     /**
      * Array of strings that static attribute keys get registered with.
      */
     private static final Object strings[] = {
-        "javax.swing.text.StyleConstants$FontConstants.bold",
-        "javax.swing.text.StyleConstants$FontConstants.italic",
-        "javax.swing.text.StyleConstants$ColorConstants.background",
-        "javax.swing.text.StyleConstants$CharacterConstants.underline",
-        "javax.swing.text.StyleConstants$ParagraphConstants.Alignment"
-    };
+            "javax.swing.text.StyleConstants$FontConstants.bold",
+            "javax.swing.text.StyleConstants$FontConstants.italic",
+            "javax.swing.text.StyleConstants$ColorConstants.background",
+            "javax.swing.text.StyleConstants$CharacterConstants.underline",
+            "javax.swing.text.StyleConstants$ParagraphConstants.Alignment" };
 
     public void testGetStaticAttribute() {
         for (int i = 0; i < keys.length; i++) {
-            assertSame("Iteration: " + i,
-                       keys[i],
-                       StyleContext.getStaticAttribute(strings[i]));
+            assertSame("Iteration: " + i, keys[i], StyleContext.getStaticAttribute(strings[i]));
         }
     }
 
     public void testGetStaticAttributeKey() {
         for (int i = 0; i < keys.length; i++) {
-            assertEquals("Iteration: " + i,
-                         strings[i],
-                         StyleContext.getStaticAttributeKey(keys[i]));
+            assertEquals("Iteration: " + i, strings[i], StyleContext
+                    .getStaticAttributeKey(keys[i]));
         }
     }
 
     public void testRegisterStaticAttributeKey() {
         SampleAttribute key = new SampleAttribute();
-        String str = (String)StyleContext.getStaticAttributeKey(key);
-
+        String str = (String) StyleContext.getStaticAttributeKey(key);
         // We haven't registered our object yet, so result should be null
         assertNull(StyleContext.getStaticAttribute(str));
-
         StyleContext.registerStaticAttributeKey(key);
-
         // The method should return the same object with which we called
         // register... method
         assertSame(key, StyleContext.getStaticAttribute(str));
     }
-
     /*
-    The commented out methods are implicitly tested
-    with StyleContext_SerializableTest
-    public void testReadAttributes() {
-        // implementation simply calls testReadAttributeSet
-    }
+     The commented out methods are implicitly tested
+     with StyleContext_SerializableTest
+     public void testReadAttributes() {
+     // implementation simply calls testReadAttributeSet
+     }
+
+     public void testWriteAttributes() {
+     // implementation simply calls testWriteAttributeSet
+     }
 
-    public void testWriteAttributes() {
-        // implementation simply calls testWriteAttributeSet
-    }
-
-    public void testReadAttributeSet() {
-    }
+     public void testReadAttributeSet() {
+     }
 
-    public void testWriteAttributeSet() {
-    }*/
+     public void testWriteAttributeSet() {
+     }*/
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyleTest.java Sun Nov 26 12:15:43 2006
@@ -23,14 +23,13 @@
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
-public class StyleTest extends MutableAttributeSetTest
-    implements ChangeListener {
-
+public class StyleTest extends MutableAttributeSetTest implements ChangeListener {
     protected Style style;
 
     /*
      * @see MutableAttributeSetTest#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         style = new StyleContext().new NamedStyle();
         for (int i = 0; i < keys.length; i++) {
@@ -38,7 +37,6 @@
         }
         mas = style;
         as = style;
-
         Style styleWithResolver = new StyleContext().new NamedStyle();
         for (int i = 0; i < keys.length; i++) {
             styleWithResolver.addAttribute(keys[i], values[i]);
@@ -56,7 +54,6 @@
         bStateChanged = false;
         style.addAttribute("key", "value");
         assertTrue(bStateChanged);
-
         style.removeChangeListener(this);
         bStateChanged = false;
         style.removeAttribute("key");
@@ -69,7 +66,6 @@
         bStateChanged = false;
         AttributeSet copy = style.copyAttributes();
         style.addAttribute(keys[0], values[0]);
-
         // Actually no change happened
         assertTrue(style.isEqual(copy));
         // The listener is to be called
@@ -100,7 +96,6 @@
         bStateChanged = false;
         AttributeSet copy = style.copyAttributes();
         style.removeAttribute("key");
-
         // Actually no change happened
         assertTrue(style.isEqual(copy));
         // The listener is to be called

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKitTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKitTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKitTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKitTest.java Sun Nov 26 12:15:43 2006
@@ -19,17 +19,19 @@
  * @version $Revision$
  */
 package javax.swing.text;
+
 import javax.swing.Action;
 import javax.swing.JEditorPane;
 import javax.swing.SwingTestCase;
 
-
-
 public class StyledEditorKitTest extends SwingTestCase {
     StyledEditorKit kit;
+
     class SimpleElement implements Element {
         String name;
+
         AttributeSet set = new SimpleAttributeSet();
+
         public SimpleElement(final String s) {
             name = s;
         }
@@ -79,15 +81,14 @@
         }
     }
 
-
-
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         setIgnoreNotImplemented(true);
         kit = new StyledEditorKit();
     }
 
-
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -95,45 +96,37 @@
     public void testStyledEditorKit() {
     }
 
-
     public void testClone() {
         Object kit1 = kit.clone();
         assertNotSame(kit1, kit);
         assertTrue(kit1 instanceof StyledEditorKit);
     }
 
-
     public void testGetActions() {
         Action[] actions = kit.getActions();
-        Action[] superActions =  new DefaultEditorKit().getActions();
+        Action[] superActions = new DefaultEditorKit().getActions();
         Action[] newActions = new Action[] {
-            new StyledEditorKit.FontSizeAction("font-size-48", 48),
-            new StyledEditorKit.FontSizeAction("font-size-36", 36),
-            new StyledEditorKit.FontSizeAction("font-size-24", 24),
-            new StyledEditorKit.FontSizeAction("font-size-18", 18),
-            new StyledEditorKit.FontSizeAction("font-size-16", 16),
-            new StyledEditorKit.FontSizeAction("font-size-14", 14),
-            new StyledEditorKit.FontSizeAction("font-size-12", 12),
-            new StyledEditorKit.FontSizeAction("font-size-10", 10),
-            new StyledEditorKit.FontSizeAction("font-size-8", 8),
-
-            new StyledEditorKit.FontFamilyAction("font-family-SansSerif",
-                                                 "SansSerif"),
-            new StyledEditorKit.FontFamilyAction("font-family-Serif",
-                                                 "Serif"),
-            new StyledEditorKit.FontFamilyAction("font-family-Monospaced",
-                                                 "Monospaced"),
-            new StyledEditorKit.BoldAction(),
-            new StyledEditorKit.UnderlineAction(),
-            new StyledEditorKit.ItalicAction(),
-            new StyledEditorKit.AlignmentAction("right-justify",
-                                                StyleConstants.ALIGN_RIGHT),
-            new StyledEditorKit.AlignmentAction("left-justify",
-                                                StyleConstants.ALIGN_LEFT),
-            new StyledEditorKit.AlignmentAction("center-justify",
-                                                StyleConstants.ALIGN_CENTER)
-                                                //,
-            //new StyledEditorKit.StyledInsertBreakAction("insert-break")
+                new StyledEditorKit.FontSizeAction("font-size-48", 48),
+                new StyledEditorKit.FontSizeAction("font-size-36", 36),
+                new StyledEditorKit.FontSizeAction("font-size-24", 24),
+                new StyledEditorKit.FontSizeAction("font-size-18", 18),
+                new StyledEditorKit.FontSizeAction("font-size-16", 16),
+                new StyledEditorKit.FontSizeAction("font-size-14", 14),
+                new StyledEditorKit.FontSizeAction("font-size-12", 12),
+                new StyledEditorKit.FontSizeAction("font-size-10", 10),
+                new StyledEditorKit.FontSizeAction("font-size-8", 8),
+                new StyledEditorKit.FontFamilyAction("font-family-SansSerif", "SansSerif"),
+                new StyledEditorKit.FontFamilyAction("font-family-Serif", "Serif"),
+                new StyledEditorKit.FontFamilyAction("font-family-Monospaced", "Monospaced"),
+                new StyledEditorKit.BoldAction(),
+                new StyledEditorKit.UnderlineAction(),
+                new StyledEditorKit.ItalicAction(),
+                new StyledEditorKit.AlignmentAction("right-justify", StyleConstants.ALIGN_RIGHT),
+                new StyledEditorKit.AlignmentAction("left-justify", StyleConstants.ALIGN_LEFT),
+                new StyledEditorKit.AlignmentAction("center-justify",
+                        StyleConstants.ALIGN_CENTER)
+        //,
+        //new StyledEditorKit.StyledInsertBreakAction("insert-break")
         };
         //There are some problems
         //1) no Foreground action in StyledEditorKit.getActions
@@ -142,7 +135,7 @@
         for (int i = 0; i < superActions.length; i++) {
             boolean was = false;
             if (superActions[i].getClass().getName().equals(
-                "javax.swing.text.DefaultEditorKit$InsertBreakAction")) {
+                    "javax.swing.text.DefaultEditorKit$InsertBreakAction")) {
                 continue;
             }
             for (int j = 0; j < actions.length; j++) {
@@ -153,14 +146,12 @@
             }
             assertTrue("action missed: " + superActions[i], was);
         }
-
         for (int i = 0; i < newActions.length; i++) {
             boolean was = false;
             for (int j = 0; j < actions.length; j++) {
-                if (newActions[i].getClass().getName().equals(
-                                 actions[j].getClass().getName())
-                    &&  newActions[i].getValue(Action.NAME).equals(
-                                 actions[j].getValue(Action.NAME))) {
+                if (newActions[i].getClass().getName().equals(actions[j].getClass().getName())
+                        && newActions[i].getValue(Action.NAME).equals(
+                                actions[j].getValue(Action.NAME))) {
                     was = true;
                     break;
                 }
@@ -211,7 +202,6 @@
         assertEquals(sas, set);
     }
 
-
     public void testDeinstallJEditorPane() {
     }
 
@@ -227,8 +217,7 @@
         removeObsolete(set);
         for (int i = 0; i < length; i++) {
             jep.setCaretPosition(i);
-            assertEquals(getElementByOffset(doc, i),
-                         kit.getCharacterAttributeRun());
+            assertEquals(getElementByOffset(doc, i), kit.getCharacterAttributeRun());
         }
     }
 
@@ -247,14 +236,12 @@
             if (i > 3 && i < 12) {
                 assertEquals(set, kit.getInputAttributes());
             } else {
-                assertEquals(new SimpleAttributeSet(),
-                             kit.getInputAttributes());
+                assertEquals(new SimpleAttributeSet(), kit.getInputAttributes());
             }
         }
     }
 
-    static final Element getElementByOffset(final Document doc,
-                                            final int offset) {
+    static final Element getElementByOffset(final Document doc, final int offset) {
         int pos = (offset == 0) ? 0 : offset - 1;
         Element elem = doc.getDefaultRootElement();
         while (elem.getElementCount() > 0) {
@@ -264,30 +251,26 @@
     }
 
     public void testGetViewFactory() {
-       ViewFactory factory = kit.getViewFactory();
-       Element element = new SimpleElement(AbstractDocument.ContentElementName);
-       assertEquals("javax.swing.text.LabelView",
-                    factory.create(element).getClass().getName());
-       element = new SimpleElement(AbstractDocument.ParagraphElementName);
-       assertEquals("javax.swing.text.ParagraphView",
-                    factory.create(element).getClass().getName());
-       element = new SimpleElement(AbstractDocument.SectionElementName);
-       View v = factory.create(element);
-       assertEquals("javax.swing.text.BoxView", v.getClass().getName());
-       assertEquals(View.Y_AXIS, ((BoxView)v).getAxis());
-       element = new SimpleElement(StyleConstants.ComponentElementName);
-       assertEquals("javax.swing.text.ComponentView",
-                    factory.create(element).getClass().getName());
-       element = new SimpleElement(StyleConstants.IconElementName);
-       assertEquals("javax.swing.text.IconView",
-                    factory.create(element).getClass().getName());
-       element = new SimpleElement("something");
-       assertEquals("javax.swing.text.LabelView",
-                    factory.create(element).getClass().getName());
-       ViewFactory factory1 = kit.getViewFactory();
-       assertEquals(factory, factory1);
+        ViewFactory factory = kit.getViewFactory();
+        Element element = new SimpleElement(AbstractDocument.ContentElementName);
+        assertEquals("javax.swing.text.LabelView", factory.create(element).getClass().getName());
+        element = new SimpleElement(AbstractDocument.ParagraphElementName);
+        assertEquals("javax.swing.text.ParagraphView", factory.create(element).getClass()
+                .getName());
+        element = new SimpleElement(AbstractDocument.SectionElementName);
+        View v = factory.create(element);
+        assertEquals("javax.swing.text.BoxView", v.getClass().getName());
+        assertEquals(View.Y_AXIS, ((BoxView) v).getAxis());
+        element = new SimpleElement(StyleConstants.ComponentElementName);
+        assertEquals("javax.swing.text.ComponentView", factory.create(element).getClass()
+                .getName());
+        element = new SimpleElement(StyleConstants.IconElementName);
+        assertEquals("javax.swing.text.IconView", factory.create(element).getClass().getName());
+        element = new SimpleElement("something");
+        assertEquals("javax.swing.text.LabelView", factory.create(element).getClass().getName());
+        ViewFactory factory1 = kit.getViewFactory();
+        assertEquals(factory, factory1);
     }
-
 
     public void testInstallJEditorPane() {
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_ActionsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_ActionsTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_ActionsTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_ActionsTest.java Sun Nov 26 12:15:43 2006
@@ -22,32 +22,33 @@
 
 import java.awt.Color;
 import java.awt.event.ActionEvent;
-
 import javax.swing.Action;
 import javax.swing.JEditorPane;
 import javax.swing.SwingTestCase;
 
 public class StyledEditorKit_ActionsTest extends SwingTestCase {
-    JEditorPane     jep;
+    JEditorPane jep;
 
-    int             dot;
+    int dot;
 
     StyledEditorKit kit;
 
-    StyledDocument  doc;
+    StyledDocument doc;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         setIgnoreNotImplemented(true);
         jep = new JEditorPane();
         kit = new StyledEditorKit();
         jep.setEditorKit(kit);
-        doc = (StyledDocument)jep.getDocument();
+        doc = (StyledDocument) jep.getDocument();
         jep.setText("ABCD\nEFGH\n" + "IGKL\nMNOP\n" + "QRST\nUVWX\n");
         dot = 18;
         jep.setCaretPosition(dot);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -56,15 +57,13 @@
         return (new Integer(i)).toString();
     }
 
-    private void checkAttribute(final int offset, final Object key,
-                                final Object value) {
-        Object realValue = ((AbstractDocument)jep.getDocument())
-                .getParagraphElement(offset).getAttributes().getAttribute(key);
+    private void checkAttribute(final int offset, final Object key, final Object value) {
+        Object realValue = ((AbstractDocument) jep.getDocument()).getParagraphElement(offset)
+                .getAttributes().getAttribute(key);
         assertEquals(value, realValue);
     }
 
-    private void checkAttribute(final int offset, final Object key,
-                                final int value) {
+    private void checkAttribute(final int offset, final Object key, final int value) {
         checkAttribute(offset, key, new Integer(value));
     }
 
@@ -73,33 +72,30 @@
     }
 
     private void assertTrue(final Object obj) {
-        assertTrue(((Boolean)obj).booleanValue());
+        assertTrue(((Boolean) obj).booleanValue());
     }
 
     private void assertFalse(final Object obj) {
-        assertFalse(((Boolean)obj).booleanValue());
+        assertFalse(((Boolean) obj).booleanValue());
     }
 
-    private void checkProperty(final int start, final int end,
-                               final Object attribute, final Object value,
-                               final Object alternative) {
+    private void checkProperty(final int start, final int end, final Object attribute,
+            final Object value, final Object alternative) {
         for (int i = 0; i < doc.getLength(); i++) {
-            Object property = StyledEditorKit_StyledTextActionTest
-                    .getAttributeSetByOffset(doc, i).getAttribute(attribute);
+            Object property = StyledEditorKit_StyledTextActionTest.getAttributeSetByOffset(doc,
+                    i).getAttribute(attribute);
             if (i >= start && i <= end) {
                 assertEquals(value, property);
             } else {
                 assertEquals(alternative, property);
             }
         }
-
     }
 
     private void checkToggleAction(final Action action, final String name,
-                                   final Object attribute) {
+            final Object attribute) {
         checkName(action, name);
-        ActionEvent ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED,
-                                         null);
+        ActionEvent ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, null);
         action.actionPerformed(ae);
         assertTrue(kit.getInputAttributes().getAttribute(attribute));
         action.actionPerformed(ae);
@@ -109,7 +105,6 @@
         ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, "true");
         action.actionPerformed(ae);
         assertFalse(kit.getInputAttributes().getAttribute(attribute));
-
         jep.setSelectionStart(2);
         jep.setSelectionEnd(5);
         action.actionPerformed(ae);
@@ -119,75 +114,48 @@
     }
 
     private void checkNonToggleAction(final Action action, final String name,
-                                      final Object attribute,
-                                      final Object value,
-                                      final Object defaultValue,
-                                      final Object alternative,
-                                      final String param1,
-                                      final String param2) {
+            final Object attribute, final Object value, final Object defaultValue,
+            final Object alternative, final String param1, final String param2) {
         checkName(action, name);
-        ActionEvent ae1 = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED,
-                                          param1);
+        ActionEvent ae1 = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, param1);
         action.actionPerformed(ae1);
         checkProperty(100, 100, attribute, alternative, alternative);
-        assertEquals(defaultValue, kit.getInputAttributes()
-                .getAttribute(attribute));
-
-        ActionEvent ae2 = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED,
-                                          param2);
+        assertEquals(defaultValue, kit.getInputAttributes().getAttribute(attribute));
+        ActionEvent ae2 = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, param2);
         action.actionPerformed(ae2);
         checkProperty(100, 100, attribute, alternative, alternative);
         assertEquals(value, kit.getInputAttributes().getAttribute(attribute));
-
         jep.setSelectionStart(2);
         jep.setSelectionEnd(5);
-
         action.actionPerformed(ae1);
-        assertEquals(defaultValue, kit.getInputAttributes()
-                .getAttribute(attribute));
+        assertEquals(defaultValue, kit.getInputAttributes().getAttribute(attribute));
         checkProperty(3, 5, attribute, defaultValue, alternative);
-
         action.actionPerformed(ae2);
         assertEquals(value, kit.getInputAttributes().getAttribute(attribute));
         checkProperty(3, 5, attribute, value, alternative);
-
         action.actionPerformed(null);
-
     }
 
     public void testAlignmentAction() {
-        Action action = new StyledEditorKit.AlignmentAction(
-                                                            null,
-                                                            StyleConstants.
-                                                            ALIGN_JUSTIFIED);
+        Action action = new StyledEditorKit.AlignmentAction(null,
+                StyleConstants.ALIGN_JUSTIFIED);
         checkName(action, null);
-        action = new StyledEditorKit.AlignmentAction(
-                                                     "alignmentName",
-                                                     StyleConstants.
-                                                     ALIGN_JUSTIFIED);
-
+        action = new StyledEditorKit.AlignmentAction("alignmentName",
+                StyleConstants.ALIGN_JUSTIFIED);
         checkName(action, "alignmentName");
         ActionEvent ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED,
-                                         toString(StyleConstants.ALIGN_CENTER));
+                toString(StyleConstants.ALIGN_CENTER));
         action.actionPerformed(ae);
-        checkAttribute(dot, StyleConstants.Alignment,
-                       StyleConstants.ALIGN_CENTER);
-
+        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_CENTER);
         ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, null);
         action.actionPerformed(ae);
-        checkAttribute(dot, StyleConstants.Alignment,
-                       StyleConstants.ALIGN_JUSTIFIED);
-
+        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
         ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, "aa");
         action.actionPerformed(ae);
-        checkAttribute(dot, StyleConstants.Alignment,
-                       StyleConstants.ALIGN_JUSTIFIED);
-
+        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
         ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, "");
         action.actionPerformed(ae);
-        checkAttribute(dot, StyleConstants.Alignment,
-                       StyleConstants.ALIGN_JUSTIFIED);
-
+        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
         action.actionPerformed(null);
     }
 
@@ -200,15 +168,12 @@
         String defaultValue = "SansSerif";
         Object alternative = null;
         String value = "Monospaced";
-        Action action = new StyledEditorKit.FontFamilyAction(null,
-                                                             defaultValue);
+        Action action = new StyledEditorKit.FontFamilyAction(null, defaultValue);
         checkName(action, null);
-
-        action = new StyledEditorKit.FontFamilyAction("familyActionName",
-                                                      defaultValue);
+        action = new StyledEditorKit.FontFamilyAction("familyActionName", defaultValue);
         Object attribute = StyleConstants.FontFamily;
-        checkNonToggleAction(action, "familyActionName", attribute, value,
-                             defaultValue, alternative, null, value);
+        checkNonToggleAction(action, "familyActionName", attribute, value, defaultValue,
+                alternative, null, value);
     }
 
     public void testFontSizeAction() {
@@ -217,32 +182,22 @@
         Integer value = new Integer(16);
         Action action = new StyledEditorKit.FontFamilyAction(null, "48");
         checkName(action, null);
-
-        action = new StyledEditorKit.FontSizeAction("sizeActionName",
-                                                      48);
+        action = new StyledEditorKit.FontSizeAction("sizeActionName", 48);
         Object attribute = StyleConstants.FontSize;
-
-        checkNonToggleAction(action, "sizeActionName", attribute, value,
-                             defaultValue, alternative, "", "16");
-
+        checkNonToggleAction(action, "sizeActionName", attribute, value, defaultValue,
+                alternative, "", "16");
     }
 
     public void testForegroundAction() {
         Color defaultValue = Color.RED;
         Object alternative = null;
         Object value = Color.decode("425");
-        Action action = new StyledEditorKit.ForegroundAction(null,
-                                                             defaultValue);
+        Action action = new StyledEditorKit.ForegroundAction(null, defaultValue);
         checkName(action, null);
-
-        action = new StyledEditorKit.ForegroundAction("foregroundName",
-                                                      defaultValue);
-
+        action = new StyledEditorKit.ForegroundAction("foregroundName", defaultValue);
         Object attribute = StyleConstants.Foreground;
-
-        checkNonToggleAction(action, "foregroundName", attribute, value,
-                             defaultValue, alternative, "", "425");
-
+        checkNonToggleAction(action, "foregroundName", attribute, value, defaultValue,
+                alternative, "", "425");
     }
 
     public void testItalicAction() {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_StyledTextActionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_StyledTextActionTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_StyledTextActionTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_StyledTextActionTest.java Sun Nov 26 12:15:43 2006
@@ -18,8 +18,8 @@
  * @author Evgeniya G. Maenkova
  * @version $Revision$
  */
-
 package javax.swing.text;
+
 import java.awt.event.ActionEvent;
 import javax.swing.Action;
 import javax.swing.JEditorPane;
@@ -27,21 +27,27 @@
 
 public class StyledEditorKit_StyledTextActionTest extends SwingTestCase {
     StyledEditorKit.StyledTextAction action;
+
     boolean bWasException;
+
     String message;
+
     JEditorPane jep;
+
     StyledEditorKit kit;
 
-    class StyledTextAction extends  StyledEditorKit.StyledTextAction {
+    class StyledTextAction extends StyledEditorKit.StyledTextAction {
+        private static final long serialVersionUID = 1L;
+
         public StyledTextAction(final String name) {
             super(name);
         }
 
         public void actionPerformed(final ActionEvent e) {
-
         }
     }
 
+    @Override
     protected void setUp() throws Exception {
         jep = new JEditorPane();
         setIgnoreNotImplemented(true);
@@ -52,7 +58,7 @@
         super.setUp();
     }
 
-
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -80,26 +86,21 @@
         SimpleAttributeSet sas = createAttributeSet(2);
         action.setParagraphAttributes(jep, sas, false);
         checkParagraphAttributes(doc, -1, 5, sas, 0);
-
         jep.setSelectionStart(10);
         jep.setSelectionEnd(13);
         SimpleAttributeSet sas2 = createAttributeSet(3);
         action.setParagraphAttributes(jep, sas2, false);
         checkParagraphAttributes(doc, 9, 15, sas2, 6);
-
         jep.setCaretPosition(18);
         SimpleAttributeSet sas3 = createAttributeSet(4);
         action.setParagraphAttributes(jep, sas3, true);
-
         for (int i = 0; i < doc.getLength(); i++) {
             AttributeSet as = doc.getParagraphElement(i).getAttributes();
             if (i < 15) {
-               sas.addAttribute(AttributeSet.ResolveAttribute,
-                                as.getAttribute(AttributeSet.ResolveAttribute)
-                                );
-               sas2.addAttribute(AttributeSet.ResolveAttribute,
-                                 as.getAttribute(AttributeSet.ResolveAttribute)
-                                 );
+                sas.addAttribute(AttributeSet.ResolveAttribute, as
+                        .getAttribute(AttributeSet.ResolveAttribute));
+                sas2.addAttribute(AttributeSet.ResolveAttribute, as
+                        .getAttribute(AttributeSet.ResolveAttribute));
             }
             if (i < 5) {
                 assertEquals(sas, as);
@@ -119,50 +120,42 @@
 
     public void testGetStyledDocument() {
         jep = new JEditorPane();
-
         try {
             action.getStyledDocument(jep);
-         } catch (IllegalArgumentException e) {
-             bWasException = true;
-             message = e.getMessage();
-         }
-
-         assertTrue(bWasException);
-         assertEquals("document must be StyledDocument", message);
-
-         StyledEditorKit styledKit = new StyledEditorKit();
-         jep.setEditorKit(styledKit);
-         assertEquals(jep.getDocument(), action.getStyledDocument(jep));
-
-         bWasException = false;
-         jep.setDocument(new PlainDocument());
-         try {
-             action.getStyledDocument(jep);
-         } catch (IllegalArgumentException e) {
-             bWasException = true;
-             message = e.getMessage();
-         }
-         assertTrue(bWasException);
-         assertEquals("document must be StyledDocument", message);
+        } catch (IllegalArgumentException e) {
+            bWasException = true;
+            message = e.getMessage();
+        }
+        assertTrue(bWasException);
+        assertEquals("document must be StyledDocument", message);
+        StyledEditorKit styledKit = new StyledEditorKit();
+        jep.setEditorKit(styledKit);
+        assertEquals(jep.getDocument(), action.getStyledDocument(jep));
+        bWasException = false;
+        jep.setDocument(new PlainDocument());
+        try {
+            action.getStyledDocument(jep);
+        } catch (IllegalArgumentException e) {
+            bWasException = true;
+            message = e.getMessage();
+        }
+        assertTrue(bWasException);
+        assertEquals("document must be StyledDocument", message);
     }
 
     public void testGetStyledEditorKit() {
         jep = new JEditorPane();
-
         try {
-           action.getStyledEditorKit(jep);
+            action.getStyledEditorKit(jep);
         } catch (IllegalArgumentException e) {
             bWasException = true;
             message = e.getMessage();
         }
-
         assertTrue(bWasException);
         assertEquals("EditorKit must be StyledEditorKit", message);
-
         StyledEditorKit styledKit = new StyledEditorKit();
         jep.setEditorKit(styledKit);
         assertEquals(styledKit, action.getStyledEditorKit(jep));
-
         jep.setDocument(new PlainDocument());
         assertEquals(styledKit, action.getStyledEditorKit(jep));
     }
@@ -179,34 +172,27 @@
         action.setCharacterAttributes(jep, sas, false);
         assertEquals(sas, kit.getInputAttributes());
         assertEquals(attrs, doc.getCharacterElement(4).getAttributes());
-
         SimpleAttributeSet sas2 = createAttributeSet(2);
         action.setCharacterAttributes(jep, sas2, false);
         assertEquals(sas2, kit.getInputAttributes());
         assertEquals(attrs, doc.getCharacterElement(4).getAttributes());
-
         SimpleAttributeSet sas3 = createAttributeSet(3);
         action.setCharacterAttributes(jep, sas3, false);
         assertEquals(sas3, kit.getInputAttributes());
         assertEquals(attrs, doc.getCharacterElement(4).getAttributes());
-
         //there is selection
-
         jep.setSelectionStart(3);
         jep.setSelectionEnd(5);
         kit.getInputAttributes().removeAttributes(kit.getInputAttributes());
         attrs = kit.getInputAttributes();
-
         SimpleAttributeSet sas4 = createAttributeSet(4);
         action.setCharacterAttributes(jep, sas4, false);
         checkAttributes(doc, 3, 6, sas4, true);
         assertEquals(attrs, kit.getInputAttributes());
-
         SimpleAttributeSet sas5 = createAttributeSet(5);
         SimpleAttributeSet sas6 = new SimpleAttributeSet();
         sas6.addAttribute("&&", "$$$");
         action.setCharacterAttributes(jep, sas6, true);
-
         assertEquals(attrs, kit.getInputAttributes());
         action.setCharacterAttributes(jep, sas5, false);
         sas5.addAttribute("&&", "$$$");
@@ -214,19 +200,14 @@
         assertEquals(attrs, kit.getInputAttributes());
     }
 
-    static final void checkAttributes(final Document doc,
-                               final int start,
-                               final int end,
-                               final MutableAttributeSet set,
-                               final boolean ignoreResolveAttribute) {
+    static final void checkAttributes(final Document doc, final int start, final int end,
+            final MutableAttributeSet set, final boolean ignoreResolveAttribute) {
         for (int i = 0; i < doc.getLength(); i++) {
             AttributeSet as = getAttributeSetByOffset(doc, i);
             if (!ignoreResolveAttribute) {
-                set.addAttribute(AttributeSet.ResolveAttribute,
-                                 as.getAttribute(AttributeSet.ResolveAttribute)
-                                );
+                set.addAttribute(AttributeSet.ResolveAttribute, as
+                        .getAttribute(AttributeSet.ResolveAttribute));
             }
-
             if (i > start && i < end) {
                 assertEquals(set, as);
             } else {
@@ -235,16 +216,12 @@
         }
     }
 
-    final void checkParagraphAttributes(final AbstractDocument doc,
-                                        final int start,
-                                        final int end,
-                                        final MutableAttributeSet set,
-                                        final int from) {
+    final void checkParagraphAttributes(final AbstractDocument doc, final int start,
+            final int end, final MutableAttributeSet set, final int from) {
         for (int i = from; i < doc.getLength(); i++) {
             AttributeSet as = doc.getParagraphElement(i).getAttributes();
-            set.addAttribute(AttributeSet.ResolveAttribute,
-                                as.getAttribute(AttributeSet.ResolveAttribute)
-                                );
+            set.addAttribute(AttributeSet.ResolveAttribute, as
+                    .getAttribute(AttributeSet.ResolveAttribute));
             if (i > start && i < end) {
                 assertSame(as, doc.getParagraphElement(i));
                 assertEquals(set.getAttributeCount(), as.getAttributeCount());
@@ -255,7 +232,6 @@
         }
     }
 
-
     final SimpleAttributeSet createAttributeSet(final int i) {
         SimpleAttributeSet sas = new SimpleAttributeSet();
         Integer value = new Integer(i);
@@ -269,8 +245,7 @@
         return sas;
     }
 
-    static final AttributeSet getAttributeSetByOffset(final Document doc,
-                                                      final int offset) {
+    static final AttributeSet getAttributeSetByOffset(final Document doc, final int offset) {
         Element elem = StyledEditorKitTest.getElementByOffset(doc, offset);
         return (elem == null) ? null : elem.getAttributes();
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TabSetTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TabSetTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TabSetTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TabSetTest.java Sun Nov 26 12:15:43 2006
@@ -14,7 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Alexey A. Ivanov
  * @version $Revision$
@@ -24,38 +23,33 @@
 import junit.framework.TestCase;
 
 public class TabSetTest extends TestCase {
-
     private TabSet tabSet;
-    private final TabStop[] tabStops = {
-        new TabStop(44f),
-        new TabStop(56f, TabStop.ALIGN_CENTER, TabStop.LEAD_NONE),
-        new TabStop(72f, TabStop.ALIGN_RIGHT, TabStop.LEAD_DOTS),
-        new TabStop(100f)
-    };
+
+    private final TabStop[] tabStops = { new TabStop(44f),
+            new TabStop(56f, TabStop.ALIGN_CENTER, TabStop.LEAD_NONE),
+            new TabStop(72f, TabStop.ALIGN_RIGHT, TabStop.LEAD_DOTS), new TabStop(100f) };
 
     public void testEquals() {
         assertTrue(tabSet.equals(tabSet));
         assertFalse(tabSet.equals(null));
         assertTrue(tabSet.equals(new TabSet(tabStops)));
-        assertFalse(tabSet.equals(new TabSet(new TabStop[] {tabStops[1]})));
+        assertFalse(tabSet.equals(new TabSet(new TabStop[] { tabStops[1] })));
     }
 
     public void testGetTab() {
         for (int i = 0; i < tabStops.length; i++) {
             assertSame(tabStops[i], tabSet.getTab(i));
         }
-
         try {
             tabSet.getTab(-1);
-
             fail("IllegalArgumentException must be thrown");
-        } catch (IllegalArgumentException e) { }
-
+        } catch (IllegalArgumentException e) {
+        }
         try {
             tabSet.getTab(tabStops.length);
-
             fail("IllegalArgumentException must be thrown");
-        } catch (IllegalArgumentException e) { }
+        } catch (IllegalArgumentException e) {
+        }
     }
 
     public void testGetTabAfter() {
@@ -71,7 +65,6 @@
     public void testGetTabIndex() {
         assertEquals(1, tabSet.getTabIndex(tabStops[1]));
         assertEquals(3, tabSet.getTabIndex(tabStops[3]));
-
         assertEquals(-1, tabSet.getTabIndex(null));
         assertEquals(-1, tabSet.getTabIndex(new TabStop(56f)));
     }
@@ -79,8 +72,7 @@
     public void testGetTabIndexAfter() {
         assertEquals(0, tabSet.getTabIndexAfter(0f));
         assertEquals(2, tabSet.getTabIndexAfter(60f));
-        assertEquals(-1, tabSet.getTabIndexAfter(tabStops[3].getPosition()
-                                                 + 0.01f));
+        assertEquals(-1, tabSet.getTabIndexAfter(tabStops[3].getPosition() + 0.01f));
     }
 
     public void testHashcode() {
@@ -100,13 +92,12 @@
 
     public void testToString() {
         assertEquals("[ tab @44.0 - center tab @56.0 - "
-                     + "right tab @72.0 (w/leaders) - tab @100.0 ]",
-                     tabSet.toString());
+                + "right tab @72.0 (w/leaders) - tab @100.0 ]", tabSet.toString());
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         tabSet = new TabSet(tabStops);
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TabStopTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TabStopTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TabStopTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TabStopTest.java Sun Nov 26 12:15:43 2006
@@ -21,7 +21,6 @@
 package javax.swing.text;
 
 import javax.swing.BasicSwingTestCase;
-
 import junit.framework.TestCase;
 
 public class TabStopTest extends TestCase {
@@ -34,87 +33,62 @@
     public void testEquals() throws Exception {
         TabStop tabStop1;
         TabStop tabStop2;
-
         tabStop1 = new TabStop(0f, TabStop.ALIGN_LEFT, TabStop.LEAD_NONE);
         tabStop2 = new TabStop(0f, TabStop.ALIGN_LEFT, TabStop.LEAD_NONE);
         assertEquals(tabStop1, tabStop2);
-
         tabStop1 = new TabStop(-12.11f, 3, -5);
         tabStop2 = new TabStop(-12.11f, 3, -5);
         assertEquals(tabStop1, tabStop2);
-
         tabStop1 = new TabStop(0f, TabStop.ALIGN_LEFT, TabStop.LEAD_NONE);
         tabStop2 = new TabStop(1f, TabStop.ALIGN_CENTER, TabStop.LEAD_EQUALS);
         assertFalse(tabStop1.equals(tabStop2));
-
         tabStop1 = new TabStop(-12.11f, TabStop.ALIGN_LEFT, -5);
         tabStop2 = new TabStop(-12.1099999f, TabStop.ALIGN_LEFT, -5);
         assertEquals(tabStop1, tabStop2);
-
         tabStop1 = new TabStop(-12.11f, 3, -6);
         tabStop2 = new TabStop(-12.12f, 3, -5);
         assertFalse(tabStop1.equals(tabStop2));
-
         tabStop1 = new TabStop(-12.1f, TabStop.ALIGN_LEFT, TabStop.LEAD_EQUALS);
         assertFalse(tabStop1.equals("test"));
-     }
+    }
 
     public void testToString() throws Exception {
         tabStop = new TabStop(1024f, TabStop.ALIGN_BAR, TabStop.LEAD_DOTS);
         assertEquals("bar tab @1024.0 (w/leaders)", tabStop.toString());
-
         tabStop = new TabStop(-15f, TabStop.ALIGN_CENTER, TabStop.LEAD_EQUALS);
         assertEquals("center tab @-15.0 (w/leaders)", tabStop.toString());
-
         tabStop = new TabStop(-5f, TabStop.ALIGN_DECIMAL, TabStop.LEAD_HYPHENS);
         assertEquals("decimal tab @-5.0 (w/leaders)", tabStop.toString());
-
         tabStop = new TabStop(0f, TabStop.ALIGN_LEFT, TabStop.LEAD_NONE);
         assertEquals("tab @0.0", tabStop.toString());
-
-        tabStop = new TabStop(12.11f, TabStop.ALIGN_RIGHT,
-                              TabStop.LEAD_THICKLINE);
+        tabStop = new TabStop(12.11f, TabStop.ALIGN_RIGHT, TabStop.LEAD_THICKLINE);
         assertEquals("right tab @12.11 (w/leaders)", tabStop.toString());
-
         tabStop = new TabStop(12.11f, 20, TabStop.LEAD_UNDERLINE);
         assertEquals("tab @12.11 (w/leaders)", tabStop.toString());
-
         tabStop = new TabStop(12.11f);
         assertEquals("tab @12.11", tabStop.toString());
-
         tabStop = new TabStop(12.11f, -23, 50);
         assertEquals("tab @12.11 (w/leaders)", tabStop.toString());
     }
 
     public void testHashCode() throws Exception {
-        assertEquals(new TabStop(3f, TabStop.ALIGN_RIGHT,
-                                 TabStop.LEAD_HYPHENS).hashCode(),
-                     new TabStop(3f, TabStop.ALIGN_RIGHT,
-                                 TabStop.LEAD_HYPHENS).hashCode());
-
-        assertEquals(new TabStop(Float.MAX_VALUE, TabStop.ALIGN_RIGHT,
-                                 TabStop.LEAD_DOTS).hashCode(),
-                     new TabStop(Float.MAX_VALUE, TabStop.ALIGN_RIGHT,
-                                 TabStop.LEAD_DOTS).hashCode());
-
-        assertEquals(new TabStop(Float.MIN_VALUE, -3, 7).hashCode(),
-                     new TabStop(Float.MIN_VALUE, -3, 7).hashCode());
-
-
-        int hashCode1 = new TabStop(3, TabStop.ALIGN_RIGHT,
-                                    TabStop.LEAD_HYPHENS).hashCode();
-        int hashCode2 = new TabStop(1, TabStop.ALIGN_RIGHT,
-                             TabStop.LEAD_HYPHENS).hashCode();
+        assertEquals(new TabStop(3f, TabStop.ALIGN_RIGHT, TabStop.LEAD_HYPHENS).hashCode(),
+                new TabStop(3f, TabStop.ALIGN_RIGHT, TabStop.LEAD_HYPHENS).hashCode());
+        assertEquals(new TabStop(Float.MAX_VALUE, TabStop.ALIGN_RIGHT, TabStop.LEAD_DOTS)
+                .hashCode(), new TabStop(Float.MAX_VALUE, TabStop.ALIGN_RIGHT,
+                TabStop.LEAD_DOTS).hashCode());
+        assertEquals(new TabStop(Float.MIN_VALUE, -3, 7).hashCode(), new TabStop(
+                Float.MIN_VALUE, -3, 7).hashCode());
+        int hashCode1 = new TabStop(3, TabStop.ALIGN_RIGHT, TabStop.LEAD_HYPHENS).hashCode();
+        int hashCode2 = new TabStop(1, TabStop.ALIGN_RIGHT, TabStop.LEAD_HYPHENS).hashCode();
         assertTrue(hashCode1 != hashCode2);
     }
 
     public void testGetLeader() throws Exception {
         tabStop = new TabStop(2.11f, 0, TabStop.LEAD_EQUALS);
         assertEquals(TabStop.LEAD_EQUALS, tabStop.getLeader());
-
         tabStop = new TabStop(20f, 3, TabStop.LEAD_UNDERLINE);
         assertEquals(TabStop.LEAD_UNDERLINE, tabStop.getLeader());
-
         tabStop = new TabStop(12.11f, -23, 50);
         assertEquals(50, tabStop.getLeader());
     }
@@ -122,26 +96,19 @@
     public void testGetPosition() throws Exception {
         tabStop = new TabStop(0f, TabStop.ALIGN_CENTER, TabStop.LEAD_DOTS);
         assertEquals(0, tabStop.getPosition(), 0.0001);
-
         tabStop = new TabStop(-2.5f, TabStop.ALIGN_CENTER, TabStop.LEAD_DOTS);
         assertEquals(-2.5, tabStop.getPosition(), 0.0001);
-
-        tabStop = new TabStop(13554111f, TabStop.ALIGN_CENTER,
-                              TabStop.LEAD_DOTS);
+        tabStop = new TabStop(13554111f, TabStop.ALIGN_CENTER, TabStop.LEAD_DOTS);
         assertEquals(13554111, tabStop.getPosition(), 0.0001);
-
-        tabStop = new TabStop(-13554111f, TabStop.ALIGN_CENTER,
-                              TabStop.LEAD_DOTS);
+        tabStop = new TabStop(-13554111f, TabStop.ALIGN_CENTER, TabStop.LEAD_DOTS);
         assertEquals(-13554111, tabStop.getPosition(), 0.0001);
     }
 
     public void testGetAlignmet() throws Exception {
         tabStop = new TabStop(2.5f, TabStop.ALIGN_DECIMAL, TabStop.LEAD_DOTS);
         assertEquals(TabStop.ALIGN_DECIMAL, tabStop.getAlignment());
-
         tabStop = new TabStop(0f, 3, TabStop.LEAD_DOTS);
         assertEquals(3, tabStop.getAlignment());
-
         tabStop = new TabStop(-1f, -3, 7);
         assertEquals(-3, tabStop.getAlignment());
     }
@@ -149,7 +116,6 @@
     public void testSerializable() throws Exception {
         tabStop = new TabStop(10f, TabStop.ALIGN_CENTER, TabStop.LEAD_HYPHENS);
         tabStop = (TabStop) BasicSwingTestCase.serializeObject(tabStop);
-
         assertEquals(10f, tabStop.getPosition(), 0.0001);
         assertEquals(TabStop.ALIGN_CENTER, tabStop.getAlignment());
         assertEquals(TabStop.LEAD_HYPHENS, tabStop.getLeader());

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TextActionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TextActionTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TextActionTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TextActionTest.java Sun Nov 26 12:15:43 2006
@@ -23,17 +23,16 @@
 package javax.swing.text;
 
 import java.awt.event.ActionEvent;
-
 import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.SwingTestCase;
 
 public class TextActionTest extends SwingTestCase {
-
     public static void main(final String[] args) {
         junit.textui.TestRunner.run(TextActionTest.class);
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
@@ -42,25 +41,34 @@
         String name1 = "name1";
         String name2 = "name2";
         String name3 = "name3";
-        String name4 = "name4";
         String name5 = "name5";
         Action action1 = new TextAction(name1) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
         Action action2 = new AbstractAction(name2) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
         Action action3 = new AbstractAction(name3) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
         Action action4 = new AbstractAction(name1) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
         Action action5 = new AbstractAction(name5) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
@@ -70,35 +78,30 @@
         Action[] list4 = new Action[] { action2 };
         Action[] list5 = new Action[] { action3, action4, action5 };
         Action[] res = null;
-
         res = TextAction.augmentList(list1, list2);
         assertTrue("result's not null", res != null);
         assertEquals("result's length ", 3, res.length);
         assertEquals("resulted list item", action3, res[0]);
         assertEquals("resulted list item", action2, res[1]);
         assertEquals("resulted list item", action4, res[2]);
-
         res = TextAction.augmentList(list2, list1);
         assertTrue("result's not null", res != null);
         assertEquals("result's length ", 3, res.length);
         assertEquals("resulted list item", action3, res[0]);
         assertEquals("resulted list item", action2, res[1]);
         assertEquals("resulted list item", action1, res[2]);
-
         res = TextAction.augmentList(list1, list3);
         assertTrue("result's not null", res != null);
         assertEquals("result's length ", 3, res.length);
         assertEquals("resulted list item", action3, res[0]);
         assertEquals("resulted list item", action2, res[1]);
         assertEquals("resulted list item", action4, res[2]);
-
         res = TextAction.augmentList(list3, list1);
         assertTrue("result's not null", res != null);
         assertEquals("result's length ", 3, res.length);
         assertEquals("resulted list item", action3, res[0]);
         assertEquals("resulted list item", action2, res[1]);
         assertEquals("resulted list item", action1, res[2]);
-
         res = TextAction.augmentList(list4, list5);
         assertTrue("result's not null", res != null);
         assertEquals("result's length ", 4, res.length);
@@ -114,41 +117,43 @@
     public void testTextActionString() {
         String str1 = "string1";
         String str2 = "string2";
-
         TextAction action1 = new TextAction(str1) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
         TextAction action2 = new TextAction(str2) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
         TextAction action3 = new TextAction(null) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
         assertEquals("Number of keys", 1, action1.getKeys().length);
         assertEquals("name ", str1, action1.getValue(Action.NAME));
         assertTrue("action is enabled initially", action1.isEnabled());
-
         assertEquals("Number of keys", 1, action2.getKeys().length);
         assertEquals("name ", str2, action2.getValue(Action.NAME));
         assertTrue("action is enabled initially", action2.isEnabled());
-
         assertEquals("Number of keys", 0, action3.getKeys().length);
         assertNull("name ", action3.getValue(Action.NAME));
         assertTrue("action is enabled initially", action3.isEnabled());
     }
 
-    public void testTextActionNullEvent () {
+    public void testTextActionNullEvent() {
         Action[] actions = new DefaultEditorKit().getActions();
-        for(int i = 0; i < actions.length; i++) {
+        for (int i = 0; i < actions.length; i++) {
             try {
                 actions[i].actionPerformed(null);
-            } catch(NullPointerException e) {
+            } catch (NullPointerException e) {
                 fail("Null event is not supported in: " + actions[i].getValue(Action.NAME));
             }
         }
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TextAction_MultithreadedTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TextAction_MultithreadedTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TextAction_MultithreadedTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/TextAction_MultithreadedTest.java Sun Nov 26 12:15:43 2006
@@ -23,26 +23,27 @@
 package javax.swing.text;
 
 import java.awt.event.ActionEvent;
-
 import javax.swing.JButton;
 import javax.swing.JComponent;
 import javax.swing.JDialog;
 import javax.swing.JTextArea;
 import javax.swing.JTextField;
 import javax.swing.SwingWaitTestCase;
-
 import junit.framework.TestCase;
 
 public class TextAction_MultithreadedTest extends TestCase {
-
     JDialog window1;
+
     JDialog window2;
+
     JDialog window3;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         if (window1 != null) {
             window1.dispose();
@@ -56,41 +57,37 @@
             window3.dispose();
             window3 = null;
         }
-
         super.tearDown();
     }
 
     public void testGetFocusedComponent() throws Exception {
         TextAction action = new TextAction("") {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
-
         window1 = new JDialog();
         window2 = new JDialog();
         window3 = new JDialog();
         JButton component1 = new JButton();
         JComponent component2 = new JTextField();
         JComponent component3 = new JTextArea();
-        ((JTextComponent)component2).setText("3");
+        ((JTextComponent) component2).setText("3");
         window1.getContentPane().add(component1);
         window2.getContentPane().add(component2);
         window3.getContentPane().add(component3);
         window1.pack();
         window2.pack();
         window3.pack();
-
         window2.setVisible(true);
         SwingWaitTestCase.requestFocusInWindowForComponent(component2);
-        
         Object res = action.getFocusedComponent();
         assertEquals("focused component", component2, res);
-
         window3.setVisible(true);
         SwingWaitTestCase.requestFocusInWindowForComponent(component3);
         res = action.getFocusedComponent();
         assertEquals("focused component", component3, res);
-
         window1.setVisible(true);
         SwingWaitTestCase.requestFocusInWindowForComponent(component1);
         res = action.getFocusedComponent();
@@ -99,10 +96,11 @@
 
     public void testGetTextComponent() throws Exception {
         TextAction action = new TextAction("") {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
         };
-
         window1 = new JDialog();
         window2 = new JDialog();
         JButton componentNoText1 = new JButton();
@@ -111,36 +109,27 @@
         JTextComponent componentText2 = new JTextField();
         componentText1.setText("1");
         componentText1.setText("2");
-        ActionEvent eventNoTextComponentInside = new ActionEvent(
-                componentNoText2, 0, "event1");
-        ActionEvent eventTextComponentInside = new ActionEvent(componentText2,
-                0, "event2");
-
+        ActionEvent eventNoTextComponentInside = new ActionEvent(componentNoText2, 0, "event1");
+        ActionEvent eventTextComponentInside = new ActionEvent(componentText2, 0, "event2");
         window1.getContentPane().add(componentNoText1);
         window2.getContentPane().add(componentText1);
         window1.pack();
         window2.pack();
-
         Object previouslyFocused = action.getFocusedComponent();
         window1.setVisible(true);
         SwingWaitTestCase.requestFocusInWindowForComponent(componentNoText1);
         Object res = action.getTextComponent(eventNoTextComponentInside);
-        
         assertEquals("focused component", previouslyFocused, res);
-
         window1.setVisible(true);
         SwingWaitTestCase.requestFocusInWindowForComponent(componentNoText1);
         res = action.getTextComponent(eventTextComponentInside);
         assertEquals("focused component", componentText2, res);
-
         window2.setVisible(true);
         SwingWaitTestCase.requestFocusInWindowForComponent(componentText1);
         res = action.getTextComponent(eventNoTextComponentInside);
         assertEquals("focused component", componentText1, res);
-
         SwingWaitTestCase.requestFocusInWindowForComponent(componentText1);
         res = action.getTextComponent(eventTextComponentInside);
         assertEquals("focused component", componentText2, res);
     }
-
 }



Mime
View raw message