You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/04/28 07:30:52 UTC

svn commit: r165101 - in /directory/network/trunk: maven.xml project.properties project.xml src/test/org/apache/mina/examples/echoserver/AcceptorTest.java src/test/org/apache/mina/examples/echoserver/ConnectorTest.java

Author: trustin
Date: Wed Apr 27 22:30:50 2005
New Revision: 165101

URL: http://svn.apache.org/viewcvs?rev=165101&view=rev
Log:
Added EMMA coverage report


Modified:
    directory/network/trunk/maven.xml
    directory/network/trunk/project.properties
    directory/network/trunk/project.xml
    directory/network/trunk/src/test/org/apache/mina/examples/echoserver/AcceptorTest.java
    directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java

Modified: directory/network/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/directory/network/trunk/maven.xml?rev=165101&r1=165100&r2=165101&view=diff
==============================================================================
--- directory/network/trunk/maven.xml (original)
+++ directory/network/trunk/maven.xml Wed Apr 27 22:30:50 2005
@@ -1,96 +1,154 @@
 <project
-	default="test"
+  default="test"
   xmlns:define="jelly:define"
-	xmlns:ant="jelly:ant"
-	xmlns:doc="doc"
+  xmlns:ant="jelly:ant"
+  xmlns:doc="doc"
   xmlns:j="jelly:core"  
   xmlns:jxr="jxr"
   xmlns:maven="jelly:maven"
   xmlns:util="jelly:util">
 
