You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2008/02/16 02:57:43 UTC

svn commit: r628224 - /jakarta/jmeter/trunk/extras/schematic.xsl

Author: sebb
Date: Fri Feb 15 17:57:43 2008
New Revision: 628224

URL: http://svn.apache.org/viewvc?rev=628224&view=rev
Log:
Initial version of stylesheet to display the structure of a JMX file

Added:
    jakarta/jmeter/trunk/extras/schematic.xsl   (with props)

Added: jakarta/jmeter/trunk/extras/schematic.xsl
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/extras/schematic.xsl?rev=628224&view=auto
==============================================================================
--- jakarta/jmeter/trunk/extras/schematic.xsl (added)
+++ jakarta/jmeter/trunk/extras/schematic.xsl Fri Feb 15 17:57:43 2008
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<!--
+   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.
+-->
+
+<!--
+    Stylesheet to display the basic details of a JMX test plan
+-->
+<xsl:template match="jmeterTestPlan">
+  <html>
+  <title>Test Plan Schematic</title>
+  <body>
+  <xsl:apply-templates/>
+  </body>
+  </html>
+</xsl:template>
+
+<xsl:template match="hashTree">
+  <ul>
+     <xsl:apply-templates/>
+  </ul>
+</xsl:template>
+
+<xsl:template match="TestPlan">
+    <xsl:call-template name="header"/>
+    <pre>
+    <xsl:value-of select='stringProp[@name="TestPlan.comments"]'/>
+    </pre>
+    <xsl:for-each select='elementProp/collectionProp/elementProp'>
+        <br/>
+        <xsl:value-of select='stringProp[@name="Argument.name"]'/>
+        <xsl:value-of select='stringProp[@name="Argument.metadata"]'/>
+        <xsl:value-of select='stringProp[@name="Argument.value"]'/>
+    </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="ThreadGroup">
+    <xsl:call-template name="header"/>
+    <xsl:text> threads: </xsl:text>
+    <xsl:value-of select='stringProp[@name="ThreadGroup.num_threads"]'/>
+    <xsl:text> loops: </xsl:text>
+    <xsl:value-of select='elementProp/*[@name="LoopController.loops"]'/>
+    <xsl:text> ramp up: </xsl:text>
+    <xsl:value-of select='stringProp[@name="ThreadGroup.ramp_time"]'/>
+    <xsl:call-template name="comment"/>
+</xsl:template>
+
+<xsl:template match="HTTPSampler|HTTPSampler2">
+    <xsl:call-template name="header"/>
+    <xsl:text> : </xsl:text>
+    <xsl:value-of select='stringProp[@name="HTTPSampler.method"]'/>
+    <xsl:text> </xsl:text>
+    <xsl:value-of select='stringProp[@name="HTTPSampler.protocol"]'/>
+    <xsl:text>://</xsl:text>
+    <xsl:value-of select='stringProp[@name="HTTPSampler.domain"]'/>
+    <xsl:text>:</xsl:text>
+    <xsl:value-of select='stringProp[@name="HTTPSampler.port"]'/>
+    <xsl:text>/</xsl:text>
+    <xsl:value-of select='stringProp[@name="HTTPSampler.path"]'/>
+    <xsl:call-template name="comment"/>
+</xsl:template>
+
+<xsl:template match="ResultCollector">
+    <xsl:call-template name="header"/>
+    <xsl:if test='stringProp[@name="filename"]!=""'>
+        Output: <xsl:value-of select='stringProp[@name="filename"]'/>
+        XML: <xsl:value-of select='objProp/value/xml'/>
+    </xsl:if>
+    <xsl:call-template name="comment"/>
+</xsl:template>
+
+<xsl:template match="*">
+    <xsl:call-template name="header"/>
+    <xsl:call-template name="comment"/>
+</xsl:template>
+
+<xsl:template name="comment">
+    <xsl:if test='stringProp/@name="TestPlan.comments"'>
+         <br/>
+         <i>
+          <xsl:value-of select='stringProp[@name="TestPlan.comments"]'/>
+        </i>
+    </xsl:if>
+</xsl:template>
+
+<xsl:template name="header">
+    <xsl:if test="@enabled = 'false'">
+(
+    </xsl:if>
+    <b>
+    <xsl:choose>
+        <xsl:when test="name() = 'GenericController'">
+            <xsl:text>SimpleController</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+             <xsl:value-of select="name()"/>
+        </xsl:otherwise>
+    </xsl:choose>
+</b> : <xsl:value-of select="@testname"/>
+    <xsl:if test="@enabled = 'false'">
+)
+    </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Propchange: jakarta/jmeter/trunk/extras/schematic.xsl
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org