<< ADD DESCRIPTION HERE http://java.net/jira/browse/JAVASERVERFACES-XXXX >> SECTION: Modified Files ---------------------------- M test/glassfish/pom.xml M test/weblogic/wls1214/pom.xml A test/glassfish/facelets A test/glassfish/facelets/core A test/glassfish/facelets/core/pom.xml A test/glassfish/facelets/core/src A test/glassfish/facelets/core/src/main A test/glassfish/facelets/core/src/main/java A test/glassfish/facelets/core/src/main/java/com A test/glassfish/facelets/core/src/main/java/com/sun A test/glassfish/facelets/core/src/main/java/com/sun/faces A test/glassfish/facelets/core/src/main/java/com/sun/faces/annotation A test/glassfish/facelets/core/src/main/java/com/sun/faces/annotation/AnnotatedValidatorNoValue.java A test/glassfish/facelets/core/src/main/java/com/sun/faces/test A test/glassfish/facelets/core/src/main/java/com/sun/faces/test/glassfish A test/glassfish/facelets/core/src/main/java/com/sun/faces/test/glassfish/facelets A test/glassfish/facelets/core/src/main/java/com/sun/faces/test/glassfish/facelets/core A test/glassfish/facelets/core/src/main/java/com/sun/faces/test/glassfish/facelets/core/AnnotationTestBean.java A test/glassfish/facelets/core/src/main/webapp A test/glassfish/facelets/core/src/main/webapp/WEB-INF A test/glassfish/facelets/core/src/main/webapp/WEB-INF/faces-config.xml A test/glassfish/facelets/core/src/main/webapp/WEB-INF/glassfish-web.xml A test/glassfish/facelets/core/src/main/webapp/WEB-INF/web.xml A test/glassfish/facelets/core/src/main/webapp/annotationtest.xhtml A test/glassfish/facelets/core/src/test A test/glassfish/facelets/core/src/test/java A test/glassfish/facelets/core/src/test/java/com A test/glassfish/facelets/core/src/test/java/com/sun A test/glassfish/facelets/core/src/test/java/com/sun/faces A test/glassfish/facelets/core/src/test/java/com/sun/faces/test A test/glassfish/facelets/core/src/test/java/com/sun/faces/test/glassfish A test/glassfish/facelets/core/src/test/java/com/sun/faces/test/glassfish/facelets A test/glassfish/facelets/core/src/test/java/com/sun/faces/test/glassfish/facelets/core A test/glassfish/facelets/core/src/test/java/com/sun/faces/test/glassfish/facelets/core/AnnotatedComponentIT.java A test/glassfish/facelets/pom.xml A test/weblogic/wls1214/facelets A test/weblogic/wls1214/facelets/core A test/weblogic/wls1214/facelets/core/pom.xml A test/weblogic/wls1214/facelets/core/src A test/weblogic/wls1214/facelets/core/src/main A test/weblogic/wls1214/facelets/core/src/main/java A test/weblogic/wls1214/facelets/core/src/main/java/com A test/weblogic/wls1214/facelets/core/src/main/java/com/sun A test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces A test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/annotation A test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/annotation/AnnotatedValidatorNoValue.java A test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/test A test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/test/weblogic A test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/test/weblogic/wls1214 A test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/test/weblogic/wls1214/facelets A test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/test/weblogic/wls1214/facelets/core A test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/test/weblogic/wls1214/facelets/core/AnnotationTestBean.java A test/weblogic/wls1214/facelets/core/src/main/webapp A test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF A test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/faces-config.xml A test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/web.xml A test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/weblogic.xml A test/weblogic/wls1214/facelets/core/src/main/webapp/annotationtest.xhtml A test/weblogic/wls1214/facelets/core/src/test A test/weblogic/wls1214/facelets/core/src/test/java A test/weblogic/wls1214/facelets/core/src/test/java/com A test/weblogic/wls1214/facelets/core/src/test/java/com/sun A test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces A test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces/test A test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces/test/weblogic A test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces/test/weblogic/wls1214 A test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces/test/weblogic/wls1214/facelets A test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces/test/weblogic/wls1214/facelets/core A test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces/test/weblogic/wls1214/facelets/core/AnnotatedComponentIT.java A test/weblogic/wls1214/facelets/pom.xml SECTION: Diffs ---------------------------- Index: test/glassfish/facelets/core =================================================================== --- test/glassfish/facelets/core (revision 13498) +++ test/glassfish/facelets/core (working copy) Property changes on: test/glassfish/facelets/core ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +target Index: test/glassfish/facelets/core/pom.xml =================================================================== --- test/glassfish/facelets/core/pom.xml (revision 0) +++ test/glassfish/facelets/core/pom.xml (working copy) @@ -0,0 +1,62 @@ + + + + + + 4.0.0 + + com.sun.faces.test.glassfish.facelets + pom + 2.2.8-SNAPSHOT + + com.sun.faces.test.glassfish.facelets + core + war + Mojarra ${project.version} - Test - Glassfish - Facelets - Core + + jsf-glassfish-facelets-core + + + UTF-8 + + Index: test/glassfish/facelets/core/src/main/java/com/sun/faces/annotation/AnnotatedValidatorNoValue.java =================================================================== --- test/glassfish/facelets/core/src/main/java/com/sun/faces/annotation/AnnotatedValidatorNoValue.java (revision 0) +++ test/glassfish/facelets/core/src/main/java/com/sun/faces/annotation/AnnotatedValidatorNoValue.java (working copy) @@ -0,0 +1,64 @@ +/* + * 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.annotation; + +import javax.faces.validator.Validator; +import javax.faces.validator.ValidatorException; +import javax.faces.validator.FacesValidator; +import javax.faces.context.FacesContext; +import javax.faces.component.UIComponent; + +@FacesValidator +public class AnnotatedValidatorNoValue implements Validator { + public void validate(FacesContext context, + UIComponent component, + Object value) throws ValidatorException { + return; + } + + private String welcomeMessage ="AnnotatedValidatorNoValue"; + + public String getWelcomeMessage() { + return welcomeMessage; + } + +} + Index: test/glassfish/facelets/core/src/main/java/com/sun/faces/test/glassfish/facelets/core/AnnotationTestBean.java =================================================================== --- test/glassfish/facelets/core/src/main/java/com/sun/faces/test/glassfish/facelets/core/AnnotationTestBean.java (revision 0) +++ test/glassfish/facelets/core/src/main/java/com/sun/faces/test/glassfish/facelets/core/AnnotationTestBean.java (working copy) @@ -0,0 +1,111 @@ +/* + * 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.test.glassfish.facelets.core; + +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.faces.FacesException; +import javax.faces.application.Application; +import javax.faces.context.FacesContext; +import javax.faces.validator.Validator; + +import com.sun.faces.annotation.AnnotatedValidatorNoValue; + +public class AnnotationTestBean { + + public String getTestResult() { + + try { + testAnnotatedComponentsWebInfClasses(); + return Boolean.TRUE.toString(); + } catch (Exception e) { + Logger.getAnonymousLogger().log(Level.SEVERE, + "AnnotationTestBean validation failure!", + e); + return Boolean.FALSE.toString(); + } + } + + private void testAnnotatedComponentsWebInfClasses() throws Exception { + FacesContext ctx = FacesContext.getCurrentInstance(); + Application app = ctx.getApplication(); + Validator v = app.createValidator("annotatedValidatorNoValue"); + + assertNotNull(v); + assertTrue(v instanceof AnnotatedValidatorNoValue); + Set defaultValidatorIds = app.getDefaultValidatorInfo().keySet(); + assertFalse(defaultValidatorIds.contains("AnnotatedValidatorNoValue")); + String welcomeMessage = ((AnnotatedValidatorNoValue)v).getWelcomeMessage(); + assertTrue(welcomeMessage.equals("AnnotatedValidatorNoValue")); + + boolean exceptionThrown = false; + v = null; + try { + v = app.createValidator("AnnotatedValidatorNoValue"); + } + catch (FacesException fe) { + assertTrue(null == v); + exceptionThrown = true; + } + assertTrue(exceptionThrown); + + } + + private void assertNotNull(Object v) { + if (v == null) { + throw new RuntimeException(); + } + } + + private void assertTrue(boolean t) { + if (!t) { + throw new RuntimeException(); + } + } + + private void assertFalse(boolean t) { + if (t) { + throw new RuntimeException(); + } + } + +} Index: test/glassfish/facelets/core/src/main/webapp/WEB-INF/faces-config.xml =================================================================== --- test/glassfish/facelets/core/src/main/webapp/WEB-INF/faces-config.xml (revision 0) +++ test/glassfish/facelets/core/src/main/webapp/WEB-INF/faces-config.xml (working copy) @@ -0,0 +1,56 @@ + + + + + + + + annotationTestBean + com.sun.faces.test.glassfish.facelets.core.AnnotationTestBean + request + + + Index: test/glassfish/facelets/core/src/main/webapp/WEB-INF/glassfish-web.xml =================================================================== --- test/glassfish/facelets/core/src/main/webapp/WEB-INF/glassfish-web.xml (revision 0) +++ test/glassfish/facelets/core/src/main/webapp/WEB-INF/glassfish-web.xml (working copy) @@ -0,0 +1,51 @@ + + + + + + + + /test-glassfish-faceslet-core + Index: test/glassfish/facelets/core/src/main/webapp/WEB-INF/web.xml =================================================================== --- test/glassfish/facelets/core/src/main/webapp/WEB-INF/web.xml (revision 0) +++ test/glassfish/facelets/core/src/main/webapp/WEB-INF/web.xml (working copy) @@ -0,0 +1,76 @@ + + + + + + + javax.faces.PROJECT_STAGE + ${webapp.projectStage} + + + javax.faces.PARTIAL_STATE_SAVING + ${webapp.partialStateSaving} + + + javax.faces.STATE_SAVING_METHOD + ${webapp.stateSavingMethod} + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/annotationtest.xhtml + + Index: test/glassfish/facelets/core/src/main/webapp/annotationtest.xhtml =================================================================== --- test/glassfish/facelets/core/src/main/webapp/annotationtest.xhtml (revision 0) +++ test/glassfish/facelets/core/src/main/webapp/annotationtest.xhtml (working copy) @@ -0,0 +1,17 @@ + + + + Annotation Scanning Test Case + + + + + + + + + Index: test/glassfish/facelets/core/src/test/java/com/sun/faces/test/glassfish/facelets/core/AnnotatedComponentIT.java =================================================================== --- test/glassfish/facelets/core/src/test/java/com/sun/faces/test/glassfish/facelets/core/AnnotatedComponentIT.java (revision 0) +++ test/glassfish/facelets/core/src/test/java/com/sun/faces/test/glassfish/facelets/core/AnnotatedComponentIT.java (working copy) @@ -0,0 +1,74 @@ +/* + * 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.test.glassfish.facelets.core; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlPage; + +import static org.junit.Assert.assertTrue; + +public class AnnotatedComponentIT { + + private String webUrl; + private WebClient webClient; + + @Before + public void setUp() { + webUrl = System.getProperty("integration.url"); + webClient = new WebClient(); + } + + @After + public void tearDown() { + webClient.closeAllWindows(); + } + + @Test + public void testAnnotations() throws Exception { + HtmlPage page = webClient.getPage(webUrl + "/faces/annotationtest.xhtml"); + + String pageText = page.getBody().asText(); + assertTrue(pageText.contains("true")); + } +} Index: test/glassfish/facelets/pom.xml =================================================================== --- test/glassfish/facelets/pom.xml (revision 0) +++ test/glassfish/facelets/pom.xml (working copy) @@ -0,0 +1,60 @@ + + + + + + 4.0.0 + + com.sun.faces.test.glassfish + pom + 2.2.8-SNAPSHOT + + com.sun.faces.test.glassfish.facelets + pom + pom + Mojarra ${project.version} - Test - Glassfish - Facelets + + core + + + Index: test/glassfish/pom.xml =================================================================== --- test/glassfish/pom.xml (revision 13498) +++ test/glassfish/pom.xml (working copy) @@ -63,6 +63,7 @@ bundle22 + facelets request_char_encoding request_char_encoding2 undeploy Index: test/weblogic/wls1214/facelets/core/pom.xml =================================================================== --- test/weblogic/wls1214/facelets/core/pom.xml (revision 0) +++ test/weblogic/wls1214/facelets/core/pom.xml (working copy) @@ -0,0 +1,62 @@ + + + + + + 4.0.0 + + com.sun.faces.test.weblogic.wls1214.facelets + pom + 2.2.8-SNAPSHOT + + com.sun.faces.test.weblogic.wls1214.facelets + core + war + Mojarra ${project.version} - Test - Weblogic - Wls1214 - Facelets - Core + + test-weblogic-wls1214-facelets-core + + + UTF-8 + + Index: test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/annotation/AnnotatedValidatorNoValue.java =================================================================== --- test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/annotation/AnnotatedValidatorNoValue.java (revision 0) +++ test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/annotation/AnnotatedValidatorNoValue.java (working copy) @@ -0,0 +1,64 @@ +/* + * 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.annotation; + +import javax.faces.validator.Validator; +import javax.faces.validator.ValidatorException; +import javax.faces.validator.FacesValidator; +import javax.faces.context.FacesContext; +import javax.faces.component.UIComponent; + +@FacesValidator +public class AnnotatedValidatorNoValue implements Validator { + public void validate(FacesContext context, + UIComponent component, + Object value) throws ValidatorException { + return; + } + + private String welcomeMessage ="AnnotatedValidatorNoValue"; + + public String getWelcomeMessage() { + return welcomeMessage; + } + +} + Index: test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/test/weblogic/wls1214/facelets/core/AnnotationTestBean.java =================================================================== --- test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/test/weblogic/wls1214/facelets/core/AnnotationTestBean.java (revision 0) +++ test/weblogic/wls1214/facelets/core/src/main/java/com/sun/faces/test/weblogic/wls1214/facelets/core/AnnotationTestBean.java (working copy) @@ -0,0 +1,111 @@ +/* + * 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.test.weblogic.wls1214.facelets.core; + +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.faces.FacesException; +import javax.faces.application.Application; +import javax.faces.context.FacesContext; +import javax.faces.validator.Validator; + +import com.sun.faces.annotation.AnnotatedValidatorNoValue; + +public class AnnotationTestBean { + + public String getTestResult() { + + try { + testAnnotatedComponentsWebInfClasses(); + return Boolean.TRUE.toString(); + } catch (Exception e) { + Logger.getAnonymousLogger().log(Level.SEVERE, + "AnnotationTestBean validation failure!", + e); + return Boolean.FALSE.toString(); + } + } + + private void testAnnotatedComponentsWebInfClasses() throws Exception { + FacesContext ctx = FacesContext.getCurrentInstance(); + Application app = ctx.getApplication(); + Validator v = app.createValidator("annotatedValidatorNoValue"); + + assertNotNull(v); + assertTrue(v instanceof AnnotatedValidatorNoValue); + Set defaultValidatorIds = app.getDefaultValidatorInfo().keySet(); + assertFalse(defaultValidatorIds.contains("AnnotatedValidatorNoValue")); + String welcomeMessage = ((AnnotatedValidatorNoValue)v).getWelcomeMessage(); + assertTrue(welcomeMessage.equals("AnnotatedValidatorNoValue")); + + boolean exceptionThrown = false; + v = null; + try { + v = app.createValidator("AnnotatedValidatorNoValue"); + } + catch (FacesException fe) { + assertTrue(null == v); + exceptionThrown = true; + } + assertTrue(exceptionThrown); + + } + + private void assertNotNull(Object v) { + if (v == null) { + throw new RuntimeException(); + } + } + + private void assertTrue(boolean t) { + if (!t) { + throw new RuntimeException(); + } + } + + private void assertFalse(boolean t) { + if (t) { + throw new RuntimeException(); + } + } + +} Index: test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/faces-config.xml =================================================================== --- test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/faces-config.xml (revision 0) +++ test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/faces-config.xml (working copy) @@ -0,0 +1,56 @@ + + + + + + + + annotationTestBean + com.sun.faces.test.weblogic.wls1214.facelets.core.AnnotationTestBean + request + + + Index: test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/web.xml =================================================================== --- test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/web.xml (revision 0) +++ test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/web.xml (working copy) @@ -0,0 +1,76 @@ + + + + + + + javax.faces.PROJECT_STAGE + ${webapp.projectStage} + + + javax.faces.PARTIAL_STATE_SAVING + ${webapp.partialStateSaving} + + + javax.faces.STATE_SAVING_METHOD + ${webapp.stateSavingMethod} + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/annotationtest.xhtml + + Index: test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/weblogic.xml =================================================================== --- test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/weblogic.xml (revision 0) +++ test/weblogic/wls1214/facelets/core/src/main/webapp/WEB-INF/weblogic.xml (working copy) @@ -0,0 +1,49 @@ + + + + + + /test-weblogic-wls1214-facelets-core + Index: test/weblogic/wls1214/facelets/core/src/main/webapp/annotationtest.xhtml =================================================================== --- test/weblogic/wls1214/facelets/core/src/main/webapp/annotationtest.xhtml (revision 0) +++ test/weblogic/wls1214/facelets/core/src/main/webapp/annotationtest.xhtml (working copy) @@ -0,0 +1,60 @@ + + + + + + + Annotation Scanning Test Case + + + + + + + + + Index: test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces/test/weblogic/wls1214/facelets/core/AnnotatedComponentIT.java =================================================================== --- test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces/test/weblogic/wls1214/facelets/core/AnnotatedComponentIT.java (revision 0) +++ test/weblogic/wls1214/facelets/core/src/test/java/com/sun/faces/test/weblogic/wls1214/facelets/core/AnnotatedComponentIT.java (working copy) @@ -0,0 +1,74 @@ +/* + * 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.test.weblogic.wls1214.facelets.core; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlPage; + +import static org.junit.Assert.assertTrue; + +public class AnnotatedComponentIT { + + private String webUrl; + private WebClient webClient; + + @Before + public void setUp() { + webUrl = System.getProperty("integration.url"); + webClient = new WebClient(); + } + + @After + public void tearDown() { + webClient.closeAllWindows(); + } + + @Test + public void testAnnotations() throws Exception { + HtmlPage page = webClient.getPage(webUrl + "/faces/annotationtest.xhtml"); + + String pageText = page.getBody().asText(); + assertTrue(pageText.contains("true")); + } +} Index: test/weblogic/wls1214/facelets/pom.xml =================================================================== --- test/weblogic/wls1214/facelets/pom.xml (revision 0) +++ test/weblogic/wls1214/facelets/pom.xml (working copy) @@ -0,0 +1,60 @@ + + + + + + 4.0.0 + + com.sun.faces.test.weblogic.wls1214 + pom + 2.2.8-SNAPSHOT + + com.sun.faces.test.weblogic.wls1214.facelets + pom + pom + Mojarra ${project.version} - Test - Weblogic - WLS1214 - Facelets + + core + + + Index: test/weblogic/wls1214/pom.xml =================================================================== --- test/weblogic/wls1214/pom.xml (revision 13498) +++ test/weblogic/wls1214/pom.xml (working copy) @@ -49,9 +49,12 @@ pom 2.2.8-SNAPSHOT - com.sun.faces.test.weblogic - wls1214 + com.sun.faces.test.weblogic.wls1214 + pom pom Mojarra ${project.version} - Test - Weblogic - WLS 12.1.4 + + facelets + SECTION: New Files ---------------------------- SEE ATTACHMENTS