Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] JUnit tip: How to have your own workspace and log


There is a "recommended pattern" to use in our test.xml files ... that has not been widely adopted. It's unlikely to really "fix" anything, but it might help in some cases, and in any case, might help diagnose problems when they do occur.

An example of this pattern is the one in the sse.core.tests, and I recently put in it one of our JUnit build reference:
http://wiki.eclipse.org/WTP_Adding_JUnits
or, to get the file directly from the wiki
http://wiki.eclipse.org/WTP_Adding_JUnits/ExampleTestXMLFile
(it's also in the cvs repository, of course, in sse.core.tests).

There's a few advantages to this pattern.

1. It makes sure your test suite runs in a new, fresh workspace, with a recognizable name (based on the name of  your test suite), which is what is usually desired. (Some tests currently default, for example, to "jst-workspace" or some such thing, and who knows what might have been left in there from a previous test).

2. It purposely does not delete the workspace after the suite finishes ... in case anyone every wants to peek at (or get) the workspace after a JUnit run, to try and diagnose some problem.

3. It does a slightly better job of capturing the log from your test suite. (linked from the test results page).

4. It minimizes the variables you need to specify or worry about ... there's just 3, or 4 in some cases ... all the rest should be fine to use as they are in the example file .. so, we'd all be more consistent.
Perhaps making it easier to transition to new ways of doing tests ... I'm still waiting for someone to do this as an extension point!  :)

There's no rocket science here, but might be a small improvement in consistent test results. If you think it might help, please give it a try when you get a chance.

Thanks,


Back to the top