From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12470 invoked by alias); 15 Jun 2006 14:23:30 -0000 Received: (qmail 12376 invoked by uid 22791); 15 Jun 2006 14:23: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; Thu, 15 Jun 2006 14:23: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.20060308/8.12.11) with ESMTP id k5FENPRa003135 for ; Thu, 15 Jun 2006 10:23:25 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k5FENP48028514 for ; Thu, 15 Jun 2006 10:23:25 -0400 Received: from [172.16.14.37] (toadstool.toronto.redhat.com [172.16.14.37]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k5FENPve025576 for ; Thu, 15 Jun 2006 10:23:25 -0400 Message-ID: <44916D5C.10608@redhat.com> Date: Thu, 15 Jun 2006 14:23:00 -0000 From: Kyle Galloway User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 To: mauve-patches@sources.redhat.com Subject: RFA JDWP TestOfClassOnlyFilter Content-Type: multipart/mixed; boundary="------------060709000206070903040505" 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/msg00407.txt.bz2 This is a multi-part message in MIME format. --------------060709000206070903040505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 253 Test for ClassOnlyFilter from JDWP. Requesting approval, and commit since I don't have access. Thanks, Kyle 2006-06-15 Kyle Galloway * gnu/testlet/gnu/classpath/jdwp/event/filters/ ClassOnlyFilter.java: New Test. --------------060709000206070903040505 Content-Type: text/x-patch; name="classonlyfilter.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="classonlyfilter.patch" Content-length: 4140 Index: gnu/testlet/gnu/classpath/jdwp/event/filters/TestOfClassOnlyFilter.java =================================================================== RCS file: gnu/testlet/gnu/classpath/jdwp/event/filters/TestOfClassOnlyFilter.java diff -N gnu/testlet/gnu/classpath/jdwp/event/filters/TestOfClassOnlyFilter.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/testlet/gnu/classpath/jdwp/event/filters/TestOfClassOnlyFilter.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,117 @@ +/* TestOfClassOnlyFilter.java -- test of ClassOnlyFilter + + Written by Kyle Galloway (kgallowa@redhat.com) + + 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.4 + + +package gnu.testlet.gnu.classpath.jdwp.event.filters; + +import gnu.classpath.jdwp.VMIdManager; +import gnu.classpath.jdwp.event.ClassPrepareEvent; +import gnu.classpath.jdwp.event.filters.ClassOnlyFilter; +import gnu.classpath.jdwp.exception.InvalidClassException; +import gnu.classpath.jdwp.id.ReferenceTypeId; +import gnu.testlet.TestHarness; +import gnu.testlet.Testlet; + +public class TestOfClassOnlyFilter + implements Testlet +{ + /** + * Tests the ClassOnlyFilter constructor + * + * @param harness the TestHarness to use + */ + public void testConstructor(TestHarness harness) + { + harness.checkPoint("Constructor"); + + VMIdManager idm = VMIdManager.getDefault(); + ReferenceTypeId validTestId = idm.getReferenceTypeId(Integer.class); + + try + { + ClassOnlyFilter testCOF = new ClassOnlyFilter(validTestId); + harness.check(true, "Constructor successful"); + } + catch (InvalidClassException ex) + { + harness.check(false, "Constructor failed with exception" + ex); + } + + } + + /** + * Tests the ClassOnlyFilter matches method + * + * @param harness the TestHarness to use + */ + public void testMatches(TestHarness harness) + { + harness.checkPoint("matches method"); + + VMIdManager idm = VMIdManager.getDefault(); + ReferenceTypeId testId = idm.getReferenceTypeId(Integer.class); + + try + { + ClassOnlyFilter testCOF = new ClassOnlyFilter(testId); + ClassPrepareEvent testEvent = new ClassPrepareEvent( + Thread.currentThread(), + Integer.class, 0); + + harness.check(testCOF.matches(testEvent), "test correct refid"); + } + catch (InvalidClassException ex) + { + harness.check(false, "Constructor(in methods test) failed with" + + "exception" + ex); + } + + try + { + ClassOnlyFilter testCOF = new ClassOnlyFilter(testId); + ClassPrepareEvent testEvent = new ClassPrepareEvent( + Thread.currentThread(), + String.class, 0); + + harness.check(! testCOF.matches(testEvent), "test wrong refid"); + } + catch (InvalidClassException ex) + { + harness.check(false, "Constructor(in methods test) failed with" + + "exception" + ex); + } + } + + /** + * Test the ClassOnlyFilter class + * + * @param harness the TestHarness to use + */ + public void test(TestHarness harness) + { + testConstructor(harness); + testMatches(harness); + } +} --------------060709000206070903040505--