harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r480411 - /harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/
Date Wed, 29 Nov 2006 05:05:03 GMT
Author: ndbeyer
Date: Tue Nov 28 21:05:02 2006
New Revision: 480411

URL: http://svn.apache.org/viewvc?view=rev&rev=480411
Log:
Rewrite 'accessibility' tests to remove unnecessary use of base swing test case classes.

Modified:
    harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleBundleTest.java
    harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleContextTest.java
    harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationSetTest.java
    harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationTest.java
    harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleResourceBundleTest.java
    harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRoleTest.java
    harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java
    harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateTest.java

Modified: harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleBundleTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleBundleTest.java?view=diff&rev=480411&r1=480410&r2=480411
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleBundleTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleBundleTest.java
Tue Nov 28 21:05:02 2006
@@ -22,40 +22,26 @@
 
 package javax.accessibility;
 
-import javax.swing.BasicSwingTestCase;
+import junit.framework.TestCase;
 
-public class AccessibleBundleTest extends BasicSwingTestCase {
-    AccessibleBundle bundle;
-    Object[][] resources;
+public class AccessibleBundleTest extends TestCase {
 
-    public void setUp() {
-        bundle = new AccessibleBundle() {};
-        resources = new AccessibleResourceBundle().getContents();
-    }
+    @SuppressWarnings("deprecation")
+    public void testToDisplayString() throws Exception {
+        AccessibleBundle bundle = new AccessibleBundle() {
+        };
 
-    public void tearDown() {
-        bundle = null;
-        resources = null;
-    }
+        Object[][] resources = new AccessibleResourceBundle().getContents();
 
-    public void testToDisplayString() throws Exception {
-        for (int  i = 0; i < resources.length; i++) {
-            bundle.key = (String)resources[i][0];
-            assertEquals("DisplayString don't match resource: " + bundle.key,
-                         bundle.toDisplayString(), resources[i][1]);
-            assertEquals("toDisplayString don't match toString: " + bundle.key,
-                         bundle.toString(), bundle.toDisplayString());
+        for (int i = 0; i < resources.length; i++) {
+            bundle.key = (String) resources[i][0];
+            assertEquals("DisplayString don't match resource: " + bundle.key, bundle
+                    .toDisplayString(), resources[i][1]);
+            assertEquals("toDisplayString don't match toString: " + bundle.key, bundle
+                    .toString(), bundle.toDisplayString());
         }
         bundle.key = "ShouldNotFindSuchAString";
         assertEquals("Not bundled DisplayString should match itself",
-                     "ShouldNotFindSuchAString", bundle.toDisplayString());
-
-        testExceptionalCase(new ExceptionalCase() {
-            public void exceptionalAction() throws Exception {
-                bundle.key = null;
-                bundle.toDisplayString();
-            }
-        });
+                "ShouldNotFindSuchAString", bundle.toDisplayString());
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleContextTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleContextTest.java?view=diff&rev=480411&r1=480410&r2=480411
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleContextTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleContextTest.java
Tue Nov 28 21:05:02 2006
@@ -15,55 +15,68 @@
  *  limitations under the License.
  */
 
-/**
- * @author Dennis Ushakov
- * @version $Revision$
- */
-
 package javax.accessibility;
 
-import java.awt.IllegalComponentStateException;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
 import java.util.Locale;
 
-import javax.swing.BasicSwingTestCase;
+import junit.framework.TestCase;
 
-public class AccessibleContextTest extends BasicSwingTestCase {
+public class AccessibleContextTest extends TestCase {
     private AccessibleContext context;
-    private PropertyChangeController propertyController;
 
+    private PropertyChangeListenerImpl propertyChangeListener;
+
+    @Override
     public void setUp() {
         context = new AccessibleContext() {
+            @Override
             public AccessibleRole getAccessibleRole() {
-                    return null;
-                };
+                return null;
+            }
+
+            @Override
             public AccessibleStateSet getAccessibleStateSet() {
-                    return null;
-                };
+                return null;
+            }
+
+            @Override
             public int getAccessibleIndexInParent() {
-                    return 0;
-                };
+                return 0;
+            }
+
+            @Override
             public int getAccessibleChildrenCount() {
-                    return 0;
-                };
+                return 0;
+            }
+
+            @Override
             public Accessible getAccessibleChild(int i) {
-                    return null;
-                };
-            public Locale getLocale() throws IllegalComponentStateException {
-                    return Locale.ENGLISH;
-                };
+                return null;
+            }
+
+            @Override
+            public Locale getLocale() {
+                return Locale.ENGLISH;
+            }
         };
-        propertyController = new PropertyChangeController(/*true*/);
-        context.addPropertyChangeListener(propertyController);
+        propertyChangeListener = new PropertyChangeListenerImpl();
+        context.addPropertyChangeListener(propertyChangeListener);
     }
 
+    @Override
     public void tearDown() {
         context = null;
+        propertyChangeListener.lastEvent = null;
     }
 
     public void testSetGetAccessibleName() {
         String name = "componentName";
         context.setAccessibleName(name);
-        assertTrue(propertyController.isChanged(AccessibleContext.ACCESSIBLE_NAME_PROPERTY));
+        assertEquals(AccessibleContext.ACCESSIBLE_NAME_PROPERTY,
+                propertyChangeListener.lastEvent.getPropertyName());
+        assertEquals(name, propertyChangeListener.lastEvent.getNewValue());
         assertEquals(name, context.getAccessibleName());
         assertEquals(name, context.accessibleName);
     }
@@ -71,7 +84,9 @@
     public void testSetGetAccessibleDescription() {
         String description = "componentDescription";
         context.setAccessibleDescription(description);
-        assertTrue(propertyController.isChanged(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY));
+        assertEquals(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY,
+                propertyChangeListener.lastEvent.getPropertyName());
+        assertEquals(description, propertyChangeListener.lastEvent.getNewValue());
         assertEquals(description, context.getAccessibleDescription());
         assertEquals(description, context.accessibleDescription);
     }
@@ -84,6 +99,7 @@
                 return null;
             }
 
