use getResource to get the URL of the resource and then parsethe URL
to find the file path
On 07/05/2009, Pete Siemsen siem...@ucar.edu wrote:
That seems reasonable, but I still don't understand how to make it work.
The program I'm trying to test is like a compiler. It reads source
files
That seems reasonable, but I still don't understand how to make it work.
The program I'm trying to test is like a compiler. It reads source
files that can contain include statements. When it parses such a
statement, the program needs to open the include file and start
parsing statements
Your compiler should be aware of the resource it is working on and not only
of the input stream. This is a common case when dealing with embeded
resource. Look at XML parsers for example.
Regards
Jeff MAURY
On Fri, May 8, 2009 at 12:39 AM, Pete Siemsen siem...@ucar.edu wrote:
That seems
This is a basic question about how to run Java unit tests that require
file names.
I use maven to develop a program that reads an input file names from
the command line. It's working fine, but now I want to share the code
with someone else. The test programs live in ../src/test/java, and
You should store your files under src/test/resources and load your files
using getResourceAsStream
Regards
Jeff MAURY
On Tue, May 5, 2009 at 11:37 PM, Pete Siemsen siem...@ucar.edu wrote:
This is a basic question about how to run Java unit tests that require file
names.
I use maven to