harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r534714 - in /harmony/enhanced/buildtest/branches/2.0: ./ adaptors/classlib/ adaptors/drlvm/ scripts/ scripts/xslt/
Date Thu, 03 May 2007 05:31:21 GMT
Author: smishura
Date: Wed May  2 22:31:19 2007
New Revision: 534714

URL: http://svn.apache.org/viewvc?view=rev&rev=534714
Log:
Apply patch from HARMONY-3798:
([testing] there is no default publisher implementation in the current BTI v 2.0)

Added:
    harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/xslt/
    harmony/enhanced/buildtest/branches/2.0/scripts/xslt/br.xsl   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/xslt/errors.xsl   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/xslt/header.xsl   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/xslt/modifications.xsl   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/xslt/unittests.xsl   (with props)
Modified:
    harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml
    harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml
    harmony/enhanced/buildtest/branches/2.0/build.xml
    harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml
    harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template
    harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml

Modified: harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml?view=diff&rev=534714&r1=534713&r2=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml Wed May  2 22:31:19 2007
@@ -8,7 +8,7 @@
     </shared>
 
     <!-- CC specific configuration -->
-    <cc> 
+    <cc publish="false">
         <!-- reference to the value by parameter ID -->
         <usesvn refid="trunk.dir.id"/>
         <!-- reference to the value by property name -->

Modified: harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml?view=diff&rev=534714&r1=534713&r2=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml Wed May  2 22:31:19 2007
@@ -20,7 +20,7 @@
     </shared>
 
     <!-- CC specific configuration -->
-    <cc> 
+    <cc publish="false"> 
         <!-- reference to the value by parameter ID -->
         <usesvn refid="trunk.dir.id"/>
         <!-- reference to the value by property name -->

Modified: harmony/enhanced/buildtest/branches/2.0/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/build.xml?view=diff&rev=534714&r1=534713&r2=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/build.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/build.xml Wed May  2 22:31:19 2007
@@ -115,8 +115,6 @@
         <description>&runDocumentation;</description>
     </target>
 
-    <target name="create-cc-configuration_"/>
-
     <target name="run-cc" description="run-cc"
             depends="init-framework, init-suites, setup-suites, check-status,
                         prepare-cc, create-cc-configuration">

Modified: harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml?view=diff&rev=534714&r1=534713&r2=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml Wed May  2 22:31:19 2007
@@ -45,7 +45,9 @@
     </target>
 
     <!-- is called from CC to launch the custom ant publisher for ${test.suite} -->
-    <target name="cc-publish" depends="load-properties, define-ant-contrib">
+    <target name="cc-publish" 
+            depends="load-properties, define-ant-contrib"
+            if="framework.parameters.usemail">
         <dirname property="publisher.dir" file="${publisher.location}"/>
         <log message="Calling Publisher ${publisher.location} at ${publisher.dir} for ${suite.name}"/>
         <ant dir="${publisher.dir}" 
@@ -138,12 +140,23 @@
                 </if>
                 <!-- insert custom publisher -->
                 <if>
-                    <isset property="@{suite.name}.parameters.cc.publisher"/>
+                    <not><isfalse value="${@{suite.name}.parameters.cc.publish}"/></not>
                 <then>
-                    <insert-publisher
-                        suite="@{suite.name}"
-                        publisher="${@{suite.name}.parameters.cc.publisher}"
-                        ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+                    <if>
+                        <isset property="@{suite.name}.parameters.cc.publisher"/>
+                    <then>
+                        <insert-publisher
+                            suite="@{suite.name}"
+                            publisher="${@{suite.name}.parameters.cc.publisher}"
+                            ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+                    </then>
+                    <else>
+                        <insert-publisher
+                            suite="@{suite.name}"
+                            publisher="${scripts.dir}/publisher.xml"
+                            ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+                    </else>
+                    </if>
                 </then>
                 </if>
                 <!-- insert the results directory publisher -->
@@ -476,7 +489,7 @@
                 />
                 <replacefilter 
                     token="&lt;!-- @BT.PUBLISHER@ --&gt;" 
-                    value="&lt;antpublisher 
+                    value="&lt;antpublisher@NL@
                 anthome='${ant.home}'@NL@
                 timeout='${cc.project.execution.timeout}'@NL@
                 antWorkingDir='${root.dir}'@NL@

Modified: harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template?view=diff&rev=534714&r1=534713&r2=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template (original)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template Wed May  2 22:31:19 2007
@@ -4,6 +4,9 @@
 # framework.parameters.usemail.to=some@mail.address.net
 # framework.parameters.usemail.from=me@some.host
 
