Oh yeah. Tx Romain!
Added a test case for the Application injection. Now I'm trying to add
another case for new the thing being injected is not in the main if chain
here...
if (Request.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.REQUEST);
} else if (HttpServletRequest.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_REQUEST);
} else if (ServletRequest.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.SERVLET_REQUEST);
} else if (UriInfo.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.URI_INFO);
} else if (HttpHeaders.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.HTTP_HEADERS);
} else if (SecurityContext.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.SECURITY_CONTEXT);
} else if (ContextResolver.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.CONTEXT_RESOLVER);
} else if (Providers.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.PROVIDERS);
} else if (ServletConfig.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.SERVLET_CONFIG);
} else if (ServletContext.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.SERVLET_CONTEXT);
} else if (HttpServletResponse.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_RESPONSE);
} else if
(javax.ws.rs.container.ResourceInfo.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.RESOURCE_INFO);
} else if (ResourceContext.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.RESOURCE_CONTEXT);
} else if (Configuration.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.CONFIGURATION);
} else if (Application.class.equals(type)) {
reference = new
ObjectReference(ThreadLocalContextManager.APPLICATION);
} else {
reference = new
MapObjectReference(ThreadLocalContextManager.OTHERS,
referenceInfo.referenceType);
}
Do you known whats missing there so I can get to the "
ThreadLocalContextManager.OTHERS" case?
[]s,
Thiago.
On Mon, Jul 16, 2018 at 11:33 AM, Romain Manni-Bucau <[email protected]>
wrote:
> Hi Thiago,
>
> you can surely start from
> https://github.com/apache/tomee/blob/master/server/
> openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/
> rs/JSonStreamingOutputTest.java
> and adapt the endpoint to match you use case?
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/
> rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-
> ee-8-high-performance>
>
>
> Le lun. 16 juil. 2018 à 17:03, Thiago Veronezi <[email protected]> a
> écrit :
>
> > Hi guys,
> >
> > This is the cleaner version of the bug I mentioned last week.
> > https://github.com/apache/tomee/pull/135
> >
> > Can you guys help me finding a way to create a unit test for it?
> >
> > Thanks,
> > Thiago.
> >
>