commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: [math] stupid question about test input files
Date Wed, 14 May 2003 15:59:29 GMT

On Wed, 14 May 2003, Phil Steitz wrote:

> Date: Wed, 14 May 2003 08:11:05 -0700
> From: Phil Steitz <>
> Reply-To: Jakarta Commons Developers List <>
> To: Jakarta Commons Developers List <>
> Subject: [math] stupid question about test input files
> I am bundling up my RandomData, EmpiricalDistribution and ValueServer
> classes for submission and the last two can take file input data.  The
> test cases need to read from a test data file.  Can I assume that this
> file will be available to the test cases with no path spec?

A plain filename with no path will be assumed to exist in the directory
from which the tests are run -- not necessarily a good assumption.

FWIW, I normally deal with this sort of thing by including the test files
in the same package source directory as the test case itself, make sure
they get copied to the output "classes" directory, and use
ClassLoader.getResourceAsStream() to load them.  The test cases for
Digester (among others) use that approach.

> Phil


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message