From d55574cd2232ec4390702cffa91bc01a8b0ff53c Mon Sep 17 00:00:00 2001 From: Arjan Tijms Date: Tue, 13 Feb 2024 00:48:52 +0100 Subject: [PATCH] Update ElResolvers to account for removed feature descriptor Update EE dependencies for OLD TCK to use Jakarta EE 11 M1 Signed-off-by: Arjan Tijms --- tck/old-tck/source/docker/pom.getlibs.xml | 295 +-- tck/old-tck/source/docker/pom.getmodules.xml | 210 +- tck/old-tck/source/install/jsf/bin/ts.jtx | 2 - .../source/install/jsf/bin/ts.jtx.platform | 2 - .../source/install/jsf/bin/ts.jtx.standalone | 1 - .../elresolvers/SimpleMethodELResolver.java | 2 - .../jsf/spec/el/elresolvers/TestServlet.java | 2337 ++++++----------- .../jsf/spec/el/elresolvers/URLClient.java | 45 - 8 files changed, 1103 insertions(+), 1791 deletions(-) diff --git a/tck/old-tck/source/docker/pom.getlibs.xml b/tck/old-tck/source/docker/pom.getlibs.xml index 4ea0cb5fa14..05b442fd536 100644 --- a/tck/old-tck/source/docker/pom.getlibs.xml +++ b/tck/old-tck/source/docker/pom.getlibs.xml @@ -15,172 +15,147 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> - - - - org.eclipse.ee4j - project - 1.0.7 - - 4.0.0 + + + + org.eclipse.ee4j + project + 1.0.7 + + 4.0.0 jakarta 1 dependency_copy - - - - - jakarta-snapshots - https://jakarta.oss.sonatype.org/content/repositories/staging/ - - + + + + + jakarta-snapshots + https://jakarta.oss.sonatype.org/content/repositories/staging/ + + - + + + commons-codec + commons-codec + 1.9 + + + commons-collections + commons-collections + 3.2.1 + + + commons-httpclient + commons-httpclient + 3.1 + + + commons-io + commons-io + 2.4 + + + org.apache.commons + commons-lang3 + 3.12.0 + + + commons-logging + commons-logging + 1.1.3 + + + net.sourceforge.cssparser + cssparser + 0.9.25 + + + net.sourceforge.htmlunit + htmlunit + 2.70.0 + + + net.sourceforge.htmlunit + htmlunit-core-js + 2.70.0 + + + org.apache.httpcomponents + httpcore + 4.4.9 + + + org.apache.httpcomponents + httpmime + 4.5.5 + + + jaxen + jaxen + 1.1.6 + + + org.jdom + jdom + 1.1.3 + + + net.sourceforge.nekohtml + nekohtml + 1.9.21 + + + org.w3c.css + sac + 1.3 + + + xalan + serializer + 2.7.3 + + + xalan + xalan + 2.7.3 + + + xerces + xercesImpl + 2.12.2 + + + xml-apis + xml-apis + 1.4.01 + + - - - commons-codec - commons-codec - 1.9 - - - commons-collections - commons-collections - 3.2.1 - - - commons-httpclient - commons-httpclient - 3.1 - - - commons-io - commons-io - 2.4 - - - org.apache.commons - commons-lang3 - 3.12.0 - - - commons-logging - commons-logging - 1.1.3 - - - net.sourceforge.cssparser - cssparser - 0.9.25 - - - net.sourceforge.htmlunit - htmlunit - 2.66.0 - - - net.sourceforge.htmlunit - htmlunit-core-js - 2.66.0 - - - - org.apache.httpcomponents - httpcore - 4.4.9 - - - org.apache.httpcomponents - httpmime - 4.5.5 - - - jaxen - jaxen - 1.1.6 - - - - org.jdom - jdom - 1.1.3 - - - net.sourceforge.nekohtml - nekohtml - 1.9.21 - - - org.w3c.css - sac - 1.3 - - - - xalan - serializer - 2.7.2 - - - xalan - xalan - 2.7.2 - - - xerces - xercesImpl - 2.11.0 - - - xml-apis - xml-apis - 1.4.01 - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.10 - - 1.8 - 1.8 - - - - copy-dependencies - process-resources - - copy-dependencies - - - - - - + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + copy-dependencies + process-resources + + copy-dependencies + + + + + + diff --git a/tck/old-tck/source/docker/pom.getmodules.xml b/tck/old-tck/source/docker/pom.getmodules.xml index d883b0f663d..0421c3ad086 100644 --- a/tck/old-tck/source/docker/pom.getmodules.xml +++ b/tck/old-tck/source/docker/pom.getmodules.xml @@ -15,125 +15,125 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> - - - - org.eclipse.ee4j - project - 1.0.7 - - 4.0.0 + + + 4.0.0 + + + + org.eclipse.ee4j + project + 1.0.7 + + jakarta 1 dependency_copy - + - 4.0.0 - 4.0.0 + 4.1.0-M1 + 4.1.0-M1 2.1.0 + 3.1.0 + - 3.0.0 + 3.0.0 2.1.0 - 5.0.0 + 6.0.0-M2 2.0.1 - 6.0.0 - 4.2.4 - - + 6.1.0-M1 + 4.2.4 + - - - - - jakarta-snapshots - https://jakarta.oss.sonatype.org/content/repositories/staging/ - - + + + + + jakarta-snapshots + https://jakarta.oss.sonatype.org/content/repositories/staging/ + + - - - jakarta.enterprise - jakarta.enterprise.cdi-api - ${cdi-api.version} - provided - - - jakarta.servlet.jsp.jstl - jakarta.servlet.jsp.jstl-api - ${jstl-api.version} - - - jakarta.inject - jakarta.inject-api - ${jakarta.inject-api.version} - - - jakarta.faces - jakarta.faces-api - ${jakarta.faces-api.version} - provided - - - jakarta.servlet.jsp - jakarta.servlet.jsp-api - ${jsp-api.version} - provided - - - jakarta.servlet - jakarta.servlet-api - ${jakarta.servlet-api.version} - provided - - - jakarta.el - jakarta.el-api - ${jakarta.el-api.version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta.annotation-api.version} - - - org.glassfish.corba - glassfish-corba-orb - ${glassfish-corba-orb.version} - - + + + jakarta.enterprise + jakarta.enterprise.cdi-api + ${cdi-api.version} + provided + + + jakarta.servlet.jsp.jstl + jakarta.servlet.jsp.jstl-api + ${jstl-api.version} + + + jakarta.inject + jakarta.inject-api + ${jakarta.inject-api.version} + + + jakarta.faces + jakarta.faces-api + ${jakarta.faces-api.version} + provided + + + jakarta.servlet.jsp + jakarta.servlet.jsp-api + ${jsp-api.version} + provided + + + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet-api.version} + provided + + + jakarta.el + jakarta.el-api + ${jakarta.el-api.version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation-api.version} + + + org.glassfish.corba + glassfish-corba-orb + ${glassfish-corba-orb.version} + + - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.10 - - 1.8 - 1.8 - - - - copy-dependencies - process-resources - - copy-dependencies - - - true - - - - - - + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + copy-dependencies + process-resources + + copy-dependencies + + + true + + + + + + diff --git a/tck/old-tck/source/install/jsf/bin/ts.jtx b/tck/old-tck/source/install/jsf/bin/ts.jtx index cfa99c04edc..78b7b8fbf6f 100644 --- a/tck/old-tck/source/install/jsf/bin/ts.jtx +++ b/tck/old-tck/source/install/jsf/bin/ts.jtx @@ -24,14 +24,12 @@ com/sun/ts/tests/jsf/spec/composite/facet/URLClient.java#compositeFacetsTagTest com/sun/ts/tests/jsf/spec/composite/packaging/classpath/URLClient.java#compositeClasspathPKGTest com/sun/ts/tests/jsf/spec/composite/packaging/webapproot/URLClient.java#compositeWebAppRootPKGTest com/sun/ts/tests/jsf/spec/composite/valueholder/URLClient.java#compositeValueHolderTest -com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesImplicitObjectResolverFeatureDescriptorTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesImplicitObjectResolverGetTypeTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesImplicitObjectResolverIsReadOnlyTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesImplicitObjectResolverSetValueTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesManagedBeanResolverGetValueTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesResourceBundleResolverFeatureDescriptorTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesScopedAttributeResolverFeatureDescriptorTest -com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#managedBeanELResolverFeatureDescriptorTest com/sun/ts/tests/jsf/spec/flows/basicmethodcall/URLClient.java#facesFlowBasicMethodCallTest com/sun/ts/tests/jsf/spec/flows/basicmultipage/URLClient.java#facesFlowScopeTest com/sun/ts/tests/jsf/spec/flows/multipagewebinf/URLClient.java#facesFlowWebInfScopeTest diff --git a/tck/old-tck/source/install/jsf/bin/ts.jtx.platform b/tck/old-tck/source/install/jsf/bin/ts.jtx.platform index a9dafb60d8e..6f131d1985a 100644 --- a/tck/old-tck/source/install/jsf/bin/ts.jtx.platform +++ b/tck/old-tck/source/install/jsf/bin/ts.jtx.platform @@ -27,14 +27,12 @@ com/sun/ts/tests/jsf/spec/composite/facet/URLClient.java#compositeFacetsTagTest com/sun/ts/tests/jsf/spec/composite/packaging/classpath/URLClient.java#compositeClasspathPKGTest com/sun/ts/tests/jsf/spec/composite/packaging/webapproot/URLClient.java#compositeWebAppRootPKGTest com/sun/ts/tests/jsf/spec/composite/valueholder/URLClient.java#compositeValueHolderTest -com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesImplicitObjectResolverFeatureDescriptorTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesImplicitObjectResolverGetTypeTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesImplicitObjectResolverIsReadOnlyTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesImplicitObjectResolverSetValueTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesManagedBeanResolverGetValueTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesResourceBundleResolverFeatureDescriptorTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesScopedAttributeResolverFeatureDescriptorTest -com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#managedBeanELResolverFeatureDescriptorTest com/sun/ts/tests/jsf/spec/flows/basicmethodcall/URLClient.java#facesFlowBasicMethodCallTest com/sun/ts/tests/jsf/spec/flows/basicmultipage/URLClient.java#facesFlowScopeTest com/sun/ts/tests/jsf/spec/flows/multipagewebinf/URLClient.java#facesFlowWebInfScopeTest diff --git a/tck/old-tck/source/install/jsf/bin/ts.jtx.standalone b/tck/old-tck/source/install/jsf/bin/ts.jtx.standalone index d44676edd18..954b7de0aa2 100644 --- a/tck/old-tck/source/install/jsf/bin/ts.jtx.standalone +++ b/tck/old-tck/source/install/jsf/bin/ts.jtx.standalone @@ -31,7 +31,6 @@ com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesImplicitObjectResol com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesManagedBeanResolverGetValueTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesResourceBundleResolverFeatureDescriptorTest com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#facesScopedAttributeResolverFeatureDescriptorTest -com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java#managedBeanELResolverFeatureDescriptorTest com/sun/ts/tests/jsf/spec/flows/basicmethodcall/URLClient.java#facesFlowBasicMethodCallTest com/sun/ts/tests/jsf/spec/flows/basicmultipage/URLClient.java#facesFlowScopeTest com/sun/ts/tests/jsf/spec/flows/multipagewebinf/URLClient.java#facesFlowWebInfScopeTest diff --git a/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/SimpleMethodELResolver.java b/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/SimpleMethodELResolver.java index b1674f06a18..8beda3cd7a2 100644 --- a/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/SimpleMethodELResolver.java +++ b/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/SimpleMethodELResolver.java @@ -381,8 +381,6 @@ public Iterator getFeatureDescriptors(ELContext context, Object base) { desc.setHidden(false); desc.setExpert(false); desc.setPreferred(true); - desc.setValue(ELResolver.RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE); - desc.setValue(ELResolver.TYPE, method.getReturnType()); methodSet.add(desc); } } diff --git a/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/TestServlet.java b/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/TestServlet.java index b55c9ab2bc9..53a6b965c4e 100644 --- a/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/TestServlet.java +++ b/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/TestServlet.java @@ -52,1687 +52,1076 @@ public final class TestServlet extends HttpTCKServlet { - private static final int FACES_PHASE = 0; - - private static final int JSP_PHASE = 1; - - private List implicitInfo; - - /** - *

