mbunit2 2.4.2.355.20100801

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/docs/ASL - Apache Software Foundation License.txt +57 -0
  2. data/docs/MbUnit License.txt +14 -0
  3. data/docs/MbUnit.chm +0 -0
  4. data/docs/Release Notes.txt +7 -0
  5. data/docs/extras/CCNet/How to use MbUnit v2 with CruiseControl.Net.txt +88 -0
  6. data/docs/extras/CCNet/images/Category.png +0 -0
  7. data/docs/extras/CCNet/images/Fixture.png +0 -0
  8. data/docs/extras/CCNet/images/Populator.png +0 -0
  9. data/docs/extras/CCNet/images/Test.png +0 -0
  10. data/docs/extras/CCNet/xsl/MBUnitDetails.xsl +592 -0
  11. data/docs/extras/CCNet/xsl/MBUnitSummary.xsl +266 -0
  12. data/docs/extras/Snippets/AdjacencyGraph.cst +1703 -0
  13. data/docs/extras/Snippets/AssertWrapper.cst +181 -0
  14. data/docs/extras/Snippets/CrudPopulator.cst +377 -0
  15. data/docs/extras/Snippets/DatabasePopulator.cst +386 -0
  16. data/docs/extras/Snippets/DatabasePopulatorCrudTest.cst +177 -0
  17. data/docs/extras/Snippets/Exception.cst +94 -0
  18. data/docs/extras/Snippets/GrammarPopulator.cst +258 -0
  19. data/docs/extras/Snippets/MockObject.cst +296 -0
  20. data/docs/extras/Snippets/RapTierCrudPopulator.cst +444 -0
  21. data/docs/extras/Snippets/SimpleFixture.cst +91 -0
  22. data/docs/extras/Snippets/SqlppCrudPopulator.cst +443 -0
  23. data/docs/extras/Snippets/TestFixture.cst +469 -0
  24. data/docs/extras/Snippets/autorunner.snippet +45 -0
  25. data/docs/extras/Snippets/combinatorialtest.snippet +54 -0
  26. data/docs/extras/Snippets/datafixture.snippet +61 -0
  27. data/docs/extras/Snippets/model.snippet +95 -0
  28. data/docs/extras/Snippets/msbuild.snippet +40 -0
  29. data/docs/extras/Snippets/nant.snippet +34 -0
  30. data/docs/extras/Snippets/perfcounterassert.cst +173 -0
  31. data/docs/extras/Snippets/processtestfixture.snippet +75 -0
  32. data/docs/extras/Snippets/rowtest.snippet +113 -0
  33. data/docs/extras/Snippets/state.snippet +27 -0
  34. data/docs/extras/Snippets/submodel.snippet +32 -0
  35. data/docs/extras/Snippets/test.snippet +28 -0
  36. data/docs/extras/Snippets/testexpectedexception.snippet +32 -0
  37. data/docs/extras/Snippets/testfixture.snippet +68 -0
  38. data/docs/extras/Snippets/testsuitefixture.snippet +48 -0
  39. data/docs/extras/Snippets/typefixture.snippet +74 -0
  40. data/docs/extras/Snippets/typefixturewithproviderfactory.snippet +77 -0
  41. data/docs/extras/Snippets/usingmbunit.snippet +19 -0
  42. data/docs/extras/Templates/VS2005/ItemTemplates/CSharp/Test/MbUnit2.TestFixtureTemplate.CSharp.zip +0 -0
  43. data/docs/extras/Templates/VS2005/ItemTemplates/VisualBasic/Test/MbUnit2.TestFixtureTemplate.VisualBasic.zip +0 -0
  44. data/docs/extras/Templates/VS2005/ProjectTemplates/CSharp/Test/MbUnit2.TestProjectTemplate.CSharp.zip +0 -0
  45. data/docs/extras/Templates/VS2005/ProjectTemplates/VisualBasic/Test/MbUnit2.TestProjectTemplate.VisualBasic.zip +0 -0
  46. data/docs/extras/Templates/VS2008/ItemTemplates/CSharp/Test/MbUnit2.TestFixtureTemplate.CSharp.zip +0 -0
  47. data/docs/extras/Templates/VS2008/ItemTemplates/VisualBasic/Test/MbUnit2.TestFixtureTemplate.VisualBasic.zip +0 -0
  48. data/docs/extras/Templates/VS2008/ProjectTemplates/CSharp/Test/MbUnit2.MvcWebApplicationTestProjectTemplate.CSharp.zip +0 -0
  49. data/docs/extras/Templates/VS2008/ProjectTemplates/CSharp/Test/MbUnit2.TestProjectTemplate.CSharp.zip +0 -0
  50. data/docs/extras/Templates/VS2008/ProjectTemplates/VisualBasic/Test/MbUnit2.MvcWebApplicationTestProjectTemplate.VisualBasic.zip +0 -0
  51. data/docs/extras/Templates/VS2008/ProjectTemplates/VisualBasic/Test/MbUnit2.TestProjectTemplate.VisualBasic.zip +0 -0
  52. data/lib/MbUnit License.txt +14 -0
  53. data/lib/MbUnit.AddIn.dll +0 -0
  54. data/lib/MbUnit.Cons.exe +0 -0
  55. data/lib/MbUnit.Cons.exe.config +12 -0
  56. data/lib/MbUnit.Framework.2.0.dll +0 -0
  57. data/lib/MbUnit.Framework.2.0.pdb +0 -0
  58. data/lib/MbUnit.Framework.2.0.xml +278 -0
  59. data/lib/MbUnit.Framework.dll +0 -0
  60. data/lib/MbUnit.Framework.pdb +0 -0
  61. data/lib/MbUnit.Framework.xml +6929 -0
  62. data/lib/MbUnit.GUI.exe +0 -0
  63. data/lib/MbUnit.GUI.exe.config +14 -0
  64. data/lib/MbUnit.MSBuild.Tasks.dll +0 -0
  65. data/lib/MbUnit.Tasks.dll +0 -0
  66. data/lib/NGraphviz.Helpers.dll +0 -0
  67. data/lib/NGraphviz.Layout.dll +0 -0
  68. data/lib/NGraphviz.dll +0 -0
  69. data/lib/QuickGraph.Algorithms.Graphviz.dll +0 -0
  70. data/lib/QuickGraph.Algorithms.dll +0 -0
  71. data/lib/QuickGraph.Algorithms.pdb +0 -0
  72. data/lib/QuickGraph.Algorithms.xml +2818 -0
  73. data/lib/QuickGraph.dll +0 -0
  74. data/lib/QuickGraph.pdb +0 -0
  75. data/lib/QuickGraph.xml +3126 -0
  76. data/lib/Refly.dll +0 -0
  77. data/lib/Refly.pdb +0 -0
  78. data/lib/Refly.xml +1327 -0
  79. data/lib/TestFu.dll +0 -0
  80. data/lib/TestFu.pdb +0 -0
  81. data/lib/TestFu.xml +1932 -0
  82. data/lib/XsdTidy.exe +0 -0
  83. metadata +163 -0
@@ -0,0 +1,57 @@
1
+ Apache License, Version 2.0
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16
+
17
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18
+
19
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20
+
21
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22
+
23
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24
+
25
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26
+
27
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28
+
29
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30
+
31
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
+
33
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34
+
35
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36
+
37
+ 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
38
+
39
+ 2. You must cause any modified files to carry prominent notices stating that You changed the files; and
40
+
41
+ 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42
+
43
+ 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
44
+
45
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
46
+
47
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
48
+
49
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
50
+
51
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
52
+
53
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
54
+
55
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
56
+
57
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,14 @@
1
+ Copyright 2005-2007 MbUnit Project - http://www.mbunit.com/
2
+ Portions Copyright 2000-2004 Jonathan De Halleux, Jamie Cansdale
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
data/docs/MbUnit.chm ADDED
Binary file
@@ -0,0 +1,7 @@
1
+ MbUnit v2
2
+ Copyright 2005-2007 MbUnit Project - http://www.mbunit.com/
3
+ ===========================================================
4
+
5
+ RELEASE NOTES
6
+ -------------
7
+
@@ -0,0 +1,88 @@
1
+ How to use MbUnit v2 with CruiseControl.Net
2
+ ===========================================
3
+
4
+ Using MbUnit v2 in CruiseControl.Net is very straightforward.
5
+
6
+
7
+ CONFIGURING THE SERVER
8
+ ----------------------
9
+
10
+ For the server, we need to ensure that the build script runs the tests and generates an XML
11
+ formatted MbUnit Test Report that is then merged into the CruiseControl.Net artifacts file
12
+ with the <merge> publisher task.
13
+
14
+ You can use any of the supported MbUnittest runners to run your tests such as MbUnit.Cons
15
+ MbUnit.Tasks or MbUnit.MSBuild.Tasks. The important thing is
16
+ to provide appropriate arguments to the test runner such that an XML report is generated
17
+ so that the test results can be saved for subsequent display in the dashboard.
18
+
19
+ Here is one way to do this:
20
+
21
+ 1. Edit the "ccnet.config" file in the CruiseControl.Net "server" folder.
22
+
23
+ * Within the <tasks> element, add an element similar to the following AFTER the tasks that
24
+ build your project. This will run the tests in your test assembly and generate an
25
+ XML test report in the project working directory.
26
+
27
+ <exec>
28
+ <executable>$$$PathToMbUnitInstallationFolder$$$\bin\MbUnit.Cons.exe</executable>
29
+ <buildArgs>/rnf:test-report /rt:Xml $$$MyTestAssembly.dll$$$</buildArgs>
30
+ </exec>
31
+
32
+ * Within the <publishers> element, add an element similar to the following BEFORE the
33
+ <xmllogger> task element. This will merge the XML test report into the build artifacts.
34
+
35
+ <merge><files><file>test-report.xml</file></files></merge>
36
+
37
+ 2. If you want test summary results to be included in the CCNet build notification emails
38
+ then you must also edit the "ccservice.exe.config" and/or "ccnet.exe.config" files
39
+ depending on whether you run CCNet as a service or as a standalone application.
40
+
41
+ * Within the <xslFiles> element add an element similar to the following:
42
+
43
+ <file name="xsl\MBUnitSummary.xsl"/>
44
+
45
+ * Copy the XSL files into the CCNet server's "xsl" folder overwriting any existing
46
+ files with the same name.
47
+
48
+ 3. Double-check:
49
+
50
+ * The XML test report is being generated as part of a build task.
51
+ * The XML test report is being merged into the CruiseControl.Net artifacts file
52
+ as part of a publisher task.
53
+ * The XSL files have been copied and are referenced in the server configuration.
54
+
55
+ 4. Restart CCNet since the server's *.exe.config files have changed and these changes
56
+ are not automatically detected by CCNet.
57
+
58
+
59
+ CONFIGURING THE DASHBOARD
60
+ -------------------------
61
+
62
+ For the dashboard, we need to add some new resources that are used to render the MbUnit Test Report
63
+ we must update the dashboard configuration file to include the new test report plugin.
64
+
65
+ 1. Copy the files from "xsl" and "images" folders into the corresponding subdirectories
66
+ of the "webdashboard" folder of your CruiseControl.Net installation overwriting any
67
+ existing files with the same name.
68
+
69
+ 2. Edit the "dashboard.config" file in the CruiseControl.Net "webdashboard" folder.
70
+
71
+ * Within the <buildPlugins> element add the following element:
72
+
73
+ <xslReportBuildPlugin description="MbUnit Details"
74
+ actionName="MbUnitDetails"
75
+ xslFileName="xsl\MBUnitDetails.xsl" />
76
+
77
+ * Within the <xslFileNames> sub-element of the <buildReportBuildPlugin> element
78
+ add an element similar to the following:
79
+
80
+ <xslFile>xsl\MBUnitSummary.xsl</xslFile>
81
+
82
+ 3. Double-check:
83
+
84
+ * The "webdashboard" folder now contains updated "xsl" and "images".
85
+ * The "dashboard.config" file has been edited to include the new build report section
86
+ and XSL file.
87
+
88
+ 4. Restart the CruiseControl.Net web application. (eg. By resetting IIS.)
Binary file
@@ -0,0 +1,592 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
+ <!--
4
+ format a number in to display its value in percent
5
+ @param value the number to format
6
+ -->
7
+ <xsl:template name="display-time-second">
8
+ <xsl:param name="value"/>
9
+ <span class="time"><xsl:value-of select="format-number($value,'0.00')"/>s</span>
10
+ </xsl:template>
11
+
12
+ <!--
13
+ format a number in to display its value in percent
14
+ @param value the number to format
15
+ -->
16
+ <xsl:template name="display-time">
17
+ <xsl:param name="value"/>
18
+ <span class="time"><xsl:value-of select="format-number($value*1000,'0.000')"/>ms</span>
19
+ </xsl:template>
20
+ <!--
21
+ format a number in to display its value in percent
22
+ @param value the number to format
23
+ -->
24
+ <xsl:template name="display-percent">
25
+ <xsl:param name="value"/>
26
+ <xsl:value-of select="format-number($value,'0.00 %')"/>
27
+ </xsl:template>
28
+ <!--
29
+ format a number in to display its value in Kb
30
+ @param value the number to format
31
+ -->
32
+ <xsl:template name="display-memory">
33
+ <xsl:param name="value"/>
34
+ <xsl:variable name="kbvalue">
35
+ <xsl:value-of select="$value * 0.0001"/>
36
+ </xsl:variable>
37
+ <xsl:value-of select="format-number($kbvalue,'0.00 Kb')"/>
38
+ </xsl:template>
39
+ <!--
40
+ template that will convert a carriage return into a br tag
41
+ @param word the text from which to convert CR to BR tag
42
+ -->
43
+ <xsl:template name="br-replace">
44
+ <xsl:param name="word"/>
45
+ <xsl:choose>
46
+ <xsl:when test="contains($word,'&#xA;')">
47
+ <xsl:value-of select="substring-before($word,'&#xA;')"/>
48
+ <br/>
49
+ <xsl:call-template name="br-replace">
50
+ <xsl:with-param name="word" select="substring-after($word,'&#xA;')"/>
51
+ </xsl:call-template>
52
+ </xsl:when>
53
+ <xsl:otherwise>
54
+ <xsl:value-of select="$word"/>
55
+ </xsl:otherwise>
56
+ </xsl:choose>
57
+ </xsl:template>
58
+ <!--
59
+ Scales value
60
+ -->
61
+ <xsl:template name="scale">
62
+ <xsl:param name="origLength"/>
63
+ <xsl:param name="targetLength"/>
64
+ <xsl:param name="value"/>
65
+ <xsl:value-of select="($value div $origLength) * $targetLength"/>
66
+ </xsl:template>
67
+
68
+ <!--
69
+ Graphical result bar
70
+ -->
71
+ <xsl:template name="counter-progressbar">
72
+ <xsl:param name="width"/>
73
+ <xsl:param name="height"/>
74
+ <div>
75
+ <xsl:attribute name="style">position:relative;background-color:#DDDDDD;border-color:black;width:<xsl:value-of select="$width"/>px;height:<xsl:value-of select="$height"/>px;</xsl:attribute>
76
+ <!-- success -->
77
+ <xsl:if test="@success-count > 0">
78
+ <div>
79
+ <xsl:attribute name="style">position:absolute;top:0px;left:0px;height:<xsl:value-of select="$height"/>px;background-color:lightgreen;font-size:1px;width:<xsl:call-template name="scale">
80
+ <xsl:with-param name="origLength" select="@run-count"/>
81
+ <xsl:with-param name="targetLength" select="$width"/>
82
+ <xsl:with-param name="value" select="@success-count"/>
83
+ </xsl:call-template>px;</xsl:attribute>
84
+ </div>
85
+ </xsl:if>
86
+ <!-- failure -->
87
+ <xsl:if test="@failure-count > 0">
88
+ <div>
89
+ <xsl:attribute name="style">position:absolute;top:0px;left:<xsl:call-template name="scale">
90
+ <xsl:with-param name="origLength" select="@run-count"/>
91
+ <xsl:with-param name="targetLength" select="$width"/>
92
+ <xsl:with-param name="value" select="@success-count"/>
93
+ </xsl:call-template>px;height:<xsl:value-of select="$height"/>px;background-color:red;font-size:1px;width:<xsl:call-template name="scale">
94
+ <xsl:with-param name="origLength" select="@run-count"/>
95
+ <xsl:with-param name="targetLength" select="$width"/>
96
+ <xsl:with-param name="value" select="@failure-count"/>
97
+ </xsl:call-template>px;</xsl:attribute>
98
+ </div>
99
+ </xsl:if>
100
+ <!-- skip -->
101
+ <xsl:if test="@skip-count > 0">
102
+ <div>
103
+ <xsl:attribute name="style">position:absolute;top:0px;left:<xsl:call-template name="scale">
104
+ <xsl:with-param name="origLength" select="@run-count"/>
105
+ <xsl:with-param name="targetLength" select="$width"/>
106
+ <xsl:with-param name="value" select="@success-count+@failure-count"/>
107
+ </xsl:call-template>px;height:<xsl:value-of select="$height"/>px;background-color:blueviolet;font-size:1px;width:<xsl:call-template name="scale">
108
+ <xsl:with-param name="origLength" select="@run-count"/>
109
+ <xsl:with-param name="targetLength" select="$width"/>
110
+ <xsl:with-param name="value" select="@skip-count"/>
111
+ </xsl:call-template>px;</xsl:attribute>
112
+ </div>
113
+ </xsl:if>
114
+ <!-- ignore -->
115
+ <xsl:if test="@ignore-count > 0">
116
+ <div>
117
+ <xsl:attribute name="style">position:absolute;top:0px;left:<xsl:call-template name="scale">
118
+ <xsl:with-param name="origLength" select="@run-count"/>
119
+ <xsl:with-param name="targetLength" select="$width"/>
120
+ <xsl:with-param name="value" select="@success-count+@failure-count+@skip-count"/>
121
+ </xsl:call-template>px;height:<xsl:value-of select="$height"/>px;background-color:orange;font-size:1px;width:<xsl:call-template name="scale">
122
+ <xsl:with-param name="origLength" select="@run-count"/>
123
+ <xsl:with-param name="targetLength" select="$width"/>
124
+ <xsl:with-param name="value" select="@ignore-count"/>
125
+ </xsl:call-template>px;</xsl:attribute>
126
+ </div>
127
+ </xsl:if>
128
+ <div>
129
+ <xsl:attribute name="style">position:absolute;top:0px;left:<xsl:value-of select="$width +2"/>px;height:<xsl:value-of select="$height"/>px;font-size:<xsl:value-of select="$height - 2"/>px;font-family:Verdana;</xsl:attribute><xsl:value-of select="@run-count"/>/<xsl:value-of select="@success-count"/>/<xsl:value-of select="@failure-count"/>/<xsl:value-of select="@skip-count"/>/<xsl:value-of select="@ignore-count"/>/<xsl:value-of select="@assert-count"/></div>
130
+ </div>
131
+ </xsl:template>
132
+
133
+ <xsl:template name="counter-literal">
134
+ <xsl:value-of select="@run-count"/> test,
135
+ <xsl:value-of select="@success-count"/> success,
136
+ <xsl:value-of select="@failure-count"/> failures,
137
+ <xsl:value-of select="@skip-count" /> skipped,
138
+ <xsl:value-of select="@ignore-count"/> ignored,
139
+ <xsl:value-of select="@assert-count"/> asserts
140
+ </xsl:template>
141
+
142
+
143
+ <xsl:template name="icon">
144
+ <xsl:param name="src"/>
145
+ <img width="16" height="16" border="0">
146
+ <xsl:attribute name="src"><xsl:value-of select="$src"/></xsl:attribute>
147
+ </img>
148
+ </xsl:template>
149
+
150
+ <xsl:template name="assembly-icon">
151
+ <xsl:call-template name="icon">
152
+ <xsl:with-param name="src">/images/Populator.png</xsl:with-param>
153
+ </xsl:call-template>
154
+ </xsl:template>
155
+
156
+ <xsl:template name="fixture-icon">
157
+ <xsl:call-template name="icon">
158
+ <xsl:with-param name="src">/images/Fixture.png</xsl:with-param>
159
+ </xsl:call-template>
160
+ </xsl:template>
161
+
162
+ <xsl:template name="namespace-icon">
163
+ <xsl:call-template name="icon">
164
+ <xsl:with-param name="src">/images/Category.png</xsl:with-param>
165
+ </xsl:call-template>
166
+ </xsl:template>
167
+
168
+ <xsl:template name="run-icon">
169
+ <xsl:call-template name="icon">
170
+ <xsl:with-param name="src">/images/Test.png</xsl:with-param>
171
+ </xsl:call-template>
172
+ </xsl:template>
173
+
174
+ <xsl:template name="assemblyid">
175
+ <xsl:param name="name"/>
176
+ as<xsl:value-of select="$name"/>
177
+ </xsl:template>
178
+
179
+ <xsl:template name="exceptionid">
180
+ <xsl:param name="name"/>
181
+ ex<xsl:value-of select="$name"/>
182
+ </xsl:template>
183
+
184
+ <!--
185
+ MbUnit main method.
186
+ -->
187
+ <xsl:template match="/">
188
+ <div id="mbunit">
189
+ <script>function ToggleVisible(blockId) {
190
+ var block = document.all.item(blockId);
191
+ var plus = document.all.item(blockId + '.plus');
192
+ if (block.style.display=='none') {
193
+ block.style.display='block';
194
+ plus.innerText='- ';
195
+ } else {
196
+ block.style.display='none';
197
+ plus.innerText='+ ';
198
+ }
199
+ }
200
+ </script>
201
+ <xsl:apply-templates select="//report-result" />
202
+ </div>
203
+ </xsl:template>
204
+
205
+ <xsl:template match="report-result">
206
+ <table cellpadding="2" cellspacing="0" border="0" width="98%">
207
+ <tr>
208
+ <td class="unittests-sectionheader" colspan="3">
209
+ MbUnit Tests run:
210
+ <xsl:value-of select="counter/@run-count" /> tests,
211
+ <xsl:value-of select="counter/@success-count" /> success,
212
+ <xsl:value-of select="counter/@failure-count" /> failure,
213
+ <xsl:value-of select="counter/@ignore-count" /> ignored,
214
+ <xsl:value-of select="counter/@skip-count" /> skipped,
215
+ <xsl:value-of select="format-number(counter/@duration,'##.##')" /> s
216
+ </td>
217
+ </tr>
218
+ <tr>
219
+ <td>
220
+ <xsl:call-template name="report-summary" />
221
+ <xsl:if test="count(//warnings)>0">
222
+ <br/>
223
+ <xsl:call-template name="warnings" />
224
+ </xsl:if>
225
+ <br/>
226
+ <xsl:call-template name="assemblies" />
227
+ </td>
228
+ </tr>
229
+ </table>
230
+ </xsl:template>
231
+
232
+ <xsl:template name="report-summary">
233
+ <table border="0" cellpadding="1" cellspacing="1">
234
+ <tr class="titles">
235
+ <td>Total</td>
236
+ <td>
237
+ <xsl:for-each select="counter">
238
+ <xsl:call-template name="counter-progressbar">
239
+ <xsl:with-param name="width">100</xsl:with-param>
240
+ <xsl:with-param name="height">14</xsl:with-param>
241
+ </xsl:call-template>
242
+ </xsl:for-each>
243
+ </td>
244
+ </tr>
245
+ <xsl:call-template name="assembly-summary"/>
246
+ </table>
247
+ </xsl:template>
248
+
249
+ <xsl:template name="assembly-summary">
250
+ <xsl:for-each select="//assemblies/assembly">
251
+ <tr class="titles">
252
+ <td>
253
+ <a>
254
+ <xsl:attribute name="href">#<xsl:value-of select="@name"/>Assembly</xsl:attribute>
255
+ <xsl:call-template name="assembly-icon"/>
256
+ <xsl:value-of select="@name"/>
257
+ </a>
258
+ </td>
259
+ <td>
260
+ <xsl:for-each select="counter">
261
+ <xsl:call-template name="counter-progressbar">
262
+ <xsl:with-param name="width">100</xsl:with-param>
263
+ <xsl:with-param name="height">12</xsl:with-param>
264
+ </xsl:call-template>
265
+ </xsl:for-each>
266
+ </td>
267
+ </tr>
268
+ <xsl:call-template name="fixture-summary" />
269
+ </xsl:for-each>
270
+ </xsl:template>
271
+
272
+ <xsl:template name="fixture-id"><xsl:param name="name" /><xsl:value-of select="$name" /></xsl:template>
273
+
274
+ <xsl:template name="fixture-summary">
275
+ <xsl:for-each select="descendant::fixture">
276
+ <tr class="fixtureSummary">
277
+ <td>
278
+ <a>
279
+ <xsl:attribute name="href">#<xsl:call-template name="fixture-id"><xsl:with-param name="name">
280
+ <xsl:value-of select="@type" />.<xsl:value-of select="@name" />
281
+ </xsl:with-param></xsl:call-template>
282
+ </xsl:attribute>
283
+ <xsl:call-template name="fixture-icon"/>
284
+ <xsl:value-of select="@type" />.<xsl:value-of select="@name" />
285
+ </a>
286
+ </td>
287
+ <td>
288
+ <xsl:for-each select="counter">
289
+ <xsl:call-template name="counter-progressbar">
290
+ <xsl:with-param name="width">100</xsl:with-param>
291
+ <xsl:with-param name="height">10</xsl:with-param>
292
+ </xsl:call-template>
293
+ </xsl:for-each>
294
+ </td>
295
+ </tr>
296
+ </xsl:for-each>
297
+ </xsl:template>
298
+
299
+ <xsl:template name="warnings">
300
+ <table>
301
+ <xsl:for-each select="//warning">
302
+ <tr>
303
+ <xsl:attribute name="class">
304
+ <xsl:choose>
305
+ <xsl:when test="position() mod 2 = 1">failureOdd</xsl:when>
306
+ <xsl:otherwise>failureEven</xsl:otherwise>
307
+ </xsl:choose>
308
+ </xsl:attribute>
309
+ <td><xsl:call-template name="run-icon"/>
310
+ <xsl:value-of select="ancestor::run/@name" /></td>
311
+ <td><xsl:value-of select="text()"/></td>
312
+ </tr>
313
+ </xsl:for-each>
314
+ </table>
315
+ </xsl:template>
316
+
317
+ <xsl:template name="assemblies">
318
+ <xsl:for-each select="assemblies/assembly">
319
+ <xsl:call-template name="assembly-detail" />
320
+ </xsl:for-each>
321
+ </xsl:template>
322
+
323
+ <xsl:template name="assembly-detail">
324
+ <h2><xsl:attribute name="id"><xsl:value-of select="@name"/>Assembly</xsl:attribute>
325
+ <xsl:call-template name="assembly-icon"/>
326
+ <xsl:value-of select="@name"/>
327
+ </h2>
328
+ <ul>
329
+ <li><strong>Full Name:</strong> <xsl:value-of select="@full-name"/></li>
330
+ <li><strong>Results:</strong>
331
+ <xsl:for-each select="counter">
332
+ <xsl:call-template name="counter-literal"/>
333
+ </xsl:for-each>
334
+ </li>
335
+ <li><strong>Duration:</strong>
336
+ <xsl:call-template name="display-time-second">
337
+ <xsl:with-param name="value" select="counter/@duration"/>
338
+ </xsl:call-template>
339
+ </li>
340
+ </ul>
341
+ <xsl:if test="set-up|tear-down">
342
+ <table>
343
+ <tr class="assemblysetupteardown" ><td>Assembly SetUp and TearDown</td></tr>
344
+ <xsl:apply-templates select="set-up"/>
345
+ <xsl:apply-templates select="tear-down"/>
346
+ </table>
347
+ </xsl:if>
348
+ <xsl:call-template name="namespaces-table" />
349
+ </xsl:template>
350
+
351
+ <xsl:template name="namespaces-table">
352
+ <xsl:apply-templates select="namespaces" />
353
+ <xsl:apply-templates select="namespace" />
354
+ </xsl:template>
355
+
356
+ <xsl:template match="namespaces">
357
+ <xsl:apply-templates select="namespace" />
358
+ </xsl:template>
359
+
360
+ <xsl:template match="namespace">
361
+ <xsl:apply-templates select="namespaces" />
362
+ <xsl:apply-templates select="fixtures" />
363
+ </xsl:template>
364
+
365
+ <xsl:template match="fixtures">
366
+ <table width="800" border="0" cellpadding="1" cellspacing="1">
367
+ <col width="700"/>
368
+ <col width="50"/>
369
+ <col width="50"/>
370
+ <xsl:apply-templates select="fixture" />
371
+ </table>
372
+ </xsl:template>
373
+
374
+ <xsl:template match="fixture">
375
+ <tr>
376
+ <xsl:attribute name="id"><xsl:call-template name="fixture-id"><xsl:with-param name="name">
377
+ <xsl:value-of select="@type" />.<xsl:value-of select="@name" />
378
+ </xsl:with-param></xsl:call-template>
379
+ </xsl:attribute>
380
+ <td>
381
+ <xsl:for-each select="counter">
382
+ <xsl:call-template name="counter-progressbar">
383
+ <xsl:with-param name="width" select="100" />
384
+ <xsl:with-param name="height" select="10" />
385
+ </xsl:call-template>
386
+ </xsl:for-each>
387
+ </td>
388
+ </tr>
389
+ <tr class="fixture" >
390
+ <td>
391
+ <xsl:call-template name="fixture-icon"/>
392
+ <xsl:value-of select="@type" />.<xsl:value-of select="@name"/>
393
+
394
+ (<xsl:call-template name="display-time-second">
395
+ <xsl:with-param name="value" select="counter/@duration"/>
396
+ </xsl:call-template>)
397
+ </td>
398
+ </tr>
399
+ <xsl:if test="set-up|tear-down">
400
+ <tr class="fixturesetupteardown"><td>Fixture SetUp and TearDown</td></tr>
401
+ <xsl:apply-templates select="set-up"/>
402
+ <xsl:apply-templates select="tear-down"/>
403
+ </xsl:if>
404
+ <tr>
405
+ <td>
406
+ <xsl:apply-templates select="runs" />
407
+ </td>
408
+ </tr>
409
+ </xsl:template>
410
+ <xsl:template match="runs">
411
+ <table width="100%" border="0" cellpadding="1" cellspacing="1">
412
+ <xsl:apply-templates select="*" />
413
+ </table>
414
+ </xsl:template>
415
+
416
+ <xsl:template match="set-up">
417
+ <xsl:call-template name="set-up-or-tear-down" />
418
+ </xsl:template>
419
+ <xsl:template match="tear-down">
420
+ <xsl:call-template name="set-up-or-tear-down" />
421
+ </xsl:template>
422
+ <xsl:template name="set-up-or-tear-down">
423
+ <tr>
424
+ <!-- Choosing style and alternate -->
425
+ <xsl:attribute name="class">
426
+ <xsl:choose>
427
+ <xsl:when test="@result = 'success'">successEven</xsl:when>
428
+ <xsl:when test="@result = 'failure'">failureEven</xsl:when>
429
+ </xsl:choose>
430
+ </xsl:attribute>
431
+ <td>
432
+ <xsl:value-of select="@name"/>
433
+ </td>
434
+ <td>
435
+ <xsl:call-template name="display-time">
436
+ <xsl:with-param name="value" select="@duration"/>
437
+ </xsl:call-template>
438
+ </td>
439
+ <td>
440
+ <xsl:call-template name="display-memory">
441
+ <xsl:with-param name="value" select="@memory"/>
442
+ </xsl:call-template>
443
+ </td>
444
+ </tr>
445
+ <!-- Adding execption log -->
446
+ <xsl:if test="@result = 'failure'">
447
+ <xsl:call-template name="exception-log"/>
448
+ </xsl:if>
449
+ <!-- Adding console out, error -->
450
+ <xsl:call-template name="console-output" />
451
+ </xsl:template>
452
+
453
+ <!--
454
+
455
+ Run template
456
+
457
+ -->
458
+ <xsl:template match="run">
459
+ <tr>
460
+ <!-- Choosing style and alternate -->
461
+ <xsl:attribute name="class">
462
+ <xsl:choose>
463
+ <xsl:when test="@result = 'success'">
464
+ <xsl:choose>
465
+ <xsl:when test="position() mod 2 = 1">successOdd</xsl:when>
466
+ <xsl:otherwise>successEven</xsl:otherwise>
467
+ </xsl:choose>
468
+ </xsl:when>
469
+ <xsl:when test="@result = 'failure'">
470
+ <xsl:choose>
471
+ <xsl:when test="position() mod 2 = 1">failureOdd</xsl:when>
472
+ <xsl:otherwise>failureEven</xsl:otherwise>
473
+ </xsl:choose>
474
+ </xsl:when>
475
+ <xsl:when test="@result = 'skip'">
476
+ <xsl:choose>
477
+ <xsl:when test="position() mod 2 = 1">skippedOdd</xsl:when>
478
+ <xsl:otherwise>skippedEven</xsl:otherwise>
479
+ </xsl:choose>
480
+ </xsl:when>
481
+ <xsl:when test="@result = 'ignore'">
482
+ <xsl:choose>
483
+ <xsl:when test="position() mod 2 = 1">ignoreOdd</xsl:when>
484
+ <xsl:otherwise>ignoreEvent</xsl:otherwise>
485
+ </xsl:choose>
486
+ </xsl:when>
487
+ </xsl:choose>
488
+ </xsl:attribute>
489
+ <td>
490
+ <xsl:call-template name="run-icon"/>
491
+ <xsl:value-of select="@name"/>
492
+ </td>
493
+ <td>
494
+ <xsl:call-template name="display-time">
495
+ <xsl:with-param name="value" select="@duration"/>
496
+ </xsl:call-template>
497
+ </td>
498
+ <td>
499
+ <xsl:call-template name="display-memory">
500
+ <xsl:with-param name="value" select="@memory"/>
501
+ </xsl:call-template>, <xsl:value-of select="@assert-count" />
502
+ </td>
503
+ </tr>
504
+ <!-- Adding execption log -->
505
+ <xsl:if test="@result = 'failure'">
506
+ <xsl:call-template name="exception-log"/>
507
+ </xsl:if>
508
+ <!-- Adding console out, error -->
509
+ <xsl:call-template name="console-output" />
510
+ </xsl:template>
511
+ <xsl:template name="exception-log">
512
+ <tr class="failure-exception">
513
+ <td>
514
+
515
+ <div style="display;">
516
+ <table border="0" cellpadding="1" cellspacing="1" width="600">
517
+ <xsl:apply-templates select="exception" />
518
+ </table>
519
+ </div>
520
+ </td>
521
+ </tr>
522
+ </xsl:template>
523
+ <xsl:template match="exception">
524
+ <tr class="exceptionType">
525
+ <td>
526
+ <strong>Type:</strong>
527
+ <xsl:value-of select="@type"/>
528
+ </td>
529
+ </tr>
530
+ <tr>
531
+ <td>
532
+ <strong>Message:</strong>
533
+ <xsl:value-of select="message"/>
534
+ </td>
535
+ </tr>
536
+ <tr>
537
+ <td>
538
+ <strong>Source:</strong>
539
+ <xsl:value-of select="source"/>
540
+ </td>
541
+ </tr>
542
+ <xsl:for-each select="properties/property">
543
+ <tr>
544
+ <td>
545
+ <bold><xsl:value-of select="@name"/>:</bold>
546
+ <xsl:value-of select="@value"/>
547
+ </td>
548
+ </tr>
549
+ </xsl:for-each>
550
+ <tr>
551
+ <td width="80">
552
+ <strong>StackTrace:</strong>
553
+ <br/>
554
+ <pre class="stackTrace" width="80">
555
+ <xsl:value-of select="stack-trace"/>
556
+ </pre>
557
+ </td>
558
+ </tr>
559
+ <xsl:apply-templates select="exception" />
560
+ </xsl:template>
561
+ <xsl:template name="console-output">
562
+ <xsl:apply-templates select="console-out"/>
563
+ <xsl:apply-templates select="console-error"/>
564
+ </xsl:template>
565
+ <xsl:template match="console-out">
566
+ <xsl:call-template name="console">
567
+ <xsl:with-param name="name">Console Output</xsl:with-param>
568
+ </xsl:call-template>
569
+ </xsl:template>
570
+ <xsl:template match="console-error">
571
+ <xsl:call-template name="console">
572
+ <xsl:with-param name="name">Console Error</xsl:with-param>
573
+ </xsl:call-template>
574
+ </xsl:template>
575
+ <xsl:template name="console">
576
+ <xsl:param name="name" />
577
+ <xsl:if test="string-length( text() ) != 0">
578
+ <tr>
579
+ <td>
580
+ <table>
581
+ <tr><td><strong><xsl:value-of select="$name"/></strong></td></tr>
582
+ <tr>
583
+ <td>
584
+ <pre class="console"><xsl:value-of select="text()"/></pre>
585
+ </td>
586
+ </tr>
587
+ </table>
588
+ </td>
589
+ </tr>
590
+ </xsl:if>
591
+ </xsl:template>
592
+ </xsl:stylesheet>