harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r548918 - in /harmony/enhanced/classlib/trunk/modules/beans: make/exclude.common src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
Date Wed, 20 Jun 2007 03:55:28 GMT
Author: leoli
Date: Tue Jun 19 20:55:28 2007
New Revision: 548918

URL: http://svn.apache.org/viewvc?view=rev&rev=548918
Log:
1. Add testcase for java.beans.beancontext.BeanContextSupport about needsGui().
2. org.apache.harmony.beans.tests.java.beans.beancontext.BeanContextSupportTest is removed
from the exclude tests list. 

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/make/exclude.common
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/make/exclude.common
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/make/exclude.common?view=diff&rev=548918&r1=548917&r2=548918
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/make/exclude.common (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/make/exclude.common Tue Jun 19 20:55:28
2007
@@ -7,4 +7,3 @@
 org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServiceAvailableEventTest.java
 org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServiceRevokedEventTest.java
 org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java
-org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java?view=diff&rev=548918&r1=548917&r2=548918
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
Tue Jun 19 20:55:28 2007
@@ -17,6 +17,8 @@
 
 package org.apache.harmony.beans.tests.java.beans.beancontext;
 
+import java.awt.Button;
+import java.awt.Component;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
@@ -2035,7 +2037,6 @@
         assertEqualsSerially(mock.support, serMock.support);
     }
 
-
      public void testSerialization_Compatibility() throws Exception {
          MockBeanContextDelegateS mock = new MockBeanContextDelegateS("main id");
          BeanContextSupport support = mock.support;
@@ -2082,7 +2083,7 @@
             return result;
         } catch (Exception e) {
             e.printStackTrace();
-            throw new RuntimeException();
+            throw new RuntimeException(e);
         }
     }
 
@@ -2179,6 +2180,42 @@
                 baos.toByteArray()));
         Object obj = oin.readObject();
         assertTrue(obj instanceof BeanContextSupport);
+    }
+    
+    public void testAvoidGui() throws Exception
+    {
+        MockBeanContextSupport1 mockBeanContextSupport1 = new MockBeanContextSupport1();
+        mockBeanContextSupport1.setOkToUseGui(false);
+        assertFalse(mockBeanContextSupport1.avoidingGui());
+        
+        mockBeanContextSupport1 = new MockBeanContextSupport1();
+        mockBeanContextSupport1.setOkToUseGui(true);
+        assertFalse(mockBeanContextSupport1.avoidingGui());
+        
+        mockBeanContextSupport1 = new MockBeanContextSupport1();
+        Component component = new Button();
+        mockBeanContextSupport1.add(component);
+        mockBeanContextSupport1.setOkToUseGui(false);
+        assertTrue(mockBeanContextSupport1.needsGui());
+        assertTrue(mockBeanContextSupport1.avoidingGui());
+        
+        mockBeanContextSupport1 = new MockBeanContextSupport1();
+        component = new Button();
+        mockBeanContextSupport1.add(component);        
+        mockBeanContextSupport1.setOkToUseGui(true);
+        assertTrue(mockBeanContextSupport1.needsGui());
+        assertFalse(mockBeanContextSupport1.avoidingGui());     
+    }
+    
+    
+    public class MockBeanContextSupport1 extends BeanContextSupport
+    {
+        private static final long serialVersionUID = 1L;
+
+        public void setOkToUseGui(boolean ok)
+        {
+            this.okToUseGui = ok;
+        }      
     }
 
 }



Mime
View raw message