From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29615 invoked by alias); 20 Oct 2005 20:25:54 -0000 Mailing-List: contact mauve-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-discuss-owner@sources.redhat.com Received: (qmail 29595 invoked by uid 22791); 20 Oct 2005 20:25:50 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 20 Oct 2005 20:25:50 +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 j9KKPmT8019512 for ; Thu, 20 Oct 2005 16:25:48 -0400 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 j9KKPmV24113 for ; Thu, 20 Oct 2005 16:25:48 -0400 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 j9KKPmSh031861 for ; Thu, 20 Oct 2005 16:25:48 -0400 Subject: FYI: New test for DefaultListSelectionModel From: Anthony Balkissoon To: mauve-discuss@sources.redhat.com Content-Type: multipart/mixed; boundary="=-q3RNbf3eMrcUnLS0hB9g" Date: Thu, 20 Oct 2005 20:25:00 -0000 Message-Id: <1129839947.2838.120.camel@tony.toronto.redhat.com> Mime-Version: 1.0 X-SW-Source: 2005-q4/txt/msg00016.txt.bz2 --=-q3RNbf3eMrcUnLS0hB9g Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 398 This test checks to see if DefaultListSelectionModel.setLeadSelectionIndex checks the selection mode to see if extending the selection is allowed. We currently fail this test. 2005-10-20 Anthony Balkissoon * gnu/testlet/javax/swing/DefaultListSelectionModel: New directory. * gnu/testlet/javax/swing/DefaultListSelectionModel/leadSelectionIndex.java: New test. --Tony --=-q3RNbf3eMrcUnLS0hB9g Content-Disposition: attachment; filename=leadSelectionIndex.java Content-Type: text/x-java; name=leadSelectionIndex.java; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 1809 //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, 59 Temple Place - Suite 330, //Boston, MA 02111-1307, USA. package gnu.testlet.javax.swing.DefaultListSelectionModel; import gnu.testlet.Testlet; import gnu.testlet.TestHarness; import javax.swing.JList; import javax.swing.DefaultListModel; import javax.swing.ListSelectionModel; /** * Tests if DefaultListSelectionModel.setLeadSelectionIndex checks the selection * mode to see if it should extend the selection or set the selection. */ public class leadSelectionIndex implements Testlet { public void test(TestHarness harness) { DefaultListModel v = new DefaultListModel(); v.addElement("0"); v.addElement("1"); v.addElement("2"); v.addElement("3"); v.addElement("4"); JList a = new JList(v); a.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); a.setSelectedIndex(1); a.getSelectionModel().setLeadSelectionIndex(3); if (!(a.getSelectedIndices().length == 1 && a.getSelectedIndices()[0] == 3)) harness.fail("setLeadSelectionIndex should check the selection mode"); } } --=-q3RNbf3eMrcUnLS0hB9g--