- * Initialize this Servlet instance. - *

- * - * @param config - * the configuration for this Servlet - * - * @throws jakarta.servlet.ServletException - * indicates initialization failure - */ - public void init(ServletConfig config) throws ServletException { - - super.init(config); - implicitInfo = new ArrayList(); - implicitInfo.add(new ImplicitObjectInfo("application", null, Object.class, - FACES_PHASE, true)); - implicitInfo.add( - new ImplicitObjectInfo("cookie", null, Map.class, FACES_PHASE, true)); - implicitInfo.add( - new ImplicitObjectInfo("header", null, Map.class, FACES_PHASE, true)); - implicitInfo.add(new ImplicitObjectInfo("headerValues", null, Map.class, - FACES_PHASE, true)); - implicitInfo.add(new ImplicitObjectInfo("initParam", null, Map.class, - FACES_PHASE, true)); - implicitInfo.add( - new ImplicitObjectInfo("param", null, Map.class, FACES_PHASE, true)); - implicitInfo.add(new ImplicitObjectInfo("paramValues", null, Map.class, - FACES_PHASE, true)); - implicitInfo.add(new ImplicitObjectInfo("request", null, Object.class, - FACES_PHASE, true)); - implicitInfo.add(new ImplicitObjectInfo("session", null, Object.class, - FACES_PHASE, true)); - implicitInfo.add(new ImplicitObjectInfo("applicationScope", null, Map.class, - FACES_PHASE, true)); - implicitInfo.add(new ImplicitObjectInfo("sessionScope", null, Map.class, - FACES_PHASE, true)); - implicitInfo.add(new ImplicitObjectInfo("requestScope", null, Map.class, - FACES_PHASE, true)); - - // these will be check in both JSP and FACES phases - - implicitInfo.add(new ImplicitObjectInfo("facesContext", null, - FacesContext.class, JSP_PHASE, true)); - implicitInfo.add(new ImplicitObjectInfo("view", null, UIViewRoot.class, - JSP_PHASE, true)); - - } // END init - - // ------------------------------------------------------------ Test Methods - public void managedBeanELResolverFeatureDescriptorTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { - - PrintWriter out = response.getWriter(); - ELContext[] elContexts = getELContexts(request, response); - ELResolver[] resolvers = getELResolvers(elContexts); - boolean passed = true; - for (int i = 0; i < resolvers.length; i++) { - - out.println("Testing phase: " + getTestPhase(i)); - - boolean nondescFound = false; - boolean descFound = false; - - FeatureDescriptor control = new FeatureDescriptor(); - for (Iterator j = resolvers[i].getFeatureDescriptors(elContexts[i], - null); j.hasNext();) { - - FeatureDescriptor descriptor = (FeatureDescriptor) j.next(); - if ("nodescription".equals(descriptor.getName())) { - nondescFound = true; - - control.setDisplayName("nodescription"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Date.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "Validating the feature descriptor for the " - + "'nodescription' managed bean!" + JSFTestUtil.NL + result); - } + private static final int FACES_PHASE = 0; + + private static final int JSP_PHASE = 1; + + private List implicitInfo; + + /** + *

+ * Initialize this Servlet instance. + *

+ * + * @param config the configuration for this Servlet + * + * @throws jakarta.servlet.ServletException indicates initialization failure + */ + public void init(ServletConfig config) throws ServletException { + + super.init(config); + implicitInfo = new ArrayList(); + implicitInfo.add(new ImplicitObjectInfo("application", null, Object.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("cookie", null, Map.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("header", null, Map.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("headerValues", null, Map.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("initParam", null, Map.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("param", null, Map.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("paramValues", null, Map.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("request", null, Object.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("session", null, Object.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("applicationScope", null, Map.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("sessionScope", null, Map.class, FACES_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("requestScope", null, Map.class, FACES_PHASE, true)); + + // these will be check in both JSP and FACES phases + + implicitInfo.add(new ImplicitObjectInfo("facesContext", null, FacesContext.class, JSP_PHASE, true)); + implicitInfo.add(new ImplicitObjectInfo("view", null, UIViewRoot.class, JSP_PHASE, true)); + + } // END init + + public void facesImplicitObjectResolverGetValueTest(HttpServletRequest request, HttpServletResponse response) throws IOException { + + PrintWriter out = response.getWriter(); + ELContext[] elContexts = getELContexts(request, response); + ELResolver[] resolvers = getELResolvers(elContexts); + boolean passed = true; + + // Force session creation for 'session' implict object + request.getSession(true); + + for (int i = 0; i < resolvers.length; i++) { + + out.println("Testing phase: " + getTestPhase(i)); + + for (ImplicitObjectInfo aImplicitInfo : implicitInfo) { + + String result = null; + if (i == JSP_PHASE) { + if (aImplicitInfo.getPhase() == JSP_PHASE) { + result = validateImplicitObjectValue(elContexts[i], resolvers[i], aImplicitInfo); + } + } else { + result = validateImplicitObjectValue(elContexts[i], resolvers[i], aImplicitInfo); + } + + if (result != null && result.length() > 0) { + passed = false; + out.println(result); + } + + elContexts[i].setPropertyResolved(false); + } + } - continue; + if (passed) { + out.println(JSFTestUtil.PASS); } - if ("description".equals(descriptor.getName())) { - descFound = true; + } // END facesImplicitObjectResolverGetValueTest - control.setDisplayName("description"); - control.setShortDescription("This is a description"); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Date.class); - control.setValue("resolvable", Boolean.TRUE); + public void facesImplicitObjectResolverGetTypeTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "Validating the feature descriptor for the " - + "'description' managed bean" + JSFTestUtil.NL + result); - } + PrintWriter out = response.getWriter(); + ELContext[] elContexts = getELContexts(request, response); + ELResolver[] resolvers = getELResolvers(elContexts); + boolean passed = true; - continue; - } + for (int i = 0; i < resolvers.length; i++) { - if (nondescFound && descFound) { - break; - } + out.println("Testing phase: " + getTestPhase(i)); - } - } + for (ImplicitObjectInfo aImplicitInfo : implicitInfo) { - if (passed) { - out.println(JSFTestUtil.PASS); - } + String result = null; + if (i == JSP_PHASE) { + if (aImplicitInfo.getPhase() == JSP_PHASE) { + result = validateImplicitObjectType(elContexts[i], resolvers[i], aImplicitInfo); + } + } else { + result = validateImplicitObjectType(elContexts[i], resolvers[i], aImplicitInfo); + } + + if (result != null && result.length() > 0) { + passed = false; + out.println(result); + } - } // END managedBeanELResolverFeatureDescriptorTest - - public void facesImplicitObjectResolverFeatureDescriptorTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { - - PrintWriter out = response.getWriter(); - ELContext[] elContexts = getELContexts(request, response); - ELResolver[] resolvers = getELResolvers(elContexts); - boolean passed = true; - - FeatureDescriptor control = new FeatureDescriptor(); - for (int i = 0, size = resolvers.length; i < size; i++) { - - boolean viewFound = false; - boolean facesContextFound = false; - boolean applicationFound = false; - boolean applicationScopeFound = false; - boolean cookieFound = false; - boolean headerFound = false; - boolean headerValuesFound = false; - boolean initParamFound = false; - boolean paramFound = false; - boolean paramValuesFound = false; - boolean requestFound = false; - boolean requestScopeFound = false; - boolean sessionFound = false; - boolean sessionScopeFound = false; - - for (Iterator j = resolvers[i].getFeatureDescriptors(elContexts[i], - null); j.hasNext();) { - - FeatureDescriptor descriptor = (FeatureDescriptor) j.next(); - - String phase; - switch (i) { - case 0: - phase = "FACES_PHASE"; - break; - case 1: - phase = "JSP_PHASE"; - break; - default: - phase = "UNKNOWN"; - break; + elContexts[i].setPropertyResolved(false); + } } - out.println("*** Checking Phase: " + phase + " ***"); - out.println("*** Resolver Name: " + j.toString()); - out.println("*** Descriptor Name: " + descriptor.getName() + " ***"); - - if ("view".equals(descriptor.getName())) { - viewFound = true; - control.setDisplayName("view"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", jakarta.faces.component.UIViewRoot.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'view' implicit object"); - out.println(result); - out.println("\n\n"); - } - - continue; + if (passed) { + out.println(JSFTestUtil.PASS); } - if ("facesContext".equals(descriptor.getName())) { - facesContextFound = true; - control.setDisplayName("facesContext"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", jakarta.faces.context.FacesContext.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'facesContext' implicit object"); - out.println(result); - } + } // END facesImplicitObjectResolverGetTypeTest - continue; - } + public void facesImplicitObjectResolverSetValueTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - if (i == FACES_PHASE) { - if ("application".equals(descriptor.getName())) { - applicationFound = true; - control.setDisplayName("application"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.lang.Object.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'application' implicit object"); - out.println(result); - } + PrintWriter out = response.getWriter(); + ELContext[] elContexts = getELContexts(request, response); + ELResolver[] resolvers = getELResolvers(elContexts); + boolean passed = true; - continue; - } - - if ("applicationScope".equals(descriptor.getName())) { - applicationScopeFound = true; - control.setDisplayName("applicationScope"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Map.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'applicationScope' implicit object"); - out.println(result); - } + for (int i = 0; i < resolvers.length; i++) { - continue; - } - - if ("cookie".equals(descriptor.getName())) { - cookieFound = true; - control.setDisplayName("cookie"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Map.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'cookie' implicit object"); - out.println(result); - } + out.println("Testing phase: " + getTestPhase(i)); - continue; - } - - if ("header".equals(descriptor.getName())) { - headerFound = true; - control.setDisplayName("header"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Map.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'header' implicit object"); - out.println(result); - } + for (ImplicitObjectInfo aImplicitInfo : implicitInfo) { - continue; - } - - if ("headerValues".equals(descriptor.getName())) { - headerValuesFound = true; - control.setDisplayName("headerValues"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Map.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'headerValues' implicit object"); - out.println(result); - } + String result = null; + if (i == JSP_PHASE) { + if (aImplicitInfo.getPhase() == JSP_PHASE) { + result = validateImplicitObjectSetValue(elContexts[i], resolvers[i], aImplicitInfo); + } + } else { + result = validateImplicitObjectSetValue(elContexts[i], resolvers[i], aImplicitInfo); + } - continue; - } - - if ("initParam".equals(descriptor.getName())) { - initParamFound = true; - control.setDisplayName("initParam"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Map.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'initParam' implicit object"); - out.println(result); + if (result != null && result.length() > 0) { + passed = false; + out.println(result); + } } + } - continue; - } - - if ("param".equals(descriptor.getName())) { - paramFound = true; - control.setDisplayName("param"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Map.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'param' implicit object"); - out.println(result); - } + if (passed) { + out.println(JSFTestUtil.PASS); + } - continue; - } - - if ("paramValues".equals(descriptor.getName())) { - paramValuesFound = true; - control.setDisplayName("paramValues"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Map.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'paramValues' implicit object"); - out.println(result); - } + } // END facesImplicitObjectResolverSetValueTest - continue; - } - - if ("request".equals(descriptor.getName())) { - requestFound = true; - control.setDisplayName("request"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.lang.Object.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'request' implicit object"); - out.println(result); - } + public void facesImplicitObjectResolverIsReadOnlyTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - continue; - } - - if ("requestScope".equals(descriptor.getName())) { - requestScopeFound = true; - control.setDisplayName("requestScope"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Map.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'requestScope' implicit object"); - out.println(result); - } + PrintWriter out = response.getWriter(); + ELContext[] elContexts = getELContexts(request, response); + ELResolver[] resolvers = getELResolvers(elContexts); + boolean passed = true; - continue; - } - - if ("session".equals(descriptor.getName())) { - sessionFound = true; - control.setDisplayName("session"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.lang.Object.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'session' implicit object"); - out.println(result); - } + for (int i = 0; i < resolvers.length; i++) { - continue; - } - - if ("sessionScope".equals(descriptor.getName())) { - sessionScopeFound = true; - control.setDisplayName("sessionScope"); - control.setShortDescription(""); - control.setExpert(false); - control.setHidden(false); - control.setPreferred(true); - control.setValue("type", java.util.Map.class); - control.setValue("resolvable", Boolean.TRUE); - - String result = validateFeatureDescriptor(control, descriptor); - if (result.length() > 0) { - passed = false; - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "validating the feature descriptor" - + " for the 'sessionScope' implicit object"); - out.println(result); - } + out.println("Testing phase: " + getTestPhase(i)); - } - } - } - - if (i == FACES_PHASE) { - if (!(viewFound && facesContextFound && applicationFound - && applicationScopeFound && requestFound && requestScopeFound - && sessionFound && sessionScopeFound && cookieFound && headerFound - && headerValuesFound && paramFound && paramValuesFound - && initParamFound)) { - passed = false; - out.println( - JSFTestUtil.FAIL + JSFTestUtil.NL + " One or more implicit object" - + "feature descriptors were not resolved when " - + "validating the Faces implicit object ELResolver"); - out.println("view: " + viewFound); - out.println("facesContext: " + facesContextFound); - out.println("application: " + applicationFound); - out.println("applicationScope: " + applicationScopeFound); - out.println("request: " + requestFound); - out.println("requestScope: " + requestScopeFound); - out.println("session: " + sessionFound); - out.println("sessionScope: " + sessionScopeFound); - out.println("header: " + headerFound); - out.println("headerValues: " + headerValuesFound); - out.println("param: " + paramFound); - out.println("paramValues: " + paramValuesFound); - out.println("cookie: " + cookieFound); - out.println("initParam: " + initParamFound); + for (ImplicitObjectInfo aImplicitInfo : implicitInfo) { + + String result = null; + if (i == JSP_PHASE) { + if (aImplicitInfo.getPhase() == JSP_PHASE) { + result = validateImplicitObjectReadOnly(elContexts[i], resolvers[i], aImplicitInfo); + } + } else { + result = validateImplicitObjectReadOnly(elContexts[i], resolvers[i], aImplicitInfo); + } + + if (result != null && result.length() > 0) { + passed = false; + out.println(result); + } + } } - } else { - if (!(viewFound && facesContextFound)) { - passed = false; - out.println(JSFTestUtil.FAIL + " One or more implicit object" - + "feature descriptors (for JSP) were not resolved when " - + "validating theFaces implicit object ELResolver"); - out.println("view: " + viewFound); - out.println("facesContext: " + facesContextFound); + + if (passed) { + out.println(JSFTestUtil.PASS); } - } - } - if (passed) { - out.println(JSFTestUtil.PASS); - } + } // END facesImplicitObjectResolverIsReadOnlyTest - } // END facesImplicitObjectResolverForJSPFeatureDescriptorTest + public void facesManagedBeanResolverGetValueTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - public void facesImplicitObjectResolverGetValueTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { + PrintWriter out = response.getWriter(); + ELContext[] elContexts = getELContexts(request, response); + ELResolver[] resolvers = getELResolvers(elContexts); + String attributeName = "description"; - PrintWriter out = response.getWriter(); - ELContext[] elContexts = getELContexts(request, response); - ELResolver[] resolvers = getELResolvers(elContexts); - boolean passed = true; + for (int i = 0, size = resolvers.length; i < size; i++) { - // Force session creation for 'session' implict object - request.getSession(true); + out.println("Testing phase: " + getTestPhase(i)); - for (int i = 0; i < resolvers.length; i++) { + /* + * If an object is associated with the name "description" in either request, session, or application return that object + * (searching in that order) + */ + ExternalContext extContext = getFacesContext().getExternalContext(); + extContext.getRequestMap().put(attributeName, "request"); + extContext.getSessionMap().put(attributeName, "session"); + extContext.getApplicationMap().put(attributeName, "application"); - out.println("Testing phase: " + getTestPhase(i)); + String result = null; + try { + result = (String) resolvers[i].getValue(elContexts[i], null, attributeName); - for (ImplicitObjectInfo aImplicitInfo : implicitInfo) { + } catch (ClassCastException cce) { + out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "Should be getting a 'String' back from Request " + + "Scope! Instead of 'Date' from Managedbean!"); + return; + } - String result = null; - if (i == JSP_PHASE) { - if (aImplicitInfo.getPhase() == JSP_PHASE) { - result = validateImplicitObjectValue(elContexts[i], resolvers[i], - aImplicitInfo); - } - } else { - result = validateImplicitObjectValue(elContexts[i], resolvers[i], - aImplicitInfo); - } + if (!"request".equals(result)) { + out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "Expected managed bean resolver to search request " + + "scope first, but instead it searched " + result); + return; + } - if (result != null && result.length() > 0) { - passed = false; - out.println(result); - } + // Remove Attribute from Request Scope. + extContext.getRequestMap().remove(attributeName); - elContexts[i].setPropertyResolved(false); - } - } + try { + result = (String) resolvers[i].getValue(elContexts[i], null, attributeName); - if (passed) { - out.println(JSFTestUtil.PASS); - } + } catch (ClassCastException cce) { + out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "Should be getting a 'String' back from Session " + + "Scope! Instead of 'Date' from Managedbean!"); + return; + } - } // END facesImplicitObjectResolverGetValueTest + if (!"session".equals(result)) { + out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "Expected managed bean resolver to search " + + "session scope first, but instead it searched " + result); + return; + } - public void facesImplicitObjectResolverGetTypeTest(HttpServletRequest request, - HttpServletResponse response) throws IOException { + // Remove Attribute from Session Scope. + extContext.getSessionMap().remove(attributeName); - PrintWriter out = response.getWriter(); - ELContext[] elContexts = getELContexts(request, response); - ELResolver[] resolvers = getELResolvers(elContexts); - boolean passed = true; + try { + result = (String) resolvers[i].getValue(elContexts[i], null, attributeName); - for (int i = 0; i < resolvers.length; i++) { + } catch (ClassCastException e) { + out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "Should be getting a 'String' back from Application " + + "Scope! Instead of 'Date' from Managedbean!"); + return; + } - out.println("Testing phase: " + getTestPhase(i)); + if (!"application".equals(result)) { + out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "Expected managed bean resolver to search " + + "application scope first, but instead it searched " + result); + return; + } - for (ImplicitObjectInfo aImplicitInfo : implicitInfo) { + // Remove attribute from Application Scope. + extContext.getApplicationMap().remove(attributeName); - String result = null; - if (i == JSP_PHASE) { - if (aImplicitInfo.getPhase() == JSP_PHASE) { - result = validateImplicitObjectType(elContexts[i], resolvers[i], - aImplicitInfo); - } - } else { - result = validateImplicitObjectType(elContexts[i], resolvers[i], - aImplicitInfo); - } + Date date = (Date) resolvers[i].getValue(elContexts[i], null, attributeName); - if (result != null && result.length() > 0) { - passed = false; - out.println(result); + if (date == null) { + out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "ELResolver.getValue() with a null " + + "base and a property matching the name of a managed " + "bean did not result in the bean being instantiated " + + "and returned."); + return; + } + + if (!elContexts[i].isPropertyResolved()) { + out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "A new managed bean was created, " + + "but isPropertyResolved() returned false."); + return; + } } - elContexts[i].setPropertyResolved(false); - } - } + out.println(JSFTestUtil.PASS); - if (passed) { - out.println(JSFTestUtil.PASS); - } + } // END facesManagedBeanResolverGetValueTest - } // END facesImplicitObjectResolverGetTypeTest + public void facesArrayListMapBeanResolverTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - public void facesImplicitObjectResolverSetValueTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { + // This test ensures that the List, Map, and Bean ELResolvers + // are present in the ELResolver chain returned by the faces + // implementation. - PrintWriter out = response.getWriter(); - ELContext[] elContexts = getELContexts(request, response); - ELResolver[] resolvers = getELResolvers(elContexts); - boolean passed = true; + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); - for (int i = 0; i < resolvers.length; i++) { + ArrayList list = new ArrayList(); + list.add("val1"); + list.add("val2"); - out.println("Testing phase: " + getTestPhase(i)); + HashMap map = new HashMap(); + map.put("key1", "value1"); + map.put("key2", "value2"); - for (ImplicitObjectInfo aImplicitInfo : implicitInfo) { + Date date = new Date(); + Long longResult = date.getTime(); - String result = null; - if (i == JSP_PHASE) { - if (aImplicitInfo.getPhase() == JSP_PHASE) { - result = validateImplicitObjectSetValue(elContexts[i], resolvers[i], - aImplicitInfo); - } - } else { - result = validateImplicitObjectSetValue(elContexts[i], resolvers[i], - aImplicitInfo); - } + String[] array = new String[] { "str1", "str2" }; - if (result != null && result.length() > 0) { - passed = false; - out.println(result); - } - } - } + // begin test - if (passed) { - out.println(JSFTestUtil.PASS); - } + boolean passed = true; - } // END facesImplicitObjectResolverSetValueTest + Object result = resolver.getValue(elContext, list, "0"); + if (!"val1".equals(result)) { + passed = false; + out.println(JSFTestUtil.FAIL + " ELResolver failed to handle a List properly" + + " which indicates that either the ListELResolver isn't present" + " or it is present and not implemented correctly."); + out.println("Expected resolver to return 'val1', recevied: " + result); + } - public void facesImplicitObjectResolverIsReadOnlyTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { + elContext.setPropertyResolved(false); - PrintWriter out = response.getWriter(); - ELContext[] elContexts = getELContexts(request, response); - ELResolver[] resolvers = getELResolvers(elContexts); - boolean passed = true; + result = resolver.getValue(elContext, map, "key1"); + if (!"value1".equals(result)) { + passed = false; + out.println(JSFTestUtil.FAIL + " ELResolver failed to handle a Map properly" + + " which indicates that either the MapELResolver isn't present" + " or it is present and not implemented correctly."); + out.println("Expected resolver to return 'value1', recevied: " + result); + } - for (int i = 0; i < resolvers.length; i++) { + elContext.setPropertyResolved(false); - out.println("Testing phase: " + getTestPhase(i)); + result = resolver.getValue(elContext, date, "time"); + if (!longResult.equals(result)) { + passed = false; + out.println(JSFTestUtil.FAIL + " ELResolver failed to handle a Bean properly" + + " which indicates that either the BeanELResolver isn't present" + " or it is present and not implemented correctly."); + out.println("Expected resolver to return '" + longResult.toString() + "', recevied: '" + result.toString() + '\''); + } - for (ImplicitObjectInfo aImplicitInfo : implicitInfo) { + elContext.setPropertyResolved(false); - String result = null; - if (i == JSP_PHASE) { - if (aImplicitInfo.getPhase() == JSP_PHASE) { - result = validateImplicitObjectReadOnly(elContexts[i], resolvers[i], - aImplicitInfo); - } - } else { - result = validateImplicitObjectReadOnly(elContexts[i], resolvers[i], - aImplicitInfo); + result = resolver.getValue(elContext, array, "0"); + if (!"str1".equals(result)) { + passed = false; + out.println(JSFTestUtil.FAIL + " ELResolver failed to handle an Array properly" + + " which indicates that either the ArrayELResolver isn't present" + + " or it is present and not implemented correctly."); + out.println("Expected resolver to return 'str1', recevied: " + result); } - if (result != null && result.length() > 0) { - passed = false; - out.println(result); + if (passed) { + out.println(JSFTestUtil.PASS); } - } - } - if (passed) { - out.println(JSFTestUtil.PASS); - } + } // END facesArrayListMapBeanResolverTest - } // END facesImplicitObjectResolverIsReadOnlyTest - - public void facesManagedBeanResolverGetValueTest(HttpServletRequest request, - HttpServletResponse response) throws IOException { - - PrintWriter out = response.getWriter(); - ELContext[] elContexts = getELContexts(request, response); - ELResolver[] resolvers = getELResolvers(elContexts); - String attributeName = "description"; - - for (int i = 0, size = resolvers.length; i < size; i++) { - - out.println("Testing phase: " + getTestPhase(i)); - - /* - * If an object is associated with the name "description" in either - * request, session, or application return that object (searching in that - * order) - */ - ExternalContext extContext = getFacesContext().getExternalContext(); - extContext.getRequestMap().put(attributeName, "request"); - extContext.getSessionMap().put(attributeName, "session"); - extContext.getApplicationMap().put(attributeName, "application"); - - String result = null; - try { - result = (String) resolvers[i].getValue(elContexts[i], null, - attributeName); - - } catch (ClassCastException cce) { - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "Should be getting a 'String' back from Request " - + "Scope! Instead of 'Date' from Managedbean!"); - return; - } - - if (!"request".equals(result)) { - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "Expected managed bean resolver to search request " - + "scope first, but instead it searched " + result); - return; - } - - // Remove Attribute from Request Scope. - extContext.getRequestMap().remove(attributeName); - - try { - result = (String) resolvers[i].getValue(elContexts[i], null, - attributeName); - - } catch (ClassCastException cce) { - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "Should be getting a 'String' back from Session " - + "Scope! Instead of 'Date' from Managedbean!"); - return; - } - - if (!"session".equals(result)) { - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "Expected managed bean resolver to search " - + "session scope first, but instead it searched " + result); - return; - } - - // Remove Attribute from Session Scope. - extContext.getSessionMap().remove(attributeName); - - try { - result = (String) resolvers[i].getValue(elContexts[i], null, - attributeName); - - } catch (ClassCastException e) { - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "Should be getting a 'String' back from Application " - + "Scope! Instead of 'Date' from Managedbean!"); - return; - } - - if (!"application".equals(result)) { - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "Expected managed bean resolver to search " - + "application scope first, but instead it searched " + result); - return; - } - - // Remove attribute from Application Scope. - extContext.getApplicationMap().remove(attributeName); - - Date date = (Date) resolvers[i].getValue(elContexts[i], null, - attributeName); - - if (date == null) { - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "ELResolver.getValue() with a null " - + "base and a property matching the name of a managed " - + "bean did not result in the bean being instantiated " - + "and returned."); - return; - } - - if (!elContexts[i].isPropertyResolved()) { - out.println(JSFTestUtil.FAIL + JSFTestUtil.NL - + "A new managed bean was created, " - + "but isPropertyResolved() returned false."); - return; - } - } + public void facesScopedAttributeResolverGetValueTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - out.println(JSFTestUtil.PASS); + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); + ExternalContext extContext = getFacesContext().getExternalContext(); + boolean bOne, bTwo, bThree = false; - } // END facesManagedBeanResolverGetValueTest + // Populate the scopes. + extContext.getRequestMap().put("desc", "request"); + extContext.getSessionMap().put("desc", "session"); + extContext.getApplicationMap().put("desc", "application"); - public void facesArrayListMapBeanResolverTest(HttpServletRequest request, - HttpServletResponse response) throws IOException { + // Test Request scope + bOne = this.testELGetValue("request", resolver, elContext, out); + extContext.getRequestMap().remove("desc"); + elContext.setPropertyResolved(false); - // This test ensures that the List, Map, and Bean ELResolvers - // are present in the ELResolver chain returned by the faces - // implementation. + // Test Session scope + bTwo = this.testELGetValue("session", resolver, elContext, out); + extContext.getSessionMap().remove("desc"); + elContext.setPropertyResolved(false); - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); + // Test Application scope + bThree = this.testELGetValue("application", resolver, elContext, out); - ArrayList list = new ArrayList(); - list.add("val1"); - list.add("val2"); + if (bOne && bTwo && bThree) { + out.println(JSFTestUtil.PASS); + } - HashMap map = new HashMap(); - map.put("key1", "value1"); - map.put("key2", "value2"); + } // END facesScopedAttributeResolverGetValueTest - Date date = new Date(); - Long longResult = date.getTime(); + public void facesScopedAttributeResolverSetValueTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - String[] array = new String[] { "str1", "str2" }; + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); + ExternalContext extContext = getFacesContext().getExternalContext(); + boolean passed = true; - // begin test + Map reqMap = extContext.getRequestMap(); + Map sesMap = extContext.getSessionMap(); + Map appMap = extContext.getApplicationMap(); - boolean passed = true; + reqMap.put("desc", "request"); + sesMap.put("desc", "session"); + appMap.put("desc", "application"); - Object result = resolver.getValue(elContext, list, "0"); - if (!"val1".equals(result)) { - passed = false; - out.println( - JSFTestUtil.FAIL + " ELResolver failed to handle a List properly" - + " which indicates that either the ListELResolver isn't present" - + " or it is present and not implemented correctly."); - out.println("Expected resolver to return 'val1', recevied: " + result); - } + resolver.setValue(elContext, null, "desc", "replaced"); + if (!"replaced".equals(reqMap.get("desc"))) { + passed = false; + out.println("ELResolver.setValue() failed to replace existing" + " request scoped attribute."); + out.println("Expected value to be: 'replaced', received: '" + reqMap.get("desc") + '\''); + } else { + if (!"session".equals(sesMap.get("desc"))) { + passed = false; + out.println("Test FAILED. ELResolver incorrectly replaced " + "session scoped attribute when only the " + + "request scoped attribute should have been replaced"); + } + if (!"application".equals(appMap.get("desc"))) { + passed = false; + out.println("Test FAILED. ELResolver incorrectly replaced " + "application scoped attribute when only the " + + "request scoped attribute should have been replaced"); + } + if (!elContext.isPropertyResolved()) { + passed = false; + out.println(JSFTestUtil.FAIL + " Request scoped attribute properly replaced, " + + "but the propertyResolved property on the ELContext was" + " not set to true"); + } + } - elContext.setPropertyResolved(false); + reqMap.remove("desc"); + elContext.setPropertyResolved(false); - result = resolver.getValue(elContext, map, "key1"); - if (!"value1".equals(result)) { - passed = false; - out.println( - JSFTestUtil.FAIL + " ELResolver failed to handle a Map properly" - + " which indicates that either the MapELResolver isn't present" - + " or it is present and not implemented correctly."); - out.println("Expected resolver to return 'value1', recevied: " + result); - } + resolver.setValue(elContext, null, "desc", "replaced"); + if (!"replaced".equals(sesMap.get("desc"))) { + passed = false; + out.println("ELResolver.setValue() failed to replace existing" + " session scoped attribute."); + out.println("Expected value to be: 'replaced', received: '" + reqMap.get("desc") + '\''); + } else { + if (reqMap.get("desc") != null) { + passed = false; + out.println("Test FAILED. ELResolver incorrectly added a " + "request scoped attribute when only the " + + "session scoped attribute should have been replaced"); + } + if (!"application".equals(appMap.get("desc"))) { + passed = false; + out.println("Test FAILED. ELResolver incorrectly replaced " + "application scoped attribute when only the " + + "session scoped attribute should have been replaced"); + } + if (!elContext.isPropertyResolved()) { + passed = false; + out.println(JSFTestUtil.FAIL + " session scoped attribute properly replaced, " + + "but the propertyResolved property on the ELContext was" + " not set to true"); + } + } - elContext.setPropertyResolved(false); - - result = resolver.getValue(elContext, date, "time"); - if (!longResult.equals(result)) { - passed = false; - out.println( - JSFTestUtil.FAIL + " ELResolver failed to handle a Bean properly" - + " which indicates that either the BeanELResolver isn't present" - + " or it is present and not implemented correctly."); - out.println("Expected resolver to return '" + longResult.toString() - + "', recevied: '" + result.toString() + '\''); - } + sesMap.remove("desc"); + elContext.setPropertyResolved(false); - elContext.setPropertyResolved(false); + resolver.setValue(elContext, null, "desc", "replaced"); + if (!"replaced".equals(appMap.get("desc"))) { + passed = false; + out.println("ELResolver.setValue() failed to replace existing" + " application scoped attribute."); + out.println("Expected value to be: 'replaced', received: '" + reqMap.get("desc") + '\''); + } else { + if (reqMap.get("desc") != null) { + passed = false; + out.println("Test FAILED. ELResolver incorrectly added a " + "request scoped attribute when only the " + + "application scoped attribute should have been replaced"); + } + if (sesMap.get("desc") != null) { + passed = false; + out.println("Test FAILED. ELResolver incorrectly added a " + "session scoped attribute when only the " + + "application scoped attribute should have been replaced"); + } + if (!elContext.isPropertyResolved()) { + passed = false; + out.println(JSFTestUtil.FAIL + " application scoped attribute properly replaced, " + + "but the propertyResolved property on the ELContext was" + " not set to true"); + } + } - result = resolver.getValue(elContext, array, "0"); - if (!"str1".equals(result)) { - passed = false; - out.println( - JSFTestUtil.FAIL + " ELResolver failed to handle an Array properly" - + " which indicates that either the ArrayELResolver isn't present" - + " or it is present and not implemented correctly."); - out.println("Expected resolver to return 'str1', recevied: " + result); - } + appMap.remove("desc"); + elContext.setPropertyResolved(false); + resolver.setValue(elContext, null, "desc", "newValue"); + if (!"newValue".equals(reqMap.get("desc"))) { + passed = false; + out.println("ELResolver.setValue() failed to add a new" + " request scoped attribute."); + out.println("Expected value to be: 'newValue', received: '" + reqMap.get("desc") + '\''); + } else { + if (sesMap.get("desc") != null) { + passed = false; + out.println("Test FAILED. ELResolver incorrectly added a " + "session scoped attribute when only the " + + "request scoped attribute should have been added"); + } + if (appMap.get("desc") != null) { + passed = false; + out.println("Test FAILED. ELResolver incorrectly added an " + "application scoped attribute when only the " + + "request scoped attribute should have been added"); + } + if (!elContext.isPropertyResolved()) { + passed = false; + out.println(JSFTestUtil.FAIL + " request scoped attribute properly added, " + + "but the propertyResolved property on the ELContext was" + " not set to true"); + } + } - if (passed) { - out.println(JSFTestUtil.PASS); - } + if (passed) { + out.println(JSFTestUtil.PASS); + } - } // END facesArrayListMapBeanResolverTest + } // END facesScopedAttributeResolverSetValueTest - public void facesScopedAttributeResolverGetValueTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { + public void facesScopedAttributeResolverFeatureDescriptorTest(HttpServletRequest request, HttpServletResponse response) + throws IOException { - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); - ExternalContext extContext = getFacesContext().getExternalContext(); - boolean bOne, bTwo, bThree = false; + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); + ExternalContext extContext = getFacesContext().getExternalContext(); + boolean passed = true; - // Populate the scopes. - extContext.getRequestMap().put("desc", "request"); - extContext.getSessionMap().put("desc", "session"); - extContext.getApplicationMap().put("desc", "application"); + Map reqMap = extContext.getRequestMap(); + Map sesMap = extContext.getSessionMap(); + Map appMap = extContext.getApplicationMap(); - // Test Request scope - bOne = this.testELGetValue("request", resolver, elContext, out); - extContext.getRequestMap().remove("desc"); - elContext.setPropertyResolved(false); + // ensure we have at least 1 in each scope + reqMap.put("req", "value1"); + sesMap.put("ses", "value1"); + appMap.put("app", "value1"); - // Test Session scope - bTwo = this.testELGetValue("session", resolver, elContext, out); - extContext.getSessionMap().remove("desc"); - elContext.setPropertyResolved(false); + HashMap> names = new HashMap>(); + HashMap controlDescriptors = new HashMap(); - // Test Application scope - bThree = this.testELGetValue("application", resolver, elContext, out); + for (Object key : reqMap.keySet()) { + names.put(key, reqMap.get(key).getClass()); + } - if (bOne && bTwo && bThree) { - out.println(JSFTestUtil.PASS); - } + for (Object key : sesMap.keySet()) { + names.put(key, sesMap.get(key).getClass()); + } - } // END facesScopedAttributeResolverGetValueTest - - public void facesScopedAttributeResolverSetValueTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { - - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); - ExternalContext extContext = getFacesContext().getExternalContext(); - boolean passed = true; - - Map reqMap = extContext.getRequestMap(); - Map sesMap = extContext.getSessionMap(); - Map appMap = extContext.getApplicationMap(); - - reqMap.put("desc", "request"); - sesMap.put("desc", "session"); - appMap.put("desc", "application"); - - resolver.setValue(elContext, null, "desc", "replaced"); - if (!"replaced".equals(reqMap.get("desc"))) { - passed = false; - out.println("ELResolver.setValue() failed to replace existing" - + " request scoped attribute."); - out.println("Expected value to be: 'replaced', received: '" - + reqMap.get("desc") + '\''); - } else { - if (!"session".equals(sesMap.get("desc"))) { - passed = false; - out.println("Test FAILED. ELResolver incorrectly replaced " - + "session scoped attribute when only the " - + "request scoped attribute should have been replaced"); - } - if (!"application".equals(appMap.get("desc"))) { - passed = false; - out.println("Test FAILED. ELResolver incorrectly replaced " - + "application scoped attribute when only the " - + "request scoped attribute should have been replaced"); - } - if (!elContext.isPropertyResolved()) { - passed = false; - out.println( - JSFTestUtil.FAIL + " Request scoped attribute properly replaced, " - + "but the propertyResolved property on the ELContext was" - + " not set to true"); - } - } + for (Object key : appMap.keySet()) { + names.put(key, appMap.get(key).getClass()); + } - reqMap.remove("desc"); - elContext.setPropertyResolved(false); - - resolver.setValue(elContext, null, "desc", "replaced"); - if (!"replaced".equals(sesMap.get("desc"))) { - passed = false; - out.println("ELResolver.setValue() failed to replace existing" - + " session scoped attribute."); - out.println("Expected value to be: 'replaced', received: '" - + reqMap.get("desc") + '\''); - } else { - if (reqMap.get("desc") != null) { - passed = false; - out.println("Test FAILED. ELResolver incorrectly added a " - + "request scoped attribute when only the " - + "session scoped attribute should have been replaced"); - } - if (!"application".equals(appMap.get("desc"))) { - passed = false; - out.println("Test FAILED. ELResolver incorrectly replaced " - + "application scoped attribute when only the " - + "session scoped attribute should have been replaced"); - } - if (!elContext.isPropertyResolved()) { - passed = false; - out.println( - JSFTestUtil.FAIL + " session scoped attribute properly replaced, " - + "but the propertyResolved property on the ELContext was" - + " not set to true"); - } - } + // next build a map of 'control' FeatureDescriptors keyed off the name + for (Map.Entry entry : names.entrySet()) { + String name = (String) entry.getKey(); + Class clazz = (Class) entry.getValue(); + FeatureDescriptor descriptor = new FeatureDescriptor(); + descriptor.setName(name); + descriptor.setDisplayName(name); + descriptor.setValue("type", clazz); + descriptor.setValue("resolvable", Boolean.TRUE); + descriptor.setExpert(false); + descriptor.setHidden(false); + descriptor.setPreferred(true); + descriptor.setShortDescription(""); + controlDescriptors.put(name, descriptor); + } - sesMap.remove("desc"); - elContext.setPropertyResolved(false); - - resolver.setValue(elContext, null, "desc", "replaced"); - if (!"replaced".equals(appMap.get("desc"))) { - passed = false; - out.println("ELResolver.setValue() failed to replace existing" - + " application scoped attribute."); - out.println("Expected value to be: 'replaced', received: '" - + reqMap.get("desc") + '\''); - } else { - if (reqMap.get("desc") != null) { - passed = false; - out.println("Test FAILED. ELResolver incorrectly added a " - + "request scoped attribute when only the " - + "application scoped attribute should have been replaced"); - } - if (sesMap.get("desc") != null) { - passed = false; - out.println("Test FAILED. ELResolver incorrectly added a " - + "session scoped attribute when only the " - + "application scoped attribute should have been replaced"); - } - if (!elContext.isPropertyResolved()) { - passed = false; - out.println(JSFTestUtil.FAIL - + " application scoped attribute properly replaced, " - + "but the propertyResolved property on the ELContext was" - + " not set to true"); - } - } + // begin test test + for (Iterator i = resolver.getFeatureDescriptors(elContext, null); i.hasNext();) { - appMap.remove("desc"); - elContext.setPropertyResolved(false); - resolver.setValue(elContext, null, "desc", "newValue"); - if (!"newValue".equals(reqMap.get("desc"))) { - passed = false; - out.println("ELResolver.setValue() failed to add a new" - + " request scoped attribute."); - out.println("Expected value to be: 'newValue', received: '" - + reqMap.get("desc") + '\''); - } else { - if (sesMap.get("desc") != null) { - passed = false; - out.println("Test FAILED. ELResolver incorrectly added a " - + "session scoped attribute when only the " - + "request scoped attribute should have been added"); - } - if (appMap.get("desc") != null) { - passed = false; - out.println("Test FAILED. ELResolver incorrectly added an " - + "application scoped attribute when only the " - + "request scoped attribute should have been added"); - } - if (!elContext.isPropertyResolved()) { - passed = false; - out.println( - JSFTestUtil.FAIL + " request scoped attribute properly added, " - + "but the propertyResolved property on the ELContext was" - + " not set to true"); - } - } + FeatureDescriptor underTest = (FeatureDescriptor) i.next(); - if (passed) { - out.println(JSFTestUtil.PASS); - } + String name = underTest.getName(); + if (controlDescriptors.containsKey(name)) { + String result = validateFeatureDescriptor(controlDescriptors.get(name), underTest); - } // END facesScopedAttributeResolverSetValueTest + if (result.length() > 0) { + passed = false; + out.println("Test FAILED when validating the FeatureDescriptor" + " for the '" + name + "' scoped attribute."); + out.println(result); + } + } + } - public void facesScopedAttributeResolverFeatureDescriptorTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { + reqMap.remove("req"); + sesMap.remove("ses"); + appMap.remove("app"); - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); - ExternalContext extContext = getFacesContext().getExternalContext(); - boolean passed = true; + if (passed) { + out.println(JSFTestUtil.PASS); + } - Map reqMap = extContext.getRequestMap(); - Map sesMap = extContext.getSessionMap(); - Map appMap = extContext.getApplicationMap(); + } // END facesScopedAttributeResolverFeatureDescriptorTest - // ensure we have at least 1 in each scope - reqMap.put("req", "value1"); - sesMap.put("ses", "value1"); - appMap.put("app", "value1"); + // ------------------------------------------------ ResourceBundleELResolver + public void facesResourceBundleResolverGetValueTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - HashMap> names = new HashMap>(); - HashMap controlDescriptors = new HashMap(); + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); + boolean passed = true; - for (Object key : reqMap.keySet()) { - names.put(key, reqMap.get(key).getClass()); - } + getFacesContext().getViewRoot().setLocale(Locale.ENGLISH); + SimpleResourceBundle_en result = (SimpleResourceBundle_en) resolver.getValue(elContext, null, "simplerb"); - for (Object key : sesMap.keySet()) { - names.put(key, sesMap.get(key).getClass()); - } + if (result == null) { + passed = false; + out.println(JSFTestUtil.FAIL + " Unable to resolve defined " + "ResourceBundle 'simplerb'"); + } else { + if (!elContext.isPropertyResolved()) { + passed = false; + out.println(JSFTestUtil.FAIL + " ResourceBundle resolved, but" + " the propertyResolved property of the " + + " ELContext was not set to true."); + } + } - for (Object key : appMap.keySet()) { - names.put(key, appMap.get(key).getClass()); - } + getFacesContext().getViewRoot().setLocale(Locale.GERMAN); + elContext.setPropertyResolved(false); + SimpleResourceBundle_de result2 = (SimpleResourceBundle_de) resolver.getValue(elContext, null, "simplerb"); - // next build a map of 'control' FeatureDescriptors keyed off the name - for (Map.Entry entry : names.entrySet()) { - String name = (String) entry.getKey(); - Class clazz = (Class) entry.getValue(); - FeatureDescriptor descriptor = new FeatureDescriptor(); - descriptor.setName(name); - descriptor.setDisplayName(name); - descriptor.setValue("type", clazz); - descriptor.setValue("resolvable", Boolean.TRUE); - descriptor.setExpert(false); - descriptor.setHidden(false); - descriptor.setPreferred(true); - descriptor.setShortDescription(""); - controlDescriptors.put(name, descriptor); + if (result2 == null) { + passed = false; + out.println(JSFTestUtil.FAIL + " Unable to resolve defined " + "ResourceBundle(DE) 'simplerb'"); + } else { + if (!elContext.isPropertyResolved()) { + passed = false; + out.println(JSFTestUtil.FAIL + " ResourceBundle(DE) resolved, but" + " the propertyResolved property of the " + + " ELContext was not set to true."); + } + } + + if (passed) { + out.println(JSFTestUtil.PASS); + } } - // begin test test - for (Iterator i = resolver.getFeatureDescriptors(elContext, null); i - .hasNext();) { + public void facesResourceBundleResolverGetTypeTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - FeatureDescriptor underTest = (FeatureDescriptor) i.next(); + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); + boolean passed = true; - String name = underTest.getName(); - if (controlDescriptors.containsKey(name)) { - String result = validateFeatureDescriptor(controlDescriptors.get(name), - underTest); + Class type = resolver.getType(elContext, null, "simplerb"); - if (result.length() > 0) { - passed = false; - out.println("Test FAILED when validating the FeatureDescriptor" - + " for the '" + name + "' scoped attribute."); - out.println(result); + if (type != ResourceBundle.class) { + passed = false; + out.println(JSFTestUtil.FAIL + " Unexpected type '" + type + "' returned by getType(). Expected " + + "java.util.ResourceBundle.class"); + } else { + if (!elContext.isPropertyResolved()) { + passed = false; + out.println(JSFTestUtil.FAIL + " Correct type returned, but" + " the propertyResolved property of the " + + " ELContext was not set to true."); + } } - } - } - reqMap.remove("req"); - sesMap.remove("ses"); - appMap.remove("app"); + if (passed) { + out.println(JSFTestUtil.PASS); + } - if (passed) { - out.println(JSFTestUtil.PASS); - } + } // END facesResourceBundleResolverGetTypeTest - } // END facesScopedAttributeResolverFeatureDescriptorTest - - // ------------------------------------------------ ResourceBundleELResolver - public void facesResourceBundleResolverGetValueTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { - - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); - boolean passed = true; - - getFacesContext().getViewRoot().setLocale(Locale.ENGLISH); - SimpleResourceBundle_en result = (SimpleResourceBundle_en) resolver - .getValue(elContext, null, "simplerb"); - - if (result == null) { - passed = false; - out.println(JSFTestUtil.FAIL + " Unable to resolve defined " - + "ResourceBundle 'simplerb'"); - } else { - if (!elContext.isPropertyResolved()) { - passed = false; - out.println(JSFTestUtil.FAIL + " ResourceBundle resolved, but" - + " the propertyResolved property of the " - + " ELContext was not set to true."); - } - } + public void facesResourceBundleResolverSetValueTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - getFacesContext().getViewRoot().setLocale(Locale.GERMAN); - elContext.setPropertyResolved(false); - SimpleResourceBundle_de result2 = (SimpleResourceBundle_de) resolver - .getValue(elContext, null, "simplerb"); - - if (result2 == null) { - passed = false; - out.println(JSFTestUtil.FAIL + " Unable to resolve defined " - + "ResourceBundle(DE) 'simplerb'"); - } else { - if (!elContext.isPropertyResolved()) { - passed = false; - out.println(JSFTestUtil.FAIL + " ResourceBundle(DE) resolved, but" - + " the propertyResolved property of the " - + " ELContext was not set to true."); - } - } + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); + boolean passed = true; - if (passed) { - out.println(JSFTestUtil.PASS); - } - } - - public void facesResourceBundleResolverGetTypeTest(HttpServletRequest request, - HttpServletResponse response) throws IOException { - - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); - boolean passed = true; - - Class type = resolver.getType(elContext, null, "simplerb"); - - if (type != ResourceBundle.class) { - passed = false; - out.println(JSFTestUtil.FAIL + " Unexpected type '" + type - + "' returned by getType(). Expected " - + "java.util.ResourceBundle.class"); - } else { - if (!elContext.isPropertyResolved()) { - passed = false; - out.println(JSFTestUtil.FAIL + " Correct type returned, but" - + " the propertyResolved property of the " - + " ELContext was not set to true."); - } - } + try { + resolver.setValue(elContext, null, "simplerb", "someValue"); + passed = false; + out.println(JSFTestUtil.FAIL + " No Exception thrown when" + " attemtping to call setValue() in the case where" + + " the resolved property is a ResourceBundle."); + } catch (Exception e) { + if (!(e instanceof PropertyNotWritableException)) { + out.println(JSFTestUtil.FAIL + " Exception thrown when attempting" + " to call setValue() in the case where" + + " the resolved property is a ResourceBundle, but" + " it wasn't an instance of" + + " PropertyNotWriteableException."); + passed = false; + } + } - if (passed) { - out.println(JSFTestUtil.PASS); - } + if (passed) { + out.println(JSFTestUtil.PASS); + } - } // END facesResourceBundleResolverGetTypeTest - - public void facesResourceBundleResolverSetValueTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { - - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); - boolean passed = true; - - try { - resolver.setValue(elContext, null, "simplerb", "someValue"); - passed = false; - out.println(JSFTestUtil.FAIL + " No Exception thrown when" - + " attemtping to call setValue() in the case where" - + " the resolved property is a ResourceBundle."); - } catch (Exception e) { - if (!(e instanceof PropertyNotWritableException)) { - out.println(JSFTestUtil.FAIL + " Exception thrown when attempting" - + " to call setValue() in the case where" - + " the resolved property is a ResourceBundle, but" - + " it wasn't an instance of" + " PropertyNotWriteableException."); - passed = false; - } - } + } // END facesResourceBundleResolverSetValueTest - if (passed) { - out.println(JSFTestUtil.PASS); - } + public void facesResourceBundleResolverIsReadOnlyTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - } // END facesResourceBundleResolverSetValueTest - - public void facesResourceBundleResolverIsReadOnlyTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { - - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); - boolean passed = true; - - if (!resolver.isReadOnly(elContext, null, "simplerb")) { - out.println(JSFTestUtil.FAIL + " Expected isReadOnly() to return" - + " true when the resolved property is a " + " ResourceBundle."); - passed = false; - } else { - if (!elContext.isPropertyResolved()) { - out.println(JSFTestUtil.FAIL + " isReadOnly() returned the correct" - + " value, but the propertyResolved property of the" - + " ELContext was not set to true."); - passed = false; - } - } + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); + boolean passed = true; - if (passed) { - out.println(JSFTestUtil.PASS); - } + if (!resolver.isReadOnly(elContext, null, "simplerb")) { + out.println( + JSFTestUtil.FAIL + " Expected isReadOnly() to return" + " true when the resolved property is a " + " ResourceBundle."); + passed = false; + } else { + if (!elContext.isPropertyResolved()) { + out.println(JSFTestUtil.FAIL + " isReadOnly() returned the correct" + " value, but the propertyResolved property of the" + + " ELContext was not set to true."); + passed = false; + } + } - } // END facesResourceBundleResolverIsReadOnlyTest - - public void facesResourceBundleResolverFeatureDescriptorTest( - HttpServletRequest request, HttpServletResponse response) - throws IOException { - - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); - boolean fd_Found = false; - - // Setup golden FeatureDescriptor. - FeatureDescriptor controlDesc = new FeatureDescriptor(); - controlDesc.setValue("resolvable", Boolean.TRUE); - controlDesc.setValue("type", ResourceBundle.class); - controlDesc.setName("simplerb"); - controlDesc.setDisplayName("simple"); - controlDesc.setExpert(false); - controlDesc.setHidden(false); - controlDesc.setPreferred(true); - controlDesc.setShortDescription(""); - - for (Iterator i = resolver.getFeatureDescriptors(elContext, null); i - .hasNext();) { - FeatureDescriptor test = (FeatureDescriptor) i.next(); - // - // out.println("DEBUG ===> FeatureDescriptor Name: " + - // test.getName() + NL); - - if ("simplerb".equals(test.getName())) { - String result = validateFeatureDescriptor(controlDesc, test); - fd_Found = true; - - if (result.length() != 0) { - out.println(result); + if (passed) { + out.println(JSFTestUtil.PASS); } - break; - } - } - if (fd_Found) { - out.println(JSFTestUtil.PASS); - } else { - out.println( - "Test FAILED! Could not find FeatureDescriptor with name of 'simplerb'"); - } + } // END facesResourceBundleResolverIsReadOnlyTest + + public void facesResourceBundleResolverFeatureDescriptorTest(HttpServletRequest request, HttpServletResponse response) + throws IOException { + + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); + boolean fd_Found = false; + + // Setup golden FeatureDescriptor. + FeatureDescriptor controlDesc = new FeatureDescriptor(); + controlDesc.setValue("resolvable", Boolean.TRUE); + controlDesc.setValue("type", ResourceBundle.class); + controlDesc.setName("simplerb"); + controlDesc.setDisplayName("simple"); + controlDesc.setExpert(false); + controlDesc.setHidden(false); + controlDesc.setPreferred(true); + controlDesc.setShortDescription(""); + + for (Iterator i = resolver.getFeatureDescriptors(elContext, null); i.hasNext();) { + FeatureDescriptor test = (FeatureDescriptor) i.next(); + // + // out.println("DEBUG ===> FeatureDescriptor Name: " + + // test.getName() + NL); + + if ("simplerb".equals(test.getName())) { + String result = validateFeatureDescriptor(controlDesc, test); + fd_Found = true; + + if (result.length() != 0) { + out.println(result); + } + break; + } + } - } // END facesResourceBundleResolverFeatureDescriptorTest - - public void facesConfigELResolverRegistrationTest(HttpServletRequest request, - HttpServletResponse response) throws IOException { - - PrintWriter out = response.getWriter(); - ELContext elContext = getFacesContext().getELContext(); - ELResolver resolver = elContext.getELResolver(); - - Collection base = new ArrayList(); - base.add("value1"); - base.add("value2"); - base.add("value3"); - - try { - Integer result = (Integer) resolver.getValue(elContext, base, "size"); - - if (result == null) { - out.println(JSFTestUtil.FAIL + " Custom resolver not called."); - return; - } - - if (!"3".equals(result.toString())) { - out.println(JSFTestUtil.FAIL + " Unexpected result returned;" - + " custom resolver not called."); - return; - } - } catch (Exception e) { - out.println( - "Test FAILED Unexpected exception thrown " + "during test: " + e); - return; - } + if (fd_Found) { + out.println(JSFTestUtil.PASS); + } else { + out.println("Test FAILED! Could not find FeatureDescriptor with name of 'simplerb'"); + } - out.println(JSFTestUtil.PASS); + } // END facesResourceBundleResolverFeatureDescriptorTest - } // END facesConfigELResolverRegistrationTest + public void facesConfigELResolverRegistrationTest(HttpServletRequest request, HttpServletResponse response) throws IOException { - // --------------------------------------------------------- Private Methods - private boolean testELGetValue(String scope, ELResolver resolver, - ELContext context, PrintWriter out) { + PrintWriter out = response.getWriter(); + ELContext elContext = getFacesContext().getELContext(); + ELResolver resolver = elContext.getELResolver(); - boolean passed = true; + Collection base = new ArrayList(); + base.add("value1"); + base.add("value2"); + base.add("value3"); - String result = (String) resolver.getValue(context, null, "desc"); + try { + Integer result = (Integer) resolver.getValue(elContext, base, "size"); - if (!scope.equals(result)) { - passed = false; - out.println( - JSFTestUtil.FAIL + " Expected managed bean resolver to " + "search " - + scope + " scope first, but instead it " + "searched " + result); - } else { - if (!context.isPropertyResolved()) { - passed = false; - out.println(JSFTestUtil.FAIL + " ELResolver failed to set " - + "propertyResolved to true after resolving a " + scope - + "scoped attribute."); - } - } + if (result == null) { + out.println(JSFTestUtil.FAIL + " Custom resolver not called."); + return; + } + + if (!"3".equals(result.toString())) { + out.println(JSFTestUtil.FAIL + " Unexpected result returned;" + " custom resolver not called."); + return; + } + } catch (Exception e) { + out.println("Test FAILED Unexpected exception thrown " + "during test: " + e); + return; + } - return passed; - } + out.println(JSFTestUtil.PASS); - private static String validateFeatureDescriptor(FeatureDescriptor control, - FeatureDescriptor underTest) { + } // END facesConfigELResolverRegistrationTest - StringBuffer sb = new StringBuffer(64); + // --------------------------------------------------------- Private Methods + private boolean testELGetValue(String scope, ELResolver resolver, ELContext context, PrintWriter out) { - if (!control.getDisplayName().equals(underTest.getDisplayName())) { - sb.append("\tExpected displayName to be '"); - sb.append(control.getDisplayName()); - sb.append("', received: '"); - sb.append(underTest.getDisplayName()).append("'\n"); - } + boolean passed = true; - if (!control.getValue("type").equals(underTest.getValue(ELResolver.TYPE))) { - sb.append("\tExpected ELResolver.TYPE property to return "); - sb.append(control.getValue("type")).append(" (type is "); - sb.append(control.getValue("type").getClass().getName()); - sb.append("), received: "); - sb.append(underTest.getValue(ELResolver.TYPE)); - sb.append(" (type is "); - sb.append(underTest.getValue(ELResolver.TYPE).getClass().getName()); - sb.append(")\n"); - } + String result = (String) resolver.getValue(context, null, "desc"); - if (!control.getValue("resolvable") - .equals(underTest.getValue(ELResolver.RESOLVABLE_AT_DESIGN_TIME))) { - sb.append("\tExpected ELResolver.RESOLVABLE_AT_DESIGN_TYPE"); - sb.append("to be ").append(control.getValue("resolvable")); - sb.append(", received: "); - sb.append(underTest.getValue(ELResolver.RESOLVABLE_AT_DESIGN_TIME)); - sb.append('\n'); - } + if (!scope.equals(result)) { + passed = false; + out.println(JSFTestUtil.FAIL + " Expected managed bean resolver to " + "search " + scope + " scope first, but instead it " + + "searched " + result); + } else { + if (!context.isPropertyResolved()) { + passed = false; + out.println(JSFTestUtil.FAIL + " ELResolver failed to set " + "propertyResolved to true after resolving a " + scope + + "scoped attribute."); + } + } - if (control.getShortDescription().length() == 0) { - if (underTest.getShortDescription() == null) { - sb.append("\tExpected a non-null description.\n"); - } - } else { - if (!control.getShortDescription() - .equals(underTest.getShortDescription().trim())) { - sb.append("\tExpected description to be '"); - sb.append(control.getShortDescription()).append("', "); - sb.append("received: '").append(underTest.getShortDescription()); - sb.append("'\n"); - } + return passed; } - if (control.isExpert() != underTest.isExpert()) { - sb.append("\tExpected expert property to be "); - sb.append(control.isExpert()).append('\n'); - } + private static String validateFeatureDescriptor(FeatureDescriptor control, FeatureDescriptor underTest) { - if (control.isHidden() != underTest.isHidden()) { - sb.append("\tExpected hidden property to be "); - sb.append(control.isHidden()).append('\n'); - } + StringBuffer sb = new StringBuffer(64); - if (control.isPreferred() != underTest.isPreferred()) { - sb.append("\tExpected preferred property to be "); - sb.append(control.isPreferred()).append('\n'); - } + if (!control.getDisplayName().equals(underTest.getDisplayName())) { + sb.append("\tExpected displayName to be '"); + sb.append(control.getDisplayName()); + sb.append("', received: '"); + sb.append(underTest.getDisplayName()).append("'\n"); + } - return sb.toString(); + if (!control.getValue("type").equals(underTest.getValue(ELResolver.TYPE))) { + sb.append("\tExpected ELResolver.TYPE property to return "); + sb.append(control.getValue("type")).append(" (type is "); + sb.append(control.getValue("type").getClass().getName()); + sb.append("), received: "); + sb.append(underTest.getValue(ELResolver.TYPE)); + sb.append(" (type is "); + sb.append(underTest.getValue(ELResolver.TYPE).getClass().getName()); + sb.append(")\n"); + } - } // END validateFeatureDescriptor + if (!control.getValue("resolvable").equals(underTest.getValue(ELResolver.RESOLVABLE_AT_DESIGN_TIME))) { + sb.append("\tExpected ELResolver.RESOLVABLE_AT_DESIGN_TYPE"); + sb.append("to be ").append(control.getValue("resolvable")); + sb.append(", received: "); + sb.append(underTest.getValue(ELResolver.RESOLVABLE_AT_DESIGN_TIME)); + sb.append('\n'); + } - /** - * @return return a two element array with the Faces ELResolver as the first - * element, and the JSP ELResolver as the second - */ - private ELResolver[] getELResolvers(ELContext[] contexts) { + if (control.getShortDescription().length() == 0) { + if (underTest.getShortDescription() == null) { + sb.append("\tExpected a non-null description.\n"); + } + } else { + if (!control.getShortDescription().equals(underTest.getShortDescription().trim())) { + sb.append("\tExpected description to be '"); + sb.append(control.getShortDescription()).append("', "); + sb.append("received: '").append(underTest.getShortDescription()); + sb.append("'\n"); + } + } - ELResolver[] resolvers = new ELResolver[2]; - resolvers[FACES_PHASE] = contexts[FACES_PHASE].getELResolver(); - resolvers[JSP_PHASE] = contexts[JSP_PHASE].getELResolver(); + if (control.isExpert() != underTest.isExpert()) { + sb.append("\tExpected expert property to be "); + sb.append(control.isExpert()).append('\n'); + } - return resolvers; + if (control.isHidden() != underTest.isHidden()) { + sb.append("\tExpected hidden property to be "); + sb.append(control.isHidden()).append('\n'); + } - } // END getELResolvers + if (control.isPreferred() != underTest.isPreferred()) { + sb.append("\tExpected preferred property to be "); + sb.append(control.isPreferred()).append('\n'); + } - /** - * @return return a two element array with the Faces ELContext as the first - * element, and the JSP ELContext as the second - */ - private ELContext[] getELContexts(HttpServletRequest request, - HttpServletResponse response) { + return sb.toString(); - ELContext[] contexts = new ELContext[2]; - contexts[FACES_PHASE] = getFacesContext().getELContext(); + } // END validateFeatureDescriptor - contexts[JSP_PHASE] = getFacesContext().getELContext(); + /** + * @return return a two element array with the Faces ELResolver as the first element, and the JSP ELResolver as the + * second + */ + private ELResolver[] getELResolvers(ELContext[] contexts) { - return contexts; + ELResolver[] resolvers = new ELResolver[2]; + resolvers[FACES_PHASE] = contexts[FACES_PHASE].getELResolver(); + resolvers[JSP_PHASE] = contexts[JSP_PHASE].getELResolver(); - } // END getELContexts + return resolvers; - private static String getTestPhase(int phase) { + } // END getELResolvers - if (phase < FACES_PHASE || phase > JSP_PHASE) { - throw new IllegalArgumentException("Unknown test phase"); - } - if (phase == FACES_PHASE) { - return "[FACES]"; - } else { - return "[JSP]"; - } + /** + * @return return a two element array with the Faces ELContext as the first element, and the JSP ELContext as the second + */ + private ELContext[] getELContexts(HttpServletRequest request, HttpServletResponse response) { - } // END getTestPhase - - private static String validateImplicitObjectValue(ELContext context, - ELResolver resolver, ImplicitObjectInfo info) { - - StringBuffer sb = new StringBuffer(64); - String name = info.getName(); - Object result = resolver.getValue(context, null, name); - - if (!info.getValueType().isAssignableFrom(result.getClass())) { - sb.append(JSFTestUtil.FAIL + " Passing a null base, and '"); - sb.append(name).append("' as the property"); - sb.append(" didn't result getValue() returning an instance of "); - sb.append(info.getValueType().getName()); - sb.append("\nObject received: ").append(result.getClass().getName()); - } else { - if (!context.isPropertyResolved()) { - sb.append(JSFTestUtil.FAIL + " ELResolver.getValue() "); - sb.append("property resolved the '").append(name); - sb.append("' implicit object, but it didn't call"); - sb.append(" ELContext.setPropertyResolved(true)."); - } - } + ELContext[] contexts = new ELContext[2]; + contexts[FACES_PHASE] = getFacesContext().getELContext(); - return sb.toString(); - - } // END validateImplicitObjectValue - - private static String validateImplicitObjectSetValue(ELContext context, - ELResolver resolver, ImplicitObjectInfo info) { - - StringBuffer sb = new StringBuffer(); - try { - resolver.setValue(context, null, info.getName(), "value"); - sb.append( - JSFTestUtil.FAIL + " No exception thrown when calling setValue()"); - sb.append(" with the base parameter set to null, and the property"); - sb.append(" parameter set to '").append(info.getName()); - sb.append("'."); - } catch (PropertyNotWritableException pnwe) { - // we're good to go - } catch (Exception e) { - sb.append( - JSFTestUtil.FAIL + " Expected a PropertyNotWritableException to"); - sb.append( - " be thrown when calling setValue() with a null base parameter"); - sb.append(" and a property parameter set to '"); - sb.append(info.getName()).append("'.\n"); - sb.append("Exception received: ").append(e.getClass().getName()); - } + contexts[JSP_PHASE] = getFacesContext().getELContext(); - if (context.isPropertyResolved()) { - sb.append(JSFTestUtil.FAIL + " propertyResolved property on ELContext"); - sb.append(" was set to true even though property was not writable."); - } + return contexts; - return sb.toString(); - } + } // END getELContexts - private static String validateImplicitObjectReadOnly(ELContext context, - ELResolver resolver, ImplicitObjectInfo info) { + private static String getTestPhase(int phase) { - StringBuffer sb = new StringBuffer(); - String name = info.getName(); - if (!resolver.isReadOnly(context, null, name)) { - sb.append(JSFTestUtil.FAIL + " Expected isReadOnly() to return true"); - sb.append(" for implicit object '").append(name).append("'."); - } + if (phase < FACES_PHASE || phase > JSP_PHASE) { + throw new IllegalArgumentException("Unknown test phase"); + } + if (phase == FACES_PHASE) { + return "[FACES]"; + } else { + return "[JSP]"; + } - if (!context.isPropertyResolved()) { - sb.append( - JSFTestUtil.FAIL + " isReadOnly() returned the expected result"); - sb.append(" but didn't set the propertyResolved property of the"); - sb.append(" ELContext to true."); - } + } // END getTestPhase - return sb.toString(); + private static String validateImplicitObjectValue(ELContext context, ELResolver resolver, ImplicitObjectInfo info) { - } + StringBuffer sb = new StringBuffer(64); + String name = info.getName(); + Object result = resolver.getValue(context, null, name); - private static String validateImplicitObjectType(ELContext context, - ELResolver resolver, ImplicitObjectInfo info) { + if (!info.getValueType().isAssignableFrom(result.getClass())) { + sb.append(JSFTestUtil.FAIL + " Passing a null base, and '"); + sb.append(name).append("' as the property"); + sb.append(" didn't result getValue() returning an instance of "); + sb.append(info.getValueType().getName()); + sb.append("\nObject received: ").append(result.getClass().getName()); + } else { + if (!context.isPropertyResolved()) { + sb.append(JSFTestUtil.FAIL + " ELResolver.getValue() "); + sb.append("property resolved the '").append(name); + sb.append("' implicit object, but it didn't call"); + sb.append(" ELContext.setPropertyResolved(true)."); + } + } + + return sb.toString(); + + } // END validateImplicitObjectValue + + private static String validateImplicitObjectSetValue(ELContext context, ELResolver resolver, ImplicitObjectInfo info) { + + StringBuffer sb = new StringBuffer(); + try { + resolver.setValue(context, null, info.getName(), "value"); + sb.append(JSFTestUtil.FAIL + " No exception thrown when calling setValue()"); + sb.append(" with the base parameter set to null, and the property"); + sb.append(" parameter set to '").append(info.getName()); + sb.append("'."); + } catch (PropertyNotWritableException pnwe) { + // we're good to go + } catch (Exception e) { + sb.append(JSFTestUtil.FAIL + " Expected a PropertyNotWritableException to"); + sb.append(" be thrown when calling setValue() with a null base parameter"); + sb.append(" and a property parameter set to '"); + sb.append(info.getName()).append("'.\n"); + sb.append("Exception received: ").append(e.getClass().getName()); + } - StringBuffer sb = new StringBuffer(); - String name = info.getName(); - Object result = resolver.getType(context, null, name); - if (info.getType() == null) { - if (result != null) { + if (context.isPropertyResolved()) { + sb.append(JSFTestUtil.FAIL + " propertyResolved property on ELContext"); + sb.append(" was set to true even though property was not writable."); + } - sb.append( - JSFTestUtil.FAIL + " Expected getType() to return null, when"); - sb.append(" the base parameter was null and the property parameter "); - sb.append("was '").append(name).append('\''); - sb.append("\nReceived: ").append(result); - } else { - if (!context.isPropertyResolved()) { + return sb.toString(); + } + + private static String validateImplicitObjectReadOnly(ELContext context, ELResolver resolver, ImplicitObjectInfo info) { - sb.append(JSFTestUtil.FAIL + " ELResolver.getType() returned the"); - sb.append(" the the expected value for the '").append(name); - sb.append("' implicit object, but it didn't call"); - sb.append(" ELContext.setPropertyResolved(true)."); + StringBuffer sb = new StringBuffer(); + String name = info.getName(); + if (!resolver.isReadOnly(context, null, name)) { + sb.append(JSFTestUtil.FAIL + " Expected isReadOnly() to return true"); + sb.append(" for implicit object '").append(name).append("'."); } - } - } else { - if (!info.getType().equals(result)) { - sb.append(JSFTestUtil.FAIL + " Expected getType() to return '"); - sb.append(info.getType().getName()).append("' when"); - sb.append(" the base parameter was null and the property"); - sb.append(" parameter was '").append(name).append('\''); - sb.append("\nReceived: ").append(result); - } else { - if (!context.isPropertyResolved()) { - sb.append(JSFTestUtil.FAIL + " ELResolver.getType() returned the"); - sb.append(" the the expected value for the '").append(name); - sb.append("' implicit object, but it didn't call"); - sb.append(" ELContext.setPropertyResolved(true)."); + if (!context.isPropertyResolved()) { + sb.append(JSFTestUtil.FAIL + " isReadOnly() returned the expected result"); + sb.append(" but didn't set the propertyResolved property of the"); + sb.append(" ELContext to true."); } - } + + return sb.toString(); + } - return sb.toString(); + private static String validateImplicitObjectType(ELContext context, ELResolver resolver, ImplicitObjectInfo info) { + + StringBuffer sb = new StringBuffer(); + String name = info.getName(); + Object result = resolver.getType(context, null, name); + if (info.getType() == null) { + if (result != null) { + + sb.append(JSFTestUtil.FAIL + " Expected getType() to return null, when"); + sb.append(" the base parameter was null and the property parameter "); + sb.append("was '").append(name).append('\''); + sb.append("\nReceived: ").append(result); + } else { + if (!context.isPropertyResolved()) { + + sb.append(JSFTestUtil.FAIL + " ELResolver.getType() returned the"); + sb.append(" the the expected value for the '").append(name); + sb.append("' implicit object, but it didn't call"); + sb.append(" ELContext.setPropertyResolved(true)."); + } + } + } else { + if (!info.getType().equals(result)) { + sb.append(JSFTestUtil.FAIL + " Expected getType() to return '"); + sb.append(info.getType().getName()).append("' when"); + sb.append(" the base parameter was null and the property"); + sb.append(" parameter was '").append(name).append('\''); + sb.append("\nReceived: ").append(result); + } else { + if (!context.isPropertyResolved()) { + + sb.append(JSFTestUtil.FAIL + " ELResolver.getType() returned the"); + sb.append(" the the expected value for the '").append(name); + sb.append("' implicit object, but it didn't call"); + sb.append(" ELContext.setPropertyResolved(true)."); + } + } + } - } // END validateImplicitObjectType + return sb.toString(); - // ---------------------------------------------------------- Nested Classes - private static class ImplicitObjectInfo { + } // END validateImplicitObjectType - private String name; + // ---------------------------------------------------------- Nested Classes + private static class ImplicitObjectInfo { - private Class type; + private String name; - private int phase; + private Class type; - private boolean isReadOnly; + private int phase; - private Class valueType; + private boolean isReadOnly; - ImplicitObjectInfo(String name, Class type, Class valueType, int phase, - boolean isReadOnly) { + private Class valueType; - this.name = name; - this.type = type; - this.valueType = valueType; - this.phase = phase; - this.isReadOnly = isReadOnly; + ImplicitObjectInfo(String name, Class type, Class valueType, int phase, boolean isReadOnly) { - } // END ImplicitObjectInfo + this.name = name; + this.type = type; + this.valueType = valueType; + this.phase = phase; + this.isReadOnly = isReadOnly; + + } // END ImplicitObjectInfo - public String getName() { + public String getName() { - return name; + return name; - } // END getName + } // END getName - public Class getType() { + public Class getType() { - return type; + return type; - } // END getType + } // END getType - public int getPhase() { + public int getPhase() { - return phase; + return phase; - } // END getPhase + } // END getPhase - public boolean isReadOnly() { + public boolean isReadOnly() { - return isReadOnly; + return isReadOnly; - } // END isReadOnly + } // END isReadOnly - public Class getValueType() { + public Class getValueType() { - return valueType; + return valueType; - } // END getValueType - } // END ImplicitObjectInfo + } // END getValueType + } // END ImplicitObjectInfo } diff --git a/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java b/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java index 388060f24a7..9f92f4de6ae 100644 --- a/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java +++ b/tck/old-tck/source/src/com/sun/ts/tests/jsf/spec/el/elresolvers/URLClient.java @@ -52,51 +52,6 @@ public Status run(String[] args, PrintWriter out, PrintWriter err) { /* Test Declarations */ - /** - * @testName: managedBeanELResolverFeatureDescriptorTest - * @assertion_ids: PENDING - * @test_Strategy: Validate that the feature descriptors for managed beans - * conform to the requirements: - ELResolver.TYPE -> the - * actual class representation of the bean type as defined by - * managed-bean-class - ELResolver.RESOLVABLE_AT_DESIGN_TIME - * -> Boolean.TRUE - Name and displayName properties are the - * value of managed-bean-name - Hidden and Expert properties - * are false - Preferred property is true - shortDescription - * is populated with the description of the managed bean - * otherwise null if no description is present. This test uses - * the ELResolver from both Faces and JSP. - * @since 1.2 - */ - public void managedBeanELResolverFeatureDescriptorTest() throws Fault { - init(); - TEST_PROPS.setProperty(APITEST, - "managedBeanELResolverFeatureDescriptorTest"); - invoke(); - } - - /** - * @testName: facesImplicitObjectResolverFeatureDescriptorTest - * @assertion_ids: PENDING - * @test_Strategy: Validate the JSP and Faces defined implicit objects conform - * to the following requirements. - ELResolver.TYPE -> matches - * the types defined in table 5-9 of the JSF Spec (in the - * non-jsp case). - ELResolver.TYPE -> view -> - * jakarta.faces.component.UIViewRoot facesContext -> - * jakarta.faces.component.FacesContext (in the JSP case) - - * ELResolver.RESOLVABLE_AT_DESIGN_TIME -> Boolean.TRUE - Name - * and displayName properties are the name of the implicit - * object - Hidden and Expert properties are false - Preferred - * property is true - shortDescription is non-null. This test - * uses the ELResolver from both Faces and JSP. - * @since 1.2 - */ - public void facesImplicitObjectResolverFeatureDescriptorTest() throws Fault { - init(); - TEST_PROPS.setProperty(APITEST, - "facesImplicitObjectResolverFeatureDescriptorTest"); - invoke(); - } - /* * @testName: facesImplicitObjectResolverGetValueTest *