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 the test data lives in ../src/test/data. Until now, I've used fully- qualified paths hard-coded into my test programs, like /Users/siemsen/ TranslateCIM/src/test/data/cim/testArrayTypeOnNonArray/testATONA.mof.

If I tar up my development directory and give it to someone else, the fully-qualified paths obviously don't work. I want to make the paths relative somehow. The program reads an input file that may contain "include" statements that cause the program to open other files relative to the first input file. It seems to my newbie eyes that using resources and getResourceAsStream won't allow me to open subfiles.

What I think I want is a runtime environment variable or something that tells me the path to the maven development directory.

Any suggestion would be appreciated.

-- Pete




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to