I have ProjectOuter which depends on ProjectCore. However, many of the tests
of ProjectCore are placed in ProjectOuter. ProjectOuter has a large bunch of
enterprise level initializations and dependencies, etc which is utilized by
the BaseTestCase(present in ProjectOuter). Every test case then extends the
BaseTestCase - including those testcases which actually test functionality
placed in ProjectCore.

Not the recommended unit test design I guess, but it's been like that
historically and we don't have immediate bandwidth to correct it since it
would require a lot of rework :(

Now my problem is that the code coverage report shows very low percentage
for ProjectCore as a large part of the testcases are in ProjectOuter. The
workaround I have found is
- Place a 'test' scope dependency of ProjectCore on ProjectOuter
- In pom, for main profile, skip test-compile during the compile phase
- In pom, for coverage profile, do not skip testC-compile during compile
Now, to get coverage, I'd need to build with maven clean install using main
profile, followed by maven test using coverage profile.

Do you have any better suggestions to solve the problem? ( I'd prefer not
calling two separate maven commands from two profiles to get coverage)

View this message in context: http://maven.40175.n5.nabble.com/Test-scope-to-avoid-cyclic-dependency-tp5729481.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
postedNov 5, '12 at 12:40p
activeNov 5, '12 at 12:40p

1 user in discussion

Zebahmad: 1 post



site design / logo © 2021 Grokbase