Letractively / jcatapult

Automatically exported from code.google.com/p/jcatapult
0 stars 0 forks source link

Injecting a test case with any class that extends BaseAction fails #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It looks like this is an issue with the WebBaseTest or something like that.
Essentially, the injection of the @ActionName using the ActionContext from
XWork fails because the ActionContext is empty. This happens in the
StrutsModule in an anonymous class:

Caused by: java.lang.NullPointerException
    at org.jcatapult.guice.StrutsModule$1.get(StrutsModule.java:60)
    at org.jcatapult.guice.StrutsModule$1.get(StrutsModule.java:58)
    at
com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProvider
Adapter.java:41)
    at
com.google.inject.InjectorImpl$SingleParameterInjector.inject(InjectorImpl.java:
640)

What needs to occur is that the WebBaseTest needs to setup the
ActionContext to set the correct ActionName. This might be really tough and
it might be better just to make the anonymous Provider check for null and
return null and then setup a method on the WebBaseTest to handle setting in
the action name for the test.

Original issue reported on code.google.com by bpontare...@gmail.com on 7 May 2008 at 2:30

GoogleCodeExporter commented 8 years ago
I fixed this issue, although it's not the best solution.  We might want to 
revisit
this later but for now I'm going to mark this issue as 'fixed'.

Original comment by leafkn...@gmail.com on 14 May 2008 at 7:12