cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r614143 - in /cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty: JettyStarterMojo.java JettyStopperMojo.java
Date Tue, 22 Jan 2008 08:28:39 GMT
Author: reinhard
Date: Tue Jan 22 00:28:37 2008
New Revision: 614143

URL: http://svn.apache.org/viewvc?rev=614143&view=rev
Log:
enable Cobertura for integration tests

Modified:
    cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStarterMojo.java
    cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStopperMojo.java

Modified: cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStarterMojo.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStarterMojo.java?rev=614143&r1=614142&r2=614143&view=diff
==============================================================================
--- cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStarterMojo.java
(original)
+++ cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStarterMojo.java
Tue Jan 22 00:28:37 2008
@@ -21,6 +21,11 @@
     private File webAppDirectory;
 
     /**
+     * @parameter expression="${project.build.directory}"
+     */
+    private File builddir;
+
+    /**
      * @parameter
      */
     private boolean skip;
@@ -31,11 +36,13 @@
             return;
         }
         try {
+            System.setProperty("org.apache.cocoon.mode", "dev");
+            System.setProperty("net.sourceforge.cobertura.datafile", new File(this.builddir,
"cobertura.ser")
+                            .getAbsolutePath());
             new JettyContainer().start("/", webAppDirectory.getAbsolutePath(), 8888);
         } catch (Exception e) {
             throw new MojoExecutionException("Can't start Jetty.", e);
         }
     }
-
 
 }

Modified: cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStopperMojo.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStopperMojo.java?rev=614143&r1=614142&r2=614143&view=diff
==============================================================================
--- cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStopperMojo.java
(original)
+++ cocoon/trunk/tools/cocoon-it-fw/src/main/java/org/apache/cocoon/maven/test/jetty/JettyStopperMojo.java
Tue Jan 22 00:28:37 2008
@@ -4,7 +4,7 @@
 import org.apache.maven.plugin.MojoExecutionException;
 
 /**
- * Stop all the JettyContainer instance.
+ * Stop the Jetty instance.
  *
  * @goal jetty-stop
  */
@@ -20,11 +20,20 @@
             this.getLog().info("Skip starting server environment.");
             return;
         }
-
         try {
             new JettyContainer().stop();
         } catch (Exception e) {
             this.getLog().error("Can't stop JettyContainer. ", e);
+        }
+        // flush information collected by Cobertura
+        try {
+            String className = "net.sourceforge.cobertura.coveragedata.ProjectData";
+            String methodName = "saveGlobalProjectData";
+            Class saveClass = Class.forName(className);
+            java.lang.reflect.Method saveMethod = saveClass.getDeclaredMethod(methodName,
new Class[0]);
+            saveMethod.invoke(null, new Object[0]);
+        } catch (Throwable t) {
+            this.getLog().debug("Error while flushing information collected by Cobertura.");
         }
     }
 }



Mime
View raw message