try putting your source and test source in separate directories. Some plugins (possibly jcoverage) don't deal well with them in the same tree.
The recommended structure is: src/main/java for sources src/test/java for test sources - Brett On Mon, 11 Oct 2004 11:07:36 +0530, Atluri Satish <[EMAIL PROTECTED]> wrote: > Hi > > I am trying to use JCoverage for a simple project, The JUNIT Test > cases written ensure 100% code-coverage , However the JCoverage report > always shows 0% coverage. > > I am using Maven 1.0, IBM JDK 1.3.1 Windows 32 build, JCoverage Plugin > 1.0.8 and please find Maven & Java files pasted below. > > I request your help in letting me know, where and what am I doing wrong. > > bye > Satish > > ******************************************************************************************** > M A V E N F I L E S > ******************************************************************************************* > ########################### > project.xml file > ############################ > <?xml version="1.0" encoding="UTF-8"?> > <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <pomVersion>3</pomVersion> > <id>TestMaven</id> > <name>TestMaven</name> > <currentVersion>1.0</currentVersion> > <organization> > <name>Test</name> > </organization> > <inceptionYear>2004</inceptionYear> > > <!-- Project Build Process --> > <build> > <nagEmailAddress>[EMAIL PROTECTED]</nagEmailAddress> > <sourceDirectory>${basedir}/src</sourceDirectory> > <unitTestSourceDirectory>${basedir}/src</unitTestSourceDirectory> > <!-- Unit Test Cases --> > > <unitTest> > <includes> > <include>**/*Test.java</include> > </includes> > </unitTest> > > </build> > > <!-- Reports --> > <reports> > <report>maven-junit-report-plugin</report> > <report>maven-jcoverage-plugin</report> > </reports> > </project> > > ########################### > project.propeties file > ############################ > ------------------------------------------------------------------------ > # xdoc Properties > # ------------------------------------------------------------------------ > maven.xdoc.date=left > maven.xdoc.includeProjectDocumentation = yes > maven.xdoc.version=${pom.currentVersion} > > #------------------------------------------------------------------------- > # JUNIT Properties > #-------------------------------------------------------------------------- > maven.junit.fork=yes > maven.junit.jvmargs=-Xmx512m > > #-------------------------------------------------------------------------- > # JCoverage Properties > #-------------------------------------------------------------------------- > maven.jcoverage.junit.fork=yes > maven.jcoverage.merge.outputDir=${basedir} > > ******************************************************************************************** > J A V A F I L E S > ******************************************************************************************* > ########################### > Java Test Fixture > ############################ > > public class TestSubject { > > public int add(int a,int b) > { > return a+b; > } > > public int substract(int a,int b) > { > return a-b; > } > > } > > ########################### > JUNIT Test Case > ############################ > > import junit.framework.TestCase; > public class TestSubjectTest extends TestCase { > > /** > * Constructor for TestSubjectTest. > * @param arg0 > */ > public TestSubjectTest(String arg0) { > super(arg0); > } > > public static void main(String[] args) { > junit.swingui.TestRunner.run(TestSubjectTest.class); > } > > public void testAdd() { > > TestSubject test = new TestSubject(); > assertEquals( > "Add Failure", > new Integer(test.add(5, 2)), > new Integer(7)); > } > > public void testsubstract() { > > TestSubject test = new TestSubject(); > assertEquals( > "Substration Failure", > new Integer(test.substract(5, 2)), > new Integer(3)); > } > > } > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
