Webtest Plugin

grails run-webtest fails with Caught: java.lang.NoClassDefFoundError: org.apache.ivy.util.Message

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: Grails-Webtest 2.0
  • Component/s: None
  • Labels:
    None
  • Environment:
    Grails 1.2.0.RC2, Plugin webtest 1.2.3

Description

When I run 'grails run-webtest' I get following Exception:

D:\testapp>grails run-webtest
Welcome to Grails 1.2.0.RC2 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\grails-1.2.0.RC2

Base Directory: D:\testapp
Resolving dependencies...
Dependencies resolved in 688ms.
Running script C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\plugins\webtest-1.2.3\scripts\RunWebtest.groovy
Environment set to test
[groovyc] Compiling 1 source file to D:\testapp\target\classes
Running WebTest ...

#############################################################################################

DEPRECATION WARNING: run-webtest is now deprecated, please use test-app -functional instead.

Please see the release notes at refactor.com.au regarding run-webtest functionality not
supported by test-app

#############################################################################################

Running HTTP Server on port 8080 ...
[delete] Deleting directory C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\tomcat
Running Grails application..
Server running. Browse to http://localhost:8080/testapp
WebTest Plugin Home: C:/Dokumente und Einstellungen/ah/.grails/1.2.0.RC2/projects/testapp/plugins/webtest-1.2.3 ...
WebTest Home: C:/Dokumente und Einstellungen/ah/.grails/1.2.0.RC2/projects/testapp/plugins/webtest-1.2.3/home ...
Application Base Dir: D:\testapp ...

call:
[java] Letting agent QTJA do the transformation
[java] Letting agent QTJA do the transformation
[java] Letting agent QTJA do the transformation
[java] D:\testapp\test\webtest\conf\webtest.properties added.
[java] Caught: java.lang.NoClassDefFoundError: org.apache.ivy.util.Message
[java] at grails.util.BuildSettings.class$(BuildSettings.groovy)
[java] at grails.util.BuildSettings.$get$$class$org$apache$ivy$util$Message(BuildSettings.groovy)
[java] at grails.util.BuildSettings.configureDependencyManager(BuildSettings.groovy:685)
[java] at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:656)
[java] at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:646)
[java] at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:634)
[java] at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:612)
[java] at grails.util.WebTest.loadBuildSettings(WebTest.groovy:112)
[java] at grails.util.WebTest.this$5$loadBuildSettings(WebTest.groovy)
[java] at grails.util.WebTest.initProps(WebTest.groovy:77)
[java] at grails.util.WebTest.prepare(WebTest.groovy:127)
[java] at grails.util.WebTest.runTests(WebTest.groovy:55)
[java] at TestSuite.main(TestSuite.groovy:8)
[java] Java Result: 1
Result file (test\reports\webtest\WebTestOverview.xml) not found!
WebTest complete
Server stopped
Build failed!!
_______

Attached you will find a simple grails application where you can reproduce this bug.

This grails application was built by following steps:

  • grails create-app testapp
  • cd testapp
  • grails create-domain-class person
  • added 'String name' and 'Integer age' to testapp\grails-app\domain\Person.groovy
  • grails generate-all person
  • grails install-plugin webtest
  • grails create-webtest person
  • grails run-webtest

Activity

Hide
Lee Butts added a comment - - edited

run-webtest will be removed in the next version (2.0) in favour of the new test-app -functional support.

I'll close this once 2.0 is released (should be within a day or two)

Show
Lee Butts added a comment - - edited run-webtest will be removed in the next version (2.0) in favour of the new test-app -functional support. I'll close this once 2.0 is released (should be within a day or two)
Hide
Armin Heinzer added a comment -

I tried 'grails test-app -functional' as well, but then I get following Exception:

D:\testapp>grails test-app -functional
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\GEMEIN~1\MERCUR~1\FUNCTI~1\Java\classes;C:\PROGRA~1\GEMEIN~1\MERCUR~1\FUNCTI~1\Java\classes\jasmine.jar
Welcome to Grails 1.2.0.RC2 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\grails-1.2.0.RC2

Base Directory: D:\testapp
Resolving dependencies...
Dependencies resolved in 672ms.
Running script C:\grails-1.2.0.RC2\scripts\TestApp.groovy
Environment set to test
[groovyc] Compiling 1 source file to D:\testapp\target\classes
[mkdir] Created dir: D:\testapp\target\test-reports\html
[mkdir] Created dir: D:\testapp\target\test-reports\plain

