harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r529034 - in /harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java: common/java/awt/AccessibleAWTContainerTest.java windows/java/awt/WinWindowRTest.java
Date Sun, 15 Apr 2007 17:39:53 GMT
Author: ndbeyer
Date: Sun Apr 15 10:39:52 2007
New Revision: 529034

URL: http://svn.apache.org/viewvc?view=rev&rev=529034
Log:
Apply modified patch for HARMONY-3544 - [classlib][awt] Several tests do not close windows
after finishing

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/AccessibleAWTContainerTest.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/AccessibleAWTContainerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/AccessibleAWTContainerTest.java?view=diff&rev=529034&r1=529033&r2=529034
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/AccessibleAWTContainerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/AccessibleAWTContainerTest.java
Sun Apr 15 10:39:52 2007
@@ -175,15 +175,18 @@
         f.add(container);
         f.setSize(100, 300);
         f.show();
+        
+        try {
+            assertSame(c2, aContainer.getAccessibleAt(p));
+            p.translate(cont1.getX(), cont1.getY());
 
-        assertSame(c2, aContainer.getAccessibleAt(p));
-//        container.remove(c2); // why ??? last assert should pass without this?
-        p.translate(cont1.getX(), cont1.getY());
-
-        assertSame(cont1, aContainer.getAccessibleAt(p));
-        p = new Point();
-        assertSame(c3, cont1.getAccessibleContext().getAccessibleComponent().getAccessibleAt(p));
-
+            assertSame(cont1, aContainer.getAccessibleAt(p));
+            p = new Point();
+            assertSame(c3, cont1.getAccessibleContext()
+                    .getAccessibleComponent().getAccessibleAt(p));
+        } finally {
+            f.dispose();
+        }
     }
 
     public final void testAccessibleAWTContainer() {

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java?view=diff&rev=529034&r1=529033&r2=529034
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java
Sun Apr 15 10:39:52 2007
@@ -40,29 +40,35 @@
     
     public final void testSetVisible() throws Throwable {
         Frame frame = new Frame();
-        frame.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowOpened(WindowEvent e) {
-                try {
-                assertTrue("window is focused before opened", 
-                           e.getWindow().isFocused());
-                } catch (Throwable err) {
-                    error = err;
+        
+        try {
+            frame.addWindowListener(new WindowAdapter() {
+                @Override
+                public void windowOpened(WindowEvent e) {
+                    try {
+                        assertTrue("window is focused before opened", e
+                                .getWindow().isFocused());
+                    } catch (Throwable err) {
+                        error = err;
+                    }
                 }
+            });
+            
+            frame.pack();
+            frame.setVisible(true);
+            
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e1) {
+                // reset interrupt flag, in case someone else cares
+                Thread.currentThread().interrupt();
             }
-        });
-        frame.pack();
-        frame.setVisible(true);
-        try {
-            Thread.sleep(1000);
-        } catch (InterruptedException e1) {            
-            e1.printStackTrace();
-        }
-        if (error != null) {
-            throw error;
+            
+            if (error != null) {
+                throw error;
+            }
+        } finally {
+            frame.dispose();
         }
-        frame.dispose();
-
     }
-
 }



Mime
View raw message