use of com.sun.ts.tests.jsf.common.factories.TCKDecoratedContextFactory in project faces by jakartaee.
the class TestServlet method getFactoryDecoratedTest.
public void getFactoryDecoratedTest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw = response.getWriter();
String expectFactNames = "com.sun.ts.tests.jsf.common.factories." + "TCKContextFactoryFour and com.sun.ts.tests.jsf.common." + "factories.TCKContextFactoryThree";
try {
FacesContextFactory fcf = (FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
TCKDecoratedContextFactory tckFactory = (TCKDecoratedContextFactory) fcf.getWrapped();
String factNameFour = tckFactory.getClass().getCanonicalName();
String factNameThree = tckFactory.getParent();
if (factNameThree.contains("TCKContextFactoryThree") && factNameFour.contains("TCKContextFactoryFour")) {
pw.println("Test PASSED");
} else {
pw.println("FacesContext Were not Decorated in correct order.");
pw.println("Found: " + factNameThree + " And " + factNameFour);
pw.println("Expected: " + expectFactNames);
pw.println("Test FAILED.");
}
} catch (Exception e) {
pw.println("Test FAILED.");
pw.println(e.toString());
}
}
Aggregations