From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31989 invoked by alias); 13 Jan 2006 22:30:45 -0000 Received: (qmail 31978 invoked by uid 22791); 13 Jan 2006 22:30:43 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.de (HELO mail.gmx.net) (213.165.64.21) by sourceware.org (qpsmtpd/0.31) with SMTP; Fri, 13 Jan 2006 22:30:42 +0000 Received: (qmail invoked by alias); 13 Jan 2006 22:30:39 -0000 Received: from p5481B0E1.dip0.t-ipconnect.de (EHLO [192.168.0.203]) [84.129.176.225] by mail.gmx.net (mp030) with SMTP; 13 Jan 2006 23:30:39 +0100 X-Authenticated: #1941950 Message-ID: <43C82A98.4040801@gmx.de> Date: Fri, 13 Jan 2006 22:30:00 -0000 From: Wolfgang Baer User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) MIME-Version: 1.0 To: mauve-patches@sources.redhat.com Subject: FYI: New test for javax.print.attribute.standard.MediaSize Content-Type: multipart/mixed; boundary="------------000605080807060305030409" X-Y-GMX-Trusted: 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: 2006/txt/msg00017.txt.bz2 This is a multi-part message in MIME format. --------------000605080807060305030409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 430 Hi, this is a new test showing that our implementation is right :-) such that user constructed objects of subclasses of MediaSize are added to the static cache. Regards, Wolfgang 2006-01-13 Wolfgang Baer * gnu/testlet/javax/print/attribute/standard, * gnu/testlet/javax/print/attribute/standard/MediaSize: New directories. * gnu/testlet/javax/print/attribute/standard/MediaSize/userClass.java: New test. --------------000605080807060305030409 Content-Type: text/x-java; name="userClass.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="userClass.java" Content-length: 2066 //Tags: JDK1.4 //Copyright (C) 2006 Free Software Foundation, Inc. //Written by Wolfgang Baer (WBaer@gmx.de) //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, 51 Franklin Street, Fifth Floor, //Boston, MA, 02110-1301 USA. package gnu.testlet.javax.print.attribute.standard.MediaSize; import gnu.testlet.TestHarness; import gnu.testlet.Testlet; import javax.print.attribute.Size2DSyntax; import javax.print.attribute.standard.MediaSize; import javax.print.attribute.standard.MediaSizeName; /** * Test that user constructed MediaSize subclass objects * are added to the media cache used by static findMedia * and getMediaSizeForName methods. */ public class userClass implements Testlet { /** MediaSize subclass for test */ public class MyMediaSize extends MediaSize { public MyMediaSize(float x, float y, int units) { super(x, y, units); } } public void test(TestHarness harness) { // One with name is found as "best" match MediaSizeName name = MediaSize.findMedia(111f, 222f, Size2DSyntax.INCH); harness.check(name == MediaSizeName.JIS_B0); // Register a user MediaSize object MyMediaSize myMediaSize = new MyMediaSize(111f, 222f, Size2DSyntax.INCH); // Now if it is added to the cache it must be found by // findMedia as it is the exact match MediaSizeName name2 = MediaSize.findMedia(111f, 222f, Size2DSyntax.INCH); harness.check(name2 == null); } } --------------000605080807060305030409--