diff --git a/gbuild-agent-web/pom.xml b/gbuild-agent-web/pom.xml deleted file mode 100644 index 0839a9856e..0000000000 --- a/gbuild-agent-web/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - 4.0.0 - - - org.apache.geronimo.gbuild - gbuild - 1.0-SNAPSHOT - ../pom.xml - - - gbuild-agent-web - GBuild Agent Webapp - - - - - ${pom.groupId} - gbuild-agent - ${pom.version} - - - - org.codehaus.plexus - plexus-service-jetty - 1.0-alpha-3 - plexus-service - - - log4j - log4j - - - - - - org.apache.maven.continuum - continuum-api - - - - org.apache.maven.continuum - continuum-core - - - - org.apache.maven.continuum - continuum-model - - - - org.codehaus.plexus - plexus-command-line - - - - org.apache.geronimo.specs - geronimo-jms_1.1_spec - - - - org.apache.geronimo.specs - geronimo-j2ee-management_1.0_spec - - - - org.apache.geronimo.specs - geronimo-servlet_2.4_spec - - - - - diff --git a/gbuild-agent-web/src/main/java/org/apache/geronimo/gbuild/agent/web/BuildQueueBrowser.java b/gbuild-agent-web/src/main/java/org/apache/geronimo/gbuild/agent/web/BuildQueueBrowser.java deleted file mode 100644 index 59917c8f6c..0000000000 --- a/gbuild-agent-web/src/main/java/org/apache/geronimo/gbuild/agent/web/BuildQueueBrowser.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * - * 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. - */ -package org.apache.geronimo.gbuild.agent.web; - -import org.apache.geronimo.gbuild.agent.Client; -import org.apache.geronimo.gbuild.agent.ClientManager; -import org.codehaus.plexus.logging.AbstractLogEnabled; - -import javax.jms.Message; -import javax.jms.ObjectMessage; -import javax.jms.Queue; -import javax.jms.QueueBrowser; -import javax.jms.Session; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.HashMap; - -/** - * @version $Rev$ $Date$ - */ -public class BuildQueueBrowser extends AbstractLogEnabled implements WebComponent{ - - /** - * @plexus.requirement - */ - private ClientManager clientManager; - - /** - * @plexus.configuration - */ - private String buildTaskQueue; - - /** - * @plexus.configuration - */ - private String keyList; - - /** - * @plexus.configuration - */ - private int maxWidth; - - public void service(HttpServletRequest request, HttpServletResponse response) throws Exception { - getLogger().info("Browsing: "+buildTaskQueue); - - Client client = clientManager.getClient(); - Session session = client.getSession(); - Queue queue = session.createQueue(buildTaskQueue); - QueueBrowser browser = session.createBrowser(queue); - getLogger().info("Browser: "+browser); - - Enumeration enumeration = browser.getEnumeration(); - getLogger().info("Enum: "+enumeration); - - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

Browsing "+buildTaskQueue+"

"); - out.println(""); - - - String[] keys = keyList.split(","); - out.println(""); - for (int i = 0; i < keys.length; i++) { - String key = keys[i]; - out.println(""); - } - out.println(""); - - getLogger().info("Has elements: "+enumeration.hasMoreElements()); - while (enumeration.hasMoreElements()) { - Message message = (Message) enumeration.nextElement(); - getLogger().info("Message: "+message); - if (message instanceof ObjectMessage) { - ObjectMessage objectMessage = (ObjectMessage) message; - Object object = objectMessage.getObject(); - if (object instanceof HashMap) { - HashMap map = (HashMap) object; - - out.println(""); - for (int i = 0; i < keys.length; i++) { - String key = keys[i]; - Object obj = map.get(key); - - String data = obj.toString(); - data = data.substring(0, Math.min(data.length(), maxWidth)); - - out.println(""); - } - out.println(""); - } - } - } - browser.close(); - out.println("
"); - out.print(key); - out.println("
"); - // If the data itself contained xml or html, that would be bad. - out.print(data); - out.println("
"); - out.println(""); - out.close(); - } -} diff --git a/gbuild-agent-web/src/main/java/org/apache/geronimo/gbuild/agent/web/WebComponent.java b/gbuild-agent-web/src/main/java/org/apache/geronimo/gbuild/agent/web/WebComponent.java deleted file mode 100644 index feb862171e..0000000000 --- a/gbuild-agent-web/src/main/java/org/apache/geronimo/gbuild/agent/web/WebComponent.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - * 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. - */ -package org.apache.geronimo.gbuild.agent.web; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @version $Rev$ $Date$ - */ -public interface WebComponent { - - String ROLE = WebComponent.class.getName(); - - void service(HttpServletRequest request, HttpServletResponse response) throws Exception; -} diff --git a/gbuild-agent-web/src/main/java/org/apache/geronimo/gbuild/agent/web/WebComponentInvoker.java b/gbuild-agent-web/src/main/java/org/apache/geronimo/gbuild/agent/web/WebComponentInvoker.java deleted file mode 100644 index 5de8bd86fb..0000000000 --- a/gbuild-agent-web/src/main/java/org/apache/geronimo/gbuild/agent/web/WebComponentInvoker.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * - * 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. - */ -package org.apache.geronimo.gbuild.agent.web; - -import org.codehaus.plexus.PlexusConstants; -import org.codehaus.plexus.PlexusContainer; -import org.codehaus.plexus.component.repository.exception.ComponentLookupException; - -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Map; -import java.util.Iterator; - -/** - * @version $Rev$ $Date$ - */ -public class WebComponentInvoker extends HttpServlet implements javax.servlet.Servlet { - - - protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String contextPath = request.getContextPath() + "/"; - String requestURI = request.getRequestURI().replaceFirst(contextPath, ""); - System.out.println("requestURI = " + requestURI); - if (requestURI.length() > 0) { - WebComponent webComponent = null; - try { - webComponent = (WebComponent) getPlexusContainer().lookup(WebComponent.ROLE, requestURI); - } catch (Exception e) { - response.setContentType("text/plain"); - response.getWriter().println("No such WebComponent: " + requestURI + ". " + e.getMessage()); - return; - } - try { - webComponent.service(request, response); - } catch (Exception e) { - response.setContentType("text/plain"); - PrintWriter writer = response.getWriter(); - writer.println("Error invoking WebComponent: " + requestURI + "." + e.getMessage()); - e.printStackTrace(writer); - return; - } - } else { - try { - PlexusContainer plexusContainer = getPlexusContainer(); - Map map = plexusContainer.lookupMap(WebComponent.ROLE); - for (Iterator iterator = map.entrySet().iterator(); iterator.hasNext();) { - Map.Entry entry = (Map.Entry) iterator.next(); - Object key = entry.getKey(); - Object value = entry.getValue(); - - response.setContentType("text/plain"); - PrintWriter out = response.getWriter(); - out.println(key +" \t " + value); - } - } catch (ComponentLookupException e) { - e.printStackTrace(); - response.setContentType("text/plain"); - PrintWriter writer = response.getWriter(); - writer.println("Error invoking WebComponent: " + requestURI + "." + e.getMessage()); - e.printStackTrace(writer); - } - } - } - - - public PlexusContainer getPlexusContainer() { - ServletContext servletContext = getServletContext(); - return (PlexusContainer) servletContext.getAttribute(PlexusConstants.PLEXUS_KEY); - } - - -} diff --git a/gbuild-agent-web/src/main/resources/META-INF/plexus/components.xml b/gbuild-agent-web/src/main/resources/META-INF/plexus/components.xml deleted file mode 100644 index 647cf411d0..0000000000 --- a/gbuild-agent-web/src/main/resources/META-INF/plexus/components.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - org.apache.geronimo.gbuild.agent.web.WebComponent - taskqueue - org.apache.geronimo.gbuild.agent.web.BuildQueueBrowser - - - org.apache.geronimo.gbuild.agent.ClientManager - - - - BUILD.TASKS - project.name,project.version,build.name - 100 - - - - - diff --git a/gbuild-agent-web/src/main/resources/WEB-INF/web.xml b/gbuild-agent-web/src/main/resources/WEB-INF/web.xml deleted file mode 100644 index 68e410e72e..0000000000 --- a/gbuild-agent-web/src/main/resources/WEB-INF/web.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - gbuild - org.apache.geronimo.gbuild.agent.web.WebComponentInvoker - 5 - - - - gbuild - /* - - - \ No newline at end of file diff --git a/gbuild-agent-web/src/site/site.xml b/gbuild-agent-web/src/site/site.xml deleted file mode 100644 index caf563583b..0000000000 --- a/gbuild-agent-web/src/site/site.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - ${parentProject} - - ${modules} - - ${reports} - - - - - - diff --git a/gbuild-report/maven.xml b/gbuild-report/maven.xml deleted file mode 100644 index 22ed5a3e21..0000000000 --- a/gbuild-report/maven.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - diff --git a/gbuild-report/pom.xml b/gbuild-report/pom.xml deleted file mode 100644 index 84b16af0c8..0000000000 --- a/gbuild-report/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - 4.0.0 - - - org.apache.geronimo.gbuild - gbuild - 1.0-SNAPSHOT - ../pom.xml - - - gbuild-report - GBuild Report - - - - - velocity - velocity - 1.4 - - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - process-classes - - run - - - - - - - - - - - - - - - - diff --git a/gbuild-report/project.properties b/gbuild-report/project.properties deleted file mode 100644 index 2c1d8ed7e5..0000000000 --- a/gbuild-report/project.properties +++ /dev/null @@ -1,16 +0,0 @@ -maven.repo.remote=\ -http://dist.codehaus.org,\ -http://www.ibiblio.org/maven,\ -http://cvs.apache.org/repository - -maven.repo.list=apache -maven.repo.apache=scp://cvs.apache.org -maven.repo.apache.directory=/www/cvs.apache.org/repository -maven.repo.apache.username=${user.name} - - -maven.compile.source=1.4 -maven.compile.target=1.4 -#maven.compile.deprecation=true -maven.compile.debug=true -maven.compile.optimize=true diff --git a/gbuild-report/project.xml b/gbuild-report/project.xml deleted file mode 100644 index 4168905763..0000000000 --- a/gbuild-report/project.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - 3 - org.apache.geronimo.gbuild - gbuild - 1.0-SNAPSHOT - gbuild - gbuild - - - - velocity - velocity - 1.4 - - - - src/main/java - src/test/java - scm@geronimo.apache.org - - - - ${basedir}/src/main/resources - - - - - - **/*Test.java - - - - - diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java deleted file mode 100644 index 8d3e38cade..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/GenerateReport.java +++ /dev/null @@ -1,257 +0,0 @@ -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; - - public GenerateReport(File sectionsFile, File workDir, File reportsDir, File outputDir, boolean forceHtml) { - this.sectionsFile = sectionsFile; - this.workDir = workDir; - this.reportsDir = reportsDir; - this.outputDir = outputDir; - this.forceHtml = forceHtml; - } - - public static void main(String[] args) throws Exception { - long processStart = System.currentTimeMillis(); - - if (args.length != 4 && args.length != 5) { - System.out.println("Usage:"); - System.out.println(" java org.apache.geronimo.gbuild.report.ProcessResults sectionsFile workDir reportsDir outputDir [forceHtml]"); - 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; - } - } - - boolean forceHtml = false; - if (args.length > 4) { - forceHtml = args[4].equalsIgnoreCase("true"); - } - - if (!outputDir.isDirectory()) { - System.out.println("outputDir is not a directory: " + outputDir.getAbsolutePath()); - return; - } - - new GenerateReport(sectionsFile, workDir, reportsDir, outputDir, forceHtml).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); - } - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java deleted file mode 100644 index 0511e11840..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/ReportFileLocator.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * 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; - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java deleted file mode 100644 index f262cec7b6..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/ReportUtil.java +++ /dev/null @@ -1,247 +0,0 @@ -/** - * - * 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(); - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/Section.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/Section.java deleted file mode 100644 index be59e94164..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/Section.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * - * 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; - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java deleted file mode 100644 index 9b67975dc9..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/SectionManager.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * - * 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; - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java deleted file mode 100644 index e2fb65db3e..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportLoader.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * 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; - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java deleted file mode 100644 index 4a6a50222a..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/SummaryReportUtil.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * - * 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); - if (testCase != null) { - 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) { - try { - 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); - } catch (NumberFormatException e) { - System.out.println("FAILED TO PARSE - "+storeName +" = "+storeValue); - return null; - } - } - - 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(); - } - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java deleted file mode 100644 index 84e644f7a4..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/TestCase.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * - * 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); - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java deleted file mode 100644 index 20816655d2..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/TestSuite.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * - * 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; - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java deleted file mode 100644 index 05a7d8ef63..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/WorkDirLoader.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * - * 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; - } -} diff --git a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/WorkDirReport.java b/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/WorkDirReport.java deleted file mode 100644 index baac8de216..0000000000 --- a/gbuild-report/src/main/java/org/apache/geronimo/gbuild/report/WorkDirReport.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * 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. - */ -package org.apache.geronimo.gbuild.report; - -import java.io.File; -import java.util.Arrays; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * @version $Rev$ $Date$ - */ -public class WorkDirReport { - private final File workDir; - private final File outputDir; - - public WorkDirReport(File workDir, File outputDir) { - this.workDir = workDir; - this.outputDir = outputDir; - } - - public static void main(String[] args) throws Exception { - long processStart = System.currentTimeMillis(); - - if (args.length != 2) { - System.out.println("Usage:"); - System.out.println(" java org.apache.geronimo.gbuild.report.WorkDirReport sectionsFile workDir reportsDir outputDir"); - System.out.println(Arrays.asList(args)); - return; - } - - // work directory - File workDir = new File(args[0]); - if (workDir.exists() && !workDir.isDirectory()) { - System.out.println("workDir is not a directory: " + workDir.getAbsolutePath()); - return; - } - - // output directory - File outputDir = new File(args[1]); - 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 WorkDirReport(workDir, 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"); - } - - // write work summary - SummaryReportUtil.saveTestCases(workTestCases, new File(outputDir, "work.properties")); - } - -} diff --git a/gbuild-report/src/main/report-resources/h3.gif b/gbuild-report/src/main/report-resources/h3.gif deleted file mode 100644 index 025524d2bd..0000000000 Binary files a/gbuild-report/src/main/report-resources/h3.gif and /dev/null differ diff --git a/gbuild-report/src/main/report-resources/icon_error_sml.gif b/gbuild-report/src/main/report-resources/icon_error_sml.gif deleted file mode 100644 index 61132ef2b0..0000000000 Binary files a/gbuild-report/src/main/report-resources/icon_error_sml.gif and /dev/null differ diff --git a/gbuild-report/src/main/report-resources/icon_info_sml.gif b/gbuild-report/src/main/report-resources/icon_info_sml.gif deleted file mode 100644 index c6cb9ad7ce..0000000000 Binary files a/gbuild-report/src/main/report-resources/icon_info_sml.gif and /dev/null differ diff --git a/gbuild-report/src/main/report-resources/icon_success_sml.gif b/gbuild-report/src/main/report-resources/icon_success_sml.gif deleted file mode 100644 index 52e85a430a..0000000000 Binary files a/gbuild-report/src/main/report-resources/icon_success_sml.gif and /dev/null differ diff --git a/gbuild-report/src/main/report-resources/icon_warning_sml.gif b/gbuild-report/src/main/report-resources/icon_warning_sml.gif deleted file mode 100644 index 873bbb52cb..0000000000 Binary files a/gbuild-report/src/main/report-resources/icon_warning_sml.gif and /dev/null differ diff --git a/gbuild-report/src/main/report-resources/maven-base.css b/gbuild-report/src/main/report-resources/maven-base.css deleted file mode 100644 index 3fff4dffee..0000000000 --- a/gbuild-report/src/main/report-resources/maven-base.css +++ /dev/null @@ -1,156 +0,0 @@ -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; -} diff --git a/gbuild-report/src/main/report-resources/maven-stylus.css b/gbuild-report/src/main/report-resources/maven-stylus.css deleted file mode 100644 index a081b3a3e0..0000000000 --- a/gbuild-report/src/main/report-resources/maven-stylus.css +++ /dev/null @@ -1,197 +0,0 @@ -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; -} - diff --git a/gbuild-report/src/main/report-resources/print.css b/gbuild-report/src/main/report-resources/print.css deleted file mode 100644 index 8c7edff592..0000000000 --- a/gbuild-report/src/main/report-resources/print.css +++ /dev/null @@ -1,7 +0,0 @@ -#banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { - display: none; -} -#bodyColumn, body.docs div.docs { - margin: 0 !important; - border: none !important -} diff --git a/gbuild-report/src/main/report-resources/spacer.gif b/gbuild-report/src/main/report-resources/spacer.gif deleted file mode 100755 index fc2560981e..0000000000 Binary files a/gbuild-report/src/main/report-resources/spacer.gif and /dev/null differ diff --git a/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/all-xml.vm b/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/all-xml.vm deleted file mode 100644 index 4865899560..0000000000 --- a/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/all-xml.vm +++ /dev/null @@ -1,19 +0,0 @@ - -#foreach( $section in $sectionManager.sections ) -
-#foreach( $testSuite in $section.testSuites ) - -#foreach( $testCase in $testSuite.testcases ) - -#if( $testCase.failed ) - -#elseif( $testCase.error ) - -#end - -#end - -#end -
-#end -
diff --git a/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/macros.vm b/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/macros.vm deleted file mode 100644 index 0d9c1a146a..0000000000 --- a/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/macros.vm +++ /dev/null @@ -1,93 +0,0 @@ -#macro( graph $rootDir $item ) - - - #if( $item.passBarSize > 0 ) - - #end - #if( $item.failBarSize > 0 ) - - #end - -
-#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 ) - - - - - - - - - -
- Tests: $summary.testCount - - Errors: $summary.errorCount - - Failures: $summary.failureCount - ${summary.passPercentage}% - #graph( $rootDir $summary ) - - Time: $summary.totalTimeString -
-#end - -#macro( resultTable $rootDir $summary ) - - - - - - - - - - - -#set( $rowStyle = "a" ) -#foreach( $item in $summary.items ) - - - - - - - - -#setRowStyle() -#end -
ClassTestsErrorsFailuresSuccess RateTime
- $item.name - - $item.testCount - - $item.errorCount - - $item.failureCount - - #graph( $rootDir $item ) - - $item.totalTimeString -
-#end - diff --git a/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/summary.vm b/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/summary.vm deleted file mode 100644 index 57b46d5e93..0000000000 --- a/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/summary.vm +++ /dev/null @@ -1,30 +0,0 @@ - - - Geronimo : $summary.name - - - - - - - -
- -

