-
1. Re: Seam with Maven
kapitanpetko Feb 20, 2009 9:41 AM (in response to walterjwhite)If you have 'pure' unit tests, that don't need Seam to be started, you can simply put your tests in your project (src/test/java) and you
will get Cobertura coverage by running cobertura:cobertura. If you, however, want to use SeamTest (starts Seam, you get bijection, conversations, the whole lot), you will need components.xml, pages.xml, etc, so it's easier to put your SeamTest's in your web project (assuming the structure in the above page). But since the Cobertura Maven plugin instruments only the classes in the current project, so you won't get full coverage (you get coverage only for the classes in the web project). Hence the need to replace dependent-on jars with instrumented ones.Not sure what you mean by 'one for each parent' and 'a core project in which can be independently tested'. Do you have one more applications?
Are those EAR's or WAR's? -
2. Re: Seam with Maven
walterjwhite Feb 20, 2009 11:36 PM (in response to walterjwhite)Hi Nikolay,
Thanks for your reply.
I would like to run both unit and integration tests.
What I meant was, I have several projects which make up my web project:
file operations
Seam (adds entities, various actions (login, register, forgot password, etc.), and auditing)
Web Content project (depends on Seam, adds web entities (nodes, wiki pages, comments, etc.))Prior to me using Seam, I was using Spring in which case, I could test the application or module at each stage as a unit and integration test. I want to switch to Seam as the application is a lot smaller yet more robust. The issue that I am having is, by having separated my projects this way, I cannot test each individual project.
These sub-projects also are used in another web application for a slightly different purpose. I am using maven as my project management tool, so my projects look like this:
web app 1
fileIo
seamCore
webContent
business
actual web pages, configuration for web appweb app 2
fileIo
seamCore
webContent
actual web pages, configuration for web appIf I would configure those sub-projects as modules, which also works, I would have to have 2 poms for each module, right? What is the best way to make those modules or dependencies able to be used in other projects without causing clutter and allowing me to unit/integration test each project?
I want to minimize duplication of effort, so copying poms doesn't seem like a very robust solution as they are really not 2 separate artifacts, and doing it the way I have now does not follow the example on the seam website.
Any ideas or comments are helpful. Please let me know if this is still unclear.
Thanks,
Walter -
3. Re: Seam with Maven
kapitanpetko Feb 23, 2009 3:35 AM (in response to walterjwhite)
Walter White wrote on Feb 20, 2009 23:36:
These sub-projects also are used in another web application for a slightly different purpose. I am using maven as my project management tool, so my projects look like this:web app 1 fileIo seamCore webContent business actual web pages, configuration for web app web app 2 fileIo seamCore webContent actual web pages, configuration for web app
If I would configure those sub-projects as modules, which also works, I would have to have 2 poms for each module, right? What is the best way to make those modules or dependencies able to be used in other projects without causing clutter and allowing me to unit/integration test each project?If your modules (fileIo, seamCore, business) are regular JAR's, I don't see a reason not to have them as modules.
You can have two webapps, each depending on the modules it needs. You will need a single POM for each module, two POM's for each webapp,
and possibly a parent POM. Something like:my-parent/pom.xml | +- fileIo/ | +- seamCore/ | +- business/ | +- web-app1/ | | | +- src/main/webapp: actual web pages, configuration for web app | +- web-app2/ | +- src/main/webapp: actual web pages, configuration for web app
You can then test fileIo, seamCore and business independently and have any additional/specific tests in web-app1/2.
I am not a Maven expert, but that seems the natural way to structure your project. Depending on other constraints you may have,
YMMV, of course. -
4. Re: Seam with Maven
xmlaura Jul 13, 2012 4:34 AM (in response to walterjwhite)Hi
i have similar but little bit different issue, i have repo from two projects, both with submodules, and the
parent1/pom.xml
|
+-
batchApp -(main+test)|
+-
webAppparent2/pom.xml
|
+-
DBUtil (main+test)|
+-
kid2.2So src/tests in batchApp/test of parent1 will run tests cover code inside src/main of DBUtil of parent2, can I follow the same in the http://seamframework.org/Documentation/SeamTestCoverageWithCobertura, the
(almost) No Ant Solution for
- In project-ejb and project-common define the following profile: ....
- In your project-web define the following profile: ...
Appreciate any comments/help!!!