I'm not sure how much detail you need, so I'll just do a brain dump -
let me know if I leave anything out.
--------------------
Running the tests:
In IntelliJ you can just open HtmlUnitDriverTestSuite or
JavascriptEnabledHtmlUnitDriverTestSuite, right click the suite()
method and select run. I don't use Eclipse, but I imagine it's just
as straight forward.
--------------------
Restricting which tests get run:
That will run the entire suite of tests. If you only want to a
single class, call the onlyRun() method on the TestSuiteBuilder:
return new TestSuiteBuilder()
.addSourceDir("common")
.onlyRun("XPathElementFindingTest")
.create();
You can also restrict the suite to specific methods (which do not have
to be in the same class) using the method() command:
return new TestSuiteBuilder()
.addSourceDir("common")
.method("testShouldTrimText")
.method("testCanCreateAWellFormedCookie")
.create();
--------------------
Test Setup:
There are two suites for HtmlUnit, one that requires JavaScript to be
enabled, the other with it disabled. Tests that require JavaScript
should be annotated with @JavascriptEnabled.
If you need any more info, please let me know :)
-- Jason