JBoss Rich Faces SVN: r8938 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-06 14:33:48 -0400 (Fri, 06 Jun 2008)
New Revision: 8938
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
pom for auto-tests updated
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-06-06 18:13:27 UTC (rev 8937)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-06-06 18:33:48 UTC (rev 8938)
@@ -100,11 +100,44 @@
<configuration>
<!-- Skip the normal tests, we'll run them in the integration-test phase -->
<skip>true</skip>
- <suiteXmlFiles>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng.xml
- </suiteXmlFile>
- </suiteXmlFiles>
+ <suiteXmlFiles>
+ <!--suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_tidy.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_neko.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ </suiteXmlFile-->
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_neko.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
</configuration>
<executions>
<execution>
@@ -115,7 +148,7 @@
<configuration>
<skip>false</skip>
<suiteXmlFiles>
- <suiteXmlFile>
+ <!--suiteXmlFile>
${project.build.directory}/test-classes/testng/testng_all_all_none.xml
</suiteXmlFile>
<suiteXmlFile>
@@ -147,9 +180,9 @@
</suiteXmlFile>
<suiteXmlFile>
${project.build.directory}/test-classes/testng/testng_default_default_none.xml
- </suiteXmlFile>
+ </suiteXmlFile-->
<suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ ${project.build.directory}/test-classes/testng/testng_default_default_neko.xml
</suiteXmlFile>
</suiteXmlFiles>
</configuration>
@@ -246,8 +279,15 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.1</version>
+ <version>5.8</version>
<scope>test</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <scope>test</scope>
<classifier>jdk15</classifier>
</dependency>
<dependency>
16 years, 4 months
JBoss Rich Faces SVN: r8937 - branches/3.1.x/test-applications/jsp/src/main/webapp/pages/Rich.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2008-06-06 14:13:27 -0400 (Fri, 06 Jun 2008)
New Revision: 8937
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/pages/Rich/Rich.jsp
Log:
Modified: branches/3.1.x/test-applications/jsp/src/main/webapp/pages/Rich/Rich.jsp
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/webapp/pages/Rich/Rich.jsp 2008-06-06 17:01:13 UTC (rev 8936)
+++ branches/3.1.x/test-applications/jsp/src/main/webapp/pages/Rich/Rich.jsp 2008-06-06 18:13:27 UTC (rev 8937)
@@ -26,9 +26,9 @@
href="<%=request.getContextPath()%>/styles/styles.css" type="text/css" />
</head>
<body>
- <div id="divOpthID" align="right" style="z-index: 200"><jsp:include
- page="/pages/RichMenu/RichMenu.jsp" /></div>
- <h:form id="formID">
+ <h:form id="formID">
+ <div id="divOpthID" align="right" style="z-index: 200"><jsp:include
+ page="/pages/RichMenu/RichMenu.jsp" /></div>
<h:panelGrid id="richGridID" columns="1">
<h:column rendered="#{richBean.reComponent}">
<jsp:include page="${richBean.pathComponent}" />
16 years, 4 months
JBoss Rich Faces SVN: r8936 - branches/3.1.x.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-06 13:01:13 -0400 (Fri, 06 Jun 2008)
New Revision: 8936
Modified:
branches/3.1.x/deployRelease.sh
Log:
http://jira.jboss.com/jira/browse/RF-3655
Modified: branches/3.1.x/deployRelease.sh
===================================================================
--- branches/3.1.x/deployRelease.sh 2008-06-06 17:00:11 UTC (rev 8935)
+++ branches/3.1.x/deployRelease.sh 2008-06-06 17:01:13 UTC (rev 8936)
@@ -1,20 +1,20 @@
PROJECT_DIR=`pwd`
-mvn -s ~/.m2t/settings.xml -P local,release deploy -N
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy -N
cd $PROJECT_DIR/cdk
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/framework
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/ui
-mvn -s ~/.m2t/settings.xml -P local,release deploy -N
-mvn -s ~/.m2t/settings.xml -P local,release install
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy -N
+mvn -s ~/.m2t/settings.xml -P local,release clean install
cd $PROJECT_DIR/docs
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/ui/assembly
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/extensions
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/samples
-mvn -s ~/.m2t/settings.xml -P local,release deploy -N
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy -N
cd $PROJECT_DIR/samples/richfaces-demo
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
16 years, 4 months
JBoss Rich Faces SVN: r8935 - trunk.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-06 13:00:11 -0400 (Fri, 06 Jun 2008)
New Revision: 8935
Modified:
trunk/deployRelease.sh
Log:
http://jira.jboss.com/jira/browse/RF-3655
Modified: trunk/deployRelease.sh
===================================================================
--- trunk/deployRelease.sh 2008-06-06 16:40:17 UTC (rev 8934)
+++ trunk/deployRelease.sh 2008-06-06 17:00:11 UTC (rev 8935)
@@ -1,22 +1,22 @@
PROJECT_DIR=`pwd`
-mvn -s ~/.m2t/settings.xml -P local,release deploy -N
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy -N
cd $PROJECT_DIR/cdk
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/framework
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/ui
-mvn -s ~/.m2t/settings.xml -P local,release deploy -N
-mvn -s ~/.m2t/settings.xml -P local,release install
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy -N
+mvn -s ~/.m2t/settings.xml -P local,release clean install
cd $PROJECT_DIR/docs
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/ui/assembly
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/extensions
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/samples
-mvn -s ~/.m2t/settings.xml -P local,release deploy -N
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy -N
cd $PROJECT_DIR/samples/laguna
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
cd $PROJECT_DIR/samples/richfaces-demo
-mvn -s ~/.m2t/settings.xml -P local,release deploy
+mvn -s ~/.m2t/settings.xml -P local,release clean deploy
16 years, 4 months
JBoss Rich Faces SVN: r8934 - trunk/ui/dataTable/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-06-06 12:40:17 -0400 (Fri, 06 Jun 2008)
New Revision: 8934
Added:
trunk/ui/dataTable/src/main/java/org/richfaces/component/DataTableViewPhaseListener.java
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
Log:
RF-2815
Added: trunk/ui/dataTable/src/main/java/org/richfaces/component/DataTableViewPhaseListener.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/DataTableViewPhaseListener.java (rev 0)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/DataTableViewPhaseListener.java 2008-06-06 16:40:17 UTC (rev 8934)
@@ -0,0 +1,45 @@
+package org.richfaces.component;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+
+public class DataTableViewPhaseListener implements PhaseListener {
+
+ private static final long serialVersionUID = 4321239328240647676L;
+
+ public void afterPhase(PhaseEvent event) {
+ }
+
+ private void resetDataModel(UIComponent component) {
+ if (component.isRendered()) {
+ if (component instanceof UIDataTable) {
+ ((UIDataTable) component).resetDataModel();
+ }
+ Iterator<UIComponent> children = component.getFacetsAndChildren();
+ while (children.hasNext()) {
+ resetDataModel(children.next());
+ }
+ }
+
+ }
+
+ public void beforePhase(PhaseEvent event) {
+ FacesContext facesContext = event.getFacesContext();
+ UIViewRoot viewRoot = facesContext.getViewRoot();
+ if (viewRoot != null) {
+ resetDataModel(viewRoot);
+ }
+ }
+
+ public PhaseId getPhaseId() {
+ return PhaseId.RENDER_RESPONSE;
+ }
+
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-06-06 16:23:40 UTC (rev 8933)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-06-06 16:40:17 UTC (rev 8934)
@@ -83,8 +83,13 @@
public static final String COMPONENT_TYPE = "org.richfaces.DataTable";
public static final String COMPONENT_FAMILY = "org.richfaces.DataTable";
-
+
@Override
+ protected void resetDataModel() {
+ super.resetDataModel();
+ }
+
+ @Override
protected ExtendedDataModel createDataModel() {
List<FilterField> filterFields = new LinkedList<FilterField>();
Map<String, SortField2> sortFieldsMap = new LinkedHashMap<String, SortField2>();
16 years, 4 months
JBoss Rich Faces SVN: r8933 - trunk/framework/impl/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-06-06 12:23:40 -0400 (Fri, 06 Jun 2008)
New Revision: 8933
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java
Log:
RF-3012
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java 2008-06-06 14:04:42 UTC (rev 8932)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java 2008-06-06 16:23:40 UTC (rev 8933)
@@ -109,7 +109,7 @@
Object argument) throws IOException {
final SequenceRange seqRange = (SequenceRange) range;
int rows = seqRange.getRows();
- int rowCount = rowKeys !=null ? rowKeys.size() : -1;
+ int rowCount = getRowCount();
int currentRow = seqRange.getFirstRow();
if(rows > 0){
rows += currentRow;
@@ -118,7 +118,7 @@
rows = rowCount;
}
for (; currentRow < rows; currentRow++) {
- visitor.process(context, rowKeys.get(currentRow), argument);
+ visitor.process(context, currentRow, argument);
}
}
16 years, 4 months
JBoss Rich Faces SVN: r8932 - in trunk/test-applications/qa/Test Reports: 3.1.5 and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-06-06 10:04:42 -0400 (Fri, 06 Jun 2008)
New Revision: 8932
Added:
trunk/test-applications/qa/Test Reports/3.1.5/
trunk/test-applications/qa/Test Reports/3.1.5/DailyReportCR1tkuprevich.xls
trunk/test-applications/qa/Test Reports/3.2.1/DailyReportCR6ayanul.xls
trunk/test-applications/qa/Test Reports/3.2.1/DailyReportCR6mvitenkov.xls
trunk/test-applications/qa/Test Reports/3.2.1/DailyReportCR8tkuprevich.xls
Log:
Added: trunk/test-applications/qa/Test Reports/3.1.5/DailyReportCR1tkuprevich.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.1.5/DailyReportCR1tkuprevich.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/qa/Test Reports/3.2.1/DailyReportCR6ayanul.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.2.1/DailyReportCR6ayanul.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/qa/Test Reports/3.2.1/DailyReportCR6mvitenkov.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.2.1/DailyReportCR6mvitenkov.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/qa/Test Reports/3.2.1/DailyReportCR8tkuprevich.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.2.1/DailyReportCR8tkuprevich.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 4 months
JBoss Rich Faces SVN: r8931 - branches/3.1.x/test-applications/jsp/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2008-06-06 08:18:09 -0400 (Fri, 06 Jun 2008)
New Revision: 8931
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
Log:
Modified: branches/3.1.x/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-06-06 11:15:48 UTC (rev 8930)
+++ branches/3.1.x/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-06-06 12:18:09 UTC (rev 8931)
@@ -44,9 +44,6 @@
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
- <listener>
- <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
- </listener>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
16 years, 4 months
JBoss Rich Faces SVN: r8930 - trunk/test-applications/seleniumTest/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-06-06 07:15:48 -0400 (Fri, 06 Jun 2008)
New Revision: 8930
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBaseNew.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java
Log:
selenium tests functionality
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBaseNew.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBaseNew.java 2008-06-06 10:58:26 UTC (rev 8929)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBaseNew.java 2008-06-06 11:15:48 UTC (rev 8930)
@@ -23,6 +23,7 @@
import org.ajax4jsf.bean.Configurator;
import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.template.Template;
import org.openqa.selenium.server.SeleniumServer;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java 2008-06-06 10:58:26 UTC (rev 8929)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java 2008-06-06 11:15:48 UTC (rev 8930)
@@ -4,7 +4,7 @@
-public class Templates implements Template {
+public class Templates {
private String template = null;
@@ -18,6 +18,10 @@
public static Templates MODALPANEL = new Templates("modalPanel");
+ public static final String COMPONENT_PREFIX_INSIDE_TABLE = "_Selenium_Test_DataTable:0:";
+
+ public static final String COMPONENT_PREFIX_SIMPLE = "";
+
private void setParentId(SeleniumTestBase test) {
if ("dataTable".equals(template)) {
test.setParentId(COMPONENT_PREFIX_INSIDE_TABLE);
16 years, 4 months
JBoss Rich Faces SVN: r8929 - in trunk/test-applications/seleniumTest: src/main/java/org/ajax4jsf/bean and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-06-06 06:58:26 -0400 (Fri, 06 Jun 2008)
New Revision: 8929
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Configurator.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBaseNew.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java
trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_neko.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_none.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_tidy.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_neko.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_none.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_tidy.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_neko.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_none.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_tidy.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_neko.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_none.xml
trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_tidy.xml
Removed:
trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml
Modified:
trunk/test-applications/seleniumTest/pom.xml
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/web.xml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
Log:
selenium tests functionality
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-06-06 10:14:53 UTC (rev 8928)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -74,8 +74,9 @@
</cargo.servlet.port>
</properties>
</configuration>
- </configuration>
- <executions>
+ </configuration>
+ <executions>
+ <!--
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
@@ -89,7 +90,8 @@
<goals>
<goal>stop</goal>
</goals>
- </execution>
+ </execution>
+ -->
</executions>
</plugin>
<plugin>
@@ -113,8 +115,41 @@
<configuration>
<skip>false</skip>
<suiteXmlFiles>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng.xml
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_tidy.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_neko.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
</suiteXmlFile>
</suiteXmlFiles>
</configuration>
@@ -144,7 +179,8 @@
<goals>
<goal>xvfb</goal>
</goals>
- </execution>
+ </execution>
+
<execution>
<phase>pre-integration-test</phase>
<goals>
@@ -180,7 +216,8 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>1.0-beta-2</version>
- <executions>
+ <executions>
+ <!--
<execution>
<phase>pre-integration-test</phase>
<goals>
@@ -190,7 +227,8 @@
<background>true</background>
<debug>false</debug>
</configuration>
- </execution>
+ </execution>
+ -->
</executions>
</plugin>
</plugins>
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Configurator.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Configurator.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Configurator.java 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,51 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.bean;
+
+public class Configurator {
+
+ private static final String[] LOAD_STRATEGIES = new String[] {"DEFAULT", "ALL"};
+
+ private static String loadScriptStrategy = LOAD_STRATEGIES[0];
+
+ private static String loadStyleStrategy = LOAD_STRATEGIES[0];
+
+ private static int currentStrategyIndex = 0;
+
+ public Configurator() {}
+
+ public String getLoadScriptStrategy() {
+ return loadScriptStrategy;
+ }
+
+ public static void setLoadScriptStrategy(String strategy) {
+ loadScriptStrategy = strategy;
+ }
+
+ public String getLoadStyleStrategy() {
+ return loadStyleStrategy;
+ }
+
+ public static void setLoadStyleStrategy(String strategy) {
+ loadStyleStrategy = strategy;
+ }
+
+}
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-06-06 10:14:53 UTC (rev 8928)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -10,6 +10,12 @@
</application>
<managed-bean>
+ <managed-bean-name>configurator</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.Configurator</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
<managed-bean-name>indexBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.IndexBean</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/web.xml 2008-06-06 10:14:53 UTC (rev 8928)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/web.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -37,22 +37,28 @@
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>false</param-value>
</context-param>
- <!-- context-param>
+ <context-param>
<param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
<param-value>NONE,TIDY,NEKO</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.xmlparser.TIDY</param-name>
<param-value>
- /pages/*
+ /faces/TIDY/*
</param-value>
</context-param>
- <context-param>
- <param-name>org.ajax4jsf.xmlparser.NONE</param-name>
- <param-value>
- /pages/layout.xhtml
- </param-value>
- </context-param-->
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.NEKO</param-name>
+ <param-value>
+ /faces/NEKO/*
+ </param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.NONE</param-name>
+ <param-value>
+ /faces/NONE/*
+ </param-value>
+ </context-param>
<!--
<context-param>
<param-name>org.ajax4jsf.SKIN</param-name>
@@ -61,11 +67,11 @@
-->
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
- <param-value>DEFAULT</param-value>
+ <param-value>#{configurator.loadStyleStrategy}</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
- <param-value>DEFAULT</param-value>
+ <param-value>#{configurator.loadScriptStrategy}</param-value>
</context-param>
<!--
-->
@@ -91,10 +97,12 @@
<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>/faces/NEKO/*</url-pattern>
+ <url-pattern>/faces/TIDY/*</url-pattern>
+ <url-pattern>/faces/NONE/*</url-pattern>
+ </servlet-mapping>
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>/faces/error.xhtml</location>
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBaseNew.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBaseNew.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBaseNew.java 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,695 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.ajax4jsf.bean.Configurator;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.openqa.selenium.server.SeleniumServer;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Parameters;
+
+import com.thoughtworks.selenium.DefaultSelenium;
+
+/**
+ * The base java class for selenium tests implementation.
+ *
+ * @author Andrey Markavtsov
+ *
+ */
+public abstract class SeleniumTestBaseNew {
+
+ /** Specifies the time to wait for page rendering */
+ private static final Integer pageRenderTime = 5000;
+
+ /** Specifies the time to wait for ajax processing */
+ protected static final int ajaxCompletionTime = 3000;
+
+ protected static final String serverPort = "8085";
+
+ private static final String WINDOW_JS_RESOLVER = "selenium.browserbot.getCurrentWindow().";
+
+ private static String filterPrefix;
+
+ private static String hostUrl;
+
+ private static String testUrl;
+
+ /** Parent component id */
+ private String parentId;
+
+ /** The default selenium instance */
+ public static DefaultSelenium selenium;
+
+ /** Host */
+ public static String host;
+
+ /** Port */
+ public static String port;
+
+ /** Protocol */
+ public static String protocol;
+
+ /** Defines the name of current j2ee application name */
+ public static final String APPLICATION_NAME = "seleniumTest";
+
+ public static final String DATA_TABLE_TEMPLATE = "dataTable";
+
+ public static final String MODAL_PANEL_TEMPLATE = "modalPanel";
+
+ public static final String SIMPLE_TEMPLATE = "simple";
+
+ public static SeleniumServer seleniumServer;
+
+ public SeleniumTestBaseNew(String protocol, String host, String port) {
+ this.host = host;
+ this.port = port;
+ this.protocol = protocol;
+ }
+
+
+ @BeforeSuite
+ public void startSeleniumServer() throws Exception {
+ seleniumServer = new SeleniumServer();
+ seleniumServer.start();
+ }
+
+
+ @AfterSuite
+ public void stopSeleniumServer() throws Exception {
+ seleniumServer.stop();
+ }
+
+ /**
+ * @param url
+ * @param browser
+ * @return
+ */
+ private DefaultSelenium createSeleniumClient(String url, String browser) {
+ return new DefaultSelenium(host, 4444, browser, url);
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ protected void startSelenium(String browser, String filter) {
+ filterPrefix = filter;
+ if (hostUrl == null) {
+ hostUrl = buildHostUrl();
+ }
+ selenium = createSeleniumClient(buildHostUrl(), browser);
+ selenium.start();
+ }
+
+
+ protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
+ Configurator.setLoadScriptStrategy(loadScriptStrategy);
+ Configurator.setLoadStyleStrategy(loadStyleStrategy);
+ }
+
+ private String buildHostUrl() {
+ StringBuilder url = new StringBuilder();
+ url.append(protocol).append("://").append(host)
+ .append(":").append(port).append("/");
+ return url.toString();
+ }
+
+ private String buildTestUrl() {
+ StringBuilder testUrl = new StringBuilder();
+ testUrl.append(APPLICATION_NAME).append(filterPrefix);
+ return testUrl.toString();
+ }
+
+ private String getTestUrl() {
+ if (testUrl == null) {
+ testUrl = buildTestUrl();
+ }
+ return testUrl;
+ }
+
+ /**
+ * Renders page
+ */
+ @Deprecated
+ protected void renderPage(String homePage) {
+ selenium.open(getTestUrl() + homePage);
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+
+ checkPageRendering(); // At the first we check if page has been
+ // rendered
+ checkJSError(); // At the second we check if JS errors occurred
+
+ // reRenderForm(); // ReRender component
+
+ // checkPageRendering(); // Check all again
+ // checkJSError();
+
+ }
+
+ /**
+ * Renders page
+ */
+ @Deprecated
+ protected void renderPage(String homePage, Templates template) {
+ selenium.open(getTestUrl() + homePage);
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+
+ template.loadTemplate(this);
+
+ checkPageRendering(); // At the first we check if page has been
+ // rendered
+ checkJSError(); // At the second we check if JS errors occurred
+
+ reRenderForm(); // ReRender component
+
+ checkPageRendering(); // Check all again
+ checkJSError();
+
+ }
+
+ /**
+ * Renders page
+ */
+ protected void renderPage(Templates template) {
+ selenium.open(getTestUrl() + getTestPrefix());
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+
+ template.loadTemplate(this);
+
+ checkPageRendering(); // At the first we check if page has been
+ // rendered
+ checkJSError(); // At the second we check if JS errors occurred
+
+ reRenderForm(); // ReRender component
+
+ checkPageRendering(); // Check all again
+ checkJSError();
+
+ }
+
+
+ /**
+ * Writes status message on client side
+ *
+ * @param message
+ */
+ public void writeStatus(String message) {
+ message = message.replace("'", "\\'");
+ StringBuffer buffer = new StringBuffer("writeStatus('");
+ buffer.append(message);
+ buffer.append("')");
+ runScript(buffer.toString());
+ }
+
+ /**
+ * ReRenders the component
+ */
+ public void reRenderForm() {
+ selenium.getEval("selenium.browserbot.getCurrentWindow().reRenderAll();");
+ // clickById("_Selenium_Test_ReRender_Form:_reRender");
+ waitForAjaxCompletion(3000);
+ }
+
+ /**
+ * Performs script defined in parameter
+ *
+ * @param script
+ * @return
+ */
+ public String runScript(String script) {
+ String result = selenium.getEval(WINDOW_JS_RESOLVER + script);
+ checkJSError();
+ return result;
+ }
+
+ /**
+ * Performs script defined in parameter
+ *
+ * @param script
+ * @return
+ */
+ public String runScript(String script, boolean checkEerror) {
+ String result = selenium.getEval(WINDOW_JS_RESOLVER + script);
+ if (checkEerror) {
+ checkJSError();
+ }
+ return result;
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ protected void stopSelenium() {
+ selenium.stop();
+ selenium = null;
+ }
+
+ /**
+ * Checks if JS error occurred. Fails test if yes. This method should be
+ * invoked after each event or any thing which can be a cause of JS error.
+ */
+ public void checkJSError() {
+ String error = selenium.getEval(WINDOW_JS_RESOLVER + "checkError();");
+ if (error != null && !("null".equals(error)) && !("".equals(error))) {
+ Assert.fail("Failure by the following Javascript error: " + error);
+ }
+ }
+
+ /**
+ * Checks if page containing component test has been rendered completely
+ */
+ public void checkPageRendering() {
+ try {
+ String t1 = getTextById("_Selenium_Test_ControlPoint1");
+ String t2 = getTextById("_Selenium_Test_ControlPoint2");
+ if (t1 == null || t2 == null || !"Control1".equals(t1) || !"Control2".equals(t2)) {
+ Assert.fail("The page has been not rendered properlly");
+ }
+ } catch (Exception e) {
+ Assert.fail("The page has not been rendered properly due the following error: " + e);
+ }
+ }
+
+ /**
+ * Waits while AJAX request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForAjaxCompletion(int miliseconds) {
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + "done==true", String.valueOf(miliseconds));
+ runScript("window.done=false");
+ }
+
+ /**
+ * Waits while AJAX request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForAjaxCompletion() {
+ waitForAjaxCompletion(ajaxCompletionTime);
+ }
+
+ /**
+ * Waits while simple request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForPageToLoad(int miliseconds) {
+ selenium.waitForPageToLoad(String.valueOf(miliseconds));
+ }
+
+ /**
+ * Waits for condition
+ *
+ * @param condition
+ * @param miliseconds
+ */
+ public void waiteForCondition(String condition, int miliseconds) {
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + condition, String.valueOf(miliseconds));
+ checkJSError();
+ }
+
+ /**
+ * Waits while simple request will be completed
+ *
+ */
+ public void waitForPageToLoad() {
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+ }
+
+ /**
+ * Asserts DOM node value equals to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ */
+ public void AssertValueEquals(String id, String value) {
+ String _v = getValueById(id);
+ Assert.assertEquals(_v, value);
+ }
+
+ /**
+ * Asserts DOM node value equals to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertValueEquals(String id, String value, String message) {
+ String _v = getValueById(id);
+ Assert.assertEquals(_v, value, message);
+ }
+
+ /**
+ * Asserts DOM node value does not equal to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ */
+ public void AssertValueNotEquals(String id, String value) {
+ String _v = getValueById(id);
+ Assert.assertNotSame(_v, value);
+ }
+
+
+ /**
+ * Asserts DOM node value does not equal to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertValueNotEquals(String id, String value, String message) {
+ String _v = getValueById(id);
+ Assert.assertNotSame(_v, value, message);
+ }
+
+
+ /**
+ * Asserts DOM node text equals to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ */
+ public void AssertTextEquals(String id, String value) {
+ String _v = getTextById(id);
+ Assert.assertEquals(_v, value);
+ }
+
+ /**
+ * Asserts DOM node text equals to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertTextEquals(String id, String value, String message) {
+ String _v = getTextById(id);
+ Assert.assertEquals(_v, value, message);
+ }
+
+
+ /**
+ * Asserts DOM node text does not equal to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ */
+ public void AssertTextNotEquals(String id, String value) {
+ String _v = getTextById(id);
+ Assert.assertNotSame(_v, value);
+ }
+
+ /**
+ * Asserts DOM node text does not equal to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertTextNotEquals(String id, String value, String message) {
+ String _v = getTextById(id);
+ Assert.assertNotSame(_v, value, message);
+ }
+
+ /**
+ * Asserts DOM node is visible
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertVisible(String id) {
+ Assert.assertTrue(isVisibleById(id));
+ }
+
+ /**
+ * Asserts DOM node is not present
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertNotPresent(String id) {
+ Assert.assertFalse(isPresentById(id));
+ }
+
+ /**
+ * Asserts DOM node is not visible
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertNotVisible(String id) {
+ Assert.assertFalse(isVisibleById(id));
+ }
+
+ /**
+ * Returns element's text
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public String getTextById(String id) {
+ return selenium.getText("id=" + id);
+ }
+
+ /**
+ * Returns element's value
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public String getValueById(String id) {
+ return selenium.getValue("id=" + id);
+ }
+
+ /**
+ * Sets a new value for DOM node with specified id.
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * a new DOM element's value
+ */
+ public void setValueById(String id, String value) {
+ runScript(String.format("document.getElementById('%1$s').value='%2$s';", id, value));
+ }
+
+ /**
+ * Returns element's width
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public Number getWidthById(String id) {
+ return selenium.getElementWidth("id=" + id);
+ }
+
+ /**
+ * Returns element's height
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public Number getHeightById(String id) {
+ return selenium.getElementHeight("id=" + id);
+ }
+
+ /**
+ * Clicks on element
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public void clickById(String id) {
+ selenium.click("id=" + id);
+ checkJSError();
+ }
+
+ /**
+ * This method should be used for click on command controls instead of
+ * 'clickById' method.
+ *
+ * @param commandId
+ */
+ public void clickCommandAndWait(String commandId) {
+ selenium.click("id=" + commandId);
+ waitForPageToLoad();
+ }
+
+ /**
+ * Return true if element is visible
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public boolean isVisibleById(String id) {
+ return selenium.isVisible("id=" + id);
+ }
+
+ /**
+ * Returns true if element with given id is present.
+ *
+ * @param id -
+ * DOM element id
+ * @return true if element with given id is present, otherwise - false
+ */
+ public boolean isPresentById(String id) {
+ return selenium.isElementPresent("id=" + id);
+ }
+
+ /**
+ * Invokes JS method on client.
+ *
+ * @param id -
+ * DOM id of component
+ * @param method -
+ * string method name
+ * @param parameters -
+ * parameters
+ * @return
+ */
+ public String invokeFromComponent(String id, String method, Object parameters) {
+ String _return = null;
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("$('");
+ buffer.append(id);
+ buffer.append("').component.");
+ buffer.append(method);
+ buffer.append("(");
+ buffer.append(ScriptUtils.toScript(parameters));
+ buffer.append(");");
+ _return = runScript(buffer.toString());
+ return _return;
+ }
+
+ /**
+ * Creates delay
+ *
+ * @param miliSeconds
+ * @throws InterruptedException
+ */
+ public void delay(int miliSeconds) {
+ try {
+ Thread.sleep(miliSeconds);
+ } catch (Exception e) {
+
+ }
+ }
+
+ /**
+ * Creates pause for defined time in miliSeconds
+ *
+ * @param miliSeconds
+ */
+ public void pause(int miliSeconds, String id) {
+ StringBuffer script = new StringBuffer("pause(");
+ script.append(miliSeconds);
+ script.append(",'");
+ script.append(id);
+ script.append("');");
+ runScript(script.toString());
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + "pauseHolder['" + id + "'] == true;", String
+ .valueOf(miliSeconds + 1000));
+ }
+
+ /**
+ * @return the parentId
+ */
+ public String getParentId() {
+ return parentId;
+ }
+
+ /**
+ * @param parentId
+ * the parentId to set
+ */
+ public void setParentId(String parentId) {
+ this.parentId = parentId;
+ }
+
+ /**
+ * Workaround for selenium.type/selenium.typeKeys
+ * @param locator
+ * @param string
+ */
+ public void type(String locator, String string) {
+ selenium.type(locator, "");
+ StringBuffer value = new StringBuffer(selenium.getValue(locator));
+ char[] chars = string.toCharArray();
+ for (int i = 0; i < chars.length; i++) {
+ String key = Character.toString(chars[i]);
+ value.append(key);
+
+ selenium.keyDown(locator, key);
+
+ if(!isFF()) {
+ selenium.type(locator, value.toString());
+ }
+
+ selenium.keyPress(locator, key);
+ selenium.keyUp(locator, key);
+
+ }
+ }
+
+
+ /**
+ * Returns the url to test page to be opened by selenium
+ * @return
+ */
+ protected String getTestPrefix() {
+ return null;
+ }
+
+ public boolean isFF() {
+ return new Boolean(selenium.getEval("navigator.userAgent.indexOf('Firefox') > -1"));
+ }
+
+}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,62 @@
+package org.richfaces;
+
+import org.ajax4jsf.template.Template;
+
+
+
+public class Templates implements Template {
+
+ private String template = null;
+
+ public Templates(String name) {
+ template = name;
+ }
+
+ public static Templates SIMPLE = new Templates("simple");
+
+ public static Templates DATATABLE = new Templates("dataTable");
+
+ public static Templates MODALPANEL = new Templates("modalPanel");
+
+ private void setParentId(SeleniumTestBase test) {
+ if ("dataTable".equals(template)) {
+ test.setParentId(COMPONENT_PREFIX_INSIDE_TABLE);
+ } else {
+ test.setParentId(COMPONENT_PREFIX_SIMPLE);
+ }
+ }
+
+ private void setParentId(SeleniumTestBaseNew test) {
+ if ("dataTable".equals(template)) {
+ test.setParentId(COMPONENT_PREFIX_INSIDE_TABLE);
+ } else {
+ test.setParentId(COMPONENT_PREFIX_SIMPLE);
+ }
+ }
+
+ public void loadTemplate(SeleniumTestBase test) {
+ setParentId(test);
+ test.runScript("loadTemplate('" + template + "');", false);
+ test.waitForPageToLoad();
+ }
+
+ public void loadTemplate(SeleniumTestBaseNew test) {
+ setParentId(test);
+ test.runScript("loadTemplate('" + template + "');", false);
+ test.waitForPageToLoad();
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof Templates)) {
+ return false;
+ }
+ Templates template = (Templates) obj;
+ if (template.template.equals(this.template)) {
+ return true;
+ }
+ return false;
+ }
+
+
+
+}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-06-06 10:14:53 UTC (rev 8928)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-06-06 10:58:26 UTC (rev 8929)
@@ -1,17 +1,23 @@
package org.richfaces.testng;
-import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
+import org.openqa.selenium.server.SeleniumServer;
import org.richfaces.SeleniumTestBase;
+import org.richfaces.SeleniumTestBaseNew;
+import org.richfaces.Templates;
import org.testng.Assert;
+import org.testng.annotations.AfterGroups;
+import org.testng.annotations.AfterSuite;
import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeGroups;
+import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxCommandButtonTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxCommandButtonTest extends SeleniumTestBaseNew {
+
public AjaxCommandButtonTest() {
super("http", "localhost", serverPort);
}
@@ -20,11 +26,18 @@
* This method are invoking before selenium tests started
*/
@BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
+ @Parameters({"browser", "filterPrefix"})
+ public void startSelenium(String browser, String filterPrefix) {
+ super.startSelenium(browser, filterPrefix);
}
+
+ @BeforeTest
+ @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
+ protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
+ super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
+ }
+
/**
* This method are invoking after selenium tests completed
*/
@@ -35,12 +48,12 @@
@Test
public void testAjaxCommandButtonComponent() throws Exception {
- _testAjaxCommandButtonComponent(Template.SIMPLE);
- _testAjaxCommandButtonComponent(Template.DATA_TABLE);
- _testAjaxCommandButtonComponent(Template.MODAL_PANEL);
+ _testAjaxCommandButtonComponent(Templates.SIMPLE);
+ _testAjaxCommandButtonComponent(Templates.DATATABLE);
+ _testAjaxCommandButtonComponent(Templates.MODALPANEL);
}
- private void _testAjaxCommandButtonComponent(Template template) {
+ private void _testAjaxCommandButtonComponent(Templates template) {
renderPage(template);
String parentId = getParentId() + "_form:";
@@ -84,6 +97,8 @@
waitForAjaxCompletion();
waitForOnCompleteHndler();
checkButton(buttonId, true, ajaxSingle, immediate, true, true, true, false);
+
+
}
private void setValidation(boolean success) {
@@ -120,8 +135,8 @@
}
- public String getTestUrl() {
- return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
- }
+ public String getTestPrefix() {
+ return "pages/ajaxCommandButton/ajaxButtonTest.xhtml";
+ }
}
Deleted: trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml 2008-06-06 10:14:53 UTC (rev 8928)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -1,17 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="seleniumTest">
- <test name="IEFunctionalTests">
- <parameter name="browser" value="*iexplore"/>
- <packages>
- <package name="org.richfaces.testng" />
- </packages>
-
- </test>
- <test name="FireFoxFunctionalTests">
- <parameter name="browser" value="*firefox"/>
- <packages>
- <package name="org.richfaces.testng" />
- </packages>
- </test>
-</suite>
-
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_neko.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_neko.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_neko.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestAANe">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsAANe">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_none.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_none.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_none.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestAANo">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsAANo">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_tidy.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_tidy.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_all_tidy.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestAAT">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsAAT">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_neko.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_neko.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_neko.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestADNe">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsADNe">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_none.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_none.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_none.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestADNo">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsADNo">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_tidy.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_tidy.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_all_default_tidy.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestADT">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsADT">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_neko.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_neko.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_neko.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDANe">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsDANe">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_none.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_none.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_none.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDANo">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsDANo">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_tidy.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_tidy.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_all_tidy.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDAT">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsDAT">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_neko.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_neko.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_neko.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDDNe">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsDDNe">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_none.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_none.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_none.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDDNo">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsDDNo">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_tidy.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_tidy.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng_default_default_tidy.xml 2008-06-06 10:58:26 UTC (rev 8929)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDDT">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsDDT">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
16 years, 4 months