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: Another JLayeredPane test


This improves my previous test for JLayeredPane.addImpl a little.

2006-01-30  Roman Kennke  <kennke@aicas.com>

        * gnu/testlet/javax/swing/JLayeredPane/addImp.java
        (testAddDifferentLayers): New test.

/Roman
Index: gnu/testlet/javax/swing/JLayeredPane/addImpl.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/JLayeredPane/addImpl.java,v
retrieving revision 1.1
diff -u -r1.1 addImpl.java
--- gnu/testlet/javax/swing/JLayeredPane/addImpl.java	30 Jan 2006 12:42:12 -0000	1.1
+++ gnu/testlet/javax/swing/JLayeredPane/addImpl.java	30 Jan 2006 13:00:06 -0000
@@ -45,6 +45,7 @@
   public void test(TestHarness harness)
   {
     testAddSameLayer(harness);
+    testAddDifferentLayers(harness);
   }
 
   /**
@@ -66,4 +67,24 @@
     h.check(l.getComponent(1), p2);
     h.check(l.getComponent(2), p3);
   }
+
+  /**
+   * Tests the addition of 3 components into different layers with -1
+   * positions.
+   *
+   * @param h the test harness to use
+   */
+  private void testAddDifferentLayers(TestHarness h)
+  {
+    JLayeredPane l = new JLayeredPane();
+    JPanel p1 = new JPanel();
+    JPanel p2 = new JPanel();
+    JPanel p3 = new JPanel();
+    l.add(p1, new Integer(0));
+    l.add(p2, new Integer(1));
+    l.add(p3, new Integer(2));
+    h.check(l.getComponent(0), p3);
+    h.check(l.getComponent(1), p2);
+    h.check(l.getComponent(2), p1);
+  }
 }

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