dev@javaserverfaces.java.net

Seeking Review: JAVASERVERFACES-1542

From: Ed Burns <edward.burns_at_oracle.com>
Date: Fri, 6 May 2011 14:33:44 -0700

The only controversial bit about this is what I did to cause the
InterruptedException to be thrown at my behest during a testcase. I
used reflection to set a field that the runtime checks to see if it
should throw the exception. If anyone can suggest a better way to do
this, I'd really appreciate it.

Make the system resilient to InterruptedException or CancellationException in FactoryFinder http://java.net/jira/browse/JAVASERVERFACES-1542


SECTION: Modified Files
----------------------------
M jsf-api/src/main/java/javax/faces/FactoryFinder.java

- Harden the catch block in
  FactoryManager.FactoryManagerCache.getApplicationFactoryManager() to
  InterruptedException or CancellationException thrown during a call to
  factories.get().

M jsf-test/build.xml
A jsf-test/JAVASERVERFACES-1542
A jsf-test/JAVASERVERFACES-1542/htmlunit
A jsf-test/JAVASERVERFACES-1542/htmlunit/src
A jsf-test/JAVASERVERFACES-1542/htmlunit/src/main
A jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java
A jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com
A jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun
A jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces
A jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces/systest
A jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces/systest/ShowTheAppIsWorking.java
A jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces/systest/OneShotDisableFactoryFinder.java
A jsf-test/JAVASERVERFACES-1542/htmlunit/pom.xml
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/java
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/java/com
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/java/com/sun
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/java/com/sun/faces
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/java/com/sun/faces/regression
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/java/com/sun/faces/regression/FactoryFinderTestCaseBean.java
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/main.xhtml
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/WEB-INF
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/WEB-INF/beans.xml
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/WEB-INF/web.xml
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/showTheAppIsWorking.xhtml
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/disableFactoryFinder.xhtml
A jsf-test/JAVASERVERFACES-1542/i_jsf_1542/pom.xml
A jsf-test/JAVASERVERFACES-1542/build.xml

- testcase fodder.


SECTION: Diffs
----------------------------
Index: jsf-api/src/main/java/javax/faces/FactoryFinder.java
===================================================================
--- jsf-api/src/main/java/javax/faces/FactoryFinder.java (revision 9014)
+++ jsf-api/src/main/java/javax/faces/FactoryFinder.java (working copy)
@@ -715,22 +715,25 @@
 
                 try {
                     return factories.get();
- } catch (CancellationException ce) {
- if (LOGGER.isLoggable(Level.FINEST)) {
- LOGGER.log(Level.FINEST,
- ce.toString(),
- ce);
+ } catch (Exception ee) {
+ Throwable cause = ee.getCause();
+ boolean doThrow = false;
+
+ if (cause instanceof CancellationException ||
+ cause instanceof InterruptedException) {
+ applicationMap.remove(key);
+ doThrow = false;
+ } else {
+ cause = (null != cause) ? cause : ee;
                     }
- applicationMap.remove(key);
- } catch (InterruptedException ie) {
                     if (LOGGER.isLoggable(Level.FINEST)) {
                         LOGGER.log(Level.FINEST,
- ie.toString(),
- ie);
+ cause.toString(),
+ cause);
                     }
- applicationMap.remove(key);
- } catch (ExecutionException ee) {
- throw new FacesException(ee);
+ if (doThrow) {
+ throw new FacesException(cause);
+ }
                 }
 
             }
@@ -830,17 +833,22 @@
 
         private final Map<String,Object> factories;
         private final ReentrantReadWriteLock lock;
+ private static boolean throwInterruptedException = false;
 
 
         // -------------------------------------------------------- Consturctors
 
 