+            @Override
             public String toString() {
                 return name;
             }
@@ -91,7 +107,7 @@
         context.setAccessibleParent(parent);
         assertEquals(parent, context.getAccessibleParent());
         assertEquals(parent, context.accessibleParent);
-        assertFalse(propertyController.isChanged());
+        assertNull(propertyChangeListener.lastEvent);
     }
 
     public void testGetAccessibleOthers() {
@@ -104,7 +120,18 @@
         assertNull(context.getAccessibleIcon());
         assertSame(context.getAccessibleRelationSet(), context.getAccessibleRelationSet());
         assertNull(context.getAccessibleTable());
-        assertFalse(propertyController.isChanged());
+        assertNull(propertyChangeListener.lastEvent);
     }
-}
 
+    private static class PropertyChangeListenerImpl implements PropertyChangeListener {
+        PropertyChangeEvent lastEvent;
+
+        PropertyChangeListenerImpl() {
+            super();
+        }
+
+        public void propertyChange(PropertyChangeEvent event) {
+            this.lastEvent = event;
+        }
+    }
+}

Modified: harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationSetTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationSetTest.java?view=diff&rev=480411&r1=480410&r2=480411
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationSetTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationSetTest.java
Tue Nov 28 21:05:02 2006
@@ -15,27 +15,25 @@
  *  limitations under the License.
  */
 
-/**
- * @author Dennis Ushakov
- * @version $Revision$
- */
-
 package javax.accessibility;
 
-import javax.swing.BasicSwingTestCase;
+import junit.framework.TestCase;
 
