You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Carlos Sanchez <ca...@apache.org> on 2006/02/09 23:06:14 UTC

Creating mock objects for core components

Hi,

I think it'd be useful to create a project with mock objects, eg
Artifact, MavenProject,... as I have already seen some implementations
in plugins test (eg. jar plugin), to avoid repetition and make it easy
to test stuff. it doesn't mean start making mocks right now, but
setting up a place where to put the stuff as we make it.

What's the suggested approach?

a) create a new project with only mocks for each project already existing
  - maven-model-mock
  - maven-artifact-mock
  pros: clean api
  cons: many new projects

b) put the mocks in the test folder and deploy the test jars
  pros: no new projects, mocks are close to implementations, same lifecycle
  cons: dirty api, tests also included in jar, we should follow
backwards compatibility in tests, no way to say what is supposed to be
used and what not

c) create a new folder src/mock/main (and src/mock/test if we really need it)
  pros: both of the other two
  cons: change directory structure now ?

WDYT?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org