JBoss Rich Faces SVN: r22517 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-05-31 11:19:04 -0400 (Tue, 31 May 2011)
New Revision: 22517
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java
Log:
Cover JSR303 validation on rich:inputNumberSpinner by selenium tests.
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java 2011-05-31 15:19:04 UTC (rev 22517)
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richInputNumberSpinner;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.utils.URLUtils;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * Test for faces/components/richInputNumberSpinner/jsr303.xhtml page
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public class TestRichSpinnerWithJSR303 extends AbstractMetamerTest {
+
+ /** Code for input validated to min value */
+ public static final int MIN_ID = 1;
+ /** Code for input validated to max value */
+ public static final int MAX_ID = 2;
+ /** Code for input validated to custom condition */
+ public static final int CUSTOM_ID = 3;
+
+ /** Wrong value for input validated to min value */
+ public static final String WRONG_MIN_VAL = "1";
+ /** Wrong value for input validated to max value */
+ public static final String WRONG_MAX_VAL = "5";
+ /** Wrong value for input validated to custom value */
+ public static final String WRONG_CUSTOM_VAL = "-1";
+
+ /** Wrong value for input validated to min value */
+ public static final String CORRECT_MIN_VAL = "3";
+ /** Wrong value for input validated to max value */
+ public static final String CORRECT_MAX_VAL = "1";
+ /** Wrong value for input validated to custom value */
+ public static final String CORRECT_CUSTOM_VAL = "5";
+
+
+ /** validation message for input validated to min value */
+ public static final String MSG_MIN = "must be greater than or equal to 2";
+ /** validation message for input validated to max value */
+ public static final String MSG_MAX = "must be less than or equal to 2";
+ /** validation message for input validated to custom value */
+ public static final String MSG_CUSTOM = "must be a positive number";
+
+ private JQueryLocator inputFormat = pjq("span[id$=:input{0}] > input");
+ private JQueryLocator msgFormat = pjq("span.rf-msg[id$=:inputMsg{0}] span.rf-msg-det");
+ private JQueryLocator outputFormat = pjq("span[id$=:output{0}]");
+
+ private JQueryLocator hCommandBtn = pjq("input[id$=:hButton]");
+ private JQueryLocator a4jCommandBtn = pjq("input[id$=:a4jButton]");
+
+ private void setAllCorrect() {
+ selenium.type(inputFormat.format(MIN_ID), CORRECT_MIN_VAL);
+ selenium.fireEvent(inputFormat.format(MIN_ID), Event.BLUR);
+ selenium.type(inputFormat.format(MAX_ID), CORRECT_MAX_VAL);
+ selenium.fireEvent(inputFormat.format(MAX_ID), Event.BLUR);
+ selenium.type(inputFormat.format(CUSTOM_ID), CORRECT_CUSTOM_VAL);
+ selenium.fireEvent(inputFormat.format(CUSTOM_ID), Event.BLUR);
+ }
+
+ private void setAllWrong() {
+ selenium.type(inputFormat.format(MIN_ID), WRONG_MIN_VAL);
+ selenium.fireEvent(inputFormat.format(MIN_ID), Event.BLUR);
+ selenium.type(inputFormat.format(MAX_ID), WRONG_MAX_VAL);
+ selenium.fireEvent(inputFormat.format(MAX_ID), Event.BLUR);
+ selenium.type(inputFormat.format(CUSTOM_ID), WRONG_CUSTOM_VAL);
+ selenium.fireEvent(inputFormat.format(CUSTOM_ID), Event.BLUR);
+
+ // wait until validation appears on last input before go ahead (e.g. submit form)
+ waitGui.until(textEquals.locator(msgFormat.format(CUSTOM_ID)).text(MSG_CUSTOM));
+ }
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richInputNumberSpinner/jsr303.xhtml");
+ }
+
+ @Test
+ public void testMin() {
+ selenium.type(inputFormat.format(MIN_ID), WRONG_MIN_VAL);
+ selenium.fireEvent(inputFormat.format(MIN_ID), Event.BLUR);
+ waitGui.until(textEquals.locator(msgFormat.format(MIN_ID)).text(MSG_MIN));
+ }
+
+ @Test
+ public void testMax() {
+ selenium.type(inputFormat.format(MAX_ID), WRONG_MAX_VAL);
+ selenium.fireEvent(inputFormat.format(MAX_ID), Event.BLUR);
+ waitGui.until(textEquals.locator(msgFormat.format(MAX_ID)).text(MSG_MAX));
+ }
+
+ @Test
+ public void testCustom() {
+ selenium.type(inputFormat.format(CUSTOM_ID), WRONG_CUSTOM_VAL);
+ selenium.fireEvent(inputFormat.format(CUSTOM_ID), Event.BLUR);
+ waitGui.until(textEquals.locator(msgFormat.format(CUSTOM_ID)).text(MSG_CUSTOM));
+ }
+
+ @Test
+ public void testAllCorrect() {
+
+ setAllCorrect();
+
+ waitGui.until(textEquals.locator(outputFormat.format(MIN_ID)).text(CORRECT_MIN_VAL));
+ Assert.assertEquals(selenium.getText(outputFormat.format(MAX_ID)), CORRECT_MAX_VAL);
+ Assert.assertEquals(selenium.getText(outputFormat.format(CUSTOM_ID)), CORRECT_CUSTOM_VAL);
+ }
+
+ @Test
+ public void testAllWrong() {
+
+ setAllCorrect();
+ setAllWrong();
+
+ selenium.click(hCommandBtn);
+
+ waitGui.until(textEquals.locator(msgFormat.format(MIN_ID)).text(MSG_MIN));
+ Assert.assertEquals(selenium.getText(msgFormat.format(MAX_ID)), MSG_MAX);
+ Assert.assertEquals(selenium.getText(msgFormat.format(CUSTOM_ID)), MSG_CUSTOM);
+
+ setAllCorrect();
+ setAllWrong();
+
+ selenium.click(a4jCommandBtn);
+
+ waitGui.until(textEquals.locator(msgFormat.format(MIN_ID)).text(MSG_MIN));
+ Assert.assertEquals(selenium.getText(msgFormat.format(MAX_ID)), MSG_MAX);
+ Assert.assertEquals(selenium.getText(msgFormat.format(CUSTOM_ID)), MSG_CUSTOM);
+ }
+
+}
13 years, 7 months
JBoss Rich Faces SVN: r22516 - in sandbox/trunk/ui: lightbox and 27 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: blabno
Date: 2011-05-31 05:44:53 -0400 (Tue, 31 May 2011)
New Revision: 22516
Added:
sandbox/trunk/ui/lightbox/
sandbox/trunk/ui/lightbox/bom/
sandbox/trunk/ui/lightbox/bom/pom.xml
sandbox/trunk/ui/lightbox/demo/
sandbox/trunk/ui/lightbox/demo/pom.xml
sandbox/trunk/ui/lightbox/demo/src/
sandbox/trunk/ui/lightbox/demo/src/main/
sandbox/trunk/ui/lightbox/demo/src/main/java/
sandbox/trunk/ui/lightbox/demo/src/main/java/org/
sandbox/trunk/ui/lightbox/demo/src/main/java/org/richfaces/
sandbox/trunk/ui/lightbox/demo/src/main/java/org/richfaces/sandbox/
sandbox/trunk/ui/lightbox/demo/src/main/java/org/richfaces/sandbox/lightbox/
sandbox/trunk/ui/lightbox/demo/src/main/java/org/richfaces/sandbox/lightbox/ConfigBean.java
sandbox/trunk/ui/lightbox/demo/src/main/resources/
sandbox/trunk/ui/lightbox/demo/src/main/webapp/
sandbox/trunk/ui/lightbox/demo/src/main/webapp/META-INF/
sandbox/trunk/ui/lightbox/demo/src/main/webapp/WEB-INF/
sandbox/trunk/ui/lightbox/demo/src/main/webapp/WEB-INF/faces-config.xml
sandbox/trunk/ui/lightbox/demo/src/main/webapp/WEB-INF/web.xml
sandbox/trunk/ui/lightbox/demo/src/main/webapp/index.jsp
sandbox/trunk/ui/lightbox/demo/src/main/webapp/menu.xhtml
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image1.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image2.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image3.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image4.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image5.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image1.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image2.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image3.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image4.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image5.jpg
sandbox/trunk/ui/lightbox/demo/src/main/webapp/sample_1.xhtml
sandbox/trunk/ui/lightbox/demo/src/test/
sandbox/trunk/ui/lightbox/demo/src/test/java/
sandbox/trunk/ui/lightbox/parent/
sandbox/trunk/ui/lightbox/parent/pom.xml
sandbox/trunk/ui/lightbox/pom.xml
sandbox/trunk/ui/lightbox/ui/
sandbox/trunk/ui/lightbox/ui/pom.xml
sandbox/trunk/ui/lightbox/ui/src/
sandbox/trunk/ui/lightbox/ui/src/main/
sandbox/trunk/ui/lightbox/ui/src/main/java/
sandbox/trunk/ui/lightbox/ui/src/main/java/org/
sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/
sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/component/
sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/component/AbstractLightbox.java
sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/component/package-info.java
sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/renderkit/
sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/renderkit/html/
sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/renderkit/html/LightboxRenderer.java
sandbox/trunk/ui/lightbox/ui/src/main/resources/
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/jquery.lightbox.css
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/jquery.lightbox.js
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-blank.gif
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-btn-close.gif
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-btn-next.gif
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-btn-prev.gif
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-ico-loading.gif
sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/richfaces.lightbox.js
sandbox/trunk/ui/lightbox/ui/src/test/
sandbox/trunk/ui/lightbox/ui/src/test/java/
sandbox/trunk/ui/lightbox/ui/src/test/resources/
Log:
Migrated lightbox component to 4.X.
Property changes on: sandbox/trunk/ui/lightbox
___________________________________________________________________
Added: svn:ignore
+ *.iml
*.ipr
*.iws
Property changes on: sandbox/trunk/ui/lightbox/bom
___________________________________________________________________
Added: svn:ignore
+ *.iml
Added: sandbox/trunk/ui/lightbox/bom/pom.xml
===================================================================
--- sandbox/trunk/ui/lightbox/bom/pom.xml (rev 0)
+++ sandbox/trunk/ui/lightbox/bom/pom.xml 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<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>org.richfaces.sandbox.ui.lightbox</groupId>
+ <artifactId>lightbox-bom</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: lightbox bom</name>
+ <packaging>pom</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-bom</artifactId>
+ <version>${project.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>lightbox-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+ <url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
Property changes on: sandbox/trunk/ui/lightbox/demo
___________________________________________________________________
Added: svn:ignore
+ *.iml
Added: sandbox/trunk/ui/lightbox/demo/pom.xml
===================================================================
--- sandbox/trunk/ui/lightbox/demo/pom.xml (rev 0)
+++ sandbox/trunk/ui/lightbox/demo/pom.xml 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.sandbox.ui.lightbox</groupId>
+ <artifactId>lightbox-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>lightbox-demo</artifactId>
+ <name>Richfaces UI Components: lightbox demo</name>
+ <packaging>war</packaging>
+ <build>
+ <finalName>lightbox-demo</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui.lightbox</groupId>
+ <artifactId>lightbox-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+</project>
+
+
Added: sandbox/trunk/ui/lightbox/demo/src/main/java/org/richfaces/sandbox/lightbox/ConfigBean.java
===================================================================
--- sandbox/trunk/ui/lightbox/demo/src/main/java/org/richfaces/sandbox/lightbox/ConfigBean.java (rev 0)
+++ sandbox/trunk/ui/lightbox/demo/src/main/java/org/richfaces/sandbox/lightbox/ConfigBean.java 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,156 @@
+package org.richfaces.sandbox.lightbox;
+
+import java.io.Serializable;
+
+public class ConfigBean implements Serializable {
+
+ private String overlayBgColor = "#000";
+
+ private double overlayOpacity = .8;
+
+ private int containerBorderSize = 10;
+
+ private int containerResizeSpeed = 400;
+
+ private boolean fixedNavigation = false;
+
+ private String keyToClose = "c";
+
+ private String keyToNext = "n";
+
+ private String keyToPrev = "p";
+
+ private String txtImage = "Image";
+
+ private String txtOf = "of";
+
+ private String imageBlank;
+
+ private String imageBtnClose;
+
+ private String imageBtnNext;
+
+ private String imageBtnPrev;
+
+ private String imageLoading;
+
+ public String getOverlayBgColor() {
+ return overlayBgColor;
+ }
+
+ public void setOverlayBgColor(String overlayBgColor) {
+ this.overlayBgColor = overlayBgColor;
+ }
+
+ public double getOverlayOpacity() {
+ return overlayOpacity;
+ }
+
+ public void setOverlayOpacity(double overlayOpacity) {
+ this.overlayOpacity = overlayOpacity;
+ }
+
+ public int getContainerBorderSize() {
+ return containerBorderSize;
+ }
+
+ public void setContainerBorderSize(int containerBorderSize) {
+ this.containerBorderSize = containerBorderSize;
+ }
+
+ public int getContainerResizeSpeed() {
+ return containerResizeSpeed;
+ }
+
+ public void setContainerResizeSpeed(int containerResizeSpeed) {
+ this.containerResizeSpeed = containerResizeSpeed;
+ }
+
+ public boolean isFixedNavigation() {
+ return fixedNavigation;
+ }
+
+ public void setFixedNavigation(boolean fixedNavigation) {
+ this.fixedNavigation = fixedNavigation;
+ }
+
+ public String getKeyToClose() {
+ return keyToClose;
+ }
+
+ public void setKeyToClose(String keyToClose) {
+ this.keyToClose = keyToClose;
+ }
+
+ public String getKeyToNext() {
+ return keyToNext;
+ }
+
+ public void setKeyToNext(String keyToNext) {
+ this.keyToNext = keyToNext;
+ }
+
+ public String getKeyToPrev() {
+ return keyToPrev;
+ }
+
+ public void setKeyToPrev(String keyToPrev) {
+ this.keyToPrev = keyToPrev;
+ }
+
+ public String getTxtImage() {
+ return txtImage;
+ }
+
+ public void setTxtImage(String txtImage) {
+ this.txtImage = txtImage;
+ }
+
+ public String getTxtOf() {
+ return txtOf;
+ }
+
+ public void setTxtOf(String txtOf) {
+ this.txtOf = txtOf;
+ }
+
+ public void setImageBlank(String imageBlank) {
+ this.imageBlank = imageBlank;
+ }
+
+ public String getImageBlank() {
+ return imageBlank;
+ }
+
+ public void setImageBtnClose(String imageBtnClose) {
+ this.imageBtnClose = imageBtnClose;
+ }
+
+ public String getImageBtnClose() {
+ return imageBtnClose;
+ }
+
+ public void setImageBtnNext(String imageBtnNext) {
+ this.imageBtnNext = imageBtnNext;
+ }
+
+ public String getImageBtnNext() {
+ return imageBtnNext;
+ }
+
+ public void setImageBtnPrev(String imageBtnPrev) {
+ this.imageBtnPrev = imageBtnPrev;
+ }
+
+ public String getImageBtnPrev() {
+ return imageBtnPrev;
+ }
+
+ public void setImageLoading(String imageLoading) {
+ this.imageLoading = imageLoading;
+ }
+
+ public String getImageLoading() {
+ return imageLoading;
+ }
+}
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- sandbox/trunk/ui/lightbox/demo/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ sandbox/trunk/ui/lightbox/demo/src/main/webapp/WEB-INF/faces-config.xml 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee" version="2.0">
+ <managed-bean>
+ <managed-bean-name>config</managed-bean-name>
+ <managed-bean-class>org.richfaces.sandbox.lightbox.ConfigBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/ui/lightbox/demo/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ sandbox/trunk/ui/lightbox/demo/src/main/webapp/WEB-INF/web.xml 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
+ <display-name>Lightbox demo</display-name>
+ <context-param>
+ <param-name>com.sun.faces.allowTextChildren</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>classic</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <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>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+
+</web-app>
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/index.jsp
===================================================================
--- sandbox/trunk/ui/lightbox/demo/src/main/webapp/index.jsp (rev 0)
+++ sandbox/trunk/ui/lightbox/demo/src/main/webapp/index.jsp 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,7 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head></head>
+<body>
+<jsp:forward page="sample_1.jsf"/>
+</body>
+</html>
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/menu.xhtml
===================================================================
--- sandbox/trunk/ui/lightbox/demo/src/main/webapp/menu.xhtml (rev 0)
+++ sandbox/trunk/ui/lightbox/demo/src/main/webapp/menu.xhtml 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,8 @@
+<ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html">
+ <div>
+ <ul>
+ <!--<li><h:outputLink value="#{facesContext.externalContext.requestContextPath}/sample_1.jsf">Example 1</h:outputLink></li>-->
+ </ul>
+ </div>
+</ui:component>
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image1.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image1.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image2.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image2.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image3.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image3.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image4.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image4.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image5.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/image5.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image1.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image1.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image2.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image2.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image3.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image3.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image4.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image4.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image5.jpg
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/demo/src/main/webapp/photos/thumb_image5.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/demo/src/main/webapp/sample_1.xhtml
===================================================================
--- sandbox/trunk/ui/lightbox/demo/src/main/webapp/sample_1.xhtml (rev 0)
+++ sandbox/trunk/ui/lightbox/demo/src/main/webapp/sample_1.xhtml 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,143 @@
+<!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:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"
+ xmlns:lightbox="http://richfaces.org/sandbox/lightbox">
+<h:head>
+ <title>Lightbox sample</title>
+ <style type="text/css">
+ #gallery ul {
+ list-style: none outside none;
+ }
+
+ #gallery ul li {
+ display: inline;
+ }
+
+ #gallery ul img {
+ border: 5px solid #3E3E3E;
+ border-bottom-width: 20px;
+ }
+
+ #gallery ul a:hover img {
+ border: 5px solid #000;
+ border-bottom-width: 20px;
+ color: #FFFFFF;
+ }
+
+ #gallery ul a:hover {
+ color: #FFFFFF;
+ }
+
+ </style>
+</h:head>
+
+<h:body>
+ <ui:include src="menu.xhtml"/>
+
+ <div id="gallery">
+ <ul>
+ <li>
+ <a href="photos/image1.jpg" title="Blue flower">
+ <h:graphicImage value="photos/thumb_image1.jpg"/>
+ </a>
+ </li>
+ <li>
+ <a href="photos/image2.jpg" title="Red leafs">
+ <h:graphicImage value="photos/thumb_image2.jpg"/>
+ </a>
+ </li>
+ <li>
+ <a href="photos/image3.jpg" title="Rain drops">
+ <h:graphicImage value="photos/thumb_image3.jpg"/>
+ </a>
+ </li>
+ <li>
+ <a href="photos/image4.jpg" title="Fresh green">
+ <h:graphicImage value="photos/thumb_image4.jpg"/>
+ </a>
+ </li>
+ <li>
+ <a href="photos/image5.jpg" title="More fresh green">
+ <h:graphicImage value="photos/thumb_image5.jpg"/>
+ </a>
+ </li>
+ </ul>
+ </div>
+
+
+ <lightbox:lightbox id="lightbox" selector="#gallery a" containerBorderSize="#{config.containerBorderSize}"
+ containerResizeSpeed="#{config.containerResizeSpeed}" keyToClose="#{config.keyToClose}" keyToNext="#{config.keyToNext}"
+ keyToPrev="#{config.keyToPrev}" overlayBgColor="#{config.overlayBgColor}" overlayOpacity="#{config.overlayOpacity}"
+ txtImage="#{config.txtImage}" txtOf="#{config.txtOf}" imageBlank="#{config.imageBlank}" imageBtnClose="#{config.imageBtnClose}"
+ imageBtnNext="#{config.imageBtnNext}" imageBtnPrev="#{config.imageBtnPrev}" imageLoading="#{config.imageLoading}"/>
+
+
+ <h:form id="lightboxForm">
+
+
+ <h:panelGrid columns="3">
+ <h:outputLabel value="containerBorderSize" for="containerBorderSize"/>
+ <h:inputText id="containerBorderSize" value="#{config.containerBorderSize}"/>
+ <h:message for="containerBorderSize"/>
+
+ <h:outputLabel value="containerResizeSpeed" for="containerResizeSpeed"/>
+ <h:inputText id="containerResizeSpeed" value="#{config.containerResizeSpeed}"/>
+ <h:message for="containerResizeSpeed"/>
+
+ <h:outputLabel value="keyToClose" for="keyToClose"/>
+ <h:inputText id="keyToClose" value="#{config.keyToClose}"/>
+ <h:message for="keyToClose"/>
+
+ <h:outputLabel value="keyToNext" for="keyToNext"/>
+ <h:inputText id="keyToNext" value="#{config.keyToNext}"/>
+ <h:message for="keyToNext"/>
+
+ <h:outputLabel value="" for="keyToPrev"/>
+ <h:inputText id="keyToPrev" value="#{config.keyToPrev}"/>
+ <h:message for="keyToPrev"/>
+
+ <h:outputLabel value="overlayBgColor" for="overlayBgColor"/>
+ <h:inputText id="overlayBgColor" value="#{config.overlayBgColor}"/>
+ <h:message for="overlayBgColor"/>
+
+ <h:outputLabel value="overlayOpacity" for="overlayOpacity"/>
+ <h:inputText id="overlayOpacity" value="#{config.overlayOpacity}"/>
+ <h:message for="overlayOpacity"/>
+
+ <h:outputLabel value="txtImage" for="txtImage"/>
+ <h:inputText id="txtImage" value="#{config.txtImage}"/>
+ <h:message for="txtImage"/>
+
+ <h:outputLabel value="txtOf" for="txtOf"/>
+ <h:inputText id="txtOf" value="#{config.txtOf}"/>
+ <h:message for="txtOf"/>
+
+ <h:outputLabel value="imageBlank" for="imageBlank"/>
+ <h:inputText id="imageBlank" value="#{config.imageBlank}"/>
+ <h:message for="imageBlank"/>
+
+ <h:outputLabel value="imageBtnClose" for="imageBtnClose"/>
+ <h:inputText id="imageBtnClose" value="#{config.imageBtnClose}"/>
+ <h:message for="imageBtnClose"/>
+
+ <h:outputLabel value="imageBtnNext" for="imageBtnNext"/>
+ <h:inputText id="imageBtnNext" value="#{config.imageBtnNext}"/>
+ <h:message for="imageBtnNext"/>
+
+ <h:outputLabel value="imageBtnPrev" for="imageBtnPrev"/>
+ <h:inputText id="imageBtnPrev" value="#{config.imageBtnPrev}"/>
+ <h:message for="imageBtnPrev"/>
+
+ <h:outputLabel value="imageLoading" for="imageLoading"/>
+ <h:inputText id="imageLoading" value="#{config.imageLoading}"/>
+ <h:message for="imageLoading"/>
+
+ <a4j:commandButton value="Submit" reRender="lightbox,lightboxForm"/>
+ </h:panelGrid>
+ </h:form>
+
+ <!--<rich:insert src="sample_1.xhtml" highlight="html"/>-->
+
+</h:body>
+</html>
Property changes on: sandbox/trunk/ui/lightbox/parent
___________________________________________________________________
Added: svn:ignore
+ *.iml
Added: sandbox/trunk/ui/lightbox/parent/pom.xml
===================================================================
--- sandbox/trunk/ui/lightbox/parent/pom.xml (rev 0)
+++ sandbox/trunk/ui/lightbox/parent/pom.xml 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<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>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.sandbox.ui.lightbox</groupId>
+ <artifactId>lightbox-parent</artifactId>
+ <name>Richfaces UI Components: lightbox parent</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
+ <org.richfaces.cdk.version>4.1.0-SNAPSHOT</org.richfaces.cdk.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui.lightbox</groupId>
+ <artifactId>lightbox-bom</artifactId>
+ <version>${project.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <version>${org.richfaces.cdk.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>${org.richfaces.cdk.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <version>1.0-beta-2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <fail>false</fail>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+ <url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
Added: sandbox/trunk/ui/lightbox/pom.xml
===================================================================
--- sandbox/trunk/ui/lightbox/pom.xml (rev 0)
+++ sandbox/trunk/ui/lightbox/pom.xml 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+ JBoss, Home of Professional Open Source
+ Copyright , Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<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>
+
+ <parent>
+ <groupId>org.richfaces.sandbox.ui.lightbox</groupId>
+ <artifactId>lightbox-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>lightbox-aggregator</artifactId>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: lightbox Aggregator</name>
+
+ <modules>
+ <module>bom</module>
+ <module>parent</module>
+ <module>ui</module>
+ <module>demo</module>
+ </modules>
+
+ <profiles>
+ <profile>
+ <id>cli</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.twdata.maven</groupId>
+ <artifactId>maven-cli-plugin</artifactId>
+ <version>1.0.6-SNAPSHOT</version>
+ <configuration>
+ <userAliases>
+ <ui>lightbox-ui clean install</ui>
+ <demo>lightbox-demo clean package</demo>
+ </userAliases>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/sandbox/trunk/ui/lightbox</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/sandbox/trunk/ui/lightbox</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
+ </scm>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+ <url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
Property changes on: sandbox/trunk/ui/lightbox/ui
___________________________________________________________________
Added: svn:ignore
+ *.iml
Added: sandbox/trunk/ui/lightbox/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/lightbox/ui/pom.xml (rev 0)
+++ sandbox/trunk/ui/lightbox/ui/pom.xml 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.richfaces.sandbox.ui.lightbox</groupId>
+ <artifactId>lightbox-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+ <artifactId>lightbox-ui</artifactId>
+ <name>Richfaces UI Components: lightbox ui</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>${org.richfaces.cdk.version}</version>
+ <executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/component/AbstractLightbox.java
===================================================================
--- sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/component/AbstractLightbox.java (rev 0)
+++ sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/component/AbstractLightbox.java 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,90 @@
+package org.richfaces.component;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.renderkit.html.LightboxRenderer;
+
+import javax.faces.component.UIComponentBase;
+
+@JsfComponent(tag = @Tag(name = "lightbox", type = TagType.Facelets),
+ renderer = @JsfRenderer(family = AbstractLightbox.COMPONENT_FAMILY, type = LightboxRenderer.RENDERER_TYPE),
+ attributes = {"core-props.xml"}
+)
+public abstract class AbstractLightbox extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Lightbox";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Lightbox";
+
+ public static final int DEFAULT_CONTAINER_BORDER_SIZE = 10;
+
+ public static final int DEFAULT_CONTAINER_RESIZE_SPEED = 400;
+
+ public static final boolean DEFAULT_FIXED_NAVIGATION = false;
+
+ public static final String DEFAULT_KEY_TO_CLOSE = "c";
+
+ public static final String DEFAULT_KEY_TO_NEXT = "n";
+
+ public static final String DEFAULT_KEY_TO_PREV = "p";
+
+ public static final String DEFAULT_TXT_IMAGE = "Image";
+
+ public static final String DEFAULT_TXT_OF = "of";
+
+ public static final String DEFAULT_OVERLAY_BG_COLOR = "#000";
+
+ public static final double DEFAULT_OVERLAY_OPACITY = .8;
+
+ @Attribute(required = true)
+ public abstract String getSelector();
+
+ @Attribute
+ public abstract String getOverlayBgColor();
+
+ @Attribute
+ public abstract Double getOverlayOpacity();
+
+ @Attribute
+ public abstract Boolean isFixedNavigation();
+
+ @Attribute
+ public abstract Integer getContainerBorderSize();
+
+ @Attribute
+ public abstract Integer getContainerResizeSpeed();
+
+ @Attribute
+ public abstract String getTxtImage();
+
+ @Attribute
+ public abstract String getTxtOf();
+
+ @Attribute
+ public abstract String getKeyToClose();
+
+ @Attribute
+ public abstract String getKeyToPrev();
+
+ @Attribute
+ public abstract String getKeyToNext();
+
+ @Attribute
+ public abstract String getImageBlank();
+
+ @Attribute
+ public abstract String getImageLoading();
+
+ @Attribute
+ public abstract String getImageBtnNext();
+
+ @Attribute
+ public abstract String getImageBtnPrev();
+
+ @Attribute
+ public abstract String getImageBtnClose();
+
+}
Added: sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/component/package-info.java (rev 0)
+++ sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/component/package-info.java 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,4 @@
+@TagLibrary(uri = "http://richfaces.org/sandbox/lightbox", shortName = "lightbox", prefix = "lightbox", displayName = "Lightbox component") package org.richfaces.component;
+
+import org.richfaces.cdk.annotations.TagLibrary;
+
Added: sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/renderkit/html/LightboxRenderer.java
===================================================================
--- sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/renderkit/html/LightboxRenderer.java (rev 0)
+++ sandbox/trunk/ui/lightbox/ui/src/main/java/org/richfaces/renderkit/html/LightboxRenderer.java 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,98 @@
+package org.richfaces.renderkit.html;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.AbstractLightbox;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.RendererBase;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+@JsfRenderer(family = AbstractLightbox.COMPONENT_FAMILY, type = LightboxRenderer.RENDERER_TYPE)
+@ResourceDependencies({
+ @ResourceDependency(name = "base-component.reslib", library = "org.richfaces", target = "head"),
+ @ResourceDependency(name = "jquery.lightbox.js", target = "head"),
+ @ResourceDependency(name = "richfaces.lightbox.js", target = "head"),
+ @ResourceDependency(name = "jquery.lightbox.css", target = "head")
+})
+public class LightboxRenderer extends RendererBase {
+
+ public static final String RENDERER_TYPE = "org.richfaces.Lightbox";
+
+ private static final Map<String, Object> DEFAULTS;
+
+ /**
+ * Following defaults are be used by addOptionIfSetAndNotDefault
+ */
+ static {
+ Map<String, Object> defaults = new HashMap<String, Object>();
+ defaults.put("overlayBgColor", AbstractLightbox.DEFAULT_OVERLAY_BG_COLOR);
+ defaults.put("overlayOpacity", AbstractLightbox.DEFAULT_OVERLAY_OPACITY);
+ defaults.put("containerBorderSize", AbstractLightbox.DEFAULT_CONTAINER_BORDER_SIZE);
+ defaults.put("containerResizeSpeed", AbstractLightbox.DEFAULT_CONTAINER_RESIZE_SPEED);
+ defaults.put("fixedNavigation", AbstractLightbox.DEFAULT_FIXED_NAVIGATION);
+ defaults.put("keyToClose", AbstractLightbox.DEFAULT_KEY_TO_CLOSE);
+ defaults.put("keyToNext", AbstractLightbox.DEFAULT_KEY_TO_NEXT);
+ defaults.put("keyToPrev", AbstractLightbox.DEFAULT_KEY_TO_PREV);
+ defaults.put("txtImage", AbstractLightbox.DEFAULT_TXT_IMAGE);
+ defaults.put("txtOf", AbstractLightbox.DEFAULT_TXT_OF);
+
+ DEFAULTS = Collections.unmodifiableMap(defaults);
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractLightbox.class;
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ AbstractLightbox lightbox = (AbstractLightbox) component;
+ final HashMap<String, Object> options = new HashMap<String, Object>();
+ addOptionIfSetAndOrDefault("imageBlank", lightbox.getImageBlank(), getURL(context, "/lightbox-blank.gif"), options);
+ addOptionIfSetAndOrDefault("imageLoading", lightbox.getImageLoading(), getURL(context, "/lightbox-ico-loading.gif"), options);
+ addOptionIfSetAndOrDefault("imageBtnNext", lightbox.getImageBtnNext(), getURL(context, "/lightbox-btn-next.gif"), options);
+ addOptionIfSetAndOrDefault("imageBtnPrev", lightbox.getImageBtnPrev(), getURL(context, "/lightbox-btn-prev.gif"), options);
+ addOptionIfSetAndOrDefault("imageBtnClose", lightbox.getImageBtnClose(), getURL(context, "/lightbox-btn-close.gif"), options);
+ addOptionIfSetAndNotDefault("containerBorderSize", lightbox.getContainerBorderSize(), options);
+ addOptionIfSetAndNotDefault("containerResizeSpeed", lightbox.getContainerResizeSpeed(), options);
+ addOptionIfSetAndNotDefault("fixedNavigation", lightbox.isFixedNavigation(), options);
+ addOptionIfSetAndNotDefault("keyToClose", lightbox.getKeyToClose(), options);
+ addOptionIfSetAndNotDefault("keyToNext", lightbox.getKeyToNext(), options);
+ addOptionIfSetAndNotDefault("keyToPrev", lightbox.getKeyToPrev(), options);
+ addOptionIfSetAndNotDefault("overlayBgColor", lightbox.getOverlayBgColor(), options);
+ addOptionIfSetAndNotDefault("overlayOpacity", lightbox.getOverlayOpacity(), options);
+ addOptionIfSetAndNotDefault("txtImage", lightbox.getTxtImage(), options);
+ addOptionIfSetAndNotDefault("txtOf", lightbox.getTxtOf(), options);
+ writer.startElement(HtmlConstants.DIV_ELEM, component);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, getUtils().clientId(context, component), "id");
+ getUtils().writeScript(context, component, new JSFunction("RichFaces.Lightbox", lightbox.getSelector(), options));
+ writer.endElement(HtmlConstants.DIV_ELEM);
+ }
+
+ protected void addOptionIfSetAndNotDefault(String optionName, Object value, Map<String, Object> options) {
+ if (value != null && !"".equals(value) && !value.equals(DEFAULTS.get(optionName))) {
+ options.put(optionName, value);
+ }
+ }
+
+ protected void addOptionIfSetAndOrDefault(String optionName, Object value, Object defaultValue, Map<String, Object> options) {
+ if (value != null && !"".equals(value)) {
+ options.put(optionName, value);
+ } else {
+ options.put(optionName, defaultValue);
+ }
+ }
+
+ private String getURL(FacesContext context, String path) {
+ return context.getApplication().getResourceHandler().createResource(path).getRequestPath();
+ }
+}
Added: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/jquery.lightbox.css
===================================================================
--- sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/jquery.lightbox.css (rev 0)
+++ sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/jquery.lightbox.css 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,128 @@
+/**
+ * jQuery lightBox plugin
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
+ * and adapted to me for use like a plugin from jQuery.
+ * @name jquery-lightbox-0.5.css
+ * @author Leandro Vieira Pinho - http://leandrovieira.com
+ * @version 0.5
+ * @date April 11, 2008
+ * @category jQuery plugin
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
+ * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
+ */
+#jquery-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 90;
+ width: 100%;
+ height: 500px;
+}
+
+#jquery-lightbox {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ z-index: 100;
+ text-align: center;
+ line-height: 0;
+}
+
+#jquery-lightbox a img {
+ border: none;
+}
+
+#lightbox-container-image-box {
+ position: relative;
+ background-color: #fff;
+ width: 250px;
+ height: 250px;
+ margin: 0 auto;
+}
+
+#lightbox-container-image {
+ padding: 10px;
+}
+
+#lightbox-loading {
+ position: absolute;
+ top: 40%;
+ left: 0%;
+ height: 25%;
+ width: 100%;
+ text-align: center;
+ line-height: 0;
+}
+
+#lightbox-nav {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 100%;
+ width: 100%;
+ z-index: 10;
+}
+
+#lightbox-container-image-box > #lightbox-nav {
+ left: 0;
+}
+
+#lightbox-nav a {
+ outline: none;
+}
+
+#lightbox-nav-btnPrev, #lightbox-nav-btnNext {
+ width: 49%;
+ height: 100%;
+ zoom: 1;
+ display: block;
+}
+
+#lightbox-nav-btnPrev {
+ left: 0;
+ float: left;
+}
+
+#lightbox-nav-btnNext {
+ right: 0;
+ float: right;
+}
+
+#lightbox-container-image-data-box {
+ font: 10px Verdana, Helvetica, sans-serif;
+ background-color: #fff;
+ margin: 0 auto;
+ line-height: 1.4em;
+ overflow: auto;
+ width: 100%;
+ padding: 0 10px 0;
+}
+
+#lightbox-container-image-data {
+ padding: 0 10px;
+ color: #666;
+}
+
+#lightbox-container-image-data #lightbox-image-details {
+ width: 70%;
+ float: left;
+ text-align: left;
+}
+
+#lightbox-image-details-caption {
+ font-weight: bold;
+}
+
+#lightbox-image-details-currentNumber {
+ display: block;
+ clear: left;
+ padding-bottom: 1.0em;
+}
+
+#lightbox-secNav-btnClose {
+ width: 66px;
+ float: right;
+ padding-bottom: 0.7em;
+}
\ No newline at end of file
Added: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/jquery.lightbox.js
===================================================================
--- sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/jquery.lightbox.js (rev 0)
+++ sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/jquery.lightbox.js 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,501 @@
+/**
+ * jQuery lightBox plugin
+ * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
+ * and adapted to me for use like a plugin from jQuery.
+ * @name jquery-lightbox-0.5.js
+ * @author Leandro Vieira Pinho - http://leandrovieira.com
+ * @version 0.5
+ * @date April 11, 2008
+ * @category jQuery plugin
+ * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
+ * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
+ * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
+ */
+
+// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
+(function($) {
+ /**
+ * $ is an alias to jQuery object
+ *
+ */
+ $.fn.lightBox = function(settings) {
+ // Settings to configure the jQuery lightBox plugin how you like
+ settings = jQuery.extend({
+ // Configuration related to overlay
+ overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
+ overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
+ // Configuration related to navigation
+ fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
+ // Configuration related to images
+ imageLoading: 'lightbox-ico-loading.gif', // (string) Path and the name of the loading icon
+ imageBtnPrev: 'lightbox-btn-prev.gif', // (string) Path and the name of the prev button image
+ imageBtnNext: 'lightbox-btn-next.gif', // (string) Path and the name of the next button image
+ imageBtnClose: 'lightbox-btn-close.gif', // (string) Path and the name of the close btn
+ imageBlank: 'lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel)
+ // Configuration related to container image box
+ containerBorderSize: 10, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
+ containerResizeSpeed: 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
+ // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
+ txtImage: 'Image', // (string) Specify text "Image"
+ txtOf: 'of', // (string) Specify text "of"
+ // Configuration related to keyboard navigation
+ keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
+ keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image
+ keyToNext: 'n', // (string) (n = next) Letter to show the next image.
+ // Don�t alter these variables in any way
+ imageArray: [],
+ activeImage: 0
+ }, settings);
+ // Caching the jQuery object with all elements matched
+ var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
+ /**
+ * Initializing the plugin calling the start function
+ *
+ * @return boolean false
+ */
+ function _initialize() {
+ _start(this, jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
+ return false; // Avoid the browser following the link
+ }
+
+ /**
+ * Start the jQuery lightBox plugin
+ *
+ * @param object objClicked The object (link) whick the user have clicked
+ * @param object jQueryMatchedObj The jQuery object with all elements matched
+ */
+ function _start(objClicked, jQueryMatchedObj) {
+ // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
+ $('embed, object, select').css({ 'visibility' : 'hidden' });
+ // Call the function to create the markup structure; style some elements; assign events in some elements.
+ _set_interface();
+ // Unset total images in imageArray
+ settings.imageArray.length = 0;
+ // Unset image active information
+ settings.activeImage = 0;
+ // We have an image set? Or just an image? Let�s see it.
+ if (jQueryMatchedObj.length == 1) {
+ settings.imageArray.push(new Array(objClicked.getAttribute('href'), objClicked.getAttribute('title')));
+ } else {
+ // Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references
+ for (var i = 0; i < jQueryMatchedObj.length; i++) {
+ settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'), jQueryMatchedObj[i].getAttribute('title')));
+ }
+ }
+ while (settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href')) {
+ settings.activeImage++;
+ }
+ // Call the function that prepares image exibition
+ _set_image_to_view();
+ }
+
+ /**
+ * Create the jQuery lightBox plugin interface
+ *
+ * The HTML markup will be like that:
+ <div id="jquery-overlay"></div>
+ <div id="jquery-lightbox">
+ <div id="lightbox-container-image-box">
+ <div id="lightbox-container-image">
+ <img src="../fotos/XX.jpg" id="lightbox-image">
+ <div id="lightbox-nav">
+ <a href="#" id="lightbox-nav-btnPrev"></a>
+ <a href="#" id="lightbox-nav-btnNext"></a>
+ </div>
+ <div id="lightbox-loading">
+ <a href="#" id="lightbox-loading-link">
+ <img src="../images/lightbox-ico-loading.gif">
+ </a>
+ </div>
+ </div>
+ </div>
+ <div id="lightbox-container-image-data-box">
+ <div id="lightbox-container-image-data">
+ <div id="lightbox-image-details">
+ <span id="lightbox-image-details-caption"></span>
+ <span id="lightbox-image-details-currentNumber"></span>
+ </div>
+ <div id="lightbox-secNav">
+ <a href="#" id="lightbox-secNav-btnClose">
+ <img src="../images/lightbox-btn-close.gif">
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ *
+ */
+ function _set_interface() {
+ // Apply the HTML markup into body tag
+ $('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');
+ // Get page sizes
+ var arrPageSizes = ___getPageSize();
+ // Style overlay and show it
+ $('#jquery-overlay').css({
+ backgroundColor: settings.overlayBgColor,
+ opacity: settings.overlayOpacity,
+ width: arrPageSizes[0],
+ height: arrPageSizes[1]
+ }).fadeIn();
+ // Get page scroll
+ var arrPageScroll = ___getPageScroll();
+ // Calculate top and left offset for the jquery-lightbox div object and show it
+ $('#jquery-lightbox').css({
+ top: arrPageScroll[1] + (arrPageSizes[3] / 10),
+ left: arrPageScroll[0]
+ }).show();
+ // Assigning click events in elements to close overlay
+ $('#jquery-overlay,#jquery-lightbox').click(function() {
+ _finish();
+ });
+ // Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
+ $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
+ _finish();
+ return false;
+ });
+ // If window was resized, calculate the new overlay dimensions
+ $(window).resize(function() {
+ // Get page sizes
+ var arrPageSizes = ___getPageSize();
+ // Style overlay and show it
+ $('#jquery-overlay').css({
+ width: arrPageSizes[0],
+ height: arrPageSizes[1]
+ });
+ // Get page scroll
+ var arrPageScroll = ___getPageScroll();
+ // Calculate top and left offset for the jquery-lightbox div object and show it
+ $('#jquery-lightbox').css({
+ top: arrPageScroll[1] + (arrPageSizes[3] / 10),
+ left: arrPageScroll[0]
+ });
+ });
+ }
+
+ /**
+ * Prepares image exibition; doing a image�s preloader to calculate it�s size
+ *
+ */
+ function _set_image_to_view() { // show the loading
+ // Show the loading
+ $('#lightbox-loading').show();
+ if (settings.fixedNavigation) {
+ $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
+ } else {
+ // Hide some elements
+ $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
+ }
+ // Image preload process
+ var objImagePreloader = new Image();
+ objImagePreloader.onload = function() {
+ $('#lightbox-image').attr('src', settings.imageArray[settings.activeImage][0]);
+ // Perfomance an effect in the image container resizing it
+ _resize_container_image_box(objImagePreloader.width, objImagePreloader.height);
+ // clear onLoad, IE behaves irratically with animated gifs otherwise
+ objImagePreloader.onload = function() {
+ };
+ };
+ objImagePreloader.src = settings.imageArray[settings.activeImage][0];
+ }
+
+ ;
+ /**
+ * Perfomance an effect in the image container resizing it
+ *
+ * @param integer intImageWidth The image�s width that will be showed
+ * @param integer intImageHeight The image�s height that will be showed
+ */
+ function _resize_container_image_box(intImageWidth, intImageHeight) {
+ // Get current width and height
+ var intCurrentWidth = $('#lightbox-container-image-box').width();
+ var intCurrentHeight = $('#lightbox-container-image-box').height();
+ // Get the width and height of the selected image plus the padding
+ var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image�s width and the left and right padding value
+ var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image�s height and the left and right padding value
+ // Diferences
+ var intDiffW = intCurrentWidth - intWidth;
+ var intDiffH = intCurrentHeight - intHeight;
+ // Perfomance the effect
+ $('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight }, settings.containerResizeSpeed, function() {
+ _show_image();
+ });
+ if (( intDiffW == 0 ) && ( intDiffH == 0 )) {
+ if ($.browser.msie) {
+ ___pause(250);
+ } else {
+ ___pause(100);
+ }
+ }
+ $('#lightbox-container-image-data-box').css({ width: intImageWidth });
+ $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
+ }
+
+ ;
+ /**
+ * Show the prepared image
+ *
+ */
+ function _show_image() {
+ $('#lightbox-loading').hide();
+ $('#lightbox-image').fadeIn(function() {
+ _show_image_data();
+ _set_navigation();
+ });
+ _preload_neighbor_images();
+ }
+
+ ;
+ /**
+ * Show the image information
+ *
+ */
+ function _show_image_data() {
+ $('#lightbox-container-image-data-box').slideDown('fast');
+ $('#lightbox-image-details-caption').hide();
+ if (settings.imageArray[settings.activeImage][1]) {
+ $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
+ }
+ // If we have a image set, display 'Image X of X'
+ if (settings.imageArray.length > 1) {
+ $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
+ }
+ }
+
+ /**
+ * Display the button navigations
+ *
+ */
+ function _set_navigation() {
+ $('#lightbox-nav').show();
+
+ // Instead to define this configuration in CSS file, we define here. And it�s need to IE. Just.
+ $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
+
+ // Show the prev button, if not the first image in set
+ if (settings.activeImage != 0) {
+ if (settings.fixedNavigation) {
+ $('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
+ .unbind()
+ .bind('click', function() {
+ settings.activeImage = settings.activeImage - 1;
+ _set_image_to_view();
+ return false;
+ });
+ } else {
+ // Show the images button for Next buttons
+ $('#lightbox-nav-btnPrev').unbind().hover(function() {
+ $(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
+ }, function() {
+ $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
+ }).show().bind('click', function() {
+ settings.activeImage = settings.activeImage - 1;
+ _set_image_to_view();
+ return false;
+ });
+ }
+ }
+
+ // Show the next button, if not the last image in set
+ if (settings.activeImage != ( settings.imageArray.length - 1 )) {
+ if (settings.fixedNavigation) {
+ $('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
+ .unbind()
+ .bind('click', function() {
+ settings.activeImage = settings.activeImage + 1;
+ _set_image_to_view();
+ return false;
+ });
+ } else {
+ // Show the images button for Next buttons
+ $('#lightbox-nav-btnNext').unbind().hover(function() {
+ $(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
+ }, function() {
+ $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
+ }).show().bind('click', function() {
+ settings.activeImage = settings.activeImage + 1;
+ _set_image_to_view();
+ return false;
+ });
+ }
+ }
+ // Enable keyboard navigation
+ _enable_keyboard_navigation();
+ }
+
+ /**
+ * Enable a support to keyboard navigation
+ *
+ */
+ function _enable_keyboard_navigation() {
+ $(document).keydown(function(objEvent) {
+ _keyboard_action(objEvent);
+ });
+ }
+
+ /**
+ * Disable the support to keyboard navigation
+ *
+ */
+ function _disable_keyboard_navigation() {
+ $(document).unbind();
+ }
+
+ /**
+ * Perform the keyboard actions
+ *
+ */
+ function _keyboard_action(objEvent) {
+ // To ie
+ if (objEvent == null) {
+ keycode = event.keyCode;
+ escapeKey = 27;
+ // To Mozilla
+ } else {
+ keycode = objEvent.keyCode;
+ escapeKey = objEvent.DOM_VK_ESCAPE;
+ }
+ // Get the key in lower case form
+ key = String.fromCharCode(keycode).toLowerCase();
+ // Verify the keys to close the ligthBox
+ if (( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey )) {
+ _finish();
+ }
+ // Verify the key to show the previous image
+ if (( key == settings.keyToPrev ) || ( keycode == 37 )) {
+ // If we�re not showing the first image, call the previous
+ if (settings.activeImage != 0) {
+ settings.activeImage = settings.activeImage - 1;
+ _set_image_to_view();
+ _disable_keyboard_navigation();
+ }
+ }
+ // Verify the key to show the next image
+ if (( key == settings.keyToNext ) || ( keycode == 39 )) {
+ // If we�re not showing the last image, call the next
+ if (settings.activeImage != ( settings.imageArray.length - 1 )) {
+ settings.activeImage = settings.activeImage + 1;
+ _set_image_to_view();
+ _disable_keyboard_navigation();
+ }
+ }
+ }
+
+ /**
+ * Preload prev and next images being showed
+ *
+ */
+ function _preload_neighbor_images() {
+ if ((settings.imageArray.length - 1) > settings.activeImage) {
+ objNext = new Image();
+ objNext.src = settings.imageArray[settings.activeImage + 1][0];
+ }
+ if (settings.activeImage > 0) {
+ objPrev = new Image();
+ objPrev.src = settings.imageArray[settings.activeImage - 1][0];
+ }
+ }
+
+ /**
+ * Remove jQuery lightBox plugin HTML markup
+ *
+ */
+ function _finish() {
+ $('#jquery-lightbox').remove();
+ $('#jquery-overlay').fadeOut(function() {
+ $('#jquery-overlay').remove();
+ });
+ // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
+ $('embed, object, select').css({ 'visibility' : 'visible' });
+ }
+
+ /**
+ / THIRD FUNCTION
+ * getPageSize() by quirksmode.com
+ *
+ * @return Array Return an array with page width, height and window width, height
+ */
+ function ___getPageSize() {
+ var xScroll, yScroll;
+ if (window.innerHeight && window.scrollMaxY) {
+ xScroll = window.innerWidth + window.scrollMaxX;
+ yScroll = window.innerHeight + window.scrollMaxY;
+ } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
+ xScroll = document.body.scrollWidth;
+ yScroll = document.body.scrollHeight;
+ } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
+ xScroll = document.body.offsetWidth;
+ yScroll = document.body.offsetHeight;
+ }
+ var windowWidth, windowHeight;
+ if (self.innerHeight) { // all except Explorer
+ if (document.documentElement.clientWidth) {
+ windowWidth = document.documentElement.clientWidth;
+ } else {
+ windowWidth = self.innerWidth;
+ }
+ windowHeight = self.innerHeight;
+ } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
+ windowWidth = document.documentElement.clientWidth;
+ windowHeight = document.documentElement.clientHeight;
+ } else if (document.body) { // other Explorers
+ windowWidth = document.body.clientWidth;
+ windowHeight = document.body.clientHeight;
+ }
+ // for small pages with total height less then height of the viewport
+ if (yScroll < windowHeight) {
+ pageHeight = windowHeight;
+ } else {
+ pageHeight = yScroll;
+ }
+ // for small pages with total width less then width of the viewport
+ if (xScroll < windowWidth) {
+ pageWidth = xScroll;
+ } else {
+ pageWidth = windowWidth;
+ }
+ arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight);
+ return arrayPageSize;
+ }
+
+ ;
+ /**
+ / THIRD FUNCTION
+ * getPageScroll() by quirksmode.com
+ *
+ * @return Array Return an array with x,y page scroll values.
+ */
+ function ___getPageScroll() {
+ var xScroll, yScroll;
+ if (self.pageYOffset) {
+ yScroll = self.pageYOffset;
+ xScroll = self.pageXOffset;
+ } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
+ yScroll = document.documentElement.scrollTop;
+ xScroll = document.documentElement.scrollLeft;
+ } else if (document.body) {// all other Explorers
+ yScroll = document.body.scrollTop;
+ xScroll = document.body.scrollLeft;
+ }
+ arrayPageScroll = new Array(xScroll, yScroll);
+ return arrayPageScroll;
+ }
+
+ ;
+ /**
+ * Stop the code execution from a escified time in milisecond
+ *
+ */
+ function ___pause(ms) {
+ var date = new Date();
+ curDate = null;
+ do {
+ var curDate = new Date();
+ }
+ while (curDate - date < ms);
+ }
+
+ ;
+ // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
+ return this.unbind('click').click(_initialize);
+ };
+})(jQuery); // Call and execute the function immediately passing the jQuery object
\ No newline at end of file
Added: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-blank.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-blank.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-btn-close.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-btn-close.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-btn-next.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-btn-next.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-btn-prev.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-btn-prev.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-ico-loading.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/lightbox-ico-loading.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/richfaces.lightbox.js
===================================================================
--- sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/richfaces.lightbox.js (rev 0)
+++ sandbox/trunk/ui/lightbox/ui/src/main/resources/META-INF/resources/richfaces.lightbox.js 2011-05-31 09:44:53 UTC (rev 22516)
@@ -0,0 +1,26 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+window.RichFaces = window.RichFaces || {};
+RichFaces.Lightbox = function(selector, options) {
+ jQuery(selector).lightBox(options);
+};
\ No newline at end of file
13 years, 7 months
JBoss Rich Faces SVN: r22515 - sandbox/trunk/ui.
by richfaces-svn-commits@lists.jboss.org
Author: blabno
Date: 2011-05-31 05:42:55 -0400 (Tue, 31 May 2011)
New Revision: 22515
Removed:
sandbox/trunk/ui/lightbox/
Log:
Migrated lightbox component to 4.X.
13 years, 7 months
JBoss Rich Faces SVN: r22514 - sandbox/trunk/ui.
by richfaces-svn-commits@lists.jboss.org
Author: blabno
Date: 2011-05-31 05:40:31 -0400 (Tue, 31 May 2011)
New Revision: 22514
Added:
sandbox/trunk/ui/lightbox/
Log:
Migrated lightbox component to 4.X.
13 years, 7 months
JBoss Rich Faces SVN: r22513 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-05-30 16:16:02 -0400 (Mon, 30 May 2011)
New Revision: 22513
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectWithJSR303.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectsWithJSR303.java
Log:
Add rich:select tests for JSR303 validation
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectWithJSR303.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectWithJSR303.java 2011-05-30 20:16:02 UTC (rev 22513)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richSelect;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.utils.URLUtils;
+import org.testng.annotations.Test;
+
+/**
+ * Test for page faces/components/richInplaceSelect/jsr303.xhtml
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public class TestSelectWithJSR303 extends TestSelectsWithJSR303 {
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richSelect/jsr303.xhtml");
+ }
+
+ @Test
+ public void testNotEmpty() {
+ verifyNotEmpty();
+ }
+
+ @Test
+ public void testRegExpPattern() {
+ verifyRegExpPattern();
+ }
+
+ @Test
+ public void testStringSize() {
+ verifyStringSize();
+ }
+
+ @Test
+ public void testCustomString() {
+ verifyCustomString();
+ }
+
+ @Test
+ public void testAllInputsWrong() {
+ verifyAllInputsWrong();
+ }
+
+ @Test
+ public void testAllInputsCorrect() {
+ verifyAllInputsCorrect();
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectsWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectsWithJSR303.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectsWithJSR303.java 2011-05-30 20:16:02 UTC (rev 22513)
@@ -0,0 +1,289 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richSelect;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+
+/**
+ * Test for component with JSF-303 validators
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public abstract class TestSelectsWithJSR303 extends AbstractMetamerTest {
+
+ private static final String WRONG_NOT_EMPTY = "";
+ private static final String NOT_EMPTY_VALIDATION_MSG = "may not be empty";
+ private static final String CORRECT_NOT_EMPTY = "Alaska";
+
+ private static final String WRONG_REG_EXP = "Alaska";
+ private static final String CORRECT_REG_EXP = "richfaces";
+ private static final String REGEXP_VALIDATION_MSG = "must match \"[a-z].*\"";
+
+
+ private static final String WRONG_STRING_SIZE = "richfaces";
+ private static final String CORRECT_STRING_SIZE = "Alaska";
+ private static final String STRING_SIZE_VALIDATION_MSG = "size must be between 3 and 6";
+
+ private static final String WRONG_CUSTOM_STRING = "richfaces";
+ private static final String CORRECT_CUSTOM_STRING = "RichFaces";
+ private static final String CUSTOM_STRING_VALIDATION_MSG = "string is not \"RichFaces\"";
+
+ private static final String NOT_EMPTY_ID = "input1";
+ private static final String REG_EXP_PATTERN_ID = "input2";
+ private static final String STRING_SIZE_ID = "input3";
+ private static final String CUSTOM_STRING_ID = "input4";
+
+ private static final String OUT_NOT_EMPTY_ID = "input1";
+ private static final String OUT_REG_EXP_PATTERN_ID = "input2";
+ private static final String OUT_STRING_SIZE_ID = "input3";
+ private static final String OUT_CUSTOM_STRING_ID = "input4";
+
+ private JQueryLocator selectFormat = jq("div[id$={0}Items]");
+
+ private JQueryLocator notEmptySelect = selectFormat.format(NOT_EMPTY_ID);
+ private JQueryLocator regExpPatternSelect = selectFormat.format(REG_EXP_PATTERN_ID);
+ private JQueryLocator stringSizeSelect = selectFormat.format(STRING_SIZE_ID);
+ private JQueryLocator customStringSelect = selectFormat.format(CUSTOM_STRING_ID);
+
+ private JQueryLocator option = jq("div.rf-sel-opt:contains({0})");
+ private JQueryLocator optionEmpty = jq("div.rf-sel-opt:eq(51)");
+
+ private JQueryLocator inputFormat = pjq("input[id$=:{0}Input]");
+
+ private JQueryLocator notEmptyInput = inputFormat.format(NOT_EMPTY_ID);
+ private JQueryLocator regExpPatternInput = inputFormat.format(REG_EXP_PATTERN_ID);
+ private JQueryLocator stringSizeInput = inputFormat.format(STRING_SIZE_ID);
+ private JQueryLocator customStringInput = inputFormat.format(CUSTOM_STRING_ID);
+
+ private JQueryLocator hCommandButton = pjq("input[id$=:hButton]");
+ private JQueryLocator a4jCommandButton = pjq("input[id$=:a4jButton]");
+
+ private JQueryLocator outputFormat = pjq("span[id$=:{0}]");
+
+ private JQueryLocator inputMsgFormat = pjq("span.rf-msg-err[id$=:{0}] > span.rf-msg-det");
+
+ private JQueryLocator input1Msg = inputMsgFormat.format(NOT_EMPTY_ID);
+ private JQueryLocator input2Msg = inputMsgFormat.format(REG_EXP_PATTERN_ID);
+ private JQueryLocator input3Msg = inputMsgFormat.format(STRING_SIZE_ID);
+ private JQueryLocator input4Msg = inputMsgFormat.format(CUSTOM_STRING_ID);
+
+ protected void verifyNotEmpty() {
+ setAllCorrect();
+
+ selenium.click(notEmptyInput);
+ selenium.click(notEmptySelect.getDescendant(optionEmpty));
+ selenium.fireEvent(notEmptyInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ selenium.click(a4jCommandButton);
+ waitAjax.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+
+ setAllCorrect();
+
+ selenium.click(notEmptyInput);
+ selenium.click(notEmptySelect.getDescendant(optionEmpty));
+ selenium.fireEvent(notEmptyInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ }
+
+ protected void verifyRegExpPattern() {
+ setAllCorrect();
+
+ selenium.click(regExpPatternInput);
+ selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
+ selenium.fireEvent(regExpPatternInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ selenium.click(a4jCommandButton);
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+
+ setAllCorrect();
+
+ selenium.click(regExpPatternInput);
+ selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
+ selenium.fireEvent(regExpPatternInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ }
+
+ protected void verifyStringSize() {
+ setAllCorrect();
+
+ selenium.click(stringSizeInput);
+ selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
+ selenium.fireEvent(stringSizeInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ selenium.click(a4jCommandButton);
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+
+ setAllCorrect();
+
+ selenium.click(stringSizeInput);
+ selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
+ selenium.fireEvent(stringSizeInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ }
+
+ protected void verifyCustomString() {
+ setAllCorrect();
+
+ selenium.click(customStringInput);
+ selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
+ selenium.fireEvent(customStringInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ selenium.click(a4jCommandButton);
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+
+ setAllCorrect();
+
+ selenium.click(customStringInput);
+ selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
+ selenium.fireEvent(customStringInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ }
+
+ protected void verifyAllInputsWrong() {
+ setAllCorrect();
+ setAllWrong();
+ selenium.click(a4jCommandButton);
+
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+
+ setAllCorrect();
+ setAllWrong();
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ }
+
+ protected void verifyAllInputsCorrect() {
+
+ // with full form submit
+
+ // set all to correct first is required to correct working function to set all wrong
+ setAllCorrect();
+ setAllWrong();
+ setAllCorrect();
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(outputFormat.format(OUT_NOT_EMPTY_ID))
+ .text(CORRECT_NOT_EMPTY));
+ waitGui.until(textEquals.locator(outputFormat.format(OUT_REG_EXP_PATTERN_ID))
+ .text(CORRECT_REG_EXP));
+ waitGui.until(textEquals.locator(outputFormat.format(OUT_STRING_SIZE_ID))
+ .text(CORRECT_STRING_SIZE));
+ waitGui.until(textEquals.locator(outputFormat.format(OUT_CUSTOM_STRING_ID))
+ .text(CORRECT_CUSTOM_STRING));
+
+ // with ajax form submit
+ setAllWrong();
+ setAllCorrect();
+ // no submit button click need, values in output fields are updated
+
+ waitGui.until(textEquals.locator(outputFormat.format(OUT_NOT_EMPTY_ID))
+ .text(CORRECT_NOT_EMPTY));
+ waitGui.until(textEquals.locator(outputFormat.format(OUT_REG_EXP_PATTERN_ID))
+ .text(CORRECT_REG_EXP));
+ waitGui.until(textEquals.locator(outputFormat.format(OUT_STRING_SIZE_ID))
+ .text(CORRECT_STRING_SIZE));
+ waitGui.until(textEquals.locator(outputFormat.format(OUT_CUSTOM_STRING_ID))
+ .text(CORRECT_CUSTOM_STRING));
+ }
+
+ private void setAllWrong() {
+
+ selenium.click(notEmptyInput);
+ selenium.click(notEmptySelect.getDescendant(optionEmpty));
+ waitGui.until(textEquals.locator(notEmptyInput).text(WRONG_NOT_EMPTY));
+ selenium.fireEvent(notEmptyInput, Event.BLUR);
+
+ selenium.click(regExpPatternInput);
+ selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
+ selenium.fireEvent(regExpPatternInput, Event.BLUR);
+
+ selenium.click(stringSizeInput);
+ selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
+ selenium.fireEvent(stringSizeInput, Event.BLUR);
+
+ selenium.click(customStringInput);
+ selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
+ selenium.fireEvent(customStringInput, Event.BLUR);
+
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+
+ }
+
+ private void setAllCorrect() {
+
+ selenium.click(notEmptySelect);
+ selenium.click(notEmptySelect.getDescendant(option.format(CORRECT_NOT_EMPTY)));
+ selenium.fireEvent(notEmptyInput, Event.BLUR);
+
+ selenium.click(regExpPatternInput);
+ selenium.click(regExpPatternSelect.getDescendant(option.format(CORRECT_REG_EXP)));
+ selenium.fireEvent(regExpPatternInput, Event.BLUR);
+
+ selenium.click(stringSizeInput);
+ selenium.click(stringSizeSelect.getDescendant(option.format(CORRECT_STRING_SIZE)));
+ selenium.fireEvent(stringSizeInput, Event.BLUR);
+
+ selenium.click(customStringInput);
+ selenium.click(customStringSelect.getDescendant(option.format(CORRECT_CUSTOM_STRING)));
+ selenium.fireEvent(customStringInput, Event.BLUR);
+
+ waitGui.until(attributePresent.locator(jq("input[id$=input4selValue]").getAttribute(new Attribute("value"))));
+ waitGui.until(attributeEquals.locator(jq("input[id$=input4selValue]").getAttribute(new Attribute("value")))
+ .text(CORRECT_CUSTOM_STRING));
+ }
+
+}
13 years, 7 months
JBoss Rich Faces SVN: r22512 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-05-30 15:22:13 -0400 (Mon, 30 May 2011)
New Revision: 22512
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestInplaceSelectWithJSR303.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestSelectsWithJSR303.java
Log:
Add selenium tests for rich:inplaceSelect JSR303 validator
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestInplaceSelectWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestInplaceSelectWithJSR303.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestInplaceSelectWithJSR303.java 2011-05-30 19:22:13 UTC (rev 22512)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richInplaceSelect;
+
+import java.net.URL;
+import org.jboss.test.selenium.utils.URLUtils;
+import org.testng.annotations.Test;
+
+/**
+ * Test for page faces/components/richInplaceSelect/jsr303.xhtml
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public class TestInplaceSelectWithJSR303 extends TestSelectsWithJSR303 {
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richInplaceSelect/jsr303.xhtml");
+ }
+
+ @Test
+ public void testNotEmpty() {
+ verifyNotEmpty();
+ }
+
+ @Test
+ public void testRegExpPattern() {
+ verifyRegExpPattern();
+ }
+
+ @Test
+ public void testStringSize() {
+ verifyStringSize();
+ }
+
+ @Test
+ public void testCustomString() {
+ verifyCustomString();
+ }
+
+ @Test
+ public void testRequired() {
+ verifyRequired();
+ }
+
+ @Test
+ public void testAllInputsWrong() {
+ verifyAllInputsWrong();
+ }
+
+ @Test
+ public void testAllInputsCorrect() {
+ verifyAllInputsCorrect();
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestSelectsWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestSelectsWithJSR303.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestSelectsWithJSR303.java 2011-05-30 19:22:13 UTC (rev 22512)
@@ -0,0 +1,334 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richInplaceSelect;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+
+/**
+ * Test for component with JSF-303 validators
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public abstract class TestSelectsWithJSR303 extends AbstractMetamerTest {
+
+ private static final String WRONG_NOT_EMPTY = "";
+ private static final String NOT_EMPTY_VALIDATION_MSG = "may not be empty";
+ private static final String CORRECT_NOT_EMPTY = "Alaska";
+
+ private static final String WRONG_REG_EXP = "Alaska";
+ private static final String CORRECT_REG_EXP = "richfaces";
+ private static final String REGEXP_VALIDATION_MSG = "must match \"[a-z].*\"";
+
+
+ private static final String WRONG_STRING_SIZE = "richfaces";
+ private static final String CORRECT_STRING_SIZE = "Alaska";
+ private static final String STRING_SIZE_VALIDATION_MSG = "size must be between 3 and 6";
+
+ private static final String WRONG_CUSTOM_STRING = "richfaces";
+ private static final String CORRECT_CUSTOM_STRING = "RichFaces";
+ private static final String CUSTOM_STRING_VALIDATION_MSG = "string is not \"RichFaces\"";
+
+ private static final String WRONG_REQUIRED_STRING = "";
+ private static final String CORRECT_REQUIRED_STRING = "richfaces";
+ private static final String REQUIRED_VALIDATION_MSG = "value is required";
+
+ private static final String NOT_EMPTY_ID = "input1";
+ private static final String REG_EXP_PATTERN_ID = "input2";
+ private static final String STRING_SIZE_ID = "input3";
+ private static final String CUSTOM_STRING_ID = "input4";
+ private static final String REQUIRED_ID = "input5";
+
+ private JQueryLocator selectFormat = jq("span[id$={0}Items]");
+
+ private JQueryLocator notEmptySelect = selectFormat.format(NOT_EMPTY_ID);
+ private JQueryLocator regExpPatternSelect = selectFormat.format(REG_EXP_PATTERN_ID);
+ private JQueryLocator stringSizeSelect = selectFormat.format(STRING_SIZE_ID);
+ private JQueryLocator customStringSelect = selectFormat.format(CUSTOM_STRING_ID);
+ private JQueryLocator requiredSelect = selectFormat.format(REQUIRED_ID);
+
+ private JQueryLocator option = jq("span.rf-is-opt:contains({0})");
+ private JQueryLocator optionEmpty = jq("span.rf-is-opt:eq(51)");
+
+ private JQueryLocator inputFormat = pjq("input[id$=:{0}Input]");
+
+ private JQueryLocator notEmptyInput = inputFormat.format(NOT_EMPTY_ID);
+ private JQueryLocator regExpPatternInput = inputFormat.format(REG_EXP_PATTERN_ID);
+ private JQueryLocator stringSizeInput = inputFormat.format(STRING_SIZE_ID);
+ private JQueryLocator customStringInput = inputFormat.format(CUSTOM_STRING_ID);
+ private JQueryLocator requiredInput = inputFormat.format(REQUIRED_ID);
+
+
+ private JQueryLocator hCommandButton = pjq("input[id$=:hButton]");
+ private JQueryLocator a4jCommandButton = pjq("input[id$=:a4jButton]");
+
+ private JQueryLocator outputFormat = pjq("span[id$=:{0}]");
+
+ private JQueryLocator inputMsgFormat = pjq("span.rf-msg-err[id$=:{0}] > span.rf-msg-det");
+
+ private JQueryLocator input1Msg = inputMsgFormat.format(NOT_EMPTY_ID);
+ private JQueryLocator input2Msg = inputMsgFormat.format(REG_EXP_PATTERN_ID);
+ private JQueryLocator input3Msg = inputMsgFormat.format(STRING_SIZE_ID);
+ private JQueryLocator input4Msg = inputMsgFormat.format(CUSTOM_STRING_ID);
+ private JQueryLocator input5Msg = inputMsgFormat.format(REQUIRED_ID);
+
+ protected void verifyNotEmpty() {
+ setAllCorrect();
+
+ selenium.click(notEmptyInput);
+ selenium.click(notEmptySelect.getDescendant(optionEmpty));
+ selenium.fireEvent(notEmptyInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ selenium.click(a4jCommandButton);
+ waitAjax.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+
+ setAllCorrect();
+
+ selenium.click(notEmptyInput);
+ selenium.click(notEmptySelect.getDescendant(optionEmpty));
+ selenium.fireEvent(notEmptyInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ }
+
+ protected void verifyRegExpPattern() {
+ setAllCorrect();
+
+ selenium.click(regExpPatternInput);
+ selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
+ selenium.fireEvent(regExpPatternInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ selenium.click(a4jCommandButton);
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+
+ setAllCorrect();
+
+ selenium.click(regExpPatternInput);
+ selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
+ selenium.fireEvent(regExpPatternInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ }
+
+ protected void verifyStringSize() {
+ setAllCorrect();
+
+ selenium.click(stringSizeInput);
+ selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
+ selenium.fireEvent(stringSizeInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ selenium.click(a4jCommandButton);
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+
+ setAllCorrect();
+
+ selenium.click(stringSizeInput);
+ selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
+ selenium.fireEvent(stringSizeInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ }
+
+ protected void verifyCustomString() {
+ setAllCorrect();
+
+ selenium.click(customStringInput);
+ selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
+ selenium.fireEvent(customStringInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ selenium.click(a4jCommandButton);
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+
+ setAllCorrect();
+
+ selenium.click(customStringInput);
+ selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
+ selenium.fireEvent(customStringInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ }
+
+ protected void verifyRequired() {
+ setAllCorrect();
+
+ selenium.click(requiredInput);
+ selenium.click(requiredSelect.getDescendant(optionEmpty));
+ selenium.fireEvent(requiredInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ // waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ selenium.click(a4jCommandButton);
+ waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+
+ setAllCorrect();
+
+ selenium.click(requiredInput);
+ selenium.click(requiredSelect.getDescendant(optionEmpty));
+ selenium.fireEvent(requiredInput, Event.BLUR);
+ // give selenium time set new value to appropriate field before submit
+ waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+ waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+
+ }
+
+ protected void verifyAllInputsWrong() {
+ setAllCorrect();
+ setAllWrong();
+ selenium.click(a4jCommandButton);
+
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+
+ setAllCorrect();
+ setAllWrong();
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ }
+
+ protected void verifyAllInputsCorrect() {
+
+ // with full form submit
+
+ // set all to correct first is required to correct working function to set all wrong
+ setAllCorrect();
+ setAllWrong();
+ setAllCorrect();
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(outputFormat.format(NOT_EMPTY_ID))
+ .text(CORRECT_NOT_EMPTY));
+ waitGui.until(textEquals.locator(outputFormat.format(REG_EXP_PATTERN_ID))
+ .text(CORRECT_REG_EXP));
+ waitGui.until(textEquals.locator(outputFormat.format(STRING_SIZE_ID))
+ .text(CORRECT_STRING_SIZE));
+ waitGui.until(textEquals.locator(outputFormat.format(CUSTOM_STRING_ID))
+ .text(CORRECT_CUSTOM_STRING));
+ waitGui.until(textEquals.locator(outputFormat.format(REQUIRED_ID))
+ .text(CORRECT_REQUIRED_STRING));
+
+ // with ajax form submit
+ setAllWrong();
+ setAllCorrect();
+ // no submit button click need, values in output fields are updated
+
+ waitGui.until(textEquals.locator(outputFormat.format(NOT_EMPTY_ID))
+ .text(CORRECT_NOT_EMPTY));
+ waitGui.until(textEquals.locator(outputFormat.format(REG_EXP_PATTERN_ID))
+ .text(CORRECT_REG_EXP));
+ waitGui.until(textEquals.locator(outputFormat.format(STRING_SIZE_ID))
+ .text(CORRECT_STRING_SIZE));
+ waitGui.until(textEquals.locator(outputFormat.format(CUSTOM_STRING_ID))
+ .text(CORRECT_CUSTOM_STRING));
+ waitGui.until(textEquals.locator(outputFormat.format(REQUIRED_ID))
+ .text(CORRECT_REQUIRED_STRING));
+ }
+
+ private void setAllWrong() {
+
+ selenium.click(notEmptyInput);
+ selenium.click(notEmptySelect.getDescendant(optionEmpty));
+ waitGui.until(textEquals.locator(notEmptyInput).text(WRONG_NOT_EMPTY));
+ selenium.fireEvent(notEmptyInput, Event.BLUR);
+
+ selenium.click(regExpPatternInput);
+ selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
+ selenium.fireEvent(regExpPatternInput, Event.BLUR);
+
+ selenium.click(stringSizeInput);
+ selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
+ selenium.fireEvent(stringSizeInput, Event.BLUR);
+
+ selenium.click(customStringInput);
+ selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
+ selenium.fireEvent(customStringInput, Event.BLUR);
+
+ selenium.click(requiredInput);
+ selenium.click(requiredSelect.getDescendant(optionEmpty));
+ selenium.fireEvent(requiredInput, Event.BLUR);
+
+ waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+
+ }
+
+ private void setAllCorrect() {
+
+ // selenium.click(notEmptySelect);
+ selenium.click(notEmptySelect.getDescendant(option.format(CORRECT_NOT_EMPTY)));
+ selenium.fireEvent(notEmptyInput, Event.BLUR);
+
+ // selenium.click(regExpPatternInput);
+ selenium.click(regExpPatternSelect.getDescendant(option.format(CORRECT_REG_EXP)));
+ selenium.fireEvent(regExpPatternInput, Event.BLUR);
+
+ // selenium.click(stringSizeInput);
+ selenium.click(stringSizeSelect.getDescendant(option.format(CORRECT_STRING_SIZE)));
+ selenium.fireEvent(stringSizeInput, Event.BLUR);
+
+ // selenium.click(customStringInput);
+ selenium.click(customStringSelect.getDescendant(option.format(CORRECT_CUSTOM_STRING)));
+ selenium.fireEvent(customStringInput, Event.BLUR);
+
+ // selenium.click(reguiredInput);
+ selenium.click(requiredSelect.getDescendant(option.format(CORRECT_REQUIRED_STRING)));
+ selenium.fireEvent(requiredInput, Event.BLUR);
+
+ waitGui.until(attributePresent.locator(jq("input[id$=input5selValue]").getAttribute(new Attribute("value"))));
+ waitGui.until(attributeEquals.locator(jq("input[id$=input5selValue]").getAttribute(new Attribute("value")))
+ .text(CORRECT_REQUIRED_STRING));
+
+ // System.out.println(" leaving setAllCorrect()");
+
+ }
+
+}
13 years, 7 months
JBoss Rich Faces SVN: r22511 - modules/build.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-05-25 11:00:17 -0400 (Wed, 25 May 2011)
New Revision: 22511
Removed:
modules/build/test
Log:
removing locking test - did not work for this repo
Deleted: modules/build/test
===================================================================
13 years, 7 months
JBoss Rich Faces SVN: r22510 - modules/build.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-05-25 10:57:17 -0400 (Wed, 25 May 2011)
New Revision: 22510
Added:
modules/build/test
Log:
Testing a lock
Added: modules/build/test
===================================================================
13 years, 7 months
JBoss Rich Faces SVN: r22509 - modules/build.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-05-25 10:56:46 -0400 (Wed, 25 May 2011)
New Revision: 22509
Modified:
modules/build/
Log:
Locking /modules/build directory - Project development has moved to GitHub, visit https://github.com/richfaces
Property changes on: modules/build
___________________________________________________________________
Added: lock
+ Project development has moved to GitHub, visit https://github.com/richfaces
13 years, 7 months
JBoss Rich Faces SVN: r22508 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richInplaceInput and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-05-24 08:48:35 -0400 (Tue, 24 May 2011)
New Revision: 22508
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteWithJSR303.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestComponentWithJSR303.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestInplaceInputWithJSR303.java
Log:
RFPL-1421: add selenium tests for autocomplete a inplaceInput
Cover JSR-303 validations for autocomplete and inplaceInput components
by selenium tests
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteWithJSR303.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteWithJSR303.java 2011-05-24 12:48:35 UTC (rev 22508)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richAutocomplete;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.utils.URLUtils;
+import org.testng.annotations.Test;
+
+/**
+ * Test for page faces/components/richAutocomplete/jsr303.xhtml
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public class TestAutocompleteWithJSR303 extends TestComponentWithJSR303 {
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richAutocomplete/jsr303.xhtml");
+ }
+
+ @Test
+ public void testNotEmpty() {
+ verifyNotEmpty();
+ }
+
+ @Test
+ public void testRegExpPattern() {
+ verifyRegExpPattern();
+ }
+
+ @Test
+ public void testStringSize() {
+ verifyStringSize();
+ }
+
+ @Test
+ public void testCustomString() {
+ verifyCustomString();
+ }
+
+ @Test
+ public void testAllInputsWrong() {
+ verifyAllInputsWrong();
+ }
+
+ @Test
+ public void testAllInputsCorrect() {
+ verifyAllInputsCorrect();
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestComponentWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestComponentWithJSR303.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestComponentWithJSR303.java 2011-05-24 12:48:35 UTC (rev 22508)
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richAutocomplete;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+
+/**
+ * Test for component with JSF-303 validators
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public abstract class TestComponentWithJSR303 extends AbstractMetamerTest {
+
+ private static final String NOT_EMPTY_VALIDATION_MSG = "may not be empty";
+ private static final String CORRECT_NOT_EMPTY = "xyz";
+
+ private static final String WRONG_REG_EXP = "1a^";
+ private static final String CORRECT_REG_EXP = "a2^E";
+ private static final String REGEXP_VALIDATION_MSG = "must match \"[a-z].*\"";
+
+
+ private static final String WRONG_STRING_SIZE = "x";
+ private static final String CORRECT_STRING_SIZE = "abc3";
+ private static final String STRING_SIZE_VALIDATION_MSG = "size must be between 3 and 6";
+
+ private static final String WRONG_CUSTOM_STRING = "rich faces";
+ private static final String CORRECT_CUSTOM_STRING = "RichFaces";
+ private static final String CUSTOM_STRING_VALIDATION_MSG = "string is not \"RichFaces\"";
+
+ private JQueryLocator notEmptyInput = pjq("input[id$=:input1Input]");
+ private JQueryLocator regExpPatternInput = pjq("input[id$=:input2Input]");
+ private JQueryLocator stringSizeInput = pjq("input[id$=:input3Input]");
+ private JQueryLocator customStringInput = pjq("input[id$=:input4Input]");
+
+ private JQueryLocator hCommandButton = pjq("input[id$=:hButton]");
+ private JQueryLocator a4jCommandButton = pjq("input[id$=:a4jButton]");
+
+ private JQueryLocator output1 = pjq("span[id$=:output1]");
+ private JQueryLocator output2 = pjq("span[id$=:output2]");
+ private JQueryLocator output3 = pjq("span[id$=:output3]");
+ private JQueryLocator output4 = pjq("span[id$=:output4]");
+
+ private JQueryLocator input1Msg = pjq("span.rf-msg-err[id$=:input1]");
+ private JQueryLocator input2Msg = pjq("span.rf-msg-err[id$=:input2]");
+ private JQueryLocator input3Msg = pjq("span.rf-msg-err[id$=:input3]");
+ private JQueryLocator input4Msg = pjq("span.rf-msg-err[id$=:input4]");
+
+ protected void verifyNotEmpty() {
+ setAllCorrect(false);
+ selenium.type(notEmptyInput, "");
+ selenium.click(a4jCommandButton);
+
+ waitGui.until(textEquals.locator(input1Msg.getChild(jq("span.rf-msg-det"))).text(NOT_EMPTY_VALIDATION_MSG));
+
+ setAllCorrect(false);
+ selenium.type(notEmptyInput, "");
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(input1Msg.getChild(jq("span.rf-msg-det"))).text(NOT_EMPTY_VALIDATION_MSG));
+ }
+
+ protected void verifyRegExpPattern() {
+
+ setAllCorrect(false);
+ selenium.type(regExpPatternInput, WRONG_REG_EXP);
+ selenium.click(a4jCommandButton);
+
+ waitGui.until(textEquals.locator(input2Msg.getChild(jq("span.rf-msg-det"))).text(REGEXP_VALIDATION_MSG));
+
+ setAllCorrect(false);
+ selenium.type(regExpPatternInput, WRONG_REG_EXP);
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(input2Msg.getChild(jq("span.rf-msg-det"))).text(REGEXP_VALIDATION_MSG));
+ }
+
+ protected void verifyStringSize() {
+ setAllCorrect(false);
+ selenium.type(stringSizeInput, WRONG_STRING_SIZE);
+ selenium.click(a4jCommandButton);
+
+ waitGui.until(textEquals.locator(input3Msg.getChild(jq("span.rf-msg-det"))).text(STRING_SIZE_VALIDATION_MSG));
+
+ setAllCorrect(false);
+ selenium.type(stringSizeInput, WRONG_STRING_SIZE);
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(input3Msg.getChild(jq("span.rf-msg-det"))).text(STRING_SIZE_VALIDATION_MSG));
+ }
+
+ protected void verifyCustomString() {
+ setAllCorrect(false);
+ selenium.type(customStringInput, WRONG_CUSTOM_STRING);
+ selenium.click(a4jCommandButton);
+
+ waitGui.until(textEquals.locator(input4Msg.getChild(jq("span.rf-msg-det"))).text(CUSTOM_STRING_VALIDATION_MSG));
+
+ setAllCorrect(false);
+ selenium.type(customStringInput, WRONG_CUSTOM_STRING);
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(input4Msg.getChild(jq("span.rf-msg-det"))).text(CUSTOM_STRING_VALIDATION_MSG));
+ }
+
+ protected void verifyAllInputsWrong() {
+ setAllWrong(false);
+ selenium.click(a4jCommandButton);
+
+ waitGui.until(textEquals.locator(input1Msg.getChild(jq("span.rf-msg-det"))).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input2Msg.getChild(jq("span.rf-msg-det"))).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input3Msg.getChild(jq("span.rf-msg-det"))).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input4Msg.getChild(jq("span.rf-msg-det"))).text(CUSTOM_STRING_VALIDATION_MSG));
+
+ setAllCorrect(false);
+ setAllWrong(false);
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(input1Msg.getChild(jq("span.rf-msg-det"))).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input2Msg.getChild(jq("span.rf-msg-det"))).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input3Msg.getChild(jq("span.rf-msg-det"))).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(textEquals.locator(input4Msg.getChild(jq("span.rf-msg-det"))).text(CUSTOM_STRING_VALIDATION_MSG));
+
+ }
+
+ protected void verifyAllInputsCorrect() {
+
+ // with full form submit
+ setAllWrong(true);
+ setAllCorrect(false);
+ selenium.click(hCommandButton);
+ selenium.waitForPageToLoad();
+
+ waitGui.until(textEquals.locator(output1).text(CORRECT_NOT_EMPTY));
+ waitGui.until(textEquals.locator(output2).text(CORRECT_REG_EXP));
+ waitGui.until(textEquals.locator(output3).text(CORRECT_STRING_SIZE));
+ waitGui.until(textEquals.locator(output4).text(CORRECT_CUSTOM_STRING));
+
+ // with ajax (no need click a4j:commandButton)
+ setAllWrong(true);
+ setAllCorrect(true);
+
+ waitGui.until(textEquals.locator(output1).text(CORRECT_NOT_EMPTY));
+ waitGui.until(textEquals.locator(output2).text(CORRECT_REG_EXP));
+ waitGui.until(textEquals.locator(output3).text(CORRECT_STRING_SIZE));
+ waitGui.until(textEquals.locator(output4).text(CORRECT_CUSTOM_STRING));
+ }
+
+ private void setAllWrong(boolean withBlur) {
+ selenium.type(notEmptyInput, "");
+ if (withBlur) { selenium.fireEvent(notEmptyInput, Event.BLUR); }
+
+ selenium.type(regExpPatternInput, WRONG_REG_EXP);
+ if (withBlur) { selenium.fireEvent(regExpPatternInput, Event.BLUR); }
+
+ selenium.type(stringSizeInput, WRONG_STRING_SIZE);
+ if (withBlur) { selenium.fireEvent(stringSizeInput, Event.BLUR); }
+
+ selenium.type(customStringInput, WRONG_CUSTOM_STRING);
+ if (withBlur) { selenium.fireEvent(customStringInput, Event.BLUR); }
+ }
+
+ private void setAllCorrect(boolean withBlur) {
+ selenium.type(notEmptyInput, CORRECT_NOT_EMPTY);
+ if (withBlur) { selenium.fireEvent(notEmptyInput, Event.BLUR); }
+
+ selenium.type(regExpPatternInput, CORRECT_REG_EXP);
+ if (withBlur) { selenium.fireEvent(regExpPatternInput, Event.BLUR); }
+
+ selenium.type(stringSizeInput, CORRECT_STRING_SIZE);
+ if (withBlur) { selenium.fireEvent(stringSizeInput, Event.BLUR); }
+
+ selenium.type(customStringInput, CORRECT_CUSTOM_STRING);
+ if (withBlur) { selenium.fireEvent(customStringInput, Event.BLUR); }
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestInplaceInputWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestInplaceInputWithJSR303.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestInplaceInputWithJSR303.java 2011-05-24 12:48:35 UTC (rev 22508)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richInplaceInput;
+
+import java.net.URL;
+import org.richfaces.tests.metamer.ftest.richAutocomplete.TestComponentWithJSR303;
+import org.jboss.test.selenium.utils.URLUtils;
+import org.testng.annotations.Test;
+
+/**
+ * Test for page faces/components/richInplaceInput/jsr303.xhtml
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public class TestInplaceInputWithJSR303 extends TestComponentWithJSR303 {
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richInplaceInput/jsr303.xhtml");
+ }
+
+ @Test
+ public void testNotEmpty() {
+ verifyNotEmpty();
+ }
+
+ @Test
+ public void testRegExpPattern() {
+ verifyRegExpPattern();
+ }
+
+ @Test
+ public void testStringSize() {
+ verifyStringSize();
+ }
+
+ @Test
+ public void testCustomString() {
+ verifyCustomString();
+ }
+
+ @Test
+ public void testAllInputsWrong() {
+ verifyAllInputsWrong();
+ }
+
+ @Test
+ public void testAllInputsCorrect() {
+ verifyAllInputsCorrect();
+ }
+
+}
13 years, 7 months