geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r331903 [1/2] - in /geronimo/gbuild/trunk: ./ src/main/java/org/apache/geronimo/gbuild/report/ src/main/report-resources/ src/main/resources/ src/main/resources/org/ src/main/resources/org/apache/ src/main/resources/org/apache/geronimo/ src...
Date Tue, 08 Nov 2005 21:57:33 GMT
Author: dain
Date: Tue Nov  8 13:57:27 2005
New Revision: 331903

URL: http://svn.apache.org/viewcvs?rev=331903&view=rev
Log:
Distributed results report

Added:
    geronimo/gbuild/trunk/maven.xml   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/Section.java   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java   (with props)
    geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java   (with props)
    geronimo/gbuild/trunk/src/main/report-resources/
    geronimo/gbuild/trunk/src/main/report-resources/h3.gif   (with props)
    geronimo/gbuild/trunk/src/main/report-resources/icon_error_sml.gif   (with props)
    geronimo/gbuild/trunk/src/main/report-resources/icon_info_sml.gif   (with props)
    geronimo/gbuild/trunk/src/main/report-resources/icon_success_sml.gif   (with props)
    geronimo/gbuild/trunk/src/main/report-resources/icon_warning_sml.gif   (with props)
    geronimo/gbuild/trunk/src/main/report-resources/maven-base.css
    geronimo/gbuild/trunk/src/main/report-resources/maven-stylus.css
    geronimo/gbuild/trunk/src/main/report-resources/print.css
    geronimo/gbuild/trunk/src/main/report-resources/spacer.gif   (with props)
    geronimo/gbuild/trunk/src/main/resources/
    geronimo/gbuild/trunk/src/main/resources/org/
    geronimo/gbuild/trunk/src/main/resources/org/apache/
    geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/
    geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/
    geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/
    geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/all-xml.vm
    geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/macros.vm
    geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/summary.vm   (with props)
    geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/testsuite.vm   (with props)
    geronimo/gbuild/trunk/src/test/java/org/apache/geronimo/gbuild/report/
    geronimo/gbuild/trunk/src/test/java/org/apache/geronimo/gbuild/report/RelativePathTest.java   (with props)
Modified:
    geronimo/gbuild/trunk/project.xml

Added: geronimo/gbuild/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/maven.xml?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/maven.xml (added)
+++ geronimo/gbuild/trunk/maven.xml Tue Nov  8 13:57:27 2005
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+    Copyright 2003-2005 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<project default="jar:install"
+    xmlns:ant="jelly:ant"
+    >
+
+    <postGoal name="java:jar-resources">
+      <ant:mkdir dir="${maven.build.dest}/META-INF/org/apache/geronimo/gbuild/report"/>
+      <ant:zip destfile="${maven.build.dest}/META-INF/org/apache/geronimo/gbuild/report/resources.zip">
+          <ant:fileset dir="${basedir}/src/main/report-resources"/>
+      </ant:zip>
+    </postGoal>
+</project>

Propchange: geronimo/gbuild/trunk/maven.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/gbuild/trunk/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/project.xml?rev=331903&r1=331902&r2=331903&view=diff
==============================================================================
--- geronimo/gbuild/trunk/project.xml (original)
+++ geronimo/gbuild/trunk/project.xml Tue Nov  8 13:57:27 2005
@@ -3,9 +3,9 @@
 <project>
 
   <pomVersion>3</pomVersion>
-  <id>gbuild</id>
-  <name>gbuild</name>
-  <currentVersion>1.0</currentVersion>
+  <groupId>org.apache.geronimo.gbuild</groupId>
+  <artifactId>gbuild</artifactId>
+  <currentVersion>1.0-SNAPSHOT</currentVersion>
   <shortDescription>gbuild</shortDescription>
   <description>gbuild</description>
   <url></url>
@@ -133,11 +133,16 @@
       <version>2.6.2</version>
     </dependency>
 
+    <dependency>
+      <groupId>velocity</groupId>
+      <artifactId>velocity</artifactId>
+      <version>1.4</version>
+    </dependency>
 <!--
     <dependency>
       <groupId>org.apache.maven.continuum</groupId>
       <artifactId>continuum-core</artifactId>
-      <version>1.0-SNAPSHOT</version>
+      <version>1.0</version>
     </dependency>
 -->
   </dependencies>
@@ -146,22 +151,17 @@
     <unitTestSourceDirectory>src/test/java</unitTestSourceDirectory>
     <nagEmailAddress>scm@geronimo.apache.org</nagEmailAddress>
 
