views:

37

answers:

0

I'm trying to setup a webtest plugin with an existing grails app that's already pretty far along...

I'm using grails 1.2.2, groovy version 1.6.4, webtest-plugin 2.0.4

I have one functional web test, which has a single call to

invoke("http://localhost:8080/myApp/")

I've overridden the existing URLMappings.groovy file so that "/" maps to the 'startToAuth' action in the LoginController, and that action (in the controller) has a single call to render a simple string message, no HTML

When I run "grails test-app functional:" , the top part of the stack trace looks like this

: Unexpected exception caught: java.net.ConnectException
at com.canoo.webtest.steps.StepUtil.handleException(StepUtil.java:120)
at com.canoo.webtest.steps.Step.handleException(Step.java:387)
at com.canoo.webtest.steps.Step.execute(Step.java:118)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
at com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:31)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
    ....

I have a dummy app in another directory, which has a similar single invoke method that completes just fine. In that working example, the "/" maps to a view, so I know that webtest at least partially works.

Since I'm a beginner to Grails, I'm not sure if something is messing with my attempt at an invoke method. There is some dynamic scaffolding in the controller classes which could be causing it, but the chain of controller logic is quite complex and goes through all sorts of constraints and internationalization checks before rendering a default login page. I would have tried to map the "/" URL directly to a view, but I get an error saying that the setLocale controller cannot map to a null object.

I'm looking for someone to show me how to get the webtest plugin to pass a single invoke method to either localhost:8080/myApp/ or localhost:8080/myApp/login by either telling me what else I need to disable to get the test to pass or (more preferably) what settings I need to change in webtest so that the test passes. Something i18n related? Some redirecting? Some scaffolding issues? I am mystified...

Thanks in advance for any help.