alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  
<TD> </TR> <TR> <TD>OS <TD> </TR> <TR> <TD>JDK Version <TD> </TR> </TABLE> <xsl:variable name="testSuiteCount" select="count(../testsuites/testsuite)"/> <xsl:variable name="testCount" select="count(../testsuites/testsuite/tests/test)"/> <xsl:variable name="passedTestCount" select="count(../testsuites/testsuite/tests/test/status[@value='pass'])"/> <xsl:variable name="failedTestCount" select="count(../testsuites/testsuite/tests/test/status[@value='fail'])"/> <xsl:variable name="dnrTestCount" select="count(../testsuites/testsuite/tests/test/status[@value='did_not_run'])"/> <xsl:variable name="testCaseCount" select="count(../testsuites/testsuite/tests/test/testcases/testcase)"/> <xsl:variable name="passedTestCaseCount" select="count(../testsuites/testsuite/tests/test/testcases/testcase/status[@value='pass'])"/> <xsl:variable name="failedTestCaseCount" select="count(../testsuites/testsuite/tests/test/testcases/testcase/status[@value='fail'])"/> <xsl:variable name="dnrTestCaseCount" select="count(../testsuites/testsuite/tests/test/testcases/testcase/status[@value='did_not_run'])"/> <HR/> <A NAME="Summary"/> <H3> Summary Test Results <TABLE BORDER="1"> <TR> <TH>Item <TH>Total <TH>Pass <TH>Fail <TH>Did Not Run </TR> <TR> <TD ALIGN="CENTER">Test Suites <TD ALIGN="RIGHT"> <TD ALIGN="RIGHT"> <TD ALIGN="RIGHT"> <TD ALIGN="RIGHT"> </TR> <TR> <TD ALIGN="CENTER">Test Cases <TD ALIGN="RIGHT"> <TD ALIGN="RIGHT"> <TD ALIGN="RIGHT"> <TD ALIGN="RIGHT"> </TR> </TABLE> </xsl:template> <xsl:template match="testsuites"> <HR/> <A NAME="DetailedResults"/> <H2> Detailed Results <TABLE BORDER="1"> <TR> <TD ALIGN="CENTER"> Test Suite Link <TD ALIGN="CENTER"> Fail Count <TD ALIGN="CENTER"> Pass Count <TD ALIGN="CENTER"> Total Count </TR> <xsl:for-each select="testsuite"> <xsl:variable name="testCount" select="count(.//testcase)"/> <xsl:variable name="failtestCount" select="count(.//testcase/status[@value='fail'])"/> <xsl:variable name="passtestCount" select="count(.//testcase/status[@value='pass'])"/> <TR> <TD ALIGN="CENTER"> <A HREF="#{generate-id(id)}"> </TD> <TD ALIGN="CENTER"> <FONT COLOR="RED"> </TD> <TD ALIGN="CENTER"> <FONT COLOR="GREEN"> </TD> <TD ALIGN="CENTER"> <FONT COLOR="BLUE"> </TD> </TR> </xsl:for-each> </TABLE> <HR/> <xsl:for-each select="testsuite"> <xsl:variable name="myname"> <xsl:choose> <xsl:when test="name!=''"> <xsl:value-of select="name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$filler"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="mydescription"> <xsl:choose> <xsl:when test="description!=''"> <xsl:value-of select="description"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$description-filler"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="mytestCount" select="count(.//testcase)"/> <xsl:variable name="myFailtestCount" select="count(.//testcase/status[@value='fail'])"/> <xsl:variable name="myPasstestCount" select="count(.//testcase/status[@value='pass'])"/> <TABLE BORDER="0" BGCOLOR="silver"> <TR> <TD>Testsuite Number <TD> </TR> <TR> <TD>Testsuite Id <TD> </TR> <TR> <TD>Testsuite Name <TD> </TR> <TR> <TD>Testsuite Description <TD> </TR> <TR> <TD>Total Test Cases Run <TD> </TR> <TR> <TD>Total Test Cases Failed <TD> </TR> <TR> <TD>Total Test Cases Passed <TD> </TR> </TABLE> <TABLE BORDER="1" BGCOLOR="silver"> <TR VALIGN="TOP"> <TH> Name <TH> Status </TR> <xsl:apply-templates select="tests"/> </TABLE> <BR/> <P ALIGN="LEFT"> <FONT SIZE="-2"> [<A HREF="#DetailedResults"> Detailed Results | <A HREF="#Summary"> Summary | <A HREF="#TOP"> Top ] </FONT> </P> </xsl:for-each> </xsl:template> <xsl:template match="tests"> <xsl:for-each select="test"> <xsl:variable name="myname"> <xsl:choose> <xsl:when test="name!=''"> <xsl:value-of select="name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$filler"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="status/@value='pass'"> <xsl:call-template name="test-row"> <xsl:with-param name="color" select="$testPassColor"/> </xsl:call-template> </xsl:if> <xsl:if test="status/@value='fail'"> <xsl:call-template name="test-row"> <xsl:with-param name="color" select="$failColor"/> </xsl:call-template> </xsl:if> <xsl:if test="status/@value='did_not_run'"> <xsl:call-template name="test-row"> <xsl:with-param name="color" select="$dnrColor"/> </xsl:call-template> </xsl:if> <xsl:apply-templates select="testcases"/> </xsl:for-each> </xsl:template> <xsl:template name="test-row"> <xsl:param name="color"/> <xsl:variable name="myname"> <xsl:choose> <xsl:when test="name!=''"> <xsl:value-of select="name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$filler"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="mystatus"> <xsl:choose> <xsl:when test="status!=''"> <xsl:value-of select="status"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$filler"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="concat('<TR BGCOLOR=', $color, '>')" disable-output-escaping="yes"/> <TD VALIGN="TOP"> <xsl:value-of select="concat('<TD VALIGN=TOP BGCOLOR=', $color, '>')" disable-output-escaping="yes"/> <xsl:value-of select="status/@value"/> <xsl:value-of select="concat('<', '/TD', '>')" disable-output-escaping="yes"/> <xsl:value-of select="concat('<', '/TR', '>')" disable-output-escaping="yes"/> </xsl:template> <xsl:template match="testcases"> <xsl:for-each select="testcase"> <xsl:if test="status/@value='pass'"> <xsl:call-template name="testcase-row"> <xsl:with-param name="color" select="$passColor"/> </xsl:call-template> </xsl:if> <xsl:if test="status/@value='fail'"> <xsl:call-template name="testcase-row"> <xsl:with-param name="color" select="$failColor"/> </xsl:call-template> </xsl:if> <xsl:if test="status/@value='did_not_run'"> <xsl:call-template name="testcase-row"> <xsl:with-param name="color" select="$dnrColor"/> </xsl:call-template> </xsl:if> </xsl:for-each> </xsl:template> <xsl:template name="testcase-row"> <xsl:param name="color"/> <xsl:variable name="myname"> <xsl:choose> <xsl:when test="name!=''"> <xsl:value-of select="name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$filler"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <TR> <TD VALIGN="TOP"> <!-- --> <xsl:value-of select="concat('<TD VALIGN=TOP BGCOLOR=', $color, '>')" disable-output-escaping="yes"/> <xsl:value-of select="status/@value"/> <xsl:value-of select="concat('<', '/TD', '>')" disable-output-escaping="yes"/> </TR> </xsl:template> </xsl:stylesheet>

Other Glassfish examples (source code examples)

Here is a short list of links related to this Glassfish j2eeReporter.xsl source code file:

Glassfish example source code file (j2eeReporter.xsl)

This example Glassfish source code file (j2eeReporter.xsl) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Glassfish tags/keywords

a, align, align, b, center, center, license, table, td, td, test, th, tr, tr

The Glassfish j2eeReporter.xsl source code

<?xml version="1.0" ?>
<!--

    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

    Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.

    The contents of this file are subject to the terms of either the GNU
    General Public License Version 2 only ("GPL") or the Common Development
    and Distribution License("CDDL") (collectively, the "License").  You
    may not use this file except in compliance with the License.  You can
    obtain a copy of the License at
    https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
    or packager/legal/LICENSE.txt.  See the License for the specific
    language governing permissions and limitations under the License.

    When distributing the software, include this License Header Notice in each
    file and include the License file at packager/legal/LICENSE.txt.

    GPL Classpath Exception:
    Oracle designates this particular file as subject to the "Classpath"
    exception as provided by Oracle in the GPL Version 2 section of the License
    file that accompanied this code.

    Modifications:
    If applicable, add the following below the License Header, with the fields
    enclosed by brackets [] replaced by your own identifying information:
    "Portions Copyright [year] [name of copyright owner]"

    Contributor(s):
    If you wish your version of this file to be governed by only the CDDL or
    only the GPL Version 2, indicate your decision by adding "[Contributor]
    elects to include this software in this distribution under the [CDDL or GPL
    Version 2] license."  If you don't indicate a single choice of license, a
    recipient has the option to distribute your version of this file under
    either the CDDL, the GPL Version 2 or to extend the choice of license to
    its licensees as provided above.  However, if you add GPL Version 2 code
    and therefore, elected the GPL Version 2 license, then the option applies
    only if the new code is made subject to such option by the copyright
    holder.

-->

<xsl:stylesheet
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:Reporter="http://jse.east.sun.com/sqe/wspack/reporter/result.dtd"
	version="1.0">

<xsl:output method="html" indent="yes"/>
<xsl:strip-space elements="description"/>
<xsl:variable name="filler"> 
<xsl:variable name="description-filler">This Test Suite has no description

<xsl:variable name="passColor">silver
<xsl:variable name="failColor">red
<xsl:variable name="dnrColor">yellow
<xsl:variable name="testPassColor">0099CC

<xsl:template match="/">
	<html>
		<A NAME="TOP"/>
		<head>
			<title>GlassFish V3 Test Results
		</head>
		<body BGCOLOR="white">
			<xsl:apply-templates/>
		</body>
	</html>
</xsl:template>

<xsl:template match="report">
	<CENTER>
		<br/>
		<H2>GlassFish V3 Test Result Report
		<xsl:apply-templates/>
	</CENTER>
</xsl:template>

<xsl:template match="date">
	<H3>Execution Date:
</xsl:template>


<xsl:template match="configuration">

	<TABLE BORDER="1">
		<TR>
			<TH COLSPAN="2">Configuration Information
		</TR>
		<TR>
			<TD>Machine Name
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.