-<!--
-	<define:taglib uri="jxr">
-		<define:jellybean
-			name="jxr"
-			className="org.apache.maven.jxr.JxrBean"
-			method="xref" />
-	</define:taglib>
--->
-
-	<preGoal name="java:compile">
-		<ant:path id="my.other.src.dir" location="${basedir}/src/examples"/>
-		<maven:addPath id="maven.compile.src.set" refid="my.other.src.dir"/>
-	</preGoal>
-
-	<postGoal name="maven-javadoc-plugin:register">
-		<doc:registerReport 
-			name="Example JavaDocs" 
-			pluginName="maven-javadoc-plugin"
-			link="apidocs-examples/index"
-			target="_blank"
-			description="Example JavaDoc API documentation."/>
-	</postGoal>
-
-	<postGoal name="maven-javadoc-plugin:report">
-		<ant:copy todir="${basedir}/target/javadoc/src">
-			<ant:fileset dir="${basedir}/src/java">
-				<ant:include name="**/*.java" />
-				<ant:include name="**/*.html" />
-				<ant:include name="**/doc-files/**/*" />
-			</ant:fileset>
-		</ant:copy>
-		<ant:javadoc
-			packagenames="org.apache.mina.examples.*"
-			sourcepath="${basedir}/src/examples"
-			destdir="${maven.docs.dest}/apidocs-examples" />
-	</postGoal>
-	<postGoal name="maven-jxr-plugin:register">
-		<doc:registerReport 
-			name="Examples Xref" 
-			pluginName="maven-jxr-plugin" 
-			link="xref-examples/index"
-			target="_blank"
-			description="A set of browsable cross-referenced example sources."/>
-	</postGoal>
-	
-	<postGoal name="maven-jxr-plugin:report">
-		<maven:pluginVar var="javadocDestdir" plugin='maven-javadoc-plugin' property='maven.javadoc.destdir'/>
-		<maven:pluginVar var="stylesheetPath" plugin='maven-jxr-plugin' property='maven.jxr.stylesheet'/>
-		<maven:pluginVar var="templatePath" plugin='maven-jxr-plugin' property='maven.jxr.templateDir'/>
-
-		<j:set var="maven.jxr.destdir.examples"
-			value="${maven.docs.dest}/xref-examples" />
-
-		<j:set var="copyright"
-			value="Copyright &amp;copy; ${year} ${pom.organization.name}. All Rights Reserved." />
-
-		<j:set var="title" value="${pom.name} ${pom.currentVersion} Reference" />
-
-		<ant:mkdir dir="${maven.jxr.destdir.examples}" />
-		<ant:copy file="${stylesheetPath}"
-			tofile="${maven.jxr.destdir.examples}/stylesheet.css"/>
-
-		<jxr:jxr
-			sourceDir="${basedir}/src/examples"
-			destDir="${maven.jxr.destdir.examples}"
-			templateDir="${templatePath}"
-			javadocDir="${javadocDestdir}"
-			windowTitle="${title}"
-			docTitle="${title}"
-			bottom="${copyright}">
-		</jxr:jxr>
-	</postGoal>
-
-	<preGoal name="dist:build-src">
-		<ant:copy todir="${maven.dist.src.assembly.dir}">
-			<ant:fileset dir=".">
-				<ant:include name="xdocs/**"/>
-			</ant:fileset>
-		</ant:copy>
-	</preGoal>
-
-	<preGoal name="dist:build-bin">
-		<attainGoal name="site"/>
-	</preGoal>
-
+  <preGoal name="java:compile">
+    <ant:path id="my.other.src.dir" location="${basedir}/src/examples"/>
+    <maven:addPath id="maven.compile.src.set" refid="my.other.src.dir"/>
+  </preGoal>
+
+  <postGoal name="maven-javadoc-plugin:register">
+    <doc:registerReport 
+      name="Example JavaDocs" 
+      pluginName="maven-javadoc-plugin"
+      link="apidocs-examples/index"
+      target="_blank"
+      description="Example JavaDoc API documentation."/>
+  </postGoal>
+
+  <postGoal name="maven-javadoc-plugin:report">
+    <ant:copy todir="${basedir}/target/javadoc/src">
+      <ant:fileset dir="${basedir}/src/java">
+        <ant:include name="**/*.java" />
+        <ant:include name="**/*.html" />
+        <ant:include name="**/doc-files/**/*" />
+      </ant:fileset>
+    </ant:copy>
+    <ant:javadoc
+      packagenames="org.apache.mina.examples.*"
+      sourcepath="${basedir}/src/examples"
+      destdir="${maven.docs.dest}/apidocs-examples" />
+  </postGoal>
+  <postGoal name="maven-jxr-plugin:register">
+    <doc:registerReport 
+      name="Examples Xref" 
+      pluginName="maven-jxr-plugin" 
+      link="xref-examples/index"
+      target="_blank"
+      description="A set of browsable cross-referenced example sources."/>
+  </postGoal>
+  
+  <postGoal name="maven-jxr-plugin:report">
+    <maven:pluginVar var="javadocDestdir" plugin='maven-javadoc-plugin' property='maven.javadoc.destdir'/>
+    <maven:pluginVar var="stylesheetPath" plugin='maven-jxr-plugin' property='maven.jxr.stylesheet'/>
+    <maven:pluginVar var="templatePath" plugin='maven-jxr-plugin' property='maven.jxr.templateDir'/>
+
+    <j:set var="maven.jxr.destdir.examples"
+      value="${maven.docs.dest}/xref-examples" />
+
+    <j:set var="copyright"
+      value="Copyright &amp;copy; ${year} ${pom.organization.name}. All Rights Reserved." />
+
+    <j:set var="title" value="${pom.name} ${pom.currentVersion} Reference" />
+
+    <ant:mkdir dir="${maven.jxr.destdir.examples}" />
+    <ant:copy file="${stylesheetPath}"
+      tofile="${maven.jxr.destdir.examples}/stylesheet.css"/>
+
+    <jxr:jxr
+      sourceDir="${basedir}/src/examples"
+      destDir="${maven.jxr.destdir.examples}"
+      templateDir="${templatePath}"
+      javadocDir="${javadocDestdir}"
+      windowTitle="${title}"
+      docTitle="${title}"
+      bottom="${copyright}">
+    </jxr:jxr>
+  </postGoal>
+
+  <preGoal name="dist:build-src">
+    <ant:copy todir="${maven.dist.src.assembly.dir}">
+      <ant:fileset dir=".">
+        <ant:include name="xdocs/**"/>
+      </ant:fileset>
+    </ant:copy>
+  </preGoal>
+
+  <preGoal name="dist:build-bin">
+    <attainGoal name="site"/>
+  </preGoal>
+
+  <!-- EMMA Hooks -->
+  <goal name="emma:backup-main">
+    <ant:copy todir="${maven.build.dest}.orig">
+      <ant:fileset dir="${maven.build.dest}"/>
+    </ant:copy>
+  </goal>
+  <goal name="emma:backup-test">
+    <ant:copy todir="${maven.test.dest}.orig">
+      <ant:fileset dir="${maven.test.dest}"/>
+    </ant:copy>
+  </goal>
+
+  <goal name="emma:restore-main">
+    <ant:delete dir="${maven.build.dest}.emma"/>
+    <ant:move todir="${maven.build.dest}.emma">
+      <ant:fileset dir="${maven.build.dest}" />
+    </ant:move>
+    <ant:move todir="${maven.build.dest}">
+      <ant:fileset dir="${maven.build.dest}.orig"/>
+    </ant:move>
+  </goal>
+  <goal name="emma:restore-test">
+    <ant:delete dir="${maven.test.dest}.emma"/>
+    <ant:move todir="${maven.test.dest}.emma">
+      <ant:fileset dir="${maven.test.dest}" />
+    </ant:move>
+    <ant:move todir="${maven.test.dest}">
+      <ant:fileset dir="${maven.test.dest}.orig"/>
+    </ant:move>
+  </goal>
+
+  <preGoal name="emma:replace-product-classes">
+    <j:if test="${context.getVariable('maven.emma.inreport') != 'true'}">
+      <attainGoal name="emma:backup-main"/>
+    </j:if>
+  </preGoal>
+  <postGoal name="emma:replace-product-classes">
+    <j:if test="${context.getVariable('maven.emma.inreport') != 'true'}">
+      <attainGoal name="emma:restore-main"/>
+    </j:if>
+  </postGoal>
+
+  <preGoal name="emma:replace-testing-classes">
+    <j:if test="${context.getVariable('maven.emma.inreport') != 'true'}">
+      <attainGoal name="emma:backup-test"/>
+    </j:if>
+  </preGoal>
+  <postGoal name="emma:replace-testing-classes">
+    <j:if test="${context.getVariable('maven.emma.inreport') != 'true'}">
+      <attainGoal name="emma:restore-test"/>
+    </j:if>
+  </postGoal>
+
+  <preGoal name="emma:realreport">
+    <attainGoal name="test:compile"/>
+    <attainGoal name="emma:backup-main"/>
+    <attainGoal name="emma:backup-test"/>
+    <echo>Turning on EMMA for report generation.</echo>
+    <ant:property name="maven.emma.inreport" value="true"/>
+    <attainGoal name="emma:test-with-forced-fork"/>
+  </preGoal>
+  <postGoal name="emma:realreport">
+    <ant:property name="maven.emma.inreport" value="false"/>
+    <echo>Turning off EMMA.</echo>
+    <attainGoal name="emma:restore-main"/>
+    <attainGoal name="emma:restore-test"/>
+  </postGoal>
 </project>

