Jorg Heymans wrote:
Daniel Fagerstrom wrote:
It also makes sense from a "real blocks" POV as most of the directories
under trunk/src/ are or will become bundles. Eclipse organizes its
bundles in a flat way: http://dev.eclipse.org/viewcvs/index.cgi/.
So this means roughly 3 same-level directories per block right?
For example:
1)org.apache.cocoon.lucene
-> mavenized, osgi enabled Real Block or Bundle
-> Exported to m2 repo
2)org.apache.cocoon.lucene.samples
-> mavenized, non-osgi block with sitemap resources and java sources.
-> Explicit pom dependency on 1)
-> Not exported to the m2 repository
Yes, IIRC, we decided a while ago to have samples as separate blocks.
Carsten have allready done this for the portal. For the sample block I
think it will be a OSGi bundle and real block as well. It will have an
block.xml that describes where the sitemap is (and possibly other
things) and it will export sitemap functionality that will be mounted at
a certain point in the URI space.
3)org.apache.cocoon.lucene.test
-> mavenized, non-osgi block with (unit)tests for 1)
-> Explicit pom dependency on 1)
-> Not exported to the m2 repository
For unit tests I'm not certain about the best way to solve it. I think
that it might become unpractical to manage them without using OSGi, as
OSGi takes care about the classloading for blocks that depend on other
blocks, without OSGi we have to simulate its classloading behaviour. OTH
if we use OSGi, the block will need to export all packages that it want
to unit test, if the tests are in a separate block, this kills
isolation. Maybe we can have the unit tests inside the block and be able
to remove them when exporting to the M2 repo? Are there any "design
patterns" for unit testing Eclipse plugins that we can reuse?
For functional tests it makes sense to have a separate test block that
test the block from the "outside". Knopflerfish have a JUnit bundle that
supports such testing
http://www.knopflerfish.org/releases/1.3.3/jars/junit/junit_all-1.0.0.html,
http://www.knopflerfish.org/releases/1.3.3/jars/junit_runner/junit_runner_all-1.0.0.html.
/Daniel