+# Prefix to be used in subject field of the mail notifications
+framework.parameters.mail.prefix=[build-test alert]
+
 # Do you want to see framework execution log?
 framework.parameters.options.dolog=false
 

Modified: harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml?view=diff&rev=534714&r1=534713&r2=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml Wed May  2 22:31:19 2007
@@ -26,6 +26,9 @@
             dir="cruisecontrol-bin-2.6.1"
             inc="*/lib/**,*/webapps/**"
         />
+        <xalan
+            url="http://mirrors.ibiblio.org/pub/mirrors/maven2/xalan/xalan/2.7.0/xalan-2.7.0.jar"
+            md5="a018d032c21a873225e702b36b171a10"/>
     </external>
 </parameters>
 

Added: harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml?view=auto&rev=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml Wed May  2 22:31:19 2007
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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. -->
+
+<!-- ====================================================================== 
+                        Status Publisher Implementation
+     ====================================================================== -->
+<project name="publisher" default="run" basedir=".">
+
+    <condition property="execution.status" 
+               value="BUILD PASSED"
+               else="BUILD FAILED">
+        <istrue value="${thisbuildsuccessful}"/>
+    </condition>
+
+    <property name="mail.subject.line" 
+              value="${framework.parameters.mail.prefix} ${execution.status} ${os.name} ${os.arch}: ${suite.name}"/>
+
+    <!-- implement publisher interface -->
+    <target name="publish" if="framework.parameters.usemail" depends="-compose-message">
+        <mail mailhost="${framework.parameters.usemail}"
+              tolist="${framework.parameters.usemail.to}"
+              from="${framework.parameters.usemail.from}"
+              subject="${mail.subject.line}">
+            <message src="${temp.files.dir}/${suite.name}-email-message.txt"/>
+        </mail>
+    </target>
+
+    <target name="-compose-message" if="framework.parameters.usemail">
+        <property name="cc.xsl.files.dir" 
+                  value="${ext.cc.location}/webapps/cruisecontrol/xsl"/>
+        <property name="transformed.file" 
+                  value="${temp.files.dir}/${suite.name}-email-message.txt"/>
+		<xslt basedir="${scripts.dir}/xslt"
+			  in="${logdir}/${logfile}" 
+			  style="${scripts.dir}/xslt/br.xsl" 
+              out="${transformed.file}"
+			  classpath="${ext.xalan.location}:${ext.cc.location}/lib/serializer-2.7.0.jar"/>
+    </target>
+
+</project>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/br.xsl
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/xslt/br.xsl?view=auto&rev=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/xslt/br.xsl (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/xslt/br.xsl Wed May  2 22:31:19 2007
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+<!--********************************************************************************
+ * CruiseControl, a Continuous Integration Toolkit
+ * Copyright (c) 2001, ThoughtWorks, Inc.
+ * 651 W Washington Ave. Suite 500
+ * Chicago, IL 60661 USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     + Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     + Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *
+ *     + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
+ *       names of its contributors may be used to endorse or promote
+ *       products derived from this software without specific prior
+ *       written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************************-->
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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. 
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+  <xsl:import href="header.xsl"/>
+  <xsl:import href="errors.xsl"/>
+  <xsl:import href="unittests.xsl"/>
+  <xsl:import href="modifications.xsl"/>
+
+  <xsl:output method="text"/>
+
+  <xsl:variable name="cruisecontrol.list" select="."/>
+
+  <xsl:template match="/">
+    <p><xsl:apply-templates select="$cruisecontrol.list" mode="header"/></p>
+    <p><xsl:apply-templates select="$cruisecontrol.list" mode="errors"/></p>
+    <p><xsl:apply-templates select="$cruisecontrol.list" mode="unittests"/></p>
+    <p><xsl:apply-templates select="$cruisecontrol.list" mode="modifications"/></p>
+  </xsl:template>
+</xsl:stylesheet>

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/br.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/errors.xsl
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/xslt/errors.xsl?view=auto&rev=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/xslt/errors.xsl (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/xslt/errors.xsl Wed May  2 22:31:19 2007
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+<!--********************************************************************************
+ * CruiseControl, a Continuous Integration Toolkit
+ * Copyright (c) 2001, ThoughtWorks, Inc.
+ * 651 W Washington Ave. Suite 600
+ * Chicago, IL 60661 USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     + Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     + Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *
+ *     + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
+ *       names of its contributors may be used to endorse or promote
+ *       products derived from this software without specific prior
+ *       written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************************-->
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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. 
+-->
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns="http://www.w3.org/TR/html4/strict.dtd" >
+
+    <xsl:output method="text"/>
+
+    <xsl:variable name="tasklist" select="/cruisecontrol/build//target/task"/>
+
+    <xsl:template match="/" mode="errors">
+
+        <xsl:variable name="error.messages" select="$tasklist/message[@priority='error']"/>
+        <xsl:variable name="warn.messages" select="$tasklist/message[@priority='warn']"/>
+        <xsl:variable name="total.errorMessage.count" select="count($warn.messages) + count($error.messages)"/>
+
+        <xsl:if test="$total.errorMessage.count > 0">
+            <xsl:text>&#10;***********************************************************&#10;</xsl:text>
+            <xsl:text>Errors/Warnings:	</xsl:text>(<xsl:value-of select="$total.errorMessage.count"/>)
+            <xsl:text>&#10;</xsl:text>
+                
+            <xsl:if test="count($error.messages) > 0">
+                <xsl:apply-templates select="$error.messages" mode="errors"/>
+            </xsl:if>
+            <xsl:if test="count($warn.messages) > 0"> 
+                <xsl:apply-templates select="$warn.messages" mode="errors"/> 
+            </xsl:if> 
+
+        </xsl:if>
+
+    </xsl:template>
+
+    <xsl:template match="message[@priority='error']" mode="errors">
+        <xsl:if test="count(./../message[@priority='error']) != position()">
+            <xsl:value-of select="text()"/>
+            <xsl:text>&#10;</xsl:text>
+        </xsl:if>
+    </xsl:template>
+
+    <xsl:template match="message[@priority='warn']" mode="errors">
+        <xsl:if test="not(starts-with(text(),'cvs update'))">
+            <xsl:value-of select="text()"/>
+            <xsl:text>&#10;</xsl:text>
+        </xsl:if>
+    </xsl:template>
+
+    <xsl:template match="/">
+        <xsl:apply-templates select="." mode="errors"/>
+    </xsl:template>
+</xsl:stylesheet>

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/errors.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/header.xsl
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/xslt/header.xsl?view=auto&rev=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/xslt/header.xsl (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/xslt/header.xsl Wed May  2 22:31:19 2007
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<!--********************************************************************************
+ * CruiseControl, a Continuous Integration Toolkit
+ * Copyright (c) 2001, ThoughtWorks, Inc.
+ * 651 W Washington Ave. Suite 600
+ * Chicago, IL 60661 USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     + Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     + Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *
+ *     + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
+ *       names of its contributors may be used to endorse or promote
+ *       products derived from this software without specific prior
+ *       written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************************-->
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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. 
+-->
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+    xmlns:lxslt="http://xml.apache.org/xslt">
+
+    <xsl:output method="text"/>
+
+    <xsl:template match="/" mode="header">
+        <xsl:variable name="modification.list" select="cruisecontrol/modifications/modification"/>
+
+            <xsl:if test="cruisecontrol/build/@error">
+                <xsl:text>BUILD FAILED:&#10;	Ant Error Message:&#10;</xsl:text>
+                <xsl:value-of select="cruisecontrol/build/@error"/>
+		<xsl:text>&#10;</xsl:text>
+            </xsl:if>
+
+            <xsl:if test="not (cruisecontrol/build/@error)">
+                <xsl:text>BUILD COMPLETE:	</xsl:text>
+                    <xsl:value-of select="cruisecontrol/info/property[@name='label']/@value"/>
+                <xsl:text>&#10;</xsl:text>
+            </xsl:if>
+
+            <xsl:text>&#10;</xsl:text>
+            <xsl:text>Date of build:	</xsl:text>
+            <xsl:value-of select="cruisecontrol/info/property[@name='builddate']/@value"/>
+            <xsl:text>&#10;</xsl:text>
+
+            <xsl:text>Time to build:	</xsl:text>
+            <xsl:value-of select="cruisecontrol/build/@time"/>
+            <xsl:text>&#10;</xsl:text>
+
+            <xsl:apply-templates select="$modification.list" mode="header">
+                <xsl:sort select="date" order="descending" data-type="text" />
+            </xsl:apply-templates>
+    </xsl:template>
+
+    <!-- Last Modification template -->
+    <xsl:template match="modification" mode="header">
+        <xsl:if test="position() = 1">
+            <xsl:text>Last changed:	</xsl:text>
+            <xsl:value-of select="date"/>
+            <xsl:text>&#10;</xsl:text>
+
+            <xsl:text>Last log entry:	</xsl:text>
+            <xsl:value-of select="comment"/>
+            <xsl:text>&#10;</xsl:text>
+
+        </xsl:if>
+    </xsl:template>
+
+    <xsl:template match="/">
+        <xsl:apply-templates select="." mode="header"/>
+    </xsl:template>
+</xsl:stylesheet>

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/header.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/modifications.xsl
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/xslt/modifications.xsl?view=auto&rev=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/xslt/modifications.xsl (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/xslt/modifications.xsl Wed May  2 22:31:19 2007
@@ -0,0 +1,401 @@
+<?xml version="1.0"?>
+<!--********************************************************************************
+ * CruiseControl, a Continuous Integration Toolkit
+ * Copyright (c) 2001, ThoughtWorks, Inc.
+ * 651 W Washington Ave. Suite 600
+ * Chicago, IL 60661 USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     + Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     + Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *
+ *     + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
+ *       names of its contributors may be used to endorse or promote
+ *       products derived from this software without specific prior
+ *       written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************************-->
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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. 
+-->
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+    <xsl:output method="text"/>
+    <xsl:variable name="modification.list" select="cruisecontrol/modifications/modification"/>
+    <xsl:variable name="urlroot" select='"/cruisecontrol/buildresults/"'/>
+
+
+    <xsl:template match="/" mode="modifications">
+            <!-- Modifications -->
+            <xsl:text>&#10;***********************************************************&#10;</xsl:text>
+            <xsl:text>Modifications since last successful build:	</xsl:text>(<xsl:value-of select="count($modification.list)"/>)
+            <xsl:text>&#10;</xsl:text>
+
+            <xsl:apply-templates select="$modification.list" mode="modifications">
+                <xsl:sort select="date" order="descending" data-type="text" />
+            </xsl:apply-templates>
+
+    </xsl:template>
+
+    <!-- user defined variables for logging into ClearQuest -->
+    <xsl:variable name="cqserver">localhost</xsl:variable>
+    <xsl:variable name="cqschema">2003.06.00</xsl:variable>
+    <xsl:variable name="cqdb">RBPRO</xsl:variable>
+    <xsl:variable name="cqlogin">admin</xsl:variable>
+    <xsl:variable name="cqpasswd">password</xsl:variable>
+
+    <xsl:template match="modification[@type='activity']" mode="modifications">
+        <xsl:variable name="cqrecurl">http://<xsl:value-of select="$cqserver"/>/cqweb/main?command=GenerateMainFrame&amp;service=CQ&amp;schema=<xsl:value-of select="$cqschema"/>&amp;contextid=<xsl:value-of select="$cqdb"/>&amp;entityID=<xsl:value-of select="revision"/>&amp;entityDefName=<xsl:value-of select="crmtype"/>&amp;username=<xsl:value-of select="$cqlogin"/>&amp;password=<xsl:value-of select="$cqpasswd"/></xsl:variable>
+            <xsl:attribute name="class">changelists-evenrow</xsl:attribute>
+            <xsl:text> </xsl:text>
+	    <a href="{$cqrecurl}" target="_blank"><xsl:value-of select="revision"/></a>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="crmtype"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="user"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="comment"/>
+            <xsl:text>&#10;</xsl:text>
+    </xsl:template>
+
+    <xsl:template match="modification[@type='contributor']" mode="modifications">
+        <xsl:variable name="cqrecurl">http://<xsl:value-of select="$cqserver"/>/cqweb/main?command=GenerateMainFrame&amp;service=CQ&amp;schema=<xsl:value-of select="$cqschema"/>&amp;contextid=<xsl:value-of select="$cqdb"/>&amp;entityID=<xsl:value-of select="revision"/>&amp;entityDefName=<xsl:value-of select="crmtype"/>&amp;username=<xsl:value-of select="$cqlogin"/>&amp;password=<xsl:value-of select="$cqpasswd"/></xsl:variable>
+            <xsl:attribute name="class">changelists-oddrow</xsl:attribute>
+		<a href="{$cqrecurl}" target="_blank"><xsl:value-of select="revision"/></a>
+            <xsl:text> </xsl:text>
+                <xsl:value-of select="crmtype"/>
+            <xsl:text> </xsl:text>
+                <xsl:value-of select="user"/>
+            <xsl:text> </xsl:text>
+                <xsl:value-of select="comment"/>
+            <xsl:text>&#10;</xsl:text>
+    </xsl:template>
+
+
+    <xsl:template match="modification[@type='p4']" mode="modifications">
+            <xsl:if test="position() mod 2=0">
+                <xsl:attribute name="class">changelists-oddrow</xsl:attribute>
+            </xsl:if>
+            <xsl:if test="position() mod 2!=0">
+                <xsl:attribute name="class">changelists-evenrow</xsl:attribute>
+            </xsl:if>
+            <xsl:value-of select="revision"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="user"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="client"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="date"/>
+            <xsl:text> </xsl:text>
+            <xsl:variable name="convertedComment">
+                <xsl:call-template name="newlineToHTML">
+                    <xsl:with-param name="line">
+                        <xsl:value-of select="comment"/>
+                    </xsl:with-param>
+                </xsl:call-template>
+            </xsl:variable>
+
+            <xsl:copy-of select="$convertedComment"/>
+            <xsl:text>&#10;</xsl:text>
+
+        <xsl:if test="count(file) > 0">
+                <xsl:if test="position() mod 2=0">
+                    <xsl:attribute name="class">changelists-oddrow</xsl:attribute>
+                </xsl:if>
+
+                <xsl:if test="position() mod 2!=0">
+                    <xsl:attribute name="class">changelists-evenrow</xsl:attribute>
+                </xsl:if>
+
+                <xsl:text>Files affected by this changelist: </xsl:text>
+                (<xsl:value-of select="count(file)"/>)
+                <xsl:text>&#10;</xsl:text>
+                <xsl:apply-templates select="file" mode="modifications"/>
+        </xsl:if>
+    </xsl:template>
+
+    <!-- used by P4 -->
+    <xsl:template match="file" mode="modifications">
+            <xsl:if test="position() mod 2=0">
+                <xsl:attribute name="class">changelists-file-oddrow</xsl:attribute>
+            </xsl:if>
+
+            <xsl:if test="position() mod 2!=0">
+                <xsl:attribute name="class">changelists-file-evenrow</xsl:attribute>
+            </xsl:if>
+
+            <xsl:value-of select="@action"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="filename"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="revision"/>
+            <xsl:text> </xsl:text>
+    </xsl:template>
+
+    <!-- Modifications template for other SourceControls -->
+    <xsl:template match="modification[file][@type!='p4']" mode="modifications">
+            <xsl:if test="position() mod 2=0">
+                <xsl:attribute name="class">modifications-oddrow</xsl:attribute>
+            </xsl:if>
+
+            <xsl:if test="position() mod 2!=0">
+                <xsl:attribute name="class">modifications-evenrow</xsl:attribute>
+            </xsl:if>
+
+            <xsl:value-of select="file/@action"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="user"/>
+            <xsl:text> </xsl:text>
+            <xsl:if test="file/project">
+                <xsl:value-of select="file/project"/>
+                <xsl:value-of select="'/'"/>
+            </xsl:if>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="file/filename"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="date"/>
+            <xsl:text> </xsl:text>
+            <xsl:variable name="convertedComment">
+                <xsl:call-template name="newlineToHTML">
+                    <xsl:with-param name="line">
+                        <xsl:value-of select="comment"/>
+                    </xsl:with-param>
+                </xsl:call-template>
+            </xsl:variable>
+            <xsl:copy-of select="$convertedComment"/>
+            <xsl:text>&#10;</xsl:text>
+    </xsl:template>
+
+    <xsl:template match="modification[file][@type='buildstatus']" mode="modifications">
+            <xsl:if test="position() mod 2=0">
+                <xsl:attribute name="class">modifications-oddrow</xsl:attribute>
+            </xsl:if>
+
+            <xsl:if test="position() mod 2!=0">
+                <xsl:attribute name="class">modifications-evenrow</xsl:attribute>
+            </xsl:if>
+
+            <xsl:value-of select="file/@action"/>
+            <xsl:text> </xsl:text>
+
+            <xsl:value-of select="user"/>
+            <xsl:text> </xsl:text>
+
+            <xsl:if test="file/project">
+                <xsl:value-of select="file/project"/>
+                <xsl:value-of select="'/'"/>
+            </xsl:if>
+
+            <xsl:for-each select="file/filename">
+                <xsl:variable name="thefile" select="substring(current(),1,string-length(current())-4)"/>
+                <xsl:variable name="theproject" select="../../comment"/>
+                <a href="{$urlroot}{$theproject}?log={$thefile}"><xsl:copy-of select="$thefile"/></a>
+                <xsl:text> </xsl:text>
+            </xsl:for-each>
+
+            <xsl:value-of select="date"/>
+            <xsl:variable name="convertedComment">
+                <xsl:call-template name="newlineToHTML">
+                    <xsl:with-param name="line">
+                        <xsl:value-of select="comment"/>
+                    </xsl:with-param>
+                </xsl:call-template>
+            </xsl:variable>
+            <xsl:copy-of select="$convertedComment"/>
+            <xsl:text>&#10;</xsl:text>
+    </xsl:template>
+
+    <!-- Up to version 2.1.6 the modification set format did not
+         include the file node -->
+    <xsl:template match="modification" mode="modifications">
+            <xsl:if test="position() mod 2=0">
+                <xsl:attribute name="class">modifications-oddrow</xsl:attribute>
+            </xsl:if>
+            <xsl:if test="position() mod 2!=0">
+                <xsl:attribute name="class">modifications-evenrow</xsl:attribute>
+            </xsl:if>
+
+            <xsl:value-of select="@type"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="user"/>
+            <xsl:text> </xsl:text>
+            <xsl:if test="project">
+                <xsl:value-of select="project"/>
+                <xsl:value-of select="'/'"/>
+            </xsl:if>
+            <xsl:value-of select="filename"/>
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="date"/>
+            <xsl:text> </xsl:text>
+            <xsl:variable name="convertedComment">
+                <xsl:call-template name="newlineToHTML">
+                    <xsl:with-param name="line">
+                        <xsl:value-of select="comment"/>
+                    </xsl:with-param>
+                </xsl:call-template>
+            </xsl:variable>
+            <xsl:copy-of select="$convertedComment"/>
+            <xsl:text>&#10;</xsl:text>
+    </xsl:template>
+
+    <!-- Used by CM Synergy -->
+    <xsl:template match="modification[@type='ccmtask']" mode="modifications">
+        <tr>
+            <td class="modifications-sectionheader">Task</td>
+            <td class="modifications-sectionheader">Owner</td>
+            <td class="modifications-sectionheader">Release</td>
+            <td class="modifications-sectionheader">Change Request(s)</td>
+            <td class="modifications-sectionheader">Completion Date</td>
+            <td class="modifications-sectionheader">Synopsis</td>
+        </tr>
+        <tr valign="top">
+            <xsl:if test="position() mod 2=0">
+                <xsl:attribute name="class">changelists-oddrow</xsl:attribute>
+            </xsl:if>
+            <xsl:if test="position() mod 2!=0">
+                <xsl:attribute name="class">changelists-evenrow</xsl:attribute>
+            </xsl:if>
+            <td class="modifications-data">
+                <b><xsl:copy-of select="task"/></b>
+            </td>
+            <td class="modifications-data">
+                <xsl:value-of select="user"/>
+            </td>
+            <td class="modifications-data">
+                <xsl:value-of select="revision"/>
+            </td>
+            <td class="modifications-data">
+                <xsl:apply-templates select="ccmcr" mode="modifications"/>
+            </td>
+            <td class="modifications-data">
+                <xsl:value-of select="date"/>
+            </td>
+            <td class="modifications-data">
+                <xsl:variable name="convertedComment">
+                    <xsl:call-template name="newlineToHTML">
+                        <xsl:with-param name="line">
+                            <xsl:value-of select="comment"/>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                </xsl:variable>
+                <xsl:copy-of select="$convertedComment"/>
+            </td>
+        </tr>
+        <xsl:if test="count(ccmobject) > 0">
+            <tr valign="top">
+                <xsl:if test="position() mod 2=0">
+                    <xsl:attribute name="class">changelists-oddrow</xsl:attribute>
+                </xsl:if>
+                <xsl:if test="position() mod 2!=0">
+                    <xsl:attribute name="class">changelists-evenrow</xsl:attribute>
+                </xsl:if>
+                <td class="modifications-data" colspan="6">
+                    <table align="right" cellpadding="1" cellspacing="1" border="0" width="95%">
+                        <tr>
+                            <td class="changelists-file-header" colspan="7">
+                                &#160;Objects associated with this task:&#160;
+                                (<xsl:value-of select="count(ccmobject)"/>)
+                            </td>
+                        </tr>
+                        <tr>
+                            <td class="changelists-file-header">Object</td>
+                            <td class="changelists-file-header">Version</td>
+                            <td class="changelists-file-header">Type</td>
+                            <td class="changelists-file-header">Instance</td>
+                            <td class="changelists-file-header">Project</td>
+                            <td class="changelists-file-header">Comment</td>
+                        </tr>
+                        <xsl:apply-templates select="ccmobject" mode="modifications"/>
+                    </table>
+                </td>
+            </tr>
+        </xsl:if>
+    </xsl:template>
+    <xsl:template match="ccmobject" mode="modifications">
+        <tr valign="top" >
+            <xsl:if test="position() mod 2=0">
+                <xsl:attribute name="class">changelists-file-oddrow</xsl:attribute>
+            </xsl:if>
+            <xsl:if test="position() mod 2!=0">
+                <xsl:attribute name="class">changelists-file-evenrow</xsl:attribute>
+            </xsl:if>
+            <td class="modifications-data"><b><xsl:value-of select="name"/></b></td>
+            <td class="modifications-data"><xsl:value-of select="version"/></td>
+            <td class="modifications-data"><xsl:value-of select="type"/></td>
+            <td class="modifications-data"><xsl:value-of select="instance"/></td>
+            <td class="modifications-data"><xsl:value-of select="project"/></td>
+            <td class="modifications-data">
+                <xsl:variable name="convertedComment">
+                    <xsl:call-template name="newlineToHTML">
+                        <xsl:with-param name="line">
+                            <xsl:value-of select="comment"/>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                </xsl:variable>
+                <xsl:copy-of select="$convertedComment"/>
+            </td>
+        </tr>
+    </xsl:template>
+    <xsl:template match="ccmcr" mode="modifications">
+        <xsl:if test="position() != 1">
+            ,
+        </xsl:if>
+        <xsl:copy-of select="*"/>
+    </xsl:template>
+
+    <xsl:template match="/">
+        <xsl:apply-templates select="." mode="modifications"/>
+    </xsl:template>
+
+    <xsl:template name="newlineToHTML">
+        <xsl:param name="line"/>
+        <xsl:choose>
+            <xsl:when test="contains($line, '&#xA;')">
+                <xsl:value-of select="substring-before($line, '&#xA;')"/>
+                <br/>
+                <xsl:call-template name="newlineToHTML">
+                    <xsl:with-param name="line">
+                        <xsl:value-of select="substring-after($line, '&#xA;')"/>
+                    </xsl:with-param>
+                </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:value-of select="$line"/>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+</xsl:stylesheet>

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/modifications.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/unittests.xsl
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/xslt/unittests.xsl?view=auto&rev=534714
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/xslt/unittests.xsl (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/xslt/unittests.xsl Wed May  2 22:31:19 2007
@@ -0,0 +1,221 @@
+<?xml version="1.0"?>
+<!--********************************************************************************
+ * CruiseControl, a Continuous Integration Toolkit
+ * Copyright (c) 2001, ThoughtWorks, Inc.
+ * 651 W Washington Ave. Suite 600
+ * Chicago, IL 60661 USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     + Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     + Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *
+ *     + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
+ *       names of its contributors may be used to endorse or promote
+ *       products derived from this software without specific prior
+ *       written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************************-->
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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. 
+-->
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+    xmlns:lxslt="http://xml.apache.org/xslt">
+
+    <xsl:output method="text"/>
+
+    <xsl:variable name="testsuite.list" select="//testsuite"/>
+    <xsl:variable name="testsuite.error.count" select="count($testsuite.list/error)"/>
+    <xsl:variable name="testcase.list" select="$testsuite.list/testcase"/>
+    <xsl:variable name="testcase.error.list" select="$testcase.list/error"/>
+    <xsl:variable name="testcase.failure.list" select="$testcase.list/failure"/>
+    <xsl:variable name="totalErrorsAndFailures" select="count($testcase.error.list) + count($testcase.failure.list) + $testsuite.error.count"/>
+
+    <xsl:template match="/" mode="unittests">
+            <!-- Unit Tests -->
+        <xsl:text>&#10;***********************************************************&#10;</xsl:text>
+        <xsl:text>Unit Tests: </xsl:text>(<xsl:value-of select="count($testcase.list)"/>)
+        <xsl:text>&#10;</xsl:text>
+
+            <xsl:choose>
+                <xsl:when test="count($testsuite.list) = 0">
+                     <xsl:text>No Tests Run: This project doesn't have any tests&#10;</xsl:text>
+                </xsl:when>
+
+                <xsl:when test="$totalErrorsAndFailures = 0">
+                    <xsl:text>All Tests Passed&#10;</xsl:text>
+                </xsl:when>
+            </xsl:choose>
+
+            <xsl:apply-templates select="$testcase.error.list" mode="unittests"/>
+            <xsl:apply-templates select="$testcase.failure.list" mode="unittests"/>
+
+            <xsl:if test="$totalErrorsAndFailures > 0">
+
+                <xsl:text>Unit Test Error Details:	</xsl:text>(<xsl:value-of select="$totalErrorsAndFailures"/>)
+                <xsl:text>&#10;</xsl:text>
+
+                <!-- (PENDING) Why doesn't this work if set up as variables up top? -->
+                <xsl:call-template name="testdetail">
+                    <xsl:with-param name="detailnodes" select="//testsuite/testcase[.//error]"/>
+                </xsl:call-template>
+
+                <xsl:call-template name="testdetail">
+                    <xsl:with-param name="detailnodes" select="//testsuite/testcase[.//failure]"/>
+                </xsl:call-template>
+            </xsl:if>
+    </xsl:template>
+
+    <!-- UnitTest Errors -->
+    <xsl:template match="error" mode="unittests">
+        <xsl:if test="position() mod 2 = 0">
+            <xsl:attribute name="class">unittests-oddrow</xsl:attribute>
+        </xsl:if>
+
+        <xsl:text>error: </xsl:text>
+        <xsl:value-of select="../@name"/>
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="..//..//@name"/>
+        <xsl:text>&#10;</xsl:text>
+    </xsl:template>
+
+    <!-- UnitTest Failures -->
+    <xsl:template match="failure" mode="unittests">
+        <xsl:if test="($testsuite.error.count + position()) mod 2 = 0">
+            <xsl:attribute name="class">unittests-oddrow</xsl:attribute>
+        </xsl:if>
+
+        <xsl:text>failure: </xsl:text>
+        <xsl:value-of select="../@name"/>
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="..//..//@name"/>
+        <xsl:text>&#10;</xsl:text>
+    </xsl:template>
+
+    <!-- UnitTest Errors And Failures Detail Template -->
+    <xsl:template name="testdetail">
+        <xsl:param name="detailnodes"/>
+        <xsl:for-each select="$detailnodes">
+            <xsl:text>Test: </xsl:text>
+            <xsl:value-of select="@name"/>
+            <xsl:text>Class: </xsl:text>
+            <xsl:value-of select="..//@name"/>
+
+            <xsl:if test="error">
+                <xsl:call-template name="test-data">
+                    <xsl:with-param name="word" select="error"/>
+                    <xsl:with-param name="type" select="'error'"/>
+                </xsl:call-template>
+            </xsl:if>
+
+            <xsl:if test="failure">
+                <xsl:call-template name="test-data">
+                    <xsl:with-param name="word" select="failure"/>
+                    <xsl:with-param name="type" select="'failure'"/>
+                </xsl:call-template>
+            </xsl:if>
+
+        </xsl:for-each>
+    </xsl:template>
+
+    <xsl:template name="test-data">
+        <xsl:param name="word"/>
+        <xsl:param name="type"/>
+        <xsl:call-template name="stack-trace">
+            <xsl:with-param name="word" select="$word"/>
+            <xsl:with-param name="type" select="$type"/>
+        </xsl:call-template>
+    </xsl:template>
+
+    <xsl:template name="stack-trace">
+        <xsl:param name="word"/>
+        <xsl:param name="type"/>
+        <xsl:call-template name="br-replace">
+            <xsl:with-param name="word" select="$word"/>
+            <xsl:with-param name="type" select="$type"/>
+            <xsl:with-param name="count" select="0"/>
+        </xsl:call-template>
+    </xsl:template>
+
+    <xsl:template name="br-replace">
+        <xsl:param name="word"/>
+        <xsl:param name="type"/>
+        <xsl:param name="count"/>
+        <xsl:variable name="stackstart"><xsl:text>	at</xsl:text></xsl:variable>
+        <xsl:variable name="cr"><xsl:text>
+</xsl:text></xsl:variable>
+        <xsl:choose>
+            <xsl:when test="contains($word,$cr)">
+                <xsl:attribute name="class">unittests-<xsl:value-of select="$type"/></xsl:attribute>
+                <xsl:if test="$count mod 2 != 0">
+                    <xsl:attribute name="bgcolor">#EEEEEE</xsl:attribute>
+                </xsl:if>
+
+                <xsl:if test="$count != 0 and starts-with($word,$stackstart)">
+                    <xsl:value-of select="substring-before($word,$cr)"/>
+                    <xsl:text>&#10;</xsl:text>
+                </xsl:if>
+
+                <xsl:if test="$count != 0 and not(starts-with($word,$stackstart))">
+                    <xsl:value-of select="substring-before($word,$cr)"/>
+                    <xsl:text>&#10;</xsl:text>
+                </xsl:if>
+
+                <xsl:if test="$count = 0">
+                    <xsl:value-of select="substring-before($word,$cr)"/>
+                    <xsl:text>&#10;</xsl:text>
+                </xsl:if>
+                <xsl:call-template name="br-replace">
+                    <xsl:with-param name="word" select="substring-after($word,$cr)"/>
+                    <xsl:with-param name="type" select="$type"/>
+                    <xsl:with-param name="count" select="$count + 1"/>
+                </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:attribute name="class">unittests-<xsl:value-of select="$type"/></xsl:attribute>
+                <xsl:if test="$count mod 2 != 0">
+                    <xsl:attribute name="bgcolor">#EEEEEE</xsl:attribute>
+                </xsl:if>
+                <xsl:value-of select="$word"/>
+                <xsl:text>&#10;</xsl:text>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+
+    <xsl:template match="/">
+        <xsl:apply-templates select="." mode="unittests"/>
+    </xsl:template>
+</xsl:stylesheet>

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/xslt/unittests.xsl
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message