4. General Problems

  1. My test only passes if I don't use jtreg to run it. Why does it fail in jtreg?
  2. How do I set the CLASSPATH environment variable for my test?
  3. Why don't you just pass all of my shell environment variables to the JVM running the test?
  4. Why is the default to run tests in another JVM?
  5. Why would I ever want to run in the same JVM?
  6. Should a test call the System.exit method?
  7. My test only applies to one platform and it will fail/not run in others. How do I prevent the harness from running it on the wrong platform?
  8. How can I make applet and main action tests read from data files?
  9. Can I use package statements in my tests?
  10. Why can't multiple test source files in the same directory have package-private classes of the same name?
  11. Should a test catch Throwable, Exception, or Error?
  12. My test requires that I use information printed to System.out or System.err to determine whether a test passed or failed. When I run my test in the harness, I can't seem to find these output streams.
  13. My test does tricky things that are not supported by jtreg. Can I still write a regression test?
  14. What happens if my test returns when there are still threads running?
  15. If my bug hasn't been fixed, and the test is run, the JVM crashes. How do I make sure that the test doesn't cause the harness to crash?
  16. The JavaTest harness is running into problems running the test because of issues with the JDK I'm trying to test. What can I do?
  17. My test requires that I install my own security manager, but it appears that the JavaTest harness has already installed one. What do I do?
  18. Can I automate running regtests or can I run the tests on a regular basis?
  19. I run all (or a huge part) of the regression test suite as part of a cron job or other nightly process. I'd like to generate my own reports or I'd like to send myself e-mail whenever a test fails. Do I have to parse the verbose output or the .jtr file?