This is an example project layout that shows one way to organise Tapestry pages, components and tests. Some of this is my personal choice but I'll present everything and you can choose what you like. Note that it assumes the Maven project layout.
+---src +---main | +---java | | +---myproject | | +---tapestry | | +---components | | | MyComponent.java | | | MyComponent.tml | | | | | +---pages | | | MyPage.java | | | MyPage.tml | | | | | +---services | | AppModule.java | | | +---resources | log4j.properties | | +---test +---conf | testng.xml | +---java +---test +---myproject +---tapestry +---components | MyComponentTest.java | +---demo | | DemoModule.java | | | +---pages | MyComponentDemo.tml | MyComponentDemo.java | +---pages | MyPageTest.java | +---testsupport AbstractMyProjectTapestryTest.java TestInfrastructureModule.java
To make Maven allow this you need to add the following to your pom (you may need to tweak the 'includes' and 'excludes' rules depending on what you have in your source folders)
<resources> <resource> <directory>src/main/resources</directory> <filtering>false</filtering> </resource> <resource> <directory>src/main/java</directory> <excludes> <exclude>**/*.java</exclude> </excludes> <filtering>false</filtering> </resource> </resources> <testResources> <testResource> <directory>src/test/resources</directory> <filtering>false</filtering> </testResource> <testResource> <directory>src/test/java</directory> <excludes> <exclude>**/*.java</exclude> </excludes> <filtering>false</filtering> </testResource> </testResources>
This makes it easy to find the tests but also keeps them separate from a Java runtime point-of-view.
FYI, the Eclipse plugin MoreUnit () makes it easy to jump between classes and tests and understands this convention.