From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32477 invoked by alias); 6 Nov 2006 20:12:40 -0000 Received: (qmail 32469 invoked by uid 22791); 6 Nov 2006 20:12:39 -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; Mon, 06 Nov 2006 20:12:35 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kA6KCXYb030487 for ; Mon, 6 Nov 2006 15:12:33 -0500 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id kA6KCWur016161 for ; Mon, 6 Nov 2006 15:12:32 -0500 Received: from toothpaste.toronto.redhat.com (toothpaste.toronto.redhat.com [172.16.14.161]) by pobox.toronto.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kA6KCVRF004134 for ; Mon, 6 Nov 2006 15:12:31 -0500 Subject: FYI: New TextComponent test From: Tania Bento To: mauve-patches@sources.redhat.com Content-Type: multipart/mixed; boundary="=-MlALA6k4IYPfnt7elO8+" Date: Mon, 06 Nov 2006 20:12:00 -0000 Message-Id: <1162843951.29838.41.camel@toothpaste.toronto.redhat.com> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 (2.6.3-1.fc5.5) 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: 2006/txt/msg00725.txt.bz2 --=-MlALA6k4IYPfnt7elO8+ Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 218 Hey, This adds a new test for java.awt.TextComponent.setSelectionStart(int). Cheers, Tania 2006-11-06 Tania Bento * gnu/testlet/java/awt/TextComponent/setSelectionStart.java: New test --=-MlALA6k4IYPfnt7elO8+ Content-Disposition: attachment; filename=patch.diff Content-Type: text/x-patch; name=patch.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 2645 Index: gnu/testlet/java/awt/TextComponent/setSelectionStart.java =================================================================== RCS file: gnu/testlet/java/awt/TextComponent/setSelectionStart.java diff -N gnu/testlet/java/awt/TextComponent/setSelectionStart.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/testlet/java/awt/TextComponent/setSelectionStart.java 6 Nov 2006 20:10:48 -0000 @@ -0,0 +1,70 @@ +/* setSelectionStart.java + Copyright (C) 2006 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. + +*/ + +// Tags: JDK1.1 + +package gnu.testlet.java.awt.TextComponent; + +import java.awt.TextComponent; +import java.awt.TextField; + +import gnu.testlet.TestHarness; +import gnu.testlet.Testlet; + +public class setSelectionStart implements Testlet +{ + + public void test(TestHarness harness) + { + TextComponent textComp = new TextField(); + + // Check that default value is correct. + harness.check(textComp.getSelectionStart(), 0); + harness.check(textComp.getSelectionEnd(), 0); + + // Check behaviour when setting text. + textComp.setText("This is some text."); + harness.check(textComp.getSelectionStart(), 0); + harness.check(textComp.getSelectionEnd(), 0); + + // Check behaviour when start < 0. + textComp.setSelectionStart(-6); + harness.check(textComp.getSelectionStart(), 0); + harness.check(textComp.getSelectionEnd(), 0); + + // Check behaviour when start = end + textComp.setSelectionStart(0); + harness.check(textComp.getSelectionStart(), 0); + harness.check(textComp.getSelectionEnd(), 0); + + // Check behaviour when start > end + textComp.setSelectionStart(13); + harness.check(textComp.getSelectionStart(), 13); + harness.check(textComp.getSelectionEnd(), 13); + + // Check behaviour when start < end + textComp.setSelectionStart(9); + harness.check(textComp.getSelectionStart(), 9); + harness.check(textComp.getSelectionEnd(), 13); + + } + +} --=-MlALA6k4IYPfnt7elO8+--