+    <resources>
+      <resource>
+        <directory>${basedir}/src/main/resources</directory>
+      </resource>
+    </resources>
+
     <unitTest>
       <includes>
         <include>**/*Test.java</include>
       </includes>
     </unitTest>
-
-    <resources>
-<!--
-      <resource>
-        <directory>.</directory>
-        <includes>
-          <include>*</include>
-        </includes>
-      </resource>
--->
-    </resources>
   </build>
 
 </project>

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,250 @@
+package org.apache.geronimo.gbuild.report;
+
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.app.VelocityEngine;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.SortedMap;
+import java.util.SortedSet;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class GenerateReport {
+    private final File sectionsFile;
+    private final File workDir;
+    private final File reportsDir;
+    private final File outputDir;
+    private final boolean forceHtml = false;
+
+    public GenerateReport(File sectionsFile, File workDir, File reportsDir, File outputDir) {
+        this.sectionsFile = sectionsFile;
+        this.workDir = workDir;
+        this.reportsDir = reportsDir;
+        this.outputDir = outputDir;
+    }
+
+    public static void main(String[] args) throws Exception {
+        long processStart = System.currentTimeMillis();
+
+        if (args.length != 4) {
+            System.out.println("Usage:");
+            System.out.println("    java org.apache.geronimo.gbuild.report.ProcessResults sectionsFile workDir reportsDir outputDir");
+            System.out.println(Arrays.asList(args));
+            return;
+        }
+
+        // sections file
+        File sectionsFile = new File(args[0]);
+        if (!sectionsFile.canRead()) {
+            System.out.println("sectionsFile is not a readable: " + sectionsFile.getAbsolutePath());
+            return;
+        }
+
+        // work directory
+        File workDir = new File(args[1]);
+        if (workDir.exists() && !workDir.isDirectory()) {
+            System.out.println("workDir is not a directory: " + workDir.getAbsolutePath());
+            return;
+        }
+
+        // reports dir
+        File reportsDir = new File(args[2]);
+        if (!reportsDir.isDirectory()) {
+            System.out.println("reportsDir is not a directory: " + reportsDir.getAbsolutePath());
+            return;
+        }
+
+        // output directory
+        File outputDir = new File(args[3]);  
+        if (!outputDir.exists()) {
+            if (!outputDir.mkdirs()) {
+                System.out.println("Could not create outputDir: " + outputDir.getAbsolutePath());
+                return;
+            }
+        }
+        if (!outputDir.isDirectory()) {
+            System.out.println("outputDir is not a directory: " + outputDir.getAbsolutePath());
+            return;
+        }
+
+        new GenerateReport(sectionsFile, workDir, reportsDir, outputDir).execute();
+        System.out.println("Elapsed time: " + (System.currentTimeMillis() - processStart) / 1000 + " sec");
+    }
+
+    public void execute() throws Exception {
+        // load all of the result from your working directory
+        ReportFileLocator reportFileLocator = new ReportFileLocator(workDir);
+        long begin;
+        SortedSet workTestCases = new TreeSet();
+        if (workDir != null) {
+            begin = System.currentTimeMillis();
+            WorkDirLoader workDirLoader = new WorkDirLoader(workDir, true, reportFileLocator);
+            workTestCases = workDirLoader.loadTestCases();
+            System.out.println("Loaded " + workTestCases.size() + " tests from " + workDir.getName() + " in " + (System.currentTimeMillis() - begin) / 1000 + " sec");
+        }
+
+
+        // load the existing test cases from the reports
+        begin = System.currentTimeMillis();
+        SummaryReportLoader summaryReportLoader = new SummaryReportLoader(reportsDir, false, reportFileLocator);
+        SortedSet reportsTestCases = summaryReportLoader.loadTestCases();
+        System.out.println("Loaded " + reportsTestCases.size() + " tests from " + reportsDir.getName() + " in " + (System.currentTimeMillis() - begin) / 1000 + " sec");
+
+        // merge the test cases
+        SortedSet testCases = ReportUtil.mergeTestCases(workTestCases, reportsTestCases);
+
+        // write work summary
+        SummaryReportUtil.saveTestCases(workTestCases, new File(outputDir, "work.properties"));
+
+        // create the section manager
+        SortedMap sectionNamesByPackage = new TreeMap(ReportUtil.loadProperties(sectionsFile));
+        SectionManager sectionManager = new SectionManager(sectionNamesByPackage, testCases);
+
+        // unpack resources
+        ReportUtil.unpackEmbeddedZip("META-INF/org/apache/geronimo/gbuild/report/resources.zip", new File(outputDir, "resources"));
+
+        // generate html site
+        begin = System.currentTimeMillis();
+        int renderCount = renderHtml(sectionManager, outputDir);
+        System.out.println("Rendered " + renderCount + " html reports in " + (System.currentTimeMillis() - begin) / 1000 + " sec");
+
+        // generate summary reports
+        begin = System.currentTimeMillis();
+        renderCount = renderSummary(sectionManager, new File(outputDir, "reports"));
+        System.out.println("Rendered " + renderCount + " summary reports in " + (System.currentTimeMillis() - begin) / 1000 + " sec");
+    }
+
+    private int renderHtml(SectionManager sectionManager, File outputDir) throws Exception {
+        VelocityEngine velocity = new VelocityEngine();
+        velocity.setProperty(Velocity.RESOURCE_LOADER, "class");
+        velocity.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
+        velocity.setProperty(Velocity.VM_LIBRARY, "org/apache/geronimo/gbuild/report/macros.vm");
+        velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.NullLogSystem");
+
+        velocity.init();
+        Template summaryTemplate = velocity.getTemplate("org/apache/geronimo/gbuild/report/summary.vm");
+        Template testSuiteTemplate = velocity.getTemplate("org/apache/geronimo/gbuild/report/testsuite.vm");
+
+        // render the summary page
+        int renderCount = 0;
+        File summaryFile = new File(outputDir, "index.html");
+        if (!summaryFile.exists() || sectionManager.isNewResult() || forceHtml) {
+            renderVelocityTemplate("summary",
+                    sectionManager,
+                    summaryFile,
+                    summaryTemplate);
+            renderCount++;
+        }
+
+        File summaryDir = new File(outputDir, "summary");
+        summaryDir.mkdirs();
+
+        // render a page for each section
+        for (Iterator iterator = sectionManager.getSections().iterator(); iterator.hasNext();) {
+            Section section = (Section) iterator.next();
+            File sectionFile = new File(summaryDir, section.getName() + ".html");
+            if (!sectionFile.exists() || section.isNewResult() || forceHtml) {
+                renderVelocityTemplate("summary",
+                        section,
+                        sectionFile,
+                        summaryTemplate);
+                renderCount++;
+            }
+
+            File sectionDir = new File(summaryDir, section.getName());
+            sectionDir.mkdirs();
+
+            // render a page for each testsuite
+            for (Iterator iterator1 = section.getTestSuites().iterator(); iterator1.hasNext();) {
+                TestSuite testSuite = (TestSuite) iterator1.next();
+
+                File testSuiteFile = new File(sectionDir, testSuite.getName() + ".html");
+                if (!testSuiteFile.exists() || testSuite.isNewResult() || forceHtml) {
+                    renderVelocityTemplate("testSuite",
+                            testSuite,
+                            testSuiteFile,
+                            testSuiteTemplate);
+                    renderCount++;
+                }
+            }
+        }
+        return renderCount;
+    }
+
+    private static int renderSummary(SectionManager sectionManager, File outputDir) throws Exception {
+        int renderCount = 0;
+        if (!outputDir.isDirectory()) {
+            if (!outputDir.mkdirs()) {
+                throw new IOException("Could not create outputDir: " + outputDir.getAbsolutePath());
+            }
+        }
+
+        // render a summary for each section
+        for (Iterator iterator = sectionManager.getSections().iterator(); iterator.hasNext();) {
+            Section section = (Section) iterator.next();
+
+            // if the section is modified write a summary report
+            if (section.isNewResult()) {
+                SummaryReportUtil.saveTestCases(section.getTestCases(), new File(outputDir, section.getName() + ".properties"));
+                System.out.println("Updated summary report for section " + section.getName());
+                renderCount++;
+            }
+        }
+        return renderCount;
+    }
+
+    private void renderVelocityTemplate(String name, Object value, File outputFile, Template template) throws Exception {
+        ReportUtil.createDirectory(outputFile.getParentFile());
+
+        VelocityContext context = new VelocityContext();
+        context.put(name, value);
+
+        String reportDir = ReportUtil.relativePath(outputFile.getParentFile(), workDir);
+        context.put("reportDir", reportDir);
+
+        String rootDir = ReportUtil.relativePath(outputFile.getParentFile(), outputDir);
+        context.put("rootDir", rootDir);
+
+        PrintStream out = null;
+        FileReader templateReader = null;
+        try {
+            out = new PrintStream(new FileOutputStream(outputFile));
+            PrintWriter writer = new PrintWriter(out);
+            template.merge(context, writer);
+            writer.flush();
+        } finally {
+            ReportUtil.close(out);
+            ReportUtil.close(templateReader);
+        }
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,40 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.report;
+
+import java.io.File;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ReportFileLocator {
+    private final File workDir;
+
+    public ReportFileLocator(File workDir) {
+        this.workDir = workDir;
+    }
+
+    public String getReportFile(String className, String testName) {
+        if (workDir != null) {
+            String path = className.replace('.', '/') + '_' + testName + ".jtr";
+            if (new File(workDir, path).exists()) {
+                return path;
+            }
+        }
+        return null;
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,247 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.report;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipEntry;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ReportUtil {
+    private ReportUtil() {
+    }
+
+    public static Properties loadProperties(File file) throws IOException {
+        Properties properties = new Properties();
+        if (!file.canRead()) {
+            return properties;
+        }
+
+        InputStream in = null;
+        try {
+            in = new FileInputStream(file);
+            properties.load(in);
+        } finally {
+            close(in);
+        }
+        return properties;
+    }
+
+    /**
+     * Write the specified map to the output file in java.util.Properties format.
+     *
+     * @param map        the data to write
+     * @param outputFile the file to which the data is written
+     * @throws IOException if a problem occurs wile writing the data
+     */
+    public static void saveProperties(final Map map, File outputFile) throws IOException {
+        createDirectory(outputFile.getParentFile());
+
+        OutputStream out = null;
+        try {
+            out = new FileOutputStream(outputFile);
+            Properties properties = new Properties() {
+                public Object get(Object key) {
+                    return map.get(key);
+                }
+
+                public synchronized Enumeration keys() {
+                    return Collections.enumeration(map.keySet());
+                }
+            };
+            properties.store(out, null);
+            out.flush();
+        } finally {
+            close(out);
+        }
+    }
+
+    public static void close(Reader thing) {
+        if (thing != null) {
+            try {
+                thing.close();
+            } catch (Exception ignored) {
+            }
+        }
+    }
+
+    public static void close(InputStream thing) {
+        if (thing != null) {
+            try {
+                thing.close();
+            } catch (Exception ignored) {
+            }
+        }
+    }
+
+    public static void close(OutputStream thing) {
+        if (thing != null && thing != System.out) {
+            try {
+                thing.close();
+            } catch (Exception ignored) {
+            }
+        }
+    }
+
+    public static String formatTime(long milis) {
+        long hours = milis / (60 * 60 * 1000);
+        milis = milis % (60 * 60 * 1000);
+
+        long min = milis / (60 * 1000);
+        milis = milis % (60 * 1000);
+
+        long sec = milis / (1000);
+        milis = milis % (1000);
+
+        return (hours < 10 ? "0" : "") + hours + ":" +
+                (min < 10 ? "0" : "") + min + ":" +
+                (sec < 10 ? "0" : "") + sec;
+    }
+
+    public static SortedSet mergeTestCases(SortedSet one, SortedSet two) {
+        Map testCases = new HashMap();
+        for (Iterator iterator = one.iterator(); iterator.hasNext();) {
+            TestCase testCase = (TestCase) iterator.next();
+            testCases.put(testCase.getUniqueId(), testCase);
+        }
+        for (Iterator iterator = two.iterator(); iterator.hasNext();) {
+            TestCase testCase = (TestCase) iterator.next();
+            TestCase exising = (TestCase) testCases.get(testCase.getUniqueId());
+            if (exising == null) {
+                testCases.put(testCase, testCase);
+            } else {
+                boolean different = exising.isPassed() != testCase.isPassed() ||
+                        exising.isFailed() != testCase.isFailed() ||
+                        exising.isError() != testCase.isError();
+                if (different && !exising.isNewResult() && testCase.isNewResult()) {
+                    // results are different so make sure the test case we keep is the new result
+                    testCases.put(testCase.getUniqueId(), testCase);
+                } else if (!different && exising.isNewResult() && !testCase.isNewResult()) {
+                    // results are not different so make sure the test case we keep is the old result
+                    // this prevents unnecessary updaing
+                    testCases.put(testCase.getUniqueId(), testCase);
+                }
+            }
+        }
+        return new TreeSet(testCases.values());
+    }
+
+    public static String relativePath(File sourceDir, File targetFile) {
+        File normalizedTarget = normalizeFile(targetFile);
+        File normalizedSource = normalizeFile(sourceDir);
+        if (normalizedSource.equals(normalizedTarget)) {
+            return ".";
+        }
+
+        List targetFileList = new ArrayList();
+        for (File f = normalizedTarget; f != null; f = f.getParentFile()) {
+            targetFileList.add(f);
+        }
+        Collections.reverse(targetFileList);
+
+        StringBuffer path = new StringBuffer();
+        for (File f = normalizedSource; f != null && f.getParentFile() != null; f = f.getParentFile()) {
+            if (!targetFileList.contains(f)) {
+                if (path.length() > 0) path.append("/");
+                path.append("..");
+            } else {
+                int i = targetFileList.indexOf(f) + 1;
+                for (; i < targetFileList.size(); i++) {
+                    File file = (File) targetFileList.get(i);
+                    if (path.length() > 0) path.append("/");
+                    path.append(file.getName());
+                }
+                return path.toString();
+            }
+        }
+
+        return targetFile.getAbsolutePath();
+    }
+
+    public static File normalizeFile(File targetFile) {
+        return new File(targetFile.getAbsoluteFile().toURI().normalize()).getAbsoluteFile();
+    }
+
+    public static void createDirectory(File dir) throws IOException {
+        if (!dir.exists()) {
+            if (!dir.mkdirs()) {
+                throw new IOException("Could not create directory: \"" + dir.getAbsolutePath() + "\"");
+            }
+        }
+        if (!dir.isDirectory()) {
+            throw new IOException("Directory is not a directory: \"" + dir.getAbsolutePath() + "\"");
+        }
+    }
+
+    public static void unpackEmbeddedZip(String jarName, File outputDir) throws IOException {
+        InputStream in = null;
+        try {
+            ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+            if (classLoader == null) classLoader = ReportUtil.class.getClassLoader();
+            in = classLoader.getResourceAsStream(jarName);
+            ZipInputStream zipInputStream = new ZipInputStream(in);
+            unpackZip(zipInputStream, outputDir);
+        } finally {
+            close(in);
+        }
+    }
+
+    public static void unpackZip(ZipInputStream zipInputStream, File outputDir) throws IOException{
+        for (ZipEntry zipEntry = zipInputStream.getNextEntry(); zipEntry != null; zipEntry = zipInputStream.getNextEntry()) {
+            File file = new File(outputDir, zipEntry.getName());
+            if (zipEntry.isDirectory()) {
+                createDirectory(file);
+            } else {
+                createDirectory(file.getParentFile());
+                OutputStream out = null;
+                try {
+                    out = new FileOutputStream(file);
+                    writeAll(zipInputStream, out);
+                } finally {
+                    close(out);
+                }
+            }
+        }
+    }
+
+    private static void writeAll(InputStream in, OutputStream out) throws IOException {
+        byte[] buffer = new byte[4096];
+        int count;
+        while ((count = in.read(buffer)) > 0) {
+            out.write(buffer, 0, count);
+        }
+        out.flush();
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/Section.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/Section.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/Section.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/Section.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,149 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.report;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.SortedSet;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Section {
+    private final String name;
+    private final SortedSet testCases;
+    private final SortedMap testSuites;
+    private final long errorCount;
+    private final long failureCount;
+    private final long totalTime;
+    private final boolean newResult;
+
+    public Section(String name, SortedSet testCases) {
+        if (name == null) throw new NullPointerException("name is null");
+        if (testCases == null) throw new NullPointerException("testCases is null");
+        this.name = name;
+        this.testCases = testCases;
+
+        // sort the test cases by class name keeping a running count
+        long errorCount = 0;
+        long failureCount = 0;
+        long totalTime = 0;
+        boolean newResult = false;
+        Map testCasesByClass = new TreeMap();
+        for (Iterator iterator = testCases.iterator(); iterator.hasNext();) {
+            TestCase testCase = (TestCase) iterator.next();
+            String className = testCase.getClassName();
+            TreeSet suiteTestCases = (TreeSet) testCasesByClass.get(className);
+            if (suiteTestCases == null) {
+                suiteTestCases = new TreeSet();
+                testCasesByClass.put(className, suiteTestCases);
+            }
+
+            if (testCase.isFailed()) {
+                failureCount++;
+            } else if (testCase.isError()) {
+                errorCount++;
+            }
+            totalTime += testCase.getTime();
+            newResult = newResult || testCase.isNewResult();
+            suiteTestCases.add(testCase);
+        }
+        this.errorCount = errorCount;
+        this.failureCount = failureCount;
+        this.totalTime = totalTime;
+        this.newResult = newResult;
+
+        SortedMap testSuites = new TreeMap();
+        for (Iterator iterator = testCasesByClass.entrySet().iterator(); iterator.hasNext();) {
+            Map.Entry entry = (Map.Entry) iterator.next();
+            String className = (String) entry.getKey();
+            Set suiteTestCases = (Set) entry.getValue();
+            TestSuite testSuite = new TestSuite(className, suiteTestCases);
+            testSuites.put(testSuite.getName(), testSuite);
+        }
+        this.testSuites = Collections.unmodifiableSortedMap(testSuites);
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public SortedSet getTestCases() {
+        return testCases;
+    }
+
+    public Collection getTestSuites() {
+        return testSuites.values();
+    }
+
+    public Collection getItems() {
+        return testSuites.values();
+    }
+
+    public long getTestCount() {
+        return testCases.size();
+    }
+
+    public long getPassCount() {
+        return testCases.size() - errorCount - failureCount;
+    }
+
+    public long getErrorCount() {
+        return errorCount;
+    }
+
+    public long getFailureCount() {
+        return failureCount;
+    }
+
+    public long getTotalTime() {
+        return totalTime;
+    }
+
+    public String getTotalTimeString() {
+        return ReportUtil.formatTime(getTotalTime());
+    }
+
+    public boolean isPassed() {
+        return testCases.size() > 0 && failureCount == 0 && errorCount == 0;
+    }
+
+    public int getPassPercentage() {
+        if (testCases.isEmpty()) {
+            return 0;
+        }
+        return (int) ((0.0 + getPassCount()) * 100 / testCases.size());
+    }
+
+    public int getPassBarSize() {
+        return getPassPercentage() * 2;
+    }
+
+    public int getFailBarSize() {
+        return 200 - getPassBarSize();
+    }
+
+    public boolean isNewResult() {
+        return newResult;
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/Section.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/Section.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,169 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.report;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.SortedSet;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SectionManager {
+    private final SortedSet testCases;
+    private final Map sections;
+    private final long errorCount;
+    private final long failureCount;
+    private final long totalTime;
+    private final boolean newResult;
+
+    public SectionManager(Map namedSections, SortedSet testCases) {
+        this.testCases = testCases;
+
+        // initialize the section set
+        Map sectionsByPackage = new TreeMap();
+        Map sectionSets = new TreeMap();
+        for (Iterator iterator = namedSections.entrySet().iterator(); iterator.hasNext();) {
+            Map.Entry entry = (Map.Entry) iterator.next();
+            String sectionName = (String) entry.getKey();
+            String sectionPackage = (String) entry.getValue();
+            sectionSets.put(sectionPackage, new TreeSet());
+            sectionsByPackage.put(sectionPackage, sectionName);
+        }
+
+        // sort the test cases by section keeping a running count
+        long errorCount = 0;
+        long failureCount = 0;
+        long totalTime = 0;
+        boolean newResult = false;
+        for (Iterator iterator = testCases.iterator(); iterator.hasNext();) {
+            TestCase testCase = (TestCase) iterator.next();
+
+            Set sectionTestCases = getSectionTestCases(testCase.getClassName(), sectionSets);
+            sectionTestCases.add(testCase);
+
+            if (testCase.isFailed()) {
+                failureCount++;
+            } else if (testCase.isError()) {
+                errorCount++;
+            }
+            totalTime += testCase.getTime();
+            newResult = newResult || testCase.isNewResult();
+        }
+        this.errorCount = errorCount;
+        this.failureCount = failureCount;
+        this.totalTime = totalTime;
+        this.newResult = newResult;
+
+        // build the section objects
+        SortedMap sections = new TreeMap();
+        for (Iterator iterator = sectionSets.entrySet().iterator(); iterator.hasNext();) {
+            Map.Entry entry = (Map.Entry) iterator.next();
+            String sectionPackage = (String) entry.getKey();
+            SortedSet sectionTestCases = (SortedSet) entry.getValue();
+            String sectionName = (String) sectionsByPackage.get(sectionPackage);
+            if (sectionName == null) sectionName = "other";
+            Section section = new Section(sectionName, sectionTestCases);
+            sections.put(section.getName(), section);
+        }
+        this.sections = Collections.unmodifiableSortedMap(sections);
+    }
+
+
+    private Set getSectionTestCases(String testCaseClass, Map sections) {
+        for (Iterator sectionIterator = sections.entrySet().iterator(); sectionIterator.hasNext();) {
+            Map.Entry sectionEntry = (Map.Entry) sectionIterator.next();
+            String sectionPackage = (String) sectionEntry.getKey();
+            sectionPackage += ".";
+            Set sectionSet = (Set) sectionEntry.getValue();
+            if (testCaseClass.startsWith(sectionPackage)) {
+                return sectionSet;
+            }
+        }
+        Set otherSet = (Set) sections.get("other");
+        if (otherSet == null) {
+            otherSet = new TreeSet();
+            sections.put("other", otherSet);
+        }
+        return otherSet;
+    }
+
+    public String getName() {
+        return "summary";
+    }
+
+    public Collection getSections() {
+        return sections.values();
+    }
+
+    public Collection getItems() {
+        return sections.values();
+    }
+
+    public long getPassCount() {
+        return testCases.size() - errorCount - failureCount;
+    }
+
+    public long getErrorCount() {
+        return errorCount;
+    }
+
+    public long getFailureCount() {
+        return failureCount;
+    }
+
+    public long getTestCount() {
+        return testCases.size();
+    }
+
+    public long getTotalTime() {
+        return totalTime;
+    }
+
+    public String getTotalTimeString() {
+        return ReportUtil.formatTime(getTotalTime());
+    }
+
+    public boolean isPassed() {
+        return testCases.size() > 0 && failureCount == 0 && errorCount == 0;
+    }
+
+    public int getPassPercentage() {
+        if (testCases.isEmpty()) {
+            return 0;
+        }
+        return (int) ((0.0 + getPassCount()) * 100 / testCases.size());
+    }
+
+    public int getPassBarSize() {
+        return getPassPercentage() * 2;
+    }
+
+    public int getFailBarSize() {
+        return 200 - getPassBarSize();
+    }
+
+    public boolean isNewResult() {
+        return newResult;
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,62 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.report;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SummaryReportLoader {
+    private final Set reportFiles;
+    private final boolean newResult;
+    private final ReportFileLocator reportFileLocator;
+
+    public SummaryReportLoader(Set reportFiles, boolean newResult, ReportFileLocator reportFileLocator) {
+        this.reportFiles = reportFiles;
+        this.newResult = newResult;
+        this.reportFileLocator = reportFileLocator;
+    }
+
+    public SummaryReportLoader(File reportsDir, boolean newResult, ReportFileLocator reportFileLocator) {
+        reportFiles = new HashSet();
+        File[] files = reportsDir.listFiles();
+        for (int i = 0; i < files.length; i++) {
+            File file = files[i];
+            if (file.canRead() && file.getName().endsWith(".properties")) {
+                reportFiles.add(file);
+            }
+        }
+        this.newResult = newResult;
+        this.reportFileLocator = reportFileLocator;
+    }
+
+    public SortedSet loadTestCases() throws Exception {
+        SortedSet testcases = new TreeSet();
+        for (Iterator iterator = reportFiles.iterator(); iterator.hasNext();) {
+            File reportFile = (File) iterator.next();
+            Set cases = SummaryReportUtil.loadTestCases(reportFile, newResult, reportFileLocator);
+            testcases.addAll(cases);
+        }
+        return testcases;
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,104 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.report;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeMap;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SummaryReportUtil {
+    private SummaryReportUtil() {
+    }
+
+    public static Set loadTestCases(File reportFile, boolean newResult, ReportFileLocator reportFileLocator) throws IOException {
+        Set testcases = new HashSet();
+        Properties properties = ReportUtil.loadProperties(reportFile);
+        for (Iterator caseIterator = properties.entrySet().iterator(); caseIterator.hasNext();) {
+            Map.Entry entry = (Map.Entry) caseIterator.next();
+            String storeName = (String) entry.getKey();
+            String storeValue = (String) entry.getValue();
+            TestCase testCase = createTestcase(storeName, storeValue, newResult, reportFileLocator);
+            testcases.add(testCase);
+        }
+        return testcases;
+    }
+
+    public static void saveTestCases(Set testCases, File outputFile) throws IOException {
+        Map summary = new TreeMap();
+        for (Iterator iterator = testCases.iterator(); iterator.hasNext();) {
+            TestCase testCase = (TestCase) iterator.next();
+            summary.put(getStoreName(testCase), getStoreValue(testCase));
+        }
+        ReportUtil.saveProperties(summary, outputFile);
+    }
+
+    private static TestCase createTestcase(String storeName, String storeValue, boolean newResult, ReportFileLocator reportFileLocator) {
+        int index = storeName.lastIndexOf('#');
+        String name = storeName.substring(index + 1);
+        String classname = storeName.substring(0, index);
+        String reportFile = reportFileLocator.getReportFile(classname, name);
+
+        char flag = storeValue.charAt(0);
+        index = storeValue.indexOf(')');
+        long time = Long.parseLong(storeValue.substring(3, index));
+        boolean failed;
+        boolean error;
+        String msg;
+        if (flag == 'P') {
+            failed = false;
+            error = false;
+            msg = "";
+        } else {
+            if (flag == 'F') {
+                failed = true;
+                error = false;
+            } else {
+                failed = false;
+                error = true;
+            }
+            if (storeValue.length() >= index + 2) {
+                msg = storeValue.substring(index + 2);
+            } else {
+                msg = "";
+            }
+        }
+
+        return new TestCase(name, classname, reportFile, time, failed, error, msg, newResult);
+    }
+
+    private static String getStoreName(TestCase testCase) {
+        return testCase.getClassName() + "#" + testCase.getName();
+    }
+
+    private static String getStoreValue(TestCase testCase) {
+        if (testCase.isPassed()) {
+            return "P (" + testCase.getTime() + ")";
+        } else if (testCase.isFailed()) {
+            return "F (" + testCase.getTime() + ") " + testCase.getMsg();
+        } else {
+            return "F (" + testCase.getTime() + ") " + testCase.getMsg();
+        }
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,116 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.report;
+
+
+
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class TestCase implements Comparable {
+    private final String name;
+    private final String className;
+    private final String reportFile;
+    private final long time;
+    private final boolean failed;
+    private final boolean error;
+    private final String msg;
+    private final boolean newResult;
+
+    public TestCase(String name, String className, String reportFile, long time, boolean failed, boolean error, String msg, boolean newResult) {
+        this.name = name;
+        this.className = className;
+        this.reportFile = reportFile;
+        this.time = time;
+        this.failed = failed;
+        this.error = error;
+        this.msg = msg;
+        this.newResult = newResult;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getClassName() {
+        return className;
+    }
+
+    public String getUniqueId() {
+        return className + '#' + name;
+    }
+
+    public String getReportFile() {
+        return reportFile;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public String getTimeString() {
+        return ReportUtil.formatTime(getTime());
+    }
+
+    public boolean isPassed() {
+        return !failed && !error;
+    }
+
+    public boolean isFailed() {
+        return failed;
+    }
+
+    public boolean isError() {
+        return error;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public boolean isNewResult() {
+        return newResult;
+    }
+
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof TestCase) {
+            TestCase testCase = (TestCase) obj;
+            return className.equals(testCase.className) && name.equals(testCase.name);
+        }
+        return false;
+    }
+
+    public int hashCode() {
+        int hash = 7;
+        hash = 31 * hash + className.hashCode();
+        hash = 31 * hash + name.hashCode();
+        return hash;
+    }
+
+    public int compareTo(Object obj) {
+        TestCase testCase = (TestCase) obj;
+        int i = className.compareTo(testCase.className);
+        if (i != 0) {
+            return i;
+        }
+        return name.compareTo(testCase.name);
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,126 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.report;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class TestSuite {
+    private final String name;
+    private final SortedMap testCases;
+    private final long errorCount;
+    private final long failureCount;
+    private final long totalTime;
+    private final boolean newResult;
+
+    public TestSuite(String name, Set testCases) {
+        this.name = name;
+
+        long errorCount = 0;
+        long failureCount = 0;
+        long totalTime = 0;
+        boolean newResult = false;
+        SortedMap testCasesByName = new TreeMap();
+        for (Iterator iterator = testCases.iterator(); iterator.hasNext();) {
+            TestCase testCase = (TestCase) iterator.next();
+            if (testCase.isFailed()) {
+                failureCount++;
+            } else if (testCase.isError()) {
+                errorCount++;
+            }
+            totalTime += testCase.getTime();
+            newResult = newResult || testCase.isNewResult();
+            testCasesByName.put(testCase.getName(), testCase);
+        }
+        this.errorCount = errorCount;
+        this.failureCount = failureCount;
+        this.totalTime = totalTime;
+        this.newResult = newResult;
+
+        this.testCases = Collections.unmodifiableSortedMap(testCasesByName);
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public TestCase getTestCase(String name) {
+        return (TestCase) testCases.get(name);
+    }
+
+    public Collection getTestCases() {
+        return testCases.values();
+    }
+
+    public Collection getItems() {
+        return testCases.values();
+    }
+
+    public long getTestCount() {
+        return testCases.size();
+    }
+
+    public long getPassCount() {
+        return testCases.size() - errorCount - failureCount;
+    }
+
+    public long getErrorCount() {
+        return errorCount;
+    }
+
+    public long getFailureCount() {
+        return failureCount;
+    }
+
+    public long getTotalTime() {
+        return totalTime;
+    }
+
+    public String getTotalTimeString() {
+        return ReportUtil.formatTime(getTotalTime());
+    }
+
+    public boolean isPassed() {
+        return getTestCount() > 0 && failureCount == 0 && errorCount == 0;
+    }
+
+    public int getPassPercentage() {
+        if (testCases.isEmpty()) {
+            return 0;
+        }
+        return (int) ((0.0 + getPassCount()) * 100 / testCases.size());
+    }
+
+    public int getPassBarSize() {
+        return getPassPercentage() * 2;
+    }
+
+    public int getFailBarSize() {
+        return 200 - getPassBarSize();
+    }
+
+    public boolean isNewResult() {
+        return newResult;
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java (added)
+++ geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java Tue Nov  8 13:57:27 2005
@@ -0,0 +1,156 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.report;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.LineNumberReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Properties;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WorkDirLoader {
+    private static final DateFormat DATE_FORMAT = new SimpleDateFormat("EEE MMM d HH:mm:ss z yyyy");
+    private static final String LOG_START = "#section";
+
+    private final File workDir;
+    private final boolean newResult;
+    private final ReportFileLocator reportFileLocator;
+
+    public WorkDirLoader(File workDir, boolean newResult, ReportFileLocator reportFileLocator) {
+        this.workDir = workDir;
+        this.newResult = newResult;
+        this.reportFileLocator = reportFileLocator;
+    }
+
+    public SortedSet loadTestCases() throws Exception {
+        SortedSet testcases = new TreeSet();
+        LinkedList resultFiles = new LinkedList();
+        findResultFiles(workDir, resultFiles);
+        for (Iterator iterator = resultFiles.iterator(); iterator.hasNext();) {
+            File resultsFile = (File) iterator.next();
+            TestCase testCase = createTestcase(resultsFile, workDir);
+            testcases.add(testCase);
+        }
+        return testcases;
+    }
+
+    public TestCase createTestcase(File resultsFile, File workDir) throws IOException {
+        Properties properties = loadResultsProperties(resultsFile);
+        String name = properties.getProperty("id");
+
+        String classname;
+        String path = workDir.toURI().relativize(resultsFile.toURI()).getPath();
+        if (!path.endsWith("_" + name + ".jtr")) {
+            System.err.println("Path should end with " + name + ".jtr - " + path);
+            classname = properties.getProperty("classname");
+        } else {
+            String classPart = path.substring(0, path.length() - name.length() - 5);
+            classname = classPart.replace('/', '.');
+        }
+
+        String reportFile = reportFileLocator.getReportFile(classname, name);
+
+        boolean failed;
+        boolean error;
+        String msg;
+        String execStatus = properties.getProperty("execStatus");
+        if (execStatus.startsWith("Passed.")) {
+            failed = false;
+            error = false;
+            msg = "";
+        } else if (execStatus.startsWith("Failed.")) {
+            failed = true;
+            error = false;
+            msg = execStatus.substring(7).trim();
+        } else if (execStatus.startsWith("Error.")) {
+            failed = true;
+            error = false;
+            msg = execStatus.substring(6).trim();
+        } else {
+            failed = false;
+            error = true;
+            msg = execStatus;
+        }
+
+        long t = 0;
+        try {
+            long start = DATE_FORMAT.parse(properties.getProperty(("start"))).getTime();
+            long end = DATE_FORMAT.parse(properties.getProperty(("end"))).getTime();
+            t = end - start;
+        } catch (Throwable e) {
+            e.printStackTrace();
+        }
+        long time = t;
+        return new TestCase(name, classname, reportFile, time, failed, error, msg, newResult);
+    }
+
+    private static void findResultFiles(File dir, Collection resultsFiles) {
+        File[] files = dir.listFiles();
+        if (null == files) {
+            return;
+        }
+        for (int i = 0; i < files.length; i++) {
+            if (files[i].isDirectory()) {
+                findResultFiles(files[i], resultsFiles);
+            } else if (files[i].getName().endsWith(".jtr")) {
+                resultsFiles.add(files[i]);
+            }
+        }
+    }
+
+    private static Properties loadResultsProperties(File resultsFile) throws IOException {
+        FileReader in = null;
+        Properties properties = new Properties();
+        try {
+            // we're going to read in line at a time
+            in = new FileReader(resultsFile);
+            LineNumberReader lineReader = new LineNumberReader(in);
+
+            // and write to a string buffer
+            StringWriter stringWriter = new StringWriter();
+            PrintWriter out = new PrintWriter(stringWriter);
+
+            // read until the log start
+            String line;
+            while ((line = lineReader.readLine()) != null) {
+                if (line.startsWith(LOG_START)) {
+                    break;
+                }
+                out.println(line);
+            }
+
+            // now load the properties
+            properties.load(new ByteArrayInputStream(stringWriter.toString().getBytes()));
+        } finally {
+            ReportUtil.close(in);
+        }
+        return properties;
+    }
+}

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Id"

Added: geronimo/gbuild/trunk/src/main/report-resources/h3.gif
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/report-resources/h3.gif?rev=331903&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/gbuild/trunk/src/main/report-resources/h3.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/gbuild/trunk/src/main/report-resources/icon_error_sml.gif
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/report-resources/icon_error_sml.gif?rev=331903&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/gbuild/trunk/src/main/report-resources/icon_error_sml.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/gbuild/trunk/src/main/report-resources/icon_info_sml.gif
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/report-resources/icon_info_sml.gif?rev=331903&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/gbuild/trunk/src/main/report-resources/icon_info_sml.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/gbuild/trunk/src/main/report-resources/icon_success_sml.gif
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/report-resources/icon_success_sml.gif?rev=331903&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/gbuild/trunk/src/main/report-resources/icon_success_sml.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/gbuild/trunk/src/main/report-resources/icon_warning_sml.gif
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/report-resources/icon_warning_sml.gif?rev=331903&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/gbuild/trunk/src/main/report-resources/icon_warning_sml.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/gbuild/trunk/src/main/report-resources/maven-base.css
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/report-resources/maven-base.css?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/report-resources/maven-base.css (added)
+++ geronimo/gbuild/trunk/src/main/report-resources/maven-base.css Tue Nov  8 13:57:27 2005
@@ -0,0 +1,156 @@
+body {
+  margin: 0px;
+  padding: 0px;
+}
+img {
+  border:none;
+}
+table {
+  padding:0px;
+  width: 100%;
+  margin-left: -2px;
+  margin-right: -2px;
+}
+acronym {
+  cursor: help;
+  border-bottom: 1px dotted #feb;
+}
+table.bodyTable th, table.bodyTable td {
+  padding: 2px 4px 2px 4px;
+  vertical-align: top;
+}
+div.clear{
+  clear:both;
+  visibility: hidden;
+}
+div.clear hr{
+  display: none;
+}
+#organizationLogo, #projectLogo {
+  font-size: xx-large; 
+  font-weight: bold;
+}
+#organizationLogo img, #projectLogo img, #organizationLogo span, #projectLogo span{
+  margin: 0px;
+}
+#organizationLogo span, #projectLogo span{
+    border: 1px solid;
+    padding: 4px 10px 4px 10px;
+    background-color: #eee;
+    cursor: pointer;
+}
+.xleft, #organizationLogo img{
+  float:left;
+} 
+.xright, #projectLogo img, #projectLogo span{
+  float:right;
+  text-shadow: #7CFC00;
+}
+#banner {
+  padding: 0px;
+}
+#banner img {
+  border: none;
+}
+#breadcrumbs {
+  padding: 3px 10px 3px 10px;
+}
+#leftColumn {
+ width: 150px;
+ float:left;
+}
+#bodyColumn {
+  margin-right: 1.5em;
+  margin-left: 177px;
+}
+#legend {
+  padding: 8px 0 8px 0;
+}
+#navcolumn {
+  padding: 8px 4px 0 8px;
+}
+#navcolumn h5 {
+  margin: 0;
+  padding: 0;
+  font-size: small;
+}
+#navcolumn ul {
+  margin: 0;
+  padding: 0;
+  font-size: small;
+}
+#navcolumn li {
+  list-style-type: none;
+  background-image: none;
+  background-repeat: no-repeat;
+  background-position: 0 0.4em;
+  padding-left: 16px;
+  list-style-position: outside;
+  line-height: 1.2em;
+  font-size: smaller;
+}
+#navcolumn li.expanded {
+  background-image: url(../images/expanded.gif);
+}
+#navcolumn li.collapsed {
+  background-image: url(../images/collapsed.gif);
+}
+#poweredBy, #poweredByExternal {
+  text-align: center;
+}
+#navcolumn img {
+  margin-top: 10px;
+  margin-bottom: 3px;
+}
+#poweredBy img {
+  display:block;
+  margin: 20px 0 20px 17px;
+  border: 1px solid black;
+  width: 90px;
+  height: 30px;
+}
+#poweredByExternal img {
+  display:block;
+  margin: 20px 0 20px 17px;
+}
+#searchbar img {
+    margin: 0px;
+    display: block;
+}
+#searchbar #q, #searchbar #btnG {
+    border: 1px solid #999;
+    margin-bottom:10px;
+}
+#searchbar form {
+    margin: 0px;
+}
+#lastPublished {
+  font-size: x-small;
+}
+.navSection {
+  margin-bottom: 2px;
+  padding: 8px;
+}
+.navSectionHead {
+  font-weight: bold;
+  font-size: x-small;
+}
+.section {
+  padding: 4px;
+}
+#footer {
+  padding: 3px 10px 3px 10px;
+  font-size: x-small;
+}
+#breadcrumbs {
+  font-size: x-small;
+  margin: 0pt;
+}
+.source {
+  padding: 12px;
+  margin: 1em 7px 1em 7px;
+}
+.source pre {
+  margin: 0px;
+  padding: 0px;
+}