-public class AccessibleRelationSetTest extends BasicSwingTestCase {
+public class AccessibleRelationSetTest extends TestCase {
     private AccessibleRelationSet set;
+
     private AccessibleRelation[] relations;
 
+    @Override
     public void setUp() {
         set = new AccessibleRelationSet();
         relations = new AccessibleRelation[] {
-                                  new AccessibleRelation(AccessibleRelation.CONTROLLED_BY),
-                                  new AccessibleRelation(AccessibleRelation.MEMBER_OF)};
+                new AccessibleRelation(AccessibleRelation.CONTROLLED_BY),
+                new AccessibleRelation(AccessibleRelation.MEMBER_OF) };
         set.addAll(relations);
     }
 
+    @Override
     public void tearDown() {
         set = null;
         relations = null;
@@ -44,11 +42,11 @@
     public void testAccessibleRelationSet() {
         assertNotNull(set.relations);
 
-        testExceptionalCase(new ExceptionalCase() {
-            public void exceptionalAction() throws Exception {
-                set = new AccessibleRelationSet(null);
-            }
-        });
+        try {
+            new AccessibleRelationSet(null);
+            fail("expected null pointer exception");
+        } catch (NullPointerException e) {
+        }
     }
 
     public void testAddContains() {
@@ -57,33 +55,31 @@
 
         AccessibleRelation relation = new AccessibleRelation(AccessibleRelation.CONTROLLER_FOR);
         assertTrue(set.add(relation));
-        if (isHarmony()) {
-            assertFalse(set.add(relation));
-        }
+        assertFalse(set.add(relation));
         assertTrue("Should contain added item", set.contains(AccessibleRelation.CONTROLLER_FOR));
-        assertFalse("Should not contain not added item", set.contains(AccessibleRelation.LABEL_FOR));
+        assertFalse("Should not contain not added item", set
+                .contains(AccessibleRelation.LABEL_FOR));
 
     }
 
     public void testNullOperations() {
         set.relations = null;
-        assertFalse("Empty set should not contain any item",
-                    set.contains(AccessibleRelation.LABEL_FOR));
-        assertNull("Empty set should not contain any item",
-                   set.get(AccessibleRelation.LABEL_FOR));
-        assertFalse("Empty set should not contain any item",
-                    set.remove(set.get(AccessibleRelation.LABEL_FOR)));
+        assertFalse("Empty set should not contain any item", set
+                .contains(AccessibleRelation.LABEL_FOR));
+        assertNull("Empty set should not contain any item", set
+                .get(AccessibleRelation.LABEL_FOR));
+        assertFalse("Empty set should not contain any item", set.remove(set
+                .get(AccessibleRelation.LABEL_FOR)));
         set.add(new AccessibleRelation(AccessibleRelation.CONTROLLER_FOR));
         set.relations = null;
         set.addAll(relations);
     }
 
     public void testDupes() {
-        AccessibleRelation dupeRelation = new AccessibleRelation(AccessibleRelation.CONTROLLED_BY);
-        if (isHarmony()) {
-            assertFalse("Should not add duplicate item", set.add(dupeRelation));
-            assertFalse("Should not add duplicate item", set.add(relations[0]));
-        }
+        AccessibleRelation dupeRelation = new AccessibleRelation(
+                AccessibleRelation.CONTROLLED_BY);
+        assertFalse("Should not add duplicate item", set.add(dupeRelation));
+        assertFalse("Should not add duplicate item", set.add(relations[0]));
         assertNotSame(dupeRelation, set.get(AccessibleRelation.CONTROLLED_BY));
         assertSame(relations[0], set.get(AccessibleRelation.CONTROLLED_BY));
         set.remove(set.get(AccessibleRelation.CONTROLLED_BY));
@@ -92,14 +88,14 @@
         set.addAll(relations);
         set.addAll(relations);
         assertEquals("Should not add duplicate items in addAll", relations.length,
-                     set.relations.size());
+                set.relations.size());
     }
 
     public void testGet() {
-        assertSame("Get should return same value",
-                   relations[0], set.get(AccessibleRelation.CONTROLLED_BY));
-        assertNull("Get should return null if no such element present",
-                   set.get(AccessibleRelation.CONTROLLER_FOR));
+        assertSame("Get should return same value", relations[0], set
+                .get(AccessibleRelation.CONTROLLED_BY));
+        assertNull("Get should return null if no such element present", set
+                .get(AccessibleRelation.CONTROLLER_FOR));
     }
 
     public void testClear() {
@@ -116,12 +112,11 @@
     public void testToString() {
         String stateSetString = set.toString();
         assertTrue("String representation should contain elements representation",
-                   stateSetString.indexOf(relations[0].toString()) >= 0);
+                stateSetString.indexOf(relations[0].toString()) >= 0);
         assertTrue("String representation should contain elements representation",
-                   stateSetString.indexOf(relations[1].toString()) >= 0);
+                stateSetString.indexOf(relations[1].toString()) >= 0);
 
         set.relations = null;
         set.toString();
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationTest.java?view=diff&rev=480411&r1=480410&r2=480411
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRelationTest.java
Tue Nov 28 21:05:02 2006
@@ -15,53 +15,41 @@
  *  limitations under the License.
  */
 
-/**
- * @author Dennis Ushakov
- * @version $Revision$
- */
-
 package javax.accessibility;
 
-import javax.swing.BasicSwingTestCase;
-
-public class AccessibleRelationTest extends BasicSwingTestCase {
-    private AccessibleRelation relation;
-
-    public void setUp() {
-        relation = new AccessibleRelation(AccessibleRelation.LABEL_FOR);
-    }
+import junit.framework.TestCase;
 
-    public void tearDown() {
-        relation = null;
-    }
+public class AccessibleRelationTest extends TestCase {
 
     public void testGetKey() {
+        AccessibleRelation relation = new AccessibleRelation(AccessibleRelation.LABEL_FOR);
         assertEquals(relation.key, relation.getKey());
     }
 
     public void testAccessibleRelation() {
+        AccessibleRelation relation = new AccessibleRelation(AccessibleRelation.LABEL_FOR);
         assertEquals(0, relation.getTarget().length);
     }
 
     public void testSetGetTarget() {
+        AccessibleRelation relation = new AccessibleRelation(AccessibleRelation.LABEL_FOR);
         StringBuffer target = new StringBuffer("text");
         relation.setTarget(target);
         assertEquals(1, relation.getTarget().length);
         assertSame(target, relation.getTarget()[0]);
 
-        StringBuffer[] targets = new StringBuffer[]{target, target};
+        StringBuffer[] targets = new StringBuffer[] { target, target };
         relation.setTarget(targets);
         assertEquals(2, relation.getTarget().length);
         assertNotSame(targets, relation.getTarget());
 
-        relation.setTarget((Object[])null);
+        relation.setTarget((Object[]) null);
         assertNotNull(relation.getTarget());
         assertEquals(0, relation.getTarget().length);
 
-        relation.setTarget((Object)null);
+        relation.setTarget((Object) null);
         assertNotNull(relation.getTarget());
         assertEquals(1, relation.getTarget().length);
         assertNull(relation.getTarget()[0]);
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleResourceBundleTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleResourceBundleTest.java?view=diff&rev=480411&r1=480410&r2=480411
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleResourceBundleTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleResourceBundleTest.java
Tue Nov 28 21:05:02 2006
@@ -15,31 +15,19 @@
  *  limitations under the License.
  */
 
-/**
- * @author Dennis Ushakov
- * @version $Revision$
- */
-
 package javax.accessibility;
 
-import javax.swing.BasicSwingTestCase;
-
-public class AccessibleResourceBundleTest extends BasicSwingTestCase {
-    private AccessibleResourceBundle resBundle;
-
-    public void setUp() {
-        resBundle = new AccessibleResourceBundle();
-    }
+import junit.framework.TestCase;
 
-    public void tearDown() {
-        resBundle = null;
-    }
+public class AccessibleResourceBundleTest extends TestCase {
 
+    @SuppressWarnings("deprecation")
     public void testGetContents() {
+        AccessibleResourceBundle resBundle = new AccessibleResourceBundle();
         Object[][] contents = resBundle.getContents();
-        if (isHarmony()) {
-            assertEquals(103, contents.length);
-        }
+        assertNotNull(contents);
+        assertTrue(contents.length > 0);
+        
         assertEquals(2, contents[10].length);
 
         contents[10] = new Object[] {"a", "b"};

Modified: harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRoleTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRoleTest.java?view=diff&rev=480411&r1=480410&r2=480411
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRoleTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleRoleTest.java
Tue Nov 28 21:05:02 2006
@@ -15,27 +15,15 @@
  *  limitations under the License.
  */
 
-/**
- * @author Dennis Ushakov
- * @version $Revision$
- */
-
 package javax.accessibility;
 
-import javax.swing.BasicSwingTestCase;
-
-public class AccessibleRoleTest extends BasicSwingTestCase {
-    private AccessibleRole state;
-
-    protected void tearDown() throws Exception {
-        state = null;
-    }
+import junit.framework.TestCase;
 
+public class AccessibleRoleTest extends TestCase {
     public void testAccessibleState() throws Exception {
         String key = "something_unexpected";
-        state = new AccessibleRole(key);
+        AccessibleRole state = new AccessibleRole(key);
         assertEquals(key, state.key);
         assertEquals(key, state.toDisplayString());
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java?view=diff&rev=480411&r1=480410&r2=480411
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java
Tue Nov 28 21:05:02 2006
@@ -15,42 +15,40 @@
  *  limitations under the License.
  */
 
-/**
- * @author Dennis Ushakov
- * @version $Revision$
- */
-
 package javax.accessibility;
 
 import java.util.Arrays;
 
-import javax.swing.SwingTestCase;
+import junit.framework.TestCase;
 
-public class AccessibleStateSetTest extends SwingTestCase {
+public class AccessibleStateSetTest extends TestCase {
     private AccessibleStateSet stateSet;
+
     private AccessibleState[] statesArray;
 
+    @Override
     public void setUp() {
         stateSet = new AccessibleStateSet();
-        statesArray = new AccessibleState[]{AccessibleState.ACTIVE, AccessibleState.ARMED};
+        statesArray = new AccessibleState[] { AccessibleState.ACTIVE, AccessibleState.ARMED
};
         stateSet.addAll(statesArray);
     }
 
+    @Override
     public void tearDown() {
         stateSet = null;
         statesArray = null;
     }
 
     public void testAccessibleStateSet() throws Exception {
-        AccessibleState[] statesArray = {AccessibleState.ACTIVE, AccessibleState.ARMED};
+        AccessibleState[] statesArray = { AccessibleState.ACTIVE, AccessibleState.ARMED };
         stateSet = new AccessibleStateSet(statesArray);
         assertNotNull(stateSet.states);
 
-        testExceptionalCase(new ExceptionalCase() {
-            public void exceptionalAction() throws Exception {
-                stateSet = new AccessibleStateSet(null);
-            }
-        });
+        try {
+            new AccessibleStateSet(null);
+            fail("expected null pointer exception");
+        } catch (NullPointerException e) {
+        }
     }
 
     public void testAddContains() throws Exception {
@@ -75,13 +73,14 @@
     public void testAddAll() {
         stateSet.addAll(statesArray);
         stateSet.addAll(statesArray);
-        assertEquals("Should not add duplicate items", statesArray.length, stateSet.states.size());
+        assertEquals("Should not add duplicate items", statesArray.length, stateSet.states
+                .size());
 
-        testExceptionalCase(new NullPointerCase() {
-            public void exceptionalAction() throws Exception {
-                stateSet.addAll(null);
-            }
-        });
+        try {
+            stateSet.addAll(null);
+            fail("expected null pointer exception");
+        } catch (NullPointerException e) {
+        }
     }
 
     public void testRemove() throws Exception {
@@ -104,30 +103,30 @@
     public void testToString() throws Exception {
         String stateSetString = stateSet.toString();
         assertTrue("String representation should contain elements representation",
-                   stateSetString.indexOf(AccessibleState.ACTIVE.toString()) >= 0);
+                stateSetString.indexOf(AccessibleState.ACTIVE.toString()) >= 0);
         assertTrue("String representation should contain elements representation",
-                   stateSetString.indexOf(AccessibleState.ARMED.toString()) >= 0);
+                stateSetString.indexOf(AccessibleState.ARMED.toString()) >= 0);
 
         stateSet.states = null;
         stateSet.toString();
-        
-        //regression test for HARMONY-1190
+
+        // regression test for HARMONY-1190
         try {
-        	new AccessibleStateSet(new AccessibleState[2]).toString();
-        	fail("NullPointerException expected");
+            new AccessibleStateSet(new AccessibleState[2]).toString();
+            fail("NullPointerException expected");
         } catch (NullPointerException e) {
-        	//expected 
+            // expected
         }
     }
 
     public void testToArray() throws Exception {
         AccessibleState[] statesReturnedArray = stateSet.toArray();
-        assertEquals("Returned array size don't match",
-                     statesArray.length, statesReturnedArray.length);
+        assertEquals("Returned array size don't match", statesArray.length,
+                statesReturnedArray.length);
         for (int i = 0; i < statesReturnedArray.length; i++)
-            assertEquals("Returned element mismatch:" + i, statesArray[i], statesReturnedArray[i]);
+            assertEquals("Returned element mismatch:" + i, statesArray[i],
+                    statesReturnedArray[i]);
         stateSet.states = null;
         Arrays.asList(stateSet.toArray());
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateTest.java?view=diff&rev=480411&r1=480410&r2=480411
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateTest.java
Tue Nov 28 21:05:02 2006
@@ -15,27 +15,16 @@
  *  limitations under the License.
  */
 
-/**
- * @author Dennis Ushakov
- * @version $Revision$
- */
-
 package javax.accessibility;
 
-import javax.swing.BasicSwingTestCase;
-
-public class AccessibleStateTest extends BasicSwingTestCase {
-    private AccessibleState state;
+import junit.framework.TestCase;
 
-    protected void tearDown() throws Exception {
-        state = null;
-    }
+public class AccessibleStateTest extends TestCase {
 
     public void testAccessibleState() throws Exception {
         String key = "something_unexpected";
-        state = new AccessibleState(key);
+        AccessibleState state = new AccessibleState(key);
         assertEquals(key, state.key);
         assertEquals(key, state.toDisplayString());
     }
 }
-



Mime
View raw message