Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Testing Strategies

Currently, Maven only supports unit testing out of the box. What we want is something flexible enough to work without having to make test definitions arbitrary.

Types of Tests

Unit Tests

  • run before package
  • want 100% success before moving on generally

Integration Tests

  • require the artifact, so run after package but before install.
  • generally want 100% before moving on.
  • May use junit or other plugin like cactus, including deploying to a server

Acceptance Tests

  • also called functional or regression tests.
  • not run every time, probably a report and/or part of a profile.
  • run after install, before deploy
  • Regression tests (acceptance tests from previous milestones) should be at 100%
  • acceptance (also called functional) tests only need to get to 100% at release time.
  • performance/stress tests - another form of acceptance test.

Use cases

  • plugin integration tests (c.f. eclipse plugin)
  • report integration tests (see Vincent S's work - htmlunit)
  • cactus plugin
  • geronimo itest plugin
  • need to be able to compile additional sources, have own dependencies (basically reapply the whole test lifecycle again - given that this also matches the main one, perhaps that can be reusable/forked)
  • we should have a setup and teardown phase around the actual test goal
  • may want to reapply test stuff on other test sets (eg junit report, clover)

separate project is ideal, but

  • a bit unnatural, more strung out
  • doesn't fit IDE well
  • you can still use it if you support in project tests, so better to do that

While a separate project might be something we recommend, I think we need to support them within the same project.


Plugin integration tests

This means running a separate instance of Maven to do it effectively, so should always be separate projects utilising the built archive without requiring it be installed (bound to the integration test phase).

(question) How can we ensure the integration test of the subproject is run before installation of the parent?
(info) Perhaps it is better to have a plugin integration testing plugin that actually runs from the parent and execs maven on the subproject.

Report integration tests

This should be done in an identical fashion to a plugin integration test, but using htmlunit to test the output. This means having junit test cases.

  • No labels