Added: geronimo/gbuild/trunk/src/main/report-resources/maven-stylus.css
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/report-resources/maven-stylus.css?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/report-resources/maven-stylus.css (added)
+++ geronimo/gbuild/trunk/src/main/report-resources/maven-stylus.css Tue Nov  8 13:57:27 2005
@@ -0,0 +1,197 @@
+TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c; PADDING: 0px; }
+TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; }
+TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; }
+
+TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; }
+TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; }
+
+body {
+        background-color: #fff;
+	font-family: Verdana, Helvetica, Arial, sans-serif;
+	margin-left: auto;
+	margin-right: auto;
+	background-repeat: repeat-y;
+	font-size: 13px;
+	padding: 0px;
+}
+td, select, input, li{
+	font-family: Verdana, Helvetica, Arial, sans-serif;
+	font-size: 12px;
+	color:#333333;
+}
+code{
+  font-size: 12px;
+}
+a {
+  text-decoration: none;
+}
+a:link {
+  color:#47a;
+}
+a:visited  {
+  color:#666666;
+}
+a:active, a:hover {
+  color:#990000;
+}
+#legend li.externalLink {
+  background: url(../images/external.png) left top no-repeat;
+  padding-left: 18px;
+}
+a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover {
+  background: url(../images/external.png) right center no-repeat;
+  padding-right: 18px;
+}
+#breadcrumbs a.externalLink, #breadcrumbs a.externalLink:link, #breadcrumbs a.externalLink:visited, #breadcrumbs a.externalLink:active, #breadcrumbs a.externalLink:hover {
+  background: none;
+  padding-right: 0px;
+}
+#legend li.newWindow {
+  background: url(../images/newwindow.png) left top no-repeat;
+  padding-left: 18px;
+}
+a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover {
+  background: url(../images/newwindow.png) right center no-repeat;
+  padding-right: 18px;
+}
+#breadcrumbs a.newWindow, #breadcrumbs a.newWindow:link, #breadcrumbs a.newWindow:visited, #breadcrumbs a.newWindow:active, #breadcrumbs a.newWindow:hover {
+  background: none;
+  padding-right: 0px;
+}
+h2 {
+	font-size: 17px;
+	color: #333333;  
+}
+h3 {
+	padding: 4px 4px 4px 24px;
+	color: #666;
+	background-color: #ccc;
+	font-weight: bold;
+	font-size: 14px;
+	background-image: url(../images/h3.gif);
+	background-repeat: no-repeat;
+	background-position: left bottom;
+}
+p {
+  line-height: 1.3em;
+  font-size: 12px;
+  color: #000;
+}
+#breadcrumbs {
+	height: 13px;
+	background-image: url(../images/breadcrumbs.jpg);
+	padding: 5px 10px 14px 20px;
+}
+* html #breadcrumbs {
+	padding-bottom: 8px;
+}
+#leftColumn {
+	margin: 10px 0 10px 0;
+	border-top-color: #ccc;
+	border-top-style: solid;
+	border-top-width: 1px;
+	border-right-color: #ccc;
+	border-right-style: solid;
+	border-right-width: 1px;
+	border-bottom-color: #ccc;
+	border-bottom-style: solid;
+	border-bottom-width: 1px;
+	padding-right: 5px;
+	padding-left: 5px;
+}
+#navcolumn h5 {
+	font-size: smaller;
+	border-bottom: 1px solid #aaaaaa;
+	padding-top: 2px;
+	padding-left: 9px;
+	color: #49635a;
+	background-image: url(../images/h5.jpg);
+	background-repeat: no-repeat;
+	background-position: left bottom;
+}
+
+table.bodyTable th {
+  color: white;
+  background-color: #bbb;
+  text-align: left;
+  font-weight: bold;
+}
+
+table.bodyTable th, table.bodyTable td {
+  font-size: 11px;
+}
+
+table.bodyTable tr.a {
+  background-color: #ddd;
+}
+
+table.bodyTable tr.b {
+  background-color: #eee;
+}
+
+.source {
+  border: 1px solid #999;
+  overflow:auto
+}
+dt {
+	padding: 4px 4px 4px 24px;
+	color: #333333;
+	background-color: #ccc;
+	font-weight: bold;
+	font-size: 14px;
+	background-image: url(../images/h3.gif);
+	background-repeat: no-repeat;
+	background-position: left bottom;
+}
+.subsectionTitle {
+	font-size: 13px;
+	font-weight: bold;
+	color: #666;
+
+}
+
+table {
+	font-size: 10px;
+}
+.xright a:link, .xright a:visited, .xright a:active {
+  color: #666;
+}
+.xright a:hover {
+  color: #003300;
+}
+#banner {
+	height: 93px;
+	background: url(../images/banner.jpg);
+}
+#navcolumn ul {
+	margin: 5px 0 15px -0em;
+}
+#navcolumn ul a {
+	color: #333333;
+}
+#navcolumn ul a:hover {
+	color: red;
+}
+#intro {
+	border: solid #ccc 1px;
+	margin: 6px 0px 0px 0px;
+	padding: 10px 40px 10px 40px;
+}
+.subsection {
+	margin-left: 3px;
+	color: #333333;
+}
+
+.subsection p {
+	font-size: 12px;
+}
+#footer {
+  padding: 10px;
+  margin: 20px 0px 20px 0px;
+  border-top: solid #ccc 1px; 
+  color: #333333;
+}
+#organizationLogo img, #projectLogo img, #projectLogo span{
+  margin: 0px;
+}
+

