This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: BeanContextSupport - new tests


I committed this patch:

2006-11-16  David Gilbert  <david.gilbert@object-refinery.com>

	*
gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildBeanContextMembershipListener.java: New test,
	*
gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildPropertyChangeListener.java: New test,
	*
gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildSerializable.java: New test,
	*
gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVetoableChangeListener.java: New test,
	*
gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVisibility.java: New test,
	*
gnu/testlet/java/beans/beancontext/BeanContextSupport/MyBeanContextSupport.java
	(getChildBeanContextMembershipListenerX): New method,
	(getChildPropertyChangeListenerX): New method,
	(getChildSerializableX): New method,
	(getChildVetoableChangeListenerX): New method,
	(getChildVisibilityX): New method.

Regards,

Dave
Index: gnu/testlet/java/beans/beancontext/BeanContextSupport/MyBeanContextSupport.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/beans/beancontext/BeanContextSupport/MyBeanContextSupport.java,v
retrieving revision 1.1
diff -u -r1.1 MyBeanContextSupport.java
--- gnu/testlet/java/beans/beancontext/BeanContextSupport/MyBeanContextSupport.java	11 Nov 2006 06:05:27 -0000	1.1
+++ gnu/testlet/java/beans/beancontext/BeanContextSupport/MyBeanContextSupport.java	16 Nov 2006 09:27:46 -0000
@@ -23,8 +23,13 @@
 
 package gnu.testlet.java.beans.beancontext.BeanContextSupport;
 
+import java.beans.PropertyChangeListener;
+import java.beans.VetoableChangeListener;
+import java.beans.Visibility;
 import java.beans.beancontext.BeanContextChild;
+import java.beans.beancontext.BeanContextMembershipListener;
 import java.beans.beancontext.BeanContextSupport;
+import java.io.Serializable;
 
 public class MyBeanContextSupport extends BeanContextSupport
 {
@@ -37,4 +42,33 @@
   {
     return BeanContextSupport.getChildBeanContextChild(child);
   }
+  
+  public static BeanContextMembershipListener getChildBeanContextMembershipListenerX(
+          Object child)
+  {
+    return BeanContextSupport.getChildBeanContextMembershipListener(child);
+  }
+
+  public static PropertyChangeListener getChildPropertyChangeListenerX(
+          Object child)
+  {
+    return BeanContextSupport.getChildPropertyChangeListener(child);
+  }
+
+  public static Serializable getChildSerializableX(Object child)
+  {
+    return BeanContextSupport.getChildSerializable(child);
+  }
+
+  public static VetoableChangeListener getChildVetoableChangeListenerX(
+          Object child)
+  {
+    return BeanContextSupport.getChildVetoableChangeListener(child);
+  }
+
+  public static Visibility getChildVisibilityX(Object child)
+  {
+    return BeanContextSupport.getChildVisibility(child);
+  }
+
 }
