Author: mvitenkov
Date: 2009-05-29 09:56:01 -0400 (Fri, 29 May 2009)
New Revision: 14407
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf4553/Bean.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf4432/Test.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf4553/Test.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf4553.xhtml
Log:
tests correction
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf4553/Bean.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf4553/Bean.java 2009-05-29
13:08:01 UTC (rev 14406)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf4553/Bean.java 2009-05-29
13:56:01 UTC (rev 14407)
@@ -12,7 +12,17 @@
private String company;
private String notes;
private int counter;
+ private boolean ajaxRendered;
+ private boolean useAjaxRendered;
+ public boolean isAjaxRendered() {
+ return ajaxRendered;
+ }
+
+ public void setAjaxRendered(boolean ajaxRendered) {
+ this.ajaxRendered = ajaxRendered;
+ }
+
public int getCounter() {
return counter++;
}
@@ -26,6 +36,8 @@
lastName = "";
company = "";
notes = "";
+ ajaxRendered = false;
+ useAjaxRendered = false;
}
public String getFirstName() {
@@ -64,4 +76,16 @@
this.notes = notes;
}
+ public boolean isUseAjaxRendered() {
+ return useAjaxRendered;
+ }
+
+ public void setUseAjaxRendered(boolean useAjaxRendered) {
+ this.useAjaxRendered = useAjaxRendered;
+ }
+
+ public void reset(){
+ counter = 0;
+ }
+
}
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf4432/Test.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf4432/Test.java 2009-05-29
13:08:01 UTC (rev 14406)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf4432/Test.java 2009-05-29
13:56:01 UTC (rev 14407)
@@ -1,6 +1,7 @@
package org.richfaces.testng.rf4432;
import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
public class Test extends SeleniumTestBase {
@@ -11,6 +12,8 @@
AssertPresent("form:sdtItems");
AssertNotPresent("form:hello");
+ selenium.click("//tr[@id='form:sdtItems:n:3']/td[1]");
+
clickAjaxCommandAndWait("//input[@type='button' and
@value='Go']");
AssertNotPresent("form:sdtItems");
@@ -19,7 +22,14 @@
clickAjaxCommandAndWait("//input[@type='button' and @value='Back to
table']");
AssertPresent("form:sdtItems");
- AssertNotPresent("form:hello");
+ AssertNotPresent("form:hello");
+
+ //check sdt header
+ AssertPresent("form:sdtItems:hcb_0");
+ AssertPresent("form:sdtItems:hcb_1");
+
+ //check selection
+ Assert.assertEquals(selenium.getAttribute("//tr[@id='form:sdtItems:n:3']@class"),
"dr-sdt-rb rich-sdt-row dr-sdt-row-active rich-sdt-row-active dr-sdt-row-selected
rich-sdt-row-selected");
}
public String getTestUrl() {
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf4553/Test.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf4553/Test.java 2009-05-29
13:08:01 UTC (rev 14406)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf4553/Test.java 2009-05-29
13:56:01 UTC (rev 14407)
@@ -3,35 +3,70 @@
import org.richfaces.SeleniumTestBase;
public class Test extends SeleniumTestBase {
+
+ public void testDefault() {
+ renderPage();
- @org.testng.annotations.Test
- public void testExecute() throws Exception {
- renderPage();
-
- AssertTextEquals("form:includeID:counter", "1");
-
+ AssertTextEquals("form:defaultIncludeID:counter", "1");
+
type("//div[@id='divID']/table/tbody/tr[1]/td[2]/input",
"John");
type("//div[@id='divID']/table/tbody/tr[2]/td[2]/input",
"Smith");
type("//div[@id='divID']/table/tbody/tr[3]/td[2]/input",
"Exadel");
-
+
clickAjaxCommandAndWait("//input[@type='button' and @value='No
actions']");
- AssertTextEquals("form:includeID:counter", "1");
+ AssertTextEquals("form:defaultIncludeID:counter", "1");
clickAjaxCommandAndWait("//input[@type='button' and @value='Next
>>']");
- AssertTextEquals("form:includeID:counter", "2");
+ AssertTextEquals("form:defaultIncludeID:counter", "2");
+
+ type("form:defaultIncludeID:notes", "Selenium test in
process...");
+
+ clickAjaxCommandAndWait("//input[@type='button' and @value='No
actions']");
+ AssertTextEquals("form:defaultIncludeID:counter", "2");
+ clickAjaxCommandAndWait("//input[@type='button' and @value='Next
>>']");
+ AssertTextEquals("form:defaultIncludeID:counter", "3");
+
+ clickAjaxCommandAndWait("//input[@type='button' and @value='No
actions']");
+ AssertTextEquals("form:defaultIncludeID:counter", "3");
+ clickAjaxCommandAndWait("//input[@type='button' and
@value='<<Previous']");
+ AssertTextEquals("form:defaultIncludeID:counter", "4");
+ }
+
+ public void testAjaxRenderedFalse() {
+ renderPage();
- type("form:includeID:notes","Selenium test in process...");
+ selenium.check("form:useAjaxRendered");
+ selenium.submit("form");
+ waitForPageToLoad();
+
+ AssertTextEquals("form:ajaxRenderedIncludeID:counter", "7");
+
clickAjaxCommandAndWait("//input[@type='button' and @value='No
actions']");
- AssertTextEquals("form:includeID:counter", "2");
+ AssertTextEquals("form:ajaxRenderedIncludeID:counter", "7");
clickAjaxCommandAndWait("//input[@type='button' and @value='Next
>>']");
- AssertTextEquals("form:includeID:counter", "3");
+ AssertTextEquals("form:ajaxRenderedIncludeID:counter", "7");
+ }
+
+ public void testAjaxRenderedTrue() {
+ renderPage();
+
+ selenium.check("form:ajaxRendered");
+ AssertTextEquals("form:ajaxRenderedIncludeID:counter", "9");
+
clickAjaxCommandAndWait("//input[@type='button' and @value='No
actions']");
- AssertTextEquals("form:includeID:counter", "3");
- clickAjaxCommandAndWait("//input[@type='button' and
@value='<<Previous']");
- AssertTextEquals("form:includeID:counter", "4");
+ AssertTextEquals("form:ajaxRenderedIncludeID:counter", "10");
+ clickAjaxCommandAndWait("//input[@type='button' and @value='Next
>>']");
+ AssertTextEquals("form:ajaxRenderedIncludeID:counter",
"11");
}
-
+
+ @org.testng.annotations.Test
+ public void testExecute() throws Exception {
+ testDefault();
+ testAjaxRenderedFalse();
+ testAjaxRenderedTrue();
+ }
+
public String getTestUrl() {
return "pages/rf4553.xhtml";
}
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf4553.xhtml
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf4553.xhtml 2009-05-29
13:08:01 UTC (rev 14406)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf4553.xhtml 2009-05-29
13:56:01 UTC (rev 14407)
@@ -7,18 +7,49 @@
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/layout/layout.xhtml">
- <ui:define name="template">
- <h:panelGrid width="100%" columns="2">
+ <ui:define name="template">
+ <h:form id="form">
+ <h:panelGrid width="100%" columns="2"
+ rendered="#{!rf4553.useAjaxRendered}" id="default">
<a4j:keepAlive beanName="rf4553" />
<rich:panel styleClass="wizard">
<f:facet name="header">
<h:outputText value="Using a4j:include for Wizard-like behaviour"
/>
</f:facet>
- <h:form id="form">
- <a4j:include viewId="/pages/examples/wstep1.xhtml"
id="includeID"/>
- </h:form>
+ <a4j:include viewId="/pages/examples/wstep1.xhtml"
+ id="defaultIncludeID" />
</rich:panel>
- </h:panelGrid>
+ </h:panelGrid>
+
+ <h:panelGrid width="100%" columns="2"
+ rendered="#{rf4553.useAjaxRendered}" id="ajaxRenderedIsUsed">
+ <a4j:keepAlive beanName="rf4553" />
+ <rich:panel styleClass="wizard">
+ <f:facet name="header">
+ <h:outputText
+ value="Using a4j:include for Wizard-like behaviour(with ajaxRendered)"
/>
+ </f:facet>
+ <a4j:include viewId="/pages/examples/wstep1.xhtml"
+ id="ajaxRenderedIncludeID"
ajaxRendered="#{rf4553.ajaxRendered}" />
+ </rich:panel>
+ </h:panelGrid>
+
+ <br />
+
+ <h:panelGrid columns="2" id="controls_panel"
border="1">
+
+ <h:outputText value="useAjaxRendered" />
+ <h:selectBooleanCheckbox value="#{rf4553.useAjaxRendered}"
+ onclick="submit()" id="useAjaxRendered">
+ </h:selectBooleanCheckbox>
+
+ <h:outputText value="ajaxRendered" />
+ <h:selectBooleanCheckbox value="#{rf4553.ajaxRendered}"
id="ajaxRendered">
+ <a4j:support event="onchange"
reRender="ajaxRenderedIsUsed"></a4j:support>
+ </h:selectBooleanCheckbox>
+ </h:panelGrid>
+ <h:commandButton action="#{rf4553.reset}" value="Reset counter"
id="reset"/>
+ </h:form>
</ui:define>
</ui:composition>
</html>
\ No newline at end of file