From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31676 invoked by alias); 6 Dec 2005 16:25:30 -0000 Received: (qmail 31641 invoked by uid 22791); 6 Dec 2005 16:25:29 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 06 Dec 2005 16:25:27 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id jB6GPPpf023322 for ; Tue, 6 Dec 2005 11:25:25 -0500 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id jB6GPPV28890 for ; Tue, 6 Dec 2005 11:25:25 -0500 Received: from tony.toronto.redhat.com (tony.toronto.redhat.com [172.16.14.158]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id jB6GPObs028229 for ; Tue, 6 Dec 2005 11:25:24 -0500 Subject: New test for BorderLayout From: Anthony Balkissoon To: mauve-patches@sources.redhat.com Content-Type: multipart/mixed; boundary="=-OWUzOqLxFJeaviwsb/c8" Date: Tue, 06 Dec 2005 16:25:00 -0000 Message-Id: <1133886324.27405.120.camel@tony.toronto.redhat.com> Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact mauve-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-patches-owner@sourceware.org X-SW-Source: 2005/txt/msg00247.txt.bz2 --=-OWUzOqLxFJeaviwsb/c8 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 282 Classpath currently fail most of these tests and also have an unexpected exception. I'm sending up a patch that makes classpath pass all these tests. 2005-12-06 Anthony Balkissoon * gnu/testlet/java/awt/BorderLayout/maxLayoutSize.java: New file. --Tony --=-OWUzOqLxFJeaviwsb/c8 Content-Disposition: attachment; filename=BorderLayoutMaxLayout.diff Content-Type: text/x-patch; name=BorderLayoutMaxLayout.diff; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 3068 Index: gnu/testlet/java/awt/BorderLayout/maxLayoutSize.java =================================================================== RCS file: gnu/testlet/java/awt/BorderLayout/maxLayoutSize.java diff -N gnu/testlet/java/awt/BorderLayout/maxLayoutSize.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/testlet/java/awt/BorderLayout/maxLayoutSize.java 6 Dec 2005 16:16:00 -0000 @@ -0,0 +1,74 @@ +// Tags: JDK1.2 + +// Copyright (C) 2005 Red Hat. + +// 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. + +package gnu.testlet.java.awt.BorderLayout; + +import gnu.testlet.TestHarness; +import gnu.testlet.Testlet; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.LayoutManager2; + +import javax.swing.JPanel; +import javax.swing.JTextField; + +/** + * Some checks for the maximumLayoutSize() method in the + * {@link BorderLayout} class. + */ +public class maxLayoutSize implements Testlet +{ + + /** + * Runs the test using the specified harness. + * + * @param harness the test harness (null not permitted). + */ + public void test(TestHarness harness) + { + JTextField ftf = new JTextField("HELLO WORLD"); + JPanel borderPanel = new JPanel(new java.awt.BorderLayout()); + borderPanel.add(ftf); + LayoutManager2 lm = (LayoutManager2) borderPanel.getLayout(); + Dimension max = new Dimension (Integer.MAX_VALUE, Integer.MAX_VALUE); + + // Check that the layout manager returns Integer.MAX_VALUE for both + // max dimensions, regardless of whether or not there's a border + harness.check (lm.maximumLayoutSize(borderPanel), max); + borderPanel.setBorder(new javax.swing.border.TitledBorder("HELLO WORLD")); + harness.check (lm.maximumLayoutSize(borderPanel), max); + + // Check that maximumLayoutSize isn't affected by the layout size of + // the contained components + ftf.setMaximumSize(new Dimension (0,0)); + harness.check (lm.maximumLayoutSize(borderPanel), max); + + // Check that maximumLayoutSize returns Integer.MAX_VALUE even for null + // arguments + harness.check (lm.maximumLayoutSize(null), max); + + // Check that a brand new BorderLayout unassociated with any Component + // also returns Integer.MAX_VALUE for a null argument. + BorderLayout bl = new BorderLayout(); + harness.check (bl.maximumLayoutSize(null), max); + } +} --=-OWUzOqLxFJeaviwsb/c8--