Added: geronimo/gbuild/trunk/src/main/report-resources/print.css
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/report-resources/print.css?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/report-resources/print.css (added)
+++ geronimo/gbuild/trunk/src/main/report-resources/print.css Tue Nov  8 13:57:27 2005
@@ -0,0 +1,7 @@
+#banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn {
+  display: none;
+}
+#bodyColumn, body.docs div.docs {
+  margin: 0 !important;
+  border: none !important
+}

Added: geronimo/gbuild/trunk/src/main/report-resources/spacer.gif
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/report-resources/spacer.gif?rev=331903&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/gbuild/trunk/src/main/report-resources/spacer.gif
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/gbuild/trunk/src/main/report-resources/spacer.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/all-xml.vm
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/all-xml.vm?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/all-xml.vm (added)
+++ geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/all-xml.vm Tue Nov  8 13:57:27 2005
@@ -0,0 +1,19 @@
+<total time='$sectionManager.totalTimeString' tests='$sectionManager.testCount' errors='$sectionManager.errorCount' failures='$sectionManager.failureCount'>
+#foreach( $section in $sectionManager.sections )
+    <section name="$section.name" time='$section.totalTimeString' tests='$section.testCount' errors='$section.errorCount' failures='$section.failureCount'>
+#foreach( $testSuite in $section.testSuites )
+        <testsuite name='$testSuite.name'  time='$testSuite.totalTimeString' tests='$testSuite.testCount' errors='$testSuite.errorCount' failures='$testSuite.failureCount' >
+#foreach( $testCase in $testSuite.testcases )
+            <testCase name='$testCase.name' time='$testCase.time'>
+#if( $testCase.failed )
+                <failure message='$testCase.msg' type=''/>
+#elseif( $testCase.error )
+                <error message='$testCase.msg' type=''/>
+#end
+            </testCase>
+#end
+        </testsuite>
+#end
+    </section>
+#end
+</total>