Index: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildBeanContextMembershipListener.java
===================================================================
RCS file: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildBeanContextMembershipListener.java
diff -N gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildBeanContextMembershipListener.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildBeanContextMembershipListener.java	16 Nov 2006 09:27:47 -0000
@@ -0,0 +1,73 @@
+/* getChildBeanContextMembershipListener.java -- some checks for the 
+       getChildBeanContextMembershipListener() method in the 
+       BeanContextSupport class.
+   Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+This file is part of Mauve.
+
+Mauve is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+Mauve is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mauve; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.java.beans.beancontext.BeanContextSupport;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import java.beans.beancontext.BeanContextChild;
+import java.beans.beancontext.BeanContextMembershipEvent;
+import java.beans.beancontext.BeanContextMembershipListener;
+import java.beans.beancontext.BeanContextProxy;
+
+public class getChildBeanContextMembershipListener implements Testlet
+{
+  static class MyBeanContextProxy implements BeanContextProxy, BeanContextMembershipListener
+  {
+    public void childrenAdded(BeanContextMembershipEvent bcme) 
+    {
+      // ignore   
+    }
+    public void childrenRemoved(BeanContextMembershipEvent bcme) {
+      // ignore   
+    }
+
+    BeanContextChild bcs;
+    public MyBeanContextProxy(BeanContextChild bcs)
+    {
+      this.bcs = bcs; 
+    }
+    public BeanContextChild getBeanContextProxy() 
+    {
+      return bcs;
+    }
+  }
+  
+  public void test(TestHarness harness)
+  {
+    // try a regular BeanContextSupport
+    MyBeanContextSupport bcs1 = new MyBeanContextSupport();
+    harness.check(MyBeanContextSupport.getChildBeanContextMembershipListenerX(bcs1), null);
+    
+    // try a proxy
+    MyBeanContextSupport bcs2 = new MyBeanContextSupport();
+    MyBeanContextProxy proxy = new MyBeanContextProxy(bcs2);
+    harness.check(MyBeanContextSupport.getChildBeanContextMembershipListenerX(proxy), proxy);
+    
+    // try null
+    harness.check(MyBeanContextSupport.getChildBeanContextMembershipListenerX(null), null);
+  }
+}
Index: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildPropertyChangeListener.java
===================================================================
RCS file: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildPropertyChangeListener.java
diff -N gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildPropertyChangeListener.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildPropertyChangeListener.java	16 Nov 2006 09:27:47 -0000
@@ -0,0 +1,62 @@
+/* getChildPropertyChangeListener.java -- some checks for the 
+       getChildPropertyChangeListener() method in the BeanContextSupport class.
+   Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+This file is part of Mauve.
+
+Mauve is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+Mauve is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mauve; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.java.beans.beancontext.BeanContextSupport;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import java.beans.beancontext.BeanContextChild;
+import java.beans.beancontext.BeanContextProxy;
+
+public class getChildPropertyChangeListener implements Testlet
+{
+  static class MyBeanContextProxy implements BeanContextProxy
+  {
+    BeanContextChild bcs;
+    public MyBeanContextProxy(BeanContextChild bcs)
+    {
+      this.bcs = bcs; 
+    }
+    public BeanContextChild getBeanContextProxy() 
+    {
+      return bcs;
+    }
+  }
+  
+  public void test(TestHarness harness)
+  {
+    // try a regular BeanContextSupport
+    MyBeanContextSupport bcs1 = new MyBeanContextSupport();
+    harness.check(MyBeanContextSupport.getChildPropertyChangeListenerX(bcs1), bcs1);
+    
+    // try a proxy
+    MyBeanContextSupport bcs2 = new MyBeanContextSupport();
+    MyBeanContextProxy proxy = new MyBeanContextProxy(bcs2);
+    harness.check(MyBeanContextSupport.getChildPropertyChangeListenerX(proxy), null);
+    
+    // try null
+    harness.check(MyBeanContextSupport.getChildPropertyChangeListenerX(null), null);
+  }
+}
Index: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildSerializable.java
===================================================================
RCS file: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildSerializable.java
diff -N gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildSerializable.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildSerializable.java	16 Nov 2006 09:27:47 -0000
@@ -0,0 +1,62 @@
+/* getChildSerializable.java -- some checks for the getChildSerializable() 
+       method in the BeanContextSupport class.
+   Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+This file is part of Mauve.
+
+Mauve is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+Mauve is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mauve; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.java.beans.beancontext.BeanContextSupport;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import java.beans.beancontext.BeanContextChild;
+import java.beans.beancontext.BeanContextProxy;
+
+public class getChildSerializable implements Testlet
+{
+  static class MyBeanContextProxy implements BeanContextProxy
+  {
+    BeanContextChild bcs;
+    public MyBeanContextProxy(BeanContextChild bcs)
+    {
+      this.bcs = bcs; 
+    }
+    public BeanContextChild getBeanContextProxy() 
+    {
+      return bcs;
+    }
+  }
+  
+  public void test(TestHarness harness)
+  {
+    // try a regular BeanContextSupport
+    MyBeanContextSupport bcs1 = new MyBeanContextSupport();
+    harness.check(MyBeanContextSupport.getChildSerializableX(bcs1), bcs1);
+    
+    // try a proxy
+    MyBeanContextSupport bcs2 = new MyBeanContextSupport();
+    MyBeanContextProxy proxy = new MyBeanContextProxy(bcs2);
+    harness.check(MyBeanContextSupport.getChildSerializableX(proxy), null);
+    
+    // try null
+    harness.check(MyBeanContextSupport.getChildSerializableX(null), null);
+  }
+}
Index: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVetoableChangeListener.java
===================================================================
RCS file: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVetoableChangeListener.java
diff -N gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVetoableChangeListener.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVetoableChangeListener.java	16 Nov 2006 09:27:47 -0000
@@ -0,0 +1,62 @@
+/* getChildVetoableChangeListener.java -- some checks for the 
+       getChildVetoableChangeListener() method in the BeanContextSupport class.
+   Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+This file is part of Mauve.
+
+Mauve is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+Mauve is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mauve; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.java.beans.beancontext.BeanContextSupport;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import java.beans.beancontext.BeanContextChild;
+import java.beans.beancontext.BeanContextProxy;
+
+public class getChildVetoableChangeListener implements Testlet
+{
+  static class MyBeanContextProxy implements BeanContextProxy
+  {
+    BeanContextChild bcs;
+    public MyBeanContextProxy(BeanContextChild bcs)
+    {
+      this.bcs = bcs; 
+    }
+    public BeanContextChild getBeanContextProxy() 
+    {
+      return bcs;
+    }
+  }
+  
+  public void test(TestHarness harness)
+  {
+    // try a regular BeanContextSupport
+    MyBeanContextSupport bcs1 = new MyBeanContextSupport();
+    harness.check(MyBeanContextSupport.getChildVetoableChangeListenerX(bcs1), bcs1);
+    
+    // try a proxy
+    MyBeanContextSupport bcs2 = new MyBeanContextSupport();
+    MyBeanContextProxy proxy = new MyBeanContextProxy(bcs2);
+    harness.check(MyBeanContextSupport.getChildVetoableChangeListenerX(proxy), null);
+    
+    // try null
+    harness.check(MyBeanContextSupport.getChildVetoableChangeListenerX(null), null);
+  }
+}
Index: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVisibility.java
===================================================================
RCS file: gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVisibility.java
diff -N gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVisibility.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/beans/beancontext/BeanContextSupport/getChildVisibility.java	16 Nov 2006 09:27:47 -0000
@@ -0,0 +1,62 @@
+/* getChildVisibility.java -- some checks for the getChildVisibility() 
+       method in the BeanContextSupport class.
+   Copyright (C) 2006 David Gilbert <david.gilbert@object-refinery.com>
+This file is part of Mauve.
+
+Mauve is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+Mauve is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mauve; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.2
+
+package gnu.testlet.java.beans.beancontext.BeanContextSupport;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import java.beans.beancontext.BeanContextChild;
+import java.beans.beancontext.BeanContextProxy;
+
+public class getChildVisibility implements Testlet
+{
+  static class MyBeanContextProxy implements BeanContextProxy
+  {
+    BeanContextChild bcs;
+    public MyBeanContextProxy(BeanContextChild bcs)
+    {
+      this.bcs = bcs; 
+    }
+    public BeanContextChild getBeanContextProxy() 
+    {
+      return bcs;
+    }
+  }
+  
+  public void test(TestHarness harness)
+  {
+    // try a regular BeanContextSupport
+    MyBeanContextSupport bcs1 = new MyBeanContextSupport();
+    harness.check(MyBeanContextSupport.getChildVisibilityX(bcs1), bcs1);
+    
+    // try a proxy
+    MyBeanContextSupport bcs2 = new MyBeanContextSupport();
+    MyBeanContextProxy proxy = new MyBeanContextProxy(bcs2);
+    harness.check(MyBeanContextSupport.getChildVisibilityX(proxy), null);
+    
+    // try null
+    harness.check(MyBeanContextSupport.getChildVisibilityX(null), null);
+  }
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]