Permalink
Browse files

Refactored to support grails 1.3.x

  • Loading branch information...
Jonathan Leibiusky
Jonathan Leibiusky committed Jun 17, 2010
1 parent d9699ef commit beae5678aaae55229244fea1ba7e4c7a99871564
@@ -1,7 +1,7 @@
class StoriesGrailsPlugin {
def version = 0.15
def title = "A BDD plugin for grails"
- def grailsVersion = "1.2.2 > *"
+ def grailsVersion = "1.3.1 > *"
def author = "Jonathan Leibiusky"
def authorEmail = "ionathan@gmail.com"
def description = "Stories is a BDD plugin for Grails that aims to make you life easier with functional testing. Stories does't depend on any testing framework out there. It tries to use them all, offerind a way to organize your tests as Stories and Scenarios. What you do inside each scenario is your problem :)... you can use either Selenium, WebTest, HtmlUnit, etc."
View
@@ -1,7 +1,7 @@
#Grails Metadata file
-#Fri Jun 04 23:38:12 ART 2010
-app.grails.version=1.2.2
+#Thu Jun 17 18:05:01 ART 2010
+app.grails.version=1.3.1
app.name=stories
-plugins.hibernate=1.2.2
+plugins.hibernate=1.3.1
plugins.rest=0.3
-plugins.tomcat=1.2.2
+plugins.tomcat=1.3.1
@@ -1,15 +1,16 @@
package stories
+import groovy.lang.GroovyShell
+import stories.junit.JUnitBuilder
import org.codehaus.groovy.grails.test.GrailsTestTypeResult
import org.codehaus.groovy.grails.test.support.GrailsTestTypeSupport
import org.codehaus.groovy.grails.test.event.GrailsTestEventPublisher
import org.codehaus.groovy.grails.test.GrailsTestTargetPattern
-import groovy.lang.GroovyShell
-import stories.junit.JUnitBuilder
import org.codehaus.groovy.grails.commons.ApplicationHolder
import org.codehaus.groovy.grails.commons.ConfigurationHolder
-import org.codehaus.groovy.grails.test.junit3.JUnit3GrailsTestTypeRunner
import org.codehaus.groovy.grails.test.report.junit.JUnitReportsFactory
+import org.junit.runner.JUnitCore
+import org.codehaus.groovy.grails.test.junit4.listener.SuiteRunListener
class GrailsStoryTestType extends GrailsTestTypeSupport {
def builder
@@ -57,11 +58,17 @@ class GrailsStoryTestType extends GrailsTestTypeSupport {
emc
}
- protected JUnit3GrailsTestTypeRunner createRunner(GrailsTestEventPublisher eventPublisher) {
- return new JUnit3GrailsTestTypeRunner(JUnitReportsFactory.createFromBuildBinding(getBuildBinding()), eventPublisher, createSystemOutAndErrSwapper());
+ protected createJUnitReportsFactory() {
+ JUnitReportsFactory.createFromBuildBinding(buildBinding)
+ }
+
+ protected createListener(eventPublisher) {
+ new SuiteRunListener(eventPublisher, createJUnitReportsFactory(), createSystemOutAndErrSwapper())
}
GrailsTestTypeResult doRun(GrailsTestEventPublisher eventPublisher) {
- return new GrailsStoryTypeResult(createRunner(eventPublisher).runTests(builder.suite))
+ def junit = new JUnitCore()
+ junit.addListener(createListener(eventPublisher))
+ new GrailsStoryTypeResult(junit.run(builder.suite))
}
}
@@ -11,9 +11,9 @@ class GrailsStoryTypeResult implements GrailsTestTypeResult {
}
int getFailCount() {
- return result.failureCount() + result.errorCount()
+ return result.getFailureCount();
}
int getPassCount() {
- return result.runCount() - getFailCount()
+ return result.getRunCount() - getFailCount()
}
}
@@ -4,12 +4,11 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
- <description>The Grails (Groovy on Rails) custom tag library</description>
+ <description>The Grails custom tag library</description>
<tlib-version>0.2</tlib-version>
<short-name>grails</short-name>
<uri>http://grails.codehaus.org/tags</uri>
-
<tag>
<name>link</name>
<tag-class>org.codehaus.groovy.grails.web.taglib.jsp.JspLinkTag</tag-class>

0 comments on commit beae567

Please sign in to comment.