Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Wrapped Viewhandler (Avoids java.lang.InstantiationException: org.jboss.weld.module.jsf.ConversationAwareViewHandler) #1656

Merged
merged 1 commit into from
Apr 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import jakarta.faces.FactoryFinder;
import jakarta.faces.application.Application;
import jakarta.faces.application.ViewHandler;
import jakarta.faces.application.ViewHandlerWrapper;
import jakarta.faces.component.UIViewRoot;
import jakarta.faces.context.ExternalContext;
import jakarta.faces.context.FacesContext;
Expand Down Expand Up @@ -172,11 +173,11 @@ public void viewHandlerRenderViewNPETest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"renderView", new Class<?>[] { FacesContext.class, UIViewRoot.class },
new Object[] { null, new UIViewRoot() }, out);

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"renderView", new Class<?>[] { FacesContext.class, UIViewRoot.class },
new Object[] { getFacesContext(), null }, out);
}
Expand Down Expand Up @@ -261,7 +262,7 @@ public void viewHandlerCalculateLocaleNPETest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"calculateLocale", new Class<?>[] { FacesContext.class },
new Object[] { null }, out);
}
Expand All @@ -271,7 +272,7 @@ public void viewHandlerCreateViewNPETest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"createView", new Class<?>[] { FacesContext.class, String.class },
new Object[] { null, "/viewId" }, out);
}
Expand All @@ -282,7 +283,7 @@ public void viewHandlerCalculateRenderKitIdNPETest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"calculateRenderKitId", new Class<?>[] { FacesContext.class },
new Object[] { null }, out);
}
Expand All @@ -293,11 +294,11 @@ public void viewHandlerGetResourceURLNPETest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"getResourceURL", new Class<?>[] { FacesContext.class, String.class },
new Object[] { null, "testString" }, out);

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"getResourceURL", new Class<?>[] { FacesContext.class, String.class },
new Object[] { getFacesContext(), null }, out);
}
Expand All @@ -308,11 +309,11 @@ public void viewHandlerGetActionURLNPETest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"getActionURL", new Class<?>[] { FacesContext.class, String.class },
new Object[] { null, "testString" }, out);

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"getActionURL", new Class<?>[] { FacesContext.class, String.class },
new Object[] { getFacesContext(), null }, out);
}
Expand All @@ -322,7 +323,7 @@ public void viewHandlerRestoreViewNPETest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"restoreView", new Class<?>[] { FacesContext.class, String.class },
new Object[] { null, "testString" }, out);
}
Expand All @@ -332,7 +333,7 @@ public void viewHandlerWriteStateNPETest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();

JSFTestUtil.checkForNPE(getApplication().getViewHandler().getClass(),
JSFTestUtil.checkForNPE(((ViewHandlerWrapper)getApplication().getViewHandler()).getWrapped().getClass(),
"writeState", new Class<?>[] { FacesContext.class },
new Object[] { null }, out);
}
Expand Down