Author: dsvyatobatsko
Date: 2008-04-29 12:23:54 -0400 (Tue, 29 Apr 2008)
New Revision: 8342
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/keepAlive/
trunk/test-applications/seleniumTest/src/main/webapp/pages/keepAlive/keepAliveTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
Log:
KeepAlive component test
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java 2008-04-29
16:23:54 UTC (rev 8342)
@@ -0,0 +1,47 @@
+package org.ajax4jsf;
+
+public class A4JKeepAliveTestBean {
+
+ /* result */
+ private Integer sum = 0;
+
+ /* value to be added to result */
+ private Integer augend = 5;
+
+ /**
+ * Gets value of sum field.
+ * @return value of sum field
+ */
+ public Integer getSum() {
+ return sum;
+ }
+
+ /**
+ * Set a new value for sum field.
+ * @param sum a new value for sum field
+ */
+ public void setSum(Integer sum) {
+ this.sum = sum;
+ }
+
+ /**
+ * Gets value of augend field.
+ * @return value of augend field
+ */
+ public Integer getAugend() {
+ return augend;
+ }
+
+ /**
+ * Set a new value for augend field.
+ * @param augend a new value for augend field
+ */
+ public void setAugend(Integer augend) {
+ this.augend = augend;
+ }
+
+ public String doSum() {
+ sum += augend;
+ return null;
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
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-04-29
16:17:34 UTC (rev 8341)
+++
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-04-29
16:23:54 UTC (rev 8342)
@@ -56,5 +56,15 @@
<managed-bean-name>pollBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.A4JPollTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>keepAliveBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.A4JKeepAliveTestBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>keepAliveBeanAjaxOnly</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.A4JKeepAliveTestBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
\ No newline at end of file
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/keepAlive/keepAliveTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/keepAlive/keepAliveTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java 2008-04-29
16:23:54 UTC (rev 8342)
@@ -0,0 +1,56 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class KeepAliveTest extends SeleniumTestBase {
+
+ public KeepAliveTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testKeepAliveComponent() throws Exception {
+ _testKeepAliveComponent(Templates.DATATABLE);
+ }
+
+ private void _testKeepAliveComponent(Templates template) {
+ renderPage("/faces/pages/keepAlive/keepAliveTest.xhtml", template);
+
+ String parentId = getParentId();
+ String sumElemId = parentId + "sum";
+ AssertValueEquals(sumElemId, "0");
+ String addButtonId = parentId + "form:add";
+ String addAjaxButtonId = parentId + "form:addAjax";
+ clickById(addButtonId);
+ clickById(addButtonId);
+ delay(3000);
+ AssertValueEquals(sumElemId, "10");
+
+ clickById(addAjaxButtonId);
+ clickById(addAjaxButtonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(sumElemId, "20");
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Show replies by date