public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: Testing Abstract Classes
@ 2002-12-23 11:51 Artur Biesiadowski
  0 siblings, 0 replies; 3+ messages in thread
From: Artur Biesiadowski @ 2002-12-23 11:51 UTC (permalink / raw)
  To: Mauve Discuss

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: Re: Testing Abstract Classes --]
[-- Type: message/rfc822, Size: 1292 bytes --]

From: Artur Biesiadowski <abies00@wp.pl>
To: Mauve Discuss <mauve-discuss@sources.redhat.com>
Subject: Re: Testing Abstract Classes
Date: Mon, 23 Dec 2002 20:40:54 +0100
Message-ID: <3E0766C6.50603@wp.pl>

<div class="moz-text-flowed" style="font-family: -moz-fixed">Daryl Lee wrote:
> I ran JDK 1.1 tests of FileReader before noticing it was an abstract class.
> Since an abstract class can't be instantiated, is the notion of testing it
> meaningful?  If so, what would be a good general approach?  Pending an
> answer, I'm going to skip over this and all other abstracts.  

We are talking about testing implementation behavior, not interfaces.

Just create a test which subclasses FileReader and calls all 
non-abstract methods in parent class to check if their results are ok. 
You might need to implement some of abstract methods in meaningful way, 
but this can actually make testing easier.

Artur

</div>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Testing Abstract Classes
  2002-12-23 11:28 Daryl Lee
@ 2002-12-24  9:56 ` Dalibor Topic
  0 siblings, 0 replies; 3+ messages in thread
From: Dalibor Topic @ 2002-12-24  9:56 UTC (permalink / raw)
  To: Daryl Lee, Mauve Discuss


--- Daryl Lee <dlee@altaregos.com> wrote:
> I ran JDK 1.1 tests of FileReader before noticing it
> was an abstract class.
> Since an abstract class can't be instantiated, is
> the notion of testing it
> meaningful?  If so, what would be a good general
> approach?  Pending an
> answer, I'm going to skip over this and all other
> abstracts.  

You can create a wrapper class with stubbed abstract
methods, and use that to test the conditions on the
non-abstract methods hold. I've written some tests for
java.io.Reader in kaffe's regression test suite that
way.

best regards,

dalibor topic

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Testing Abstract Classes
@ 2002-12-23 11:28 Daryl Lee
  2002-12-24  9:56 ` Dalibor Topic
  0 siblings, 1 reply; 3+ messages in thread
From: Daryl Lee @ 2002-12-23 11:28 UTC (permalink / raw)
  To: Mauve Discuss

I ran JDK 1.1 tests of FileReader before noticing it was an abstract class.
Since an abstract class can't be instantiated, is the notion of testing it
meaningful?  If so, what would be a good general approach?  Pending an
answer, I'm going to skip over this and all other abstracts.  

-- 
Daryl Lee 
Open the present--it's a gift.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-24 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-23 11:51 Testing Abstract Classes Artur Biesiadowski
  -- strict thread matches above, loose matches on Subject: below --
2002-12-23 11:28 Daryl Lee
2002-12-24  9:56 ` Dalibor Topic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).