Added: geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/macros.vm
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/macros.vm?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/macros.vm (added)
+++ geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/macros.vm Tue Nov  8 13:57:27 2005
@@ -0,0 +1,93 @@
+#macro( graph $rootDir $item )
+      <table width="200" height="15" cellpadding="0" cellspacing="0" border="0" class="estimateGraph">
+        <tr>
+          #if( $item.passBarSize > 0 )
+          <td class="greenbar"><img src="${rootDir}/resources/spacer.gif" border="0" width="$item.passBarSize" height="1"/></td>
+          #end
+          #if( $item.failBarSize > 0 )
+          <td class="darkredbar"><img src="${rootDir}/resources/spacer.gif" border="0" width="$item.failBarSize" height="1"/></td>
+          #end
+        </tr>
+      </table>
+#end
+
+#macro( testImage $rootDir $testCase )
+    #if( $testCase.passed )
+      #set( $image = "${rootDir}/resources/icon_success_sml.gif" )
+    #elseif( $testCase.failed )
+      #set( $image = "${rootDir}/resources/icon_warning_sml.gif" )
+    #else
+      #set( $image = "${rootDir}/resources/icon_error_sml.gif" )
+    #end
+#end
+
+#macro( setRowStyle )
+    #if( $rowStyle == "a" )
+      #set( $rowStyle = "b" )
+    #else
+      #set( $rowStyle = "a" )
+    #end
+#end
+
+#macro( summaryLine $rootDir $summary )
+      <table class="bodyTable">
+        <tr class="a">
+          <td>
+            Tests: $summary.testCount
+          </td>
+          <td>
+            Errors: $summary.errorCount
+          </td>
+          <td>
+            Failures: $summary.failureCount
+          </td>
+          <td align="center" width="30">${summary.passPercentage}%</td>
+          <td align="center" width="200">
+            #graph( $rootDir $summary )
+          </td>
+          <td>
+            Time: $summary.totalTimeString
+          </td>
+        </tr>
+      </table>
+#end
+
+#macro( resultTable $rootDir $summary )
+<table class="bodyTable">
+  <thead>
+    <tr>
+      <th>Class</th>
+      <th>Tests</th>
+      <th>Errors</th>
+      <th>Failures</th>
+      <th>Success Rate</th>
+      <th>Time</th>
+    </tr>
+  </thead>
+#set( $rowStyle = "a" )
+#foreach( $item in $summary.items )
+  <tr class="$rowStyle">
+    <td>
+      <a href="${summary.name}/${item.name}.html">$item.name</a>
+    </td>
+    <td width="30">
+      $item.testCount
+    </td>
+    <td width="30">
+      $item.errorCount
+    </td>
+    <td width="30">
+      $item.failureCount
+    </td>
+    <td width="200">
+      #graph( $rootDir $item )
+    </td>
+    <td width="30">
+      $item.totalTimeString
+    </td>
+  </tr>
+#setRowStyle()
+#end
+</table>
+#end
+

