Looks like similar to what Jason has reported.
here is my theory : Spring uses JDK proxies but CXF SpringAopHelper is not
initialized in the test case so may be the test class should just implement
an interface with a method

@Context
public void setUriInfo(UriInfo ui);

cheers, Sergey

On Wed, Jun 16, 2010 at 7:03 PM, Daniel Kulp <[email protected]> wrote:

>
> Is this something you can create a small test case for?  That would be a
> help.
>
> Dan
>
> On Wednesday 16 June 2010 2:06:29 am senthu wrote:
> > Hi,
> >
> > I am working on a API to expose service using CXF. The strange problem
> > facing here is, when we deploy as a web-app the UriInfo getting injected
> > and everything is working fine.
> >
> > When we run the Junit test cases, UriBuilder throws NullPointerException
> as
> > the UriInfo holds null. It happens only when we keep the @Context UriInfo
> > in an abstract class field or a bean property.
> >
> > The unit test cases work fine when the UriInfo is been given as a method
> > param to the APIs we expose.
> >
> > In Junit test case, we are instantiating JAXRSServerFactoryBean and
> adding
> > the resource provider as the service interface. Please help getting
> through
> > this issue.
> >
> > Thanks,
> > SK
>
> --
> Daniel Kulp
> [email protected]
> http://dankulp.com/blog
>

Reply via email to