- public FactoryManager() {
+ public FactoryManager() throws InterruptedException {
             factories = new HashMap<String,Object>();
             for (String name : FACTORY_NAMES) {
                 factories.put(name, new ArrayList(4));
             }
             lock = new ReentrantReadWriteLock(true);
+ if (throwInterruptedException) {
+ throwInterruptedException = false;
+ throw new InterruptedException("Throwing InterruptedException for testing purposes");
+ }
         }
 
 
Index: jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces/systest/ShowTheAppIsWorking.java
===================================================================
--- jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces/systest/ShowTheAppIsWorking.java (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces/systest/ShowTheAppIsWorking.java (revision 0)
@@ -0,0 +1,73 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.faces.systest;
+
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+import com.sun.faces.htmlunit.HtmlUnitFacesTestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+public class ShowTheAppIsWorking extends HtmlUnitFacesTestCase {
+
+ public ShowTheAppIsWorking(String name) {
+ super(name);
+ }
+
+ /**
+ * Return the tests included in this test suite.
+ */
+ public static Test suite() {
+ return (new TestSuite(ShowTheAppIsWorking.class));
+ }
+
+
+ // ------------------------------------------------------------ Test Methods
+
+ public void testBasicAppFunctionality() throws Exception {
+
+ HtmlPage page = getPage("/faces/showTheAppIsWorking.xhtml?foo=bar&baz=bop");
+ assertTrue(page.asText().contains("foobaz"));
+
+ }
+
+}
Index: jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces/systest/OneShotDisableFactoryFinder.java
===================================================================
--- jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces/systest/OneShotDisableFactoryFinder.java (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/htmlunit/src/main/java/com/sun/faces/systest/OneShotDisableFactoryFinder.java (revision 0)
@@ -0,0 +1,77 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.faces.systest;
+
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+
+import com.sun.faces.htmlunit.HtmlUnitFacesTestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+public class OneShotDisableFactoryFinder extends HtmlUnitFacesTestCase {
+
+ public OneShotDisableFactoryFinder(String name) {
+ super(name);
+ }
+
+ /**
+ * Return the tests included in this test suite.
+ */
+ public static Test suite() {
+ return (new TestSuite(OneShotDisableFactoryFinder.class));
+ }
+
+ // ------------------------------------------------------------ Test Methods
+
+ public void testCauseInterruptedExceptionOnNextDeploy() throws Exception {
+
+ HtmlPage page = getPage("/faces/disableFactoryFinder.xhtml");
+
+ HtmlSubmitInput button = (HtmlSubmitInput) page.getElementById("button");
+ button.click();
+
+
+
+ }
+
+}
Index: jsf-test/JAVASERVERFACES-1542/htmlunit/pom.xml
===================================================================
--- jsf-test/JAVASERVERFACES-1542/htmlunit/pom.xml (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/htmlunit/pom.xml (revision 0)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.sun.faces.test</groupId>
+ <artifactId>i_jsf_1542_htmlunit</artifactId>
+ <packaging>jar</packaging>
+ <name>i_jsf_1542_htmlunit</name>
+ <version>2.0</version>
+
+ <description></description>
+
+ <properties>
+
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <artifactId>htmlunit</artifactId>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces.extensions</groupId>
+ <artifactId>jsf-extensions-test-time</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <version>2.1-alpha-2</version>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ <finalName>i_jsf_1542_htmlunit</finalName>
+ </build>
+
+ <repositories>
+ <repository>
+ <id>java.net</id>
+ <name>java.net</name>
+ <url>http://download.java.net/maven/2</url>
+ <layout>default</layout>
+ </repository>
+ </repositories>
+
+</project>

Property changes on: jsf-test/JAVASERVERFACES-1542/i_jsf_1542
___________________________________________________________________
Added: svn:ignore
   + target


Index: jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/java/com/sun/faces/regression/FactoryFinderTestCaseBean.java
===================================================================
--- jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/java/com/sun/faces/regression/FactoryFinderTestCaseBean.java (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/java/com/sun/faces/regression/FactoryFinderTestCaseBean.java (revision 0)
@@ -0,0 +1,91 @@
+
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.faces.regression;
+
+import java.lang.reflect.Field;
+import java.util.Iterator;
+import javax.enterprise.context.RequestScoped;
+import javax.faces.FactoryFinder;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.inject.Named;
+
+
+_at_Named(value="accessBean")
+_at_RequestScoped
+public class FactoryFinderTestCaseBean {
+
+ public void disableFactoryFinder() throws Exception {
+ Class [] declaredClasses = FactoryFinder.class.getDeclaredClasses();
+ Class factoryManagerClass = null;
+ for (Class cur : declaredClasses) {
+ if (cur.getName().contains("FactoryManager")) {
+ factoryManagerClass = cur;
+ break;
+ }
+ }
+ assert(null != factoryManagerClass);
+ Field [] factoryManagerFields = factoryManagerClass.getDeclaredFields();
+ Field throwExceptionField = null;
+ for (Field cur : factoryManagerFields) {
+ if (cur.getName().contains("throwInterruptedException")) {
+ throwExceptionField = cur;
+ }
+ }
+ assert(null != throwExceptionField);
+ throwExceptionField.setAccessible(true);
+ throwExceptionField.set(null, true);
+ }
+
+ public String getQueryStringValue() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ ExternalContext extContext = context.getExternalContext();
+ StringBuilder result = new StringBuilder();
+
+ Iterator<String> params = extContext.getRequestParameterNames();
+ while (params.hasNext()) {
+ result.append(params.next());
+ }
+
+ return result.toString();
+ }
+}
Index: jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/main.xhtml
===================================================================
--- jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/main.xhtml (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/main.xhtml (revision 0)
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+<h:head>
+ <title>A Simple JavaServer Faces 2.0 View</title>
+</h:head>
+<h:body>
+ <h:form>
+ <p><h:commandButton value="submit" /></p>
+ </h:form>
+</h:body>
+</html>
Index: jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/WEB-INF/beans.xml
===================================================================
Index: jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/WEB-INF/web.xml
===================================================================
--- jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/WEB-INF/web.xml (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/WEB-INF/web.xml (revision 0)
@@ -0,0 +1,39 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<web-app version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+
+ <display-name>mojarra-regression-test</display-name>
+ <description>A simple regression test to make it easier to get your bug fixed. The only reason we need a web.xml is to set the PROJECT_STAGE to Develoment. If you have a web.xml, then you need to map the FacesServlet.</description>
+
+ <context-param>
+ <description>
+ Tell the runtime where we are in the project development
+ lifecycle. Valid values are:
+ Development, UnitTest, SystemTest, or Production.
+ The runtime will display helpful hints to correct common mistakes
+ when the value is Development.
+ </description>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>faces/main.xhtml</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Index: jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/showTheAppIsWorking.xhtml
===================================================================
--- jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/showTheAppIsWorking.xhtml (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/showTheAppIsWorking.xhtml (revision 0)
@@ -0,0 +1,56 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ or packager/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [year] [name of copyright owner]"
+
+ Contributor(s):
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <h:head>
+ <title>Disable FactoryFinder</title>
+ </h:head>
+ <h:body>
+ <h:form prependId="false">
+ #{accessBean.queryStringValue}
+ </h:form>
+ </h:body>
+</html>
Index: jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/disableFactoryFinder.xhtml
===================================================================
--- jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/disableFactoryFinder.xhtml (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/i_jsf_1542/src/main/webapp/disableFactoryFinder.xhtml (revision 0)
@@ -0,0 +1,57 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ or packager/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [year] [name of copyright owner]"
+
+ Contributor(s):
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <h:head>
+ <title>Disable FactoryFinder</title>
+ </h:head>
+ <h:body>
+ <h:form prependId="false">
+ <h:commandButton id="button" value="disableFactoryFinder"
+ action="#{accessBean.disableFactoryFinder}" />
+ </h:form>
+ </h:body>
+</html>
Index: jsf-test/JAVASERVERFACES-1542/i_jsf_1542/pom.xml
===================================================================
--- jsf-test/JAVASERVERFACES-1542/i_jsf_1542/pom.xml (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/i_jsf_1542/pom.xml (revision 0)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.sun.faces.regression</groupId>
+ <artifactId>i_jsf_1542</artifactId>
+ <version>1.0</version>
+ <packaging>war</packaging>
+ <name>${project.artifactId}</name>
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax</groupId>
+ <artifactId>javaee-api</artifactId>
+ <version>6.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>java.net-maven2-repository</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/2/</url>
+ <layout>default</layout>
+ </repository>
+ </repositories>
+</project>
Index: jsf-test/JAVASERVERFACES-1542/build.xml
===================================================================
--- jsf-test/JAVASERVERFACES-1542/build.xml (revision 0)
+++ jsf-test/JAVASERVERFACES-1542/build.xml (revision 0)
@@ -0,0 +1,113 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ or packager/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [year] [name of copyright owner]"
+
+ Contributor(s):
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+
+-->
+
+<!-- ************ JSF build file ************************************** -->
+
+<project name="JAVASERVERFACES-1542" default="test" basedir=".">
+
+ <property file="../../build.properties"/>
+ <path id="1542.classpath">
+ <path refid="html.classpath" />
+ <pathelement location="${basedir}/htmlunit/target/classes"/>
+ </path>
+
+ <import file="${jsf.build.home}/common/ant/common.xml"/>
+
+ <target name="build">
+
+ <jsf.mvn dir="${basedir}/i_jsf_1542" goals="install" />
+ <jsf.mvn dir="${basedir}/htmlunit" goals="install" />
+
+ </target>
+
+ <target name="clean">
+
+ <jsf.mvn dir="${basedir}/i_jsf_1542" goals="clean" />
+ <jsf.mvn dir="${basedir}/htmlunit" goals="clean" />
+
+ </target>
+
+ <target name="install">
+ <deploy.artifact
+ artifact="${basedir}/i_jsf_1542/target/i_jsf_1542.war"
+ appName="i_jsf_1542"/>
+
+ </target>
+
+ <target name="remove">
+
+ <undeploy.artifact
+ artifact="${basedir}/i_jsf_1542/target/i_jsf_1542.war"
+ appName="i_jsf_1542"/>
+
+ </target>
+
+ <target name="test" depends="define.scenario.aware.port">
+
+ <jsf.junit context-path="/i_jsf_1542"
+ classpath-refid="1542.classpath"
+ test-results-dir="${regression.test.results.dir}">
+ <tests>
+ <fileset dir="${basedir}/htmlunit/target/classes"
+ includes="com/sun/faces/systest/OneShotDisableFactoryFinder.class"/>
+ </tests>
+ </jsf.junit>
+
+ <antcall target="remove" />
+ <antcall target="install" />
+
+ <jsf.junit context-path="/i_jsf_1542"
+ classpath-refid="1542.classpath"
+ test-results-dir="${regression.test.results.dir}">
+ <tests>
+ <fileset dir="${basedir}/htmlunit/target/classes"
+ includes="com/sun/faces/systest/ShowTheAppIsWorking.class"/>
+ </tests>
+ </jsf.junit>
+
+
+ </target>
+
+
+
+</project>
Index: jsf-test/build.xml
===================================================================
--- jsf-test/build.xml (revision 9014)
+++ jsf-test/build.xml (working copy)
@@ -51,17 +51,17 @@
 
     <property name="deploy-exploded-applications" value="" />
 
- <property name="applications-for-V3-only" value="JAVASERVERFACES-1856" />
+ <property name="applications-for-V3-only" value="JAVASERVERFACES-1856,JAVASERVERFACES-1542" />
 
     <property name="applications-for-V3.1-only"
               value="GLASSFISH-11636,
                      GLASSFISH-15985,
- JAVASERVERFACES-1856" />
+ JAVASERVERFACES-1856,JAVASERVERFACES-1542" />
 
     <property name="applications-for-V3.1_no_cluster-only"
               value="GLASSFISH-11636,
                      GLASSFISH-15985,
- JAVASERVERFACES-1856,JAVASERVERFACES-1655" />
+ JAVASERVERFACES-1856,JAVASERVERFACES-1655,JAVASERVERFACES-1542" />
 
     <property name="container-agnostic-applications" value="
                     JAVASERVERFACES-1958,JAVASERVERFACES-2038" />


-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/
| 29 Business Days til JSF 2.2 Early Draft Review
| 65 Business Days til JSF 2.2 Public Review
| 153 Business Days til JSF 2.2 Proposed Final Draft