Permalink
Browse files

added Data Driven Test

  • Loading branch information...
1 parent 7ed6f5b commit 0f03112bf0e7906d2a51c1edbe9e8ddd630f8677 @manutestin manutestin committed Feb 29, 2012
Showing with 40 additions and 1,000 deletions.
  1. BIN target/classes/ApplicationResources$_run_closure1.class
  2. BIN target/classes/ApplicationResources$_run_closure1_closure2.class
  3. BIN target/classes/ApplicationResources.class
  4. BIN target/classes/BootStrap$_closure1.class
  5. BIN target/classes/BootStrap$_closure2.class
  6. BIN target/classes/BootStrap.class
  7. BIN target/classes/BuildConfig$_run_closure1.class
  8. BIN target/classes/BuildConfig$_run_closure1_closure2.class
  9. BIN target/classes/BuildConfig$_run_closure1_closure3.class
  10. BIN target/classes/BuildConfig$_run_closure1_closure4.class
  11. BIN target/classes/BuildConfig$_run_closure1_closure5.class
  12. BIN target/classes/BuildConfig.class
  13. BIN target/classes/Config$_run_closure1.class
  14. BIN target/classes/Config$_run_closure1_closure3.class
  15. BIN target/classes/Config$_run_closure1_closure4.class
  16. BIN target/classes/Config$_run_closure2.class
  17. BIN target/classes/Config.class
  18. BIN target/classes/DataSource$_run_closure1.class
  19. BIN target/classes/DataSource$_run_closure2.class
  20. BIN target/classes/DataSource$_run_closure3.class
  21. BIN target/classes/DataSource$_run_closure3_closure4.class
  22. BIN target/classes/DataSource$_run_closure3_closure4_closure7.class
  23. BIN target/classes/DataSource$_run_closure3_closure5.class
  24. BIN target/classes/DataSource$_run_closure3_closure5_closure8.class
  25. BIN target/classes/DataSource$_run_closure3_closure6.class
  26. BIN target/classes/DataSource$_run_closure3_closure6_closure9.class
  27. BIN target/classes/DataSource$_run_closure3_closure6_closure9_closure10.class
  28. BIN target/classes/DataSource.class
  29. BIN target/classes/UrlMappings$__clinit__closure1.class
  30. BIN target/classes/UrlMappings$__clinit__closure1_closure2.class
  31. BIN target/classes/UrlMappings$__clinit__closure1_closure2_closure3.class
  32. BIN target/classes/UrlMappings.class
  33. BIN target/classes/es/demo/Album$__clinit__closure1.class
  34. BIN target/classes/es/demo/Album.class
  35. BIN target/classes/resources$_run_closure1.class
  36. BIN target/classes/resources.class
  37. BIN target/test-classes/unit/es/demo/AlbumSpec.class
  38. +0 −9 target/test-reports/TEST-unit-spock-es.demo.AlbumSpec.xml
  39. +0 −15 target/test-reports/TESTS-TestSuites.xml
  40. +0 −216 target/test-reports/html/all.html
  41. +0 −212 target/test-reports/html/es/demo/0_AlbumSpec.html
  42. +0 −183 target/test-reports/html/failed.html
  43. +0 −60 target/test-reports/html/index.html
  44. +0 −290 target/test-reports/html/stylesheet.css
  45. +0 −1 target/test-reports/plain/TEST-unit-spock-es.demo.AlbumSpec-err.txt
  46. +0 −1 target/test-reports/plain/TEST-unit-spock-es.demo.AlbumSpec-out.txt
  47. +0 −10 target/test-reports/plain/TEST-unit-spock-es.demo.AlbumSpec.txt
  48. +40 −3 test/unit/es/demo/AlbumSpec.groovy
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="0" hostname="Manu-Mac.local" name="es.demo.AlbumSpec" tests="1" time="1.783" timestamp="2012-02-29T18:32:37">
- <properties />
- <testcase classname="es.demo.AlbumSpec" name="albums can be saved and retrieved" time="1.74" />
- <system-out><![CDATA[--Output from albums can be saved and retrieved--
-]]></system-out>
- <system-err><![CDATA[--Output from albums can be saved and retrieved--
-]]></system-err>
-</testsuite>
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<testsuites>
- <testsuite errors="0" failures="0" hostname="Manu-Mac.local" id="0" name="AlbumSpec" package="es.demo" tests="1" time="1.783" timestamp="2012-02-29T18:32:37">
- <properties />
-
- <testcase classname="es.demo.AlbumSpec" name="albums can be saved and retrieved" time="1.74" />
-
- <system-out><![CDATA[--Output from albums can be saved and retrieved--
-]]></system-out>
-
- <system-err><![CDATA[--Output from albums can be saved and retrieved--
-]]></system-err>
-
- </testsuite>
-</testsuites>
@@ -1,216 +0,0 @@
-<!DOCTYPE html><html xmlns:lxslt="http://xml.apache.org/xslt" xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils">
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>
- Unit Test Results
- - All tests</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css">
-</head>
-<body>
-<div id="report" class="container container_8">
-<div class="grid_6 alpha">
-<div class="grailslogo"></div>
-<h1>
- Unit Test Results
- - All tests </h1>
-<p class="intro">
- A single test executed
-
- without a single error or failure!
- </p>
-</div>
-<div class="grid_2 omega">
-<nav id="navigationlinks">
-<p>
-<a href="failed.html">
- Tests with failure and errors
- </a>
-</p>
-<p>
-<a href="index.html">
- Package summary
- </a>
-</p>
-<p>
-<a href="all.html">
- Show all tests
- </a>
-</p>
-</nav>
-</div>
-<div class="clear"></div>
-<div class="testsuite success">
-<div class="header">
-<h2>AlbumSpec</h2>
-<h3>
- A single test executed
-
- without a single error or failure!
- </h3>
-</div>
-<div class="testcase clearfix success grid_8 alpha omega" data-name="albums can be saved and retrieved">
-<div class="grid_3 alpha">
-<p>
-<span class="icon success"></span><b class="testname message success">albums can be saved and retrieved</b>
-</p>
-<p class="summary">Executed in 1.74 seconds.</p>
-</div>
-<div class="grid_5 omega outputinfo"></div>
-<div class="clear"></div>
-</div>
-<div class="clearfix output footer">
-<div class="sysout">
-<h2>Standard output</h2>
-<pre class="stdout">--Output from albums can be saved and retrieved--
-</pre>
-</div>
-<div class="syserr">
-<h2>System error</h2>
-<pre class="syserr">--Output from albums can be saved and retrieved--
-</pre>
-</div>
-</div>
-<div class="clear"></div>
-</div>
-<div class="clear"></div>
-</div>
-<!--
- Parses JUnit output and associates it with the corresponding test case
- -->
-<script language="javascript">
-
-
-/**
- * The JUnit report format is incredibly stuipd in the
- * sense that it accumulates output from all test methods
- * into a single xml node.
- */
-(function() {
-
- var outputElements = findOutputElements();
- for (var i in outputElements) {
- var outputElement = outputElements[i];
- var textOutput = outputElement.element.firstChild.nodeValue;
- var header = outputElement.getHeader();
- appendTestMethodOutput(textOutput, header);
- }
-
- function findOutputElements() {
- var outputElements = [];
- var preElements = document.getElementsByTagName("pre");
- for (var i in preElements) {
- var preElement = preElements[i];
- var className = preElement.className || "";
- if (className.indexOf("stdout") >= 0) {
- var outputElement = new OutputElement(preElement, "output");
- outputElements.push(outputElement);
- } else if (className.indexOf("syserr") >= 0) {
- var outputElement = new OutputElement(preElement, "error");
- outputElements.push(outputElement);
- }
- }
-
- return outputElements;
- }
-
- function OutputElement(element, type) {
- this.element = element;
- this.type = type;
-
- this.getHeader = function() {
- if (type === "output") {
- return "System output";
- } else if ("error") {
- return "System error";
- }
- }
- }
-
- function appendTestMethodOutput(text, header) {
- var testOutput = new TestMethodOutput(header);
-
- var lines = text.split(/\r\n|\r|\n/);
- for (var i in lines) {
- var line = lines[i];
- var matches = line.match(/^--Output from (.*)--$/);
- if (matches !== null && matches.length == 2) {
- testOutput.flushToDom();
- testOutput.testName = matches[1];
- } else {
- testOutput.addLine(line);
- }
- }
-
- testOutput.flushToDom();
- }
-
- function TestMethodOutput(header) {
- this.header = header;
- this.testName = undefined;
- this.buffer = "";
-
- this.addLine = function(line) {
- this.buffer += line + "\n";
- }
-
- this.flushToDom = function() {
- if (this.testName !== undefined) {
- var domNode = getTestcaseElementByName(this.testName);
- if (domNode !== undefined && trimString(this.buffer).length > 0) {
- this.appendTo(domNode);
- }
-
- this.reset();
- }
- }
-
- this.appendTo = function(domNode) {
- var node = document.createElement("div");
- node.innerHTML = '<p><b class="message">' + header + '</b></p>';
-
- var preNode = document.createElement("pre");
- preNode.appendChild(document.createTextNode(this.buffer));
- node.appendChild(preNode);
-
- var outputContainer = findElementByTagClassAndParent("div", "outputinfo", domNode);
- outputContainer.appendChild(node);
- }
-
- this.reset = function() {
- this.methodName = undefined;
- this.buffer = "";
- }
- }
-
- function getTestcaseElementByName(name) {
- var divElements = document.getElementsByTagName("div");
- var elementCount = divElements.length;
- for (var i=0; i<elementCount; i++) {
- var el = divElements[i];
- if (el.getAttribute("data-name") === name) {
- return el;
- }
- }
- }
-
- function findElementByTagClassAndParent(tagName, className, parentNode) {
- var elements = parentNode.getElementsByTagName(tagName);
- for (var i in elements) {
- var element = elements[i];
-
- // Not 100% correct, but good enough here
- if (element.className !== undefined && element.className.indexOf(className) >= 0) {
- return element;
- }
- }
- }
-
- function trimString(str) {
- return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
- }
-
-})();
-
- </script>
-</body>
-</html>
Oops, something went wrong.

0 comments on commit 0f03112

Please sign in to comment.