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: additions to recent JSplitPane tests


I added several new tests to the Constructor.java file and 2 new tests
to the setComponent.java file.  These helped me figure out what was
going on in JSplitPane and I'm currently tidying up a classpath patch
that makes us pass all these tests.

2005-11-16  Anthony Balkissoon  <abalkiss@redhat.com>

	* gnu/testlet/javax/swing/JSplitPane/Constructor.java: Added several
	new tests.
	* gnu/testlet/javax/swing/JSplitPane/setComponent.java: Likewise.

--Tony
Index: gnu/testlet/javax/swing/JSplitPane/Constructor.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/JSplitPane/Constructor.java,v
retrieving revision 1.1
diff -u -r1.1 Constructor.java
--- gnu/testlet/javax/swing/JSplitPane/Constructor.java	16 Nov 2005 20:46:29 -0000	1.1
+++ gnu/testlet/javax/swing/JSplitPane/Constructor.java	16 Nov 2005 21:27:44 -0000
@@ -29,7 +29,8 @@
 
 /**
  * This tests whether the constructors for JSplitPane assign 
- * the correct Components as leftComponent and rightComponent.
+ * the correct Components as leftComponent and rightComponent
+ * when dealing with null arguments.
  */ 
 public class Constructor implements Testlet {
 	
@@ -39,10 +40,48 @@
           harness.check(pane.getLeftComponent().getClass() == JButton.class);
           harness.check(pane.getRightComponent().getClass() == JButton.class);
 
+          harness.checkPoint ("constructor with only orientation");
+          pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                    
+          pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                    
+
+          harness.checkPoint ("constructor with orientation and layout");
+          pane = new JSplitPane (JSplitPane.VERTICAL_SPLIT, false);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                    
+          pane = new JSplitPane (JSplitPane.VERTICAL_SPLIT, true);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                    
+          pane = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, true);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                    
+          pane = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, false);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                              
+
+          harness.checkPoint ("constructor with orientation and 2 components");
+          pane = new JSplitPane (JSplitPane.VERTICAL_SPLIT, null, null);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                    
+          pane = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, null, null);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                    
+
+          harness.checkPoint ("most general constructor");
           pane = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, false, null, null);
-          harness.checkPoint ("general constructor with 2 nulls");
           harness.check(pane.getLeftComponent() == null);
           harness.check(pane.getRightComponent() == null);                    
+          pane = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, true, null, null);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);        
+          pane = new JSplitPane (JSplitPane.VERTICAL_SPLIT, false, null, null);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                    
+          pane = new JSplitPane (JSplitPane.VERTICAL_SPLIT, true, null, null);
+          harness.check(pane.getLeftComponent() == null);
+          harness.check(pane.getRightComponent() == null);                                          
 	}
-
 }
Index: gnu/testlet/javax/swing/JSplitPane/setComponent.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/JSplitPane/setComponent.java,v
retrieving revision 1.1
diff -u -r1.1 setComponent.java
--- gnu/testlet/javax/swing/JSplitPane/setComponent.java	16 Nov 2005 20:46:29 -0000	1.1
+++ gnu/testlet/javax/swing/JSplitPane/setComponent.java	16 Nov 2005 21:27:44 -0000
@@ -39,16 +39,24 @@
           JButton button = new JButton();
 
           harness.checkPoint ("set left");
+          // try setting to null
           pane.setLeftComponent(null);
           harness.check (pane.getLeftComponent() == null);
+          // now set it to a real component
           pane.setLeftComponent(scroll);
           harness.check (pane.getLeftComponent() == scroll);
+          // now try setting it to null again
+          pane.setLeftComponent (null);
+          harness.check (pane.getLeftComponent() == null);
+
 
           harness.checkPoint ("set right");
           pane.setRightComponent(null);
           harness.check (pane.getRightComponent() == null);
           pane.setRightComponent(button);
           harness.check(pane.getRightComponent() == button);
+          pane.setRightComponent(null);
+          harness.check(pane.getRightComponent() == null);
 
 	}

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