Starting functional test phase ...
Loading WebTest configuration ...
D:\testapp\test\webtest\conf\webtest.properties added. ...
Testing testapp deployed as testapp ...
Using WebTest home: C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\plugins\webtest-1.2.3\home ...
[groovyc] Compiling 1 source file to D:\testapp\target\classes
[delete] Deleting directory C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\tomcat
Running Grails application..
Server running. Browse to http://localhost:8080/testapp
Registering steps and initialising WebTest... ...

wt.defineTasks:
Trying to override old definition of task retry

wt.webtestMonitor:
[echo] C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\plugins\webtest-1.2.3\home/tools/WebTestMonitor.groovy

wt.defineMacros:
[echo] No macro to define
Scanning for entities...
0 entities found
Already uptodate: D:\testapp\dtd\Project.dtd
Definitions dir not found: D:\testapp\definitions. Ignoring.

wt.htmlReports.init:
[mkdir] Created dir: D:\testapp\test\reports\webtest\resources
[copy] Copying 22 files to D:\testapp\test\reports\webtest\resources
[copy] Copying 1 file to D:\testapp\test\reports\webtest
Trying to override old definition of task groovy

-------------------------------------------------------
Running 1 webtest test...
Running test PersonTests...
testPersonListNewDelete...FAILED
[echo] Formatting D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.xml to HTML in folder D:\testapp\test\reports\webtest\001_PersonTeststestP
[xslt] Processing D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.xml to D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.html
[xslt] Loading stylesheet C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\plugins\webtest-1.2.3\home\resources\WebTestReport.xsl
Tests Completed in 2188ms ...
-------------------------------------------------------
Tests passed: 0
Tests failed: 1
-------------------------------------------------------
Error running webtest tests: groovy.lang.MissingMethodException: No signature of method: _Events$_run_closure4.doCall() is applicable for argument types: (java.lang.String) values
: [webtest]
groovy.lang.MissingMethodException: No signature of method: _Events$_run_closure4.doCall() is applicable for argument types: (java.lang.String) values: [webtest]
at _GrailsEvents_groovy$_run_closure5.doCall(_GrailsEvents_groovy:58)
at _GrailsEvents_groovy$_run_closure5.call(_GrailsEvents_groovy)
at _GrailsTest_groovy$_run_closure4.doCall(_GrailsTest_groovy:273)
at _GrailsTest_groovy$_run_closure4.call(_GrailsTest_groovy)
at _GrailsTest_groovy$_run_closure2.doCall(_GrailsTest_groovy:221)
at _GrailsTest_groovy$_run_closure1_closure21.doCall(_GrailsTest_groovy:181)
at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:168)
at TestApp$_run_closure1.doCall(TestApp.groovy:102)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
[xslt] Processing D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.xml to D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestSummary.xml
[xslt] Loading stylesheet C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\plugins\webtest-1.2.3\home\resources\WebTestReportSummaryExtractor.xsl
[echo] DONE. Formatting D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.xml to HTML in folder D:\testapp\test\reports\webtest\001_PersonTeststestP
Server stopped
[junitreport] Processing D:\testapp\target\test-reports\TESTS-TestSuites.xml to D:\TEMP\null2112338982
[junitreport] Loading stylesheet jar:file:/C:/Dokumente%20und%20Einstellungen/ah/.ivy2/cache/org.apache.ant/ant-junit/jars/ant-junit-1.7.1.jar!/org/apache/tools/ant/taskdefs/optio
nal/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 219ms
[junitreport] Deleting: D:\TEMP\null2112338982

Tests FAILED - view reports in target\test-reports
Application context shutting down...
Application context shutdown.
D:\testapp>