Added: geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/summary.vm
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/summary.vm?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/summary.vm (added)
+++ geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/summary.vm Tue Nov  8 13:57:27 2005
@@ -0,0 +1,30 @@
+<html>
+  <head>
+    <title>Geronimo : $summary.name</title>
+
+    <style type="text/css" media="all">
+      @import url("${rootDir}/resources/maven-base.css");
+      @import url("${rootDir}/resources/maven-stylus.css");
+    </style>
+    <link rel="stylesheet" href="${rootDir}/resources/print.css" type="text/css" media="print"></link>
+    <META http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+    <div class="section">
+      <a name="$summary.name"></a>
+      <h2>Geronimo : $summary.name</h2>
+      #summaryLine( $rootDir $summary )
+    </div>
+
+    <div class="section">
+      #resultTable( $rootDir $summary )
+    </div>
+    <div class="section">
+      #summaryLine( $rootDir $summary )
+      <p>
+        * Note: Statistics are not computed recursively, they only sum up all of its testsuites numbers.
+      </p>
+    </div>
+  </body>
+</html>

Propchange: geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/summary.vm
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/testsuite.vm
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/testsuite.vm?rev=331903&view=auto
==============================================================================
--- geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/testsuite.vm (added)
+++ geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/testsuite.vm Tue Nov  8 13:57:27 2005
@@ -0,0 +1,48 @@
+<html>
+  <head>
+    <title>Geronimo : $testSuite.name</title>
+
+    <style type="text/css" media="all">
+      @import url("${rootDir}/resources/maven-base.css");
+      @import url("${rootDir}/resources/maven-stylus.css");
+    </style>
+    <link rel="stylesheet" href="${rootDir}/resources/print.css" type="text/css" media="print"></link>
+    <META http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+    <div class="section">
+      <a name="$summary.name"></a>
+      <h2>Geronimo : $testSuite.name</h2>
+      #summaryLine( $rootDir $testSuite )
+    </div>
+
+    <div class="section">
+      <table class="bodyTable">
+#set( $rowStyle = "a" )
+#foreach( $testCase in $testSuite.testCases )
+        <tr class="$rowStyle">
+          <td style="width:20px">
+            #testImage( $rootDir $testCase )
+            <img width="15" height="15" src="$image" alt="Success"></img>
+          </td>
+          <td style="width:98%">
+            #if ( ${testCase.reportFile} )
+            <a href="${reportDir}/${testCase.reportFile}">
+            #end
+            $testCase.name
+            #if ( ${testCase.reportFile} )
+            </a>
+            #end
+          <td style="width:60px">$testCase.timeString</td>
+        </tr>
+#setRowStyle()
+#end
+      </table>
+
+    </div>
+    <div class="section">
+      #summaryLine( $rootDir $testSuite )
+    </div>
+  </body>
+</html>

Propchange: geronimo/gbuild/trunk/src/main/resources/org/apache/geronimo/gbuild/report/testsuite.vm
------------------------------------------------------------------------------
    svn:mime-type = text/html



Mime
View raw message