Geronimo : $summary.name

- #summaryLine( $rootDir $summary ) -
- -
- #resultTable( $rootDir $summary ) -
-
- #summaryLine( $rootDir $summary ) -

- * Note: Statistics are not computed recursively, they only sum up all of its testsuites numbers. -

-
- - diff --git a/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/testsuite.vm b/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/testsuite.vm deleted file mode 100644 index 76f5eb6543..0000000000 --- a/gbuild-report/src/main/resources/org/apache/geronimo/gbuild/report/testsuite.vm +++ /dev/null @@ -1,48 +0,0 @@ - - - Geronimo : $testSuite.name - - - - - - - -
- -

Geronimo : $testSuite.name

- #summaryLine( $rootDir $testSuite ) -
- -
- -#set( $rowStyle = "a" ) -#foreach( $testCase in $testSuite.testCases ) - - - - -#setRowStyle() -#end -
- #testImage( $rootDir $testCase ) - Success - - #if ( ${testCase.reportFile} ) - - #end - $testCase.name - #if ( ${testCase.reportFile} ) - - #end - $testCase.timeString
- -
-
- #summaryLine( $rootDir $testSuite ) -
- - diff --git a/gbuild-report/src/site/site.xml b/gbuild-report/src/site/site.xml deleted file mode 100644 index caf563583b..0000000000 --- a/gbuild-report/src/site/site.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - ${parentProject} - - ${modules} - - ${reports} - - - - - - diff --git a/gbuild-report/src/test/java/org/apache/geronimo/gbuild/report/RelativePathTest.java b/gbuild-report/src/test/java/org/apache/geronimo/gbuild/report/RelativePathTest.java deleted file mode 100644 index 3c9f620ec1..0000000000 --- a/gbuild-report/src/test/java/org/apache/geronimo/gbuild/report/RelativePathTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * - * 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 junit.framework.TestCase; - -import java.io.File; - -/** - * @version $Rev$ $Date$ - */ -public class RelativePathTest extends TestCase { - public void testRelativeSame() { - File source = new File("/one/two/three/four"); - File target = new File("/one/two/three/four"); - String expectedPath = "."; - relativeTests(expectedPath, source, target); - } - - public void testRelativeParent() { - File source = new File("/one/two/three/four/five/six/seven"); - File target = new File("/one/two/three/four"); - String expectedPath = "../../.."; - relativeTests(expectedPath, source, target); - } - - public void testRelativeChild() { - File source = new File("/one/two/three/four"); - File target = new File("/one/two/three/four/five/six/seven"); - String expectedPath = "five/six/seven"; - relativeTests(expectedPath, source, target); - } - - public void testRelativeDirs() { - File source = new File("/one/two/three/four/five/six/seven"); - File target = new File("/one/two/three/four/cinco/seis/siete"); - String expectedPath = "../../../cinco/seis/siete"; - relativeTests(expectedPath, source, target); - } - - public void testNotRelative() { - File source = new File("/one/two/three/four"); - File target = new File("/uno/dos/tres/cuatro"); - String expectedPath = "/uno/dos/tres/cuatro"; - relativeTests(expectedPath, source, target); - } - - public void testRelativeSameWithSpaces() { - File source = new File("/o n e/t w o/t h r e e/f o u r"); - File target = new File("/o n e/t w o/t h r e e/f o u r"); - String expectedPath = "."; - relativeTests(expectedPath, source, target); - } - - public void testRelativeParentWithSpaces() { - File source = new File("/o n e/t w o/t h r e e/f o u r/f i v e/six/seven"); - File target = new File("/o n e/t w o/t h r e e/f o u r"); - String expectedPath = "../../.."; - relativeTests(expectedPath, source, target); - } - - public void testRelativeChildWithSpaces() { - File source = new File("/o n e/t w o/t h r e e/f o u r"); - File target = new File("/o n e/t w o/t h r e e/f o u r/f i v e/s i x/s e v e n"); - String expectedPath = "f i v e/s i x/s e v e n"; - relativeTests(expectedPath, source, target); - } - - public void testRelativeDirsWithSpaces() { - File source = new File("/o n e/t w o/t h r e e/f o u r/f i v e/s i x/s e v e n"); - File target = new File("/o n e/t w o/t h r e e/f o u r/c i n c o/s e i s/s i e t e"); - String expectedPath = "../../../c i n c o/s e i s/s i e t e"; - relativeTests(expectedPath, source, target); - } - - public void testNotRelativeWithSpaces() { - File source = new File("/o n e/t w o/t h r e e/f o u r"); - File target = new File("/u n o/d o s/t r e s/c u a t r o"); - String expectedPath = "/u n o/d o s/t r e s/c u a t r o"; - relativeTests(expectedPath, source, target); - } - - private void relativeTests(String expectedPath, File source, File target) { - relativeTest(expectedPath, source, target); - relativeTest(expectedPath, source, target.getAbsoluteFile()); - relativeTest(expectedPath, source, ReportUtil.normalizeFile(target)); - } - - private void relativeTest(String expectedPath, File sourceDir, File targetFile) { - String path = ReportUtil.relativePath(sourceDir, targetFile); - assertEquals(expectedPath, path); - File normalizedTarget = ReportUtil.normalizeFile(targetFile); - File normalizedPath = new File(path); - if (!normalizedPath.isAbsolute()) normalizedPath = new File(sourceDir, path); - normalizedPath = ReportUtil.normalizeFile(normalizedPath); - assertEquals(normalizedTarget, normalizedPath); - } - -}