Show
Armin Heinzer added a comment - I tried 'grails test-app -functional' as well, but then I get following Exception: D:\testapp>grails test-app -functional Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\GEMEIN~1\MERCUR~1\FUNCTI~1\Java\classes;C:\PROGRA~1\GEMEIN~1\MERCUR~1\FUNCTI~1\Java\classes\jasmine.jar Welcome to Grails 1.2.0.RC2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: C:\grails-1.2.0.RC2 Base Directory: D:\testapp Resolving dependencies... Dependencies resolved in 672ms. Running script C:\grails-1.2.0.RC2\scripts\TestApp.groovy Environment set to test [groovyc] Compiling 1 source file to D:\testapp\target\classes [mkdir] Created dir: D:\testapp\target\test-reports\html [mkdir] Created dir: D:\testapp\target\test-reports\plain Starting functional test phase ... Loading WebTest configuration ... D:\testapp\test\webtest\conf\webtest.properties added. ... Testing testapp deployed as testapp ... Using WebTest home: C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\plugins\webtest-1.2.3\home ... [groovyc] Compiling 1 source file to D:\testapp\target\classes [delete] Deleting directory C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\tomcat Running Grails application.. Server running. Browse to http://localhost:8080/testapp Registering steps and initialising WebTest... ... wt.defineTasks: Trying to override old definition of task retry wt.webtestMonitor: [echo] C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\plugins\webtest-1.2.3\home/tools/WebTestMonitor.groovy wt.defineMacros: [echo] No macro to define Scanning for entities... 0 entities found Already uptodate: D:\testapp\dtd\Project.dtd Definitions dir not found: D:\testapp\definitions. Ignoring. wt.htmlReports.init: [mkdir] Created dir: D:\testapp\test\reports\webtest\resources [copy] Copying 22 files to D:\testapp\test\reports\webtest\resources [copy] Copying 1 file to D:\testapp\test\reports\webtest Trying to override old definition of task groovy ------------------------------------------------------- Running 1 webtest test... Running test PersonTests... testPersonListNewDelete...FAILED [echo] Formatting D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.xml to HTML in folder D:\testapp\test\reports\webtest\001_PersonTeststestP [xslt] Processing D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.xml to D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.html [xslt] Loading stylesheet C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\plugins\webtest-1.2.3\home\resources\WebTestReport.xsl Tests Completed in 2188ms ... ------------------------------------------------------- Tests passed: 0 Tests failed: 1 ------------------------------------------------------- Error running webtest tests: groovy.lang.MissingMethodException: No signature of method: _Events$_run_closure4.doCall() is applicable for argument types: (java.lang.String) values : [webtest] groovy.lang.MissingMethodException: No signature of method: _Events$_run_closure4.doCall() is applicable for argument types: (java.lang.String) values: [webtest] at _GrailsEvents_groovy$_run_closure5.doCall(_GrailsEvents_groovy:58) at _GrailsEvents_groovy$_run_closure5.call(_GrailsEvents_groovy) at _GrailsTest_groovy$_run_closure4.doCall(_GrailsTest_groovy:273) at _GrailsTest_groovy$_run_closure4.call(_GrailsTest_groovy) at _GrailsTest_groovy$_run_closure2.doCall(_GrailsTest_groovy:221) at _GrailsTest_groovy$_run_closure1_closure21.doCall(_GrailsTest_groovy:181) at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:168) at TestApp$_run_closure1.doCall(TestApp.groovy:102) at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:344) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:334) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.processTargets(Gant.groovy:495) at gant.Gant.processTargets(Gant.groovy:480) [xslt] Processing D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.xml to D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestSummary.xml [xslt] Loading stylesheet C:\Dokumente und Einstellungen\ah\.grails\1.2.0.RC2\projects\testapp\plugins\webtest-1.2.3\home\resources\WebTestReportSummaryExtractor.xsl [echo] DONE. Formatting D:\testapp\test\reports\webtest\001_PersonTeststestP\WebTestReport.xml to HTML in folder D:\testapp\test\reports\webtest\001_PersonTeststestP Server stopped [junitreport] Processing D:\testapp\target\test-reports\TESTS-TestSuites.xml to D:\TEMP\null2112338982 [junitreport] Loading stylesheet jar:file:/C:/Dokumente%20und%20Einstellungen/ah/.ivy2/cache/org.apache.ant/ant-junit/jars/ant-junit-1.7.1.jar!/org/apache/tools/ant/taskdefs/optio nal/junit/xsl/junit-frames.xsl [junitreport] Transform time: 219ms [junitreport] Deleting: D:\TEMP\null2112338982 Tests FAILED - view reports in target\test-reports Application context shutting down... Application context shutdown. D:\testapp>
Hide
Lee Butts added a comment -

Hi,

yes, test-app is also broken currently under 1.2RC2 - will be fixed in 2.0 release.

cheers

Lee

Show
Lee Butts added a comment - Hi, yes, test-app is also broken currently under 1.2RC2 - will be fixed in 2.0 release. cheers Lee
Hide
Lee Butts added a comment -

Closing resolved issues

Show
Lee Butts added a comment - Closing resolved issues

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: