maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Atluri Satish <atlurisat...@gmail.com>
Subject JCoverage Report always shows 0% Coverage
Date Mon, 11 Oct 2004 05:37:36 GMT
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>test@test.com</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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message