Author: mvitenkov
Date: 2009-06-01 05:12:24 -0400 (Mon, 01 Jun 2009)
New Revision: 14418
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7140/
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7140/Bean.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7140/
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7140/Test.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7140.xhtml
Log:
+RF-7140 selenium test.
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7140/Bean.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7140/Bean.java
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7140/Bean.java 2009-06-01
09:12:24 UTC (rev 14418)
@@ -0,0 +1,53 @@
+package org.richfaces.regressionarea.issues.rf7140;
+
+import java.util.Random;
+import java.util.UUID;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("rf7140")
+(a)Scope(ScopeType.SESSION)
+public class Bean {
+
+ public static final class Item {
+ private String[] data;
+
+ private Object sortOrder;
+
+ public Item(String[] data) {
+ super();
+ this.data = data;
+ }
+
+ public String[] getData() {
+ return data;
+ }
+
+ public Object getSortOrder() {
+ return sortOrder;
+ }
+
+ public void setSortOrder(Object sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+ }
+
+ private Item[] items;
+
+ {
+ items = new Item[4];
+ for (int i = 0; i < items.length; i++) {
+ String[] s = new String[4];
+ for (int j = 0; j < s.length; j++) {
+ s[j] = UUID.randomUUID().toString();
+ }
+ items[i] = new Item(s);
+ }
+ }
+
+ public Item[] getItems() {
+ return items;
+ }
+}
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7140/Test.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7140/Test.java
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7140/Test.java 2009-06-01
09:12:24 UTC (rev 14418)
@@ -0,0 +1,34 @@
+package org.richfaces.testng.rf7140;
+
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+
+public class Test extends SeleniumTestBase {
+
+ @org.testng.annotations.Test
+ public void testExecute() throws Exception {
+ renderPage();
+
+ clickAjaxCommandAndWait("//form[@id='form']/table[1]/thead/tr/th");
+ String t1FirstRow =
selenium.getTable("//form[(a)id='form']/table[1].1.0");
+ String t1LastRow =
selenium.getTable("//form[(a)id='form']/table[1].4.0");
+
+ clickAjaxCommandAndWait("//form[@id='form']/table[1]/thead/tr/th");
+ Assert.assertEquals(selenium.getTable("//form[(a)id='form']/table[1].1.0"),
t1LastRow);
+ Assert.assertEquals(selenium.getTable("//form[(a)id='form']/table[1].4.0"),
t1FirstRow);
+
+ clickAjaxCommandAndWait("//form[@id='form']/table[4]/thead/tr/th");
+ String t4FirstRow =
selenium.getTable("//form[(a)id='form']/table[4].1.0");
+ String t4LastRow =
selenium.getTable("//form[(a)id='form']/table[4].4.0");
+
+ clickAjaxCommandAndWait("//form[@id='form']/table[4]/thead/tr/th");
+ Assert.assertEquals(selenium.getTable("//form[(a)id='form']/table[4].1.0"),
t4LastRow);
+ Assert.assertEquals(selenium.getTable("//form[(a)id='form']/table[4].4.0"),
t4FirstRow);
+
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/rf7140.xhtml";
+ }
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7140.xhtml
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7140.xhtml
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7140.xhtml 2009-06-01
09:12:24 UTC (rev 14418)
@@ -0,0 +1,30 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+
+<ui:composition template="/layout/layout.xhtml">
+ <ui:define name="template">
+ <h:form id="form">
+ <a4j:repeat value="#{rf7140.items}" var="item">
+ <rich:dataTable value="#{item.data}" var="data">
+ <rich:column sortable="true" sortBy="#{data}"
+ sortOrder="#{item.sortOrder}">
+ <f:facet name="header">
+ header
+ </f:facet>
+ #{data}
+ </rich:column>
+ </rich:dataTable>
+
+ <br />
+ <br />
+ </a4j:repeat>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file