Modified: directory/network/trunk/project.properties
URL: http://svn.apache.org/viewcvs/directory/network/trunk/project.properties?rev=165101&r1=165100&r2=165101&view=diff
==============================================================================
--- directory/network/trunk/project.properties (original)
+++ directory/network/trunk/project.properties Wed Apr 27 22:30:50 2005
@@ -31,3 +31,6 @@
 maven.eclipse.classpath.include=${basedir}/src/examples
 
 maven.site.stage.directory=/home/akarasulu/public_html/rsynced-sites/directory/subprojects/network
+
+maven.emma.mode.product=replace_classes 
+maven.emma.mode.testing=replace_classes 

Modified: directory/network/trunk/project.xml
URL: http://svn.apache.org/viewcvs/directory/network/trunk/project.xml?rev=165101&r1=165100&r2=165101&view=diff
==============================================================================
--- directory/network/trunk/project.xml (original)
+++ directory/network/trunk/project.xml Wed Apr 27 22:30:50 2005
@@ -94,6 +94,21 @@
       <url>http://junit.org/</url>
     </dependency>
 
+    <dependency>
+      <groupId>emma</groupId>
+      <artifactId>emma</artifactId>
+      <version>2.0.latest</version>
+      <url>http://emma.sourceforge.net/</url>
+    </dependency>
+
+    <dependency>
+      <groupId>emma</groupId>
+      <artifactId>maven-emma-plugin</artifactId>
+      <version>0.4</version>
+      <url>http://emma.sourceforge.net/</url>
+      <type>plugin</type>
+    </dependency>
+
   </dependencies>
 
 
@@ -122,6 +137,7 @@
 
       <excludes>
         <exclude>**/Abstract*</exclude>
+	<exclude>**/datagram/BindTest*</exclude>
       </excludes>
     </unitTest>
 
@@ -143,9 +159,7 @@
     <report>maven-changes-plugin</report>
     <report>maven-jxr-plugin</report>
     <report>maven-junit-report-plugin</report>
-    <!-- causing build failures 
-    <report>maven-jcoverage-plugin</report>
-    -->
+    <report>maven-emma-plugin</report>
     <report>maven-jdepend-plugin</report>
     <report>maven-simian-plugin</report>
     <report>maven-tasklist-plugin</report>

Modified: directory/network/trunk/src/test/org/apache/mina/examples/echoserver/AcceptorTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/examples/echoserver/AcceptorTest.java?rev=165101&r1=165100&r2=165101&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/examples/echoserver/AcceptorTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/examples/echoserver/AcceptorTest.java Wed Apr 27 22:30:50 2005
@@ -59,7 +59,7 @@
         // Add an SSL filter
         SSLFilter sslFilter =
             new SSLFilter( BogusSSLContextFactory.getInstance( true ) );
-        sslFilter.setDebug( SSLFilter.Debug.ON );
+        //sslFilter.setDebug( SSLFilter.Debug.ON );
         acceptor.getFilterChain().addLast( "SSL", sslFilter );
         
         // Create a commons-net socket factory

Modified: directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java?rev=165101&r1=165100&r2=165101&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java Wed Apr 27 22:30:50 2005
@@ -75,7 +75,7 @@
         // Add an SSL filter to acceptor
         SSLFilter acceptorSSLFilter =
             new SSLFilter( BogusSSLContextFactory.getInstance( true ) );
-        acceptorSSLFilter.setDebug( SSLFilter.Debug.ON );
+        //acceptorSSLFilter.setDebug( SSLFilter.Debug.ON );
         acceptor.getFilterChain().addLast( "SSL", acceptorSSLFilter );
 
         // Create a connector
@@ -86,7 +86,7 @@
         SSLFilter connectorSSLFilter =
             new SSLFilter( BogusSSLContextFactory.getInstance( false ) );
         connectorSSLFilter.setUseClientMode( true ); // set client mode
-        connectorSSLFilter.setDebug( SSLFilter.Debug.ON );
+        //connectorSSLFilter.setDebug( SSLFilter.Debug.ON );
         connector.getFilterChain().addLast( "SSL", connectorSSLFilter );
 
         testConnector( connector );