Re: test data location question

2009-05-08 Thread Stephen Connolly
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

Re: test data location question

2009-05-07 Thread Pete Siemsen
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

Re: test data location question

2009-05-07 Thread Jeff MAURY
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

test data location question

2009-05-05 Thread Pete Siemsen
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

Re: test data location question

2009-05-05 Thread Jeff MAURY
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