JBoss Rich Faces SVN: r8760 - in trunk/test-applications/seleniumTest/src/test/java/org/richfaces: test and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-05-26 10:23:42 -0400 (Mon, 26 May 2008)
New Revision: 8760
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxPollTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxRegionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/CalendarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ComboBoxTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ContextMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/DataTableTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/DropDownMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/InplaceSelectTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/InputNumberSpinnerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/KeepAliveTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/LoadStyleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/OrderingListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PickListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/SpacerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/TogglePanelTest.java
Log:
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxCommandButtonTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxCommandButtonTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,120 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+
+public class AjaxCommandButtonTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxCommandButtonTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testAjaxCommandButtonComponent() throws Exception {
+ _testAjaxCommandButtonComponent(Templates.SIMPLE);
+ _testAjaxCommandButtonComponent(Templates.DATATABLE);
+ _testAjaxCommandButtonComponent(Templates.MODALPANEL);
+ }
+
+ private void _testAjaxCommandButtonComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ String buttonId = parentId + "b1";
+ boolean ajaxSingle = false;
+ boolean immediate = false;
+ writeStatus("Click button 1");
+ setValidation(true);
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ checkButton(buttonId, true, ajaxSingle, immediate, true, true, true, true);
+
+ buttonId = parentId + "b2";
+ ajaxSingle = false;
+ immediate = false;
+ writeStatus("Click button 2");
+ setValidation(false);
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ checkButton(buttonId, false, ajaxSingle, immediate, false, false, false, false);
+
+ buttonId = parentId + "b3";
+ ajaxSingle = false;
+ immediate = true;
+ writeStatus("Click button 3");
+ setValidation(true);
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ checkButton(buttonId, true, ajaxSingle, immediate, true, true, true, false);
+
+ buttonId = parentId + "b4";
+ ajaxSingle = true;
+ immediate = true;
+ writeStatus("Click button 4");
+ setValidation(false);
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ checkButton(buttonId, true, ajaxSingle, immediate, true, true, true, false);
+
+
+ }
+
+ private void setValidation(boolean success) {
+ StringBuffer buffer = new StringBuffer("setValidation(");
+ buffer.append(success);
+ buffer.append(");");
+ runScript(buffer.toString());
+ }
+
+ private void checkButton(String id, boolean testData, boolean ajaxSingle, boolean immediate, boolean testAction, boolean testActionListener, boolean testFListener, boolean testInput) {
+ writeStatus("Checking button...");
+ StringBuffer buffer = new StringBuffer("checkButton('");
+ buffer.append(id);
+ buffer.append("',");
+ buffer.append(testData);
+ buffer.append(",");
+ buffer.append(testAction);
+ buffer.append(",");
+ buffer.append(testActionListener);
+ buffer.append(",");
+ buffer.append(testFListener);
+ buffer.append(",");
+ buffer.append(testInput);
+ buffer.append(");");
+ String result = runScript(buffer.toString());
+ if (result != null && result.length() > 0) {
+ Assert.fail("<a4j:commandButton> [ajaxSingle="+ajaxSingle+" ; immediate="+immediate+"] test failure caused by " + result);
+ }
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxCommandLinkTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxCommandLinkTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxCommandLinkTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,93 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class AjaxCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxCommandLinkTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testAjaxCommandLinkComponent() throws Exception {
+ _testAjaxCommandLinkComponent(Templates.SIMPLE);
+ _testAjaxCommandLinkComponent(Templates.DATATABLE);
+ _testAjaxCommandLinkComponent(Templates.MODALPANEL);
+ }
+
+ private void _testAjaxCommandLinkComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ String LinkId = parentId + "l1";
+ String inputId = parentId + "_value";
+
+ writeStatus("Click link 1 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "12345");
+
+ writeStatus("Click link 1 again: ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "123452345");
+
+ LinkId = parentId + "l2";
+
+ writeStatus("Click link 2 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "1234523455");
+
+ LinkId = parentId + "l3";
+
+ writeStatus("Click link 3 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "1234523455");
+
+ LinkId = parentId + "l4";
+
+ writeStatus("Click link 4 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "12345234555");
+
+ LinkId = parentId + "l5";
+
+ writeStatus("Click link 5 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "12345234555");
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxPollTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxPollTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxPollTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,80 @@
+/**
+ *
+ */
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+/**
+ * @author Andrey Markavstov
+ *
+ */
+public class AjaxPollTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxPollTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testAjaxPollComponent() {
+ _testAjaxPollComponent(Templates.SIMPLE);
+ _testAjaxPollComponent(Templates.DATATABLE);
+ _testAjaxPollComponent(Templates.MODALPANEL);
+ }
+
+ private void _testAjaxPollComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+ String pollId = parentId + "poll";
+ String inputId = parentId + "_value";
+
+ writeStatus("Start polling...");
+ clickById(parentId + "_enabled");
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "1");
+
+ writeStatus("Polling in progress...");
+ pause(1500, pollId);
+ AssertValueNotEquals(inputId, "1");
+ waiteForCondition("document.getElementById('"+inputId+"').value == 8", 7000);
+
+ pause(1500, pollId);
+ writeStatus("Polling should be stopped...");
+ AssertValueEquals(inputId, "8");
+ AssertTextEquals(parentId + "_text", "Polling");
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.test.base.RichSeleniumTest#getTestUrl()
+ */
+ public String getTestUrl() {
+ return "/faces/pages/ajaxPoll/ajaxPollTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxRegionTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxRegionTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxRegionTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,103 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class AjaxRegionTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxRegionTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testAjaxRegionComponent() throws Exception {
+ _testAjaxRegionComponent(Templates.SIMPLE);
+ _testAjaxRegionComponent(Templates.DATATABLE);
+ _testAjaxRegionComponent(Templates.MODALPANEL);
+ }
+
+ private void _testAjaxRegionComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ writeStatus("check nested regions");
+
+ String externalLink = parentId + "externalLink";
+ String internalLink = parentId + "internalLink";
+
+ String internalElemId = parentId + "internal";
+ String externalElemId = parentId + "external";
+
+ selenium.type(internalElemId, "5");
+ selenium.type(externalElemId, "5");
+
+ clickById(internalLink);
+ waitForAjaxCompletion();
+ AssertValueEquals(internalElemId, "5");
+ AssertValueEquals(externalElemId, "0");
+
+ selenium.type(internalElemId, "10");
+ selenium.type(externalElemId, "10");
+
+ clickById(externalLink);
+ waitForAjaxCompletion();
+ AssertValueEquals(internalElemId, "10");
+ AssertValueEquals(externalElemId, "10");
+
+ writeStatus("verify \"selfRendered\" component's attribute");
+
+ String selfRenderedLink = parentId + "selfRenderedLink";
+ clickById(selfRenderedLink);
+ waitForAjaxCompletion();
+ AssertNotPresent("transientText");
+
+ writeStatus("verify \"renderRegionOnly\" component's attribute");
+
+ String renderOnlyLink = parentId + "renderOnlyLink";
+ String renderLink = parentId + "renderLink";
+
+ String renderOnlyElemId = parentId + "renderOnly";
+ String renderElemId = parentId + "render";
+
+ selenium.type(renderOnlyElemId, "7");
+
+ clickById(renderOnlyLink);
+
+ AssertValueEquals(renderOnlyElemId, "7");
+ AssertValueEquals(renderElemId, "0");
+
+ selenium.type(renderElemId, "11");
+ clickById(renderLink);
+
+ AssertValueEquals(renderOnlyElemId, "11");
+ AssertValueEquals(renderElemId, "11");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/ajaxRegion/ajaxRegionTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxStatusTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxStatusTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/AjaxStatusTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,91 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class AjaxStatusTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxStatusTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testAjaxStatusComponent() throws Exception {
+ _testAjaxStatusComponent(Templates.SIMPLE);
+ _testAjaxStatusComponent(Templates.DATATABLE);
+ _testAjaxStatusComponent(Templates.MODALPANEL);
+ }
+
+ private void _testAjaxStatusComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String btn1 = parentId + "button1";
+ clickById(btn1);
+
+ String reg1Status = parentId + "region1:status";
+
+ writeStatus("Ajax request is in progress");
+
+ AssertVisible(reg1Status + ".start");
+ AssertNotVisible(reg1Status + ".stop");
+ String start = getTextById(reg1Status + ".start");
+ Assert.assertTrue(start.startsWith("In progress..."));
+ pause(3000, reg1Status);
+
+ writeStatus("Ajax request completed");
+
+ AssertNotVisible(reg1Status + ".start");
+ AssertVisible(reg1Status + ".stop");
+ String stop = getTextById(reg1Status + ".stop");
+ Assert.assertTrue(stop.startsWith("Complete"));
+
+ String btn2 = parentId + "button2";
+ clickById(btn2);
+
+ String reg2Status = parentId + "region2:status";
+
+ writeStatus("Ajax request is in progress");
+
+ AssertVisible(reg2Status + ".start");
+ AssertNotVisible(reg2Status + ".stop");
+ start = getTextById(reg2Status + ".start");
+ Assert.assertTrue(start.startsWith("In progress..."));
+ pause(3000, reg2Status);
+
+ writeStatus("Ajax request completed");
+
+ AssertNotVisible(reg2Status + ".start");
+ AssertVisible(reg2Status + ".stop");
+ stop = getTextById(reg1Status + ".stop");
+ Assert.assertTrue(stop.startsWith("Complete"));
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/ajaxStatus/ajaxStatusTest.xhtml";
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/CalendarTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/CalendarTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/CalendarTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,148 @@
+/**
+ * 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.testng;
+
+import java.text.ParseException;
+import java.util.Date;
+
+import org.ajax4jsf.bean.CalendarTestBean;
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class CalendarTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ /**
+ * Default constructor
+ */
+ public CalendarTest() {
+ super("http", "localhost", serverPort);
+ }
+
+
+ /**
+ * 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 testContextMenuComponent() throws Exception {
+ _testSelectDateComponent(Templates.SIMPLE);
+ _testCalendarComponent(Templates.DATATABLE);
+ _testCalendarComponent(Templates.MODALPANEL);
+ }
+
+ private void _testCalendarComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String containerId = getParentId() + "_form:";
+ String calendarOpenedId = containerId + "calendar";
+ String calendarCollapsedId = calendarOpenedId + "Popup";
+ String calendarInputDate = calendarOpenedId + "InputDate";
+ String calendarPopupButton = calendarCollapsedId + "Button";
+ String outputPanel = containerId + "outputPanel";
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+
+ writeStatus("Mouse click on calendar InputDate field");
+ clickById(calendarInputDate);
+
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+
+ writeStatus("Mouse click outside calendar");
+ clickById(outputPanel);
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+
+ writeStatus("Mouse click on calendar popup button");
+ clickById(calendarPopupButton);
+
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+ }
+
+ private void _testSelectDateComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ Date newSelectedDate = CalendarTestBean.getDayInMay(15);
+
+ String containerId = getParentId() + "_form:";
+ String calendarOpenedId = containerId + "calendar";
+ String calendarCollapsedId = calendarOpenedId + "Popup";
+ String calendarInputDate = calendarOpenedId + "InputDate";
+ String calendarPopupButton = calendarCollapsedId + "Button";
+ String outputPanel = containerId + "outputPanel";
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+ writeStatus("Mouse click on calendar popup button");
+ clickById(calendarPopupButton);
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+
+ String inputDateString = getValueById(calendarInputDate);
+ Date readDate = null;
+ try {
+ readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
+ } catch(ParseException parseException) {
+ // skip exception
+ }
+ Assert.assertEquals(readDate, CalendarTestBean.DEFAULT_DATE, "Default date representation is wrong!");
+
+ // click on 15th of May
+ String newSelectedDateId = calendarOpenedId + "DayCell18";
+ clickById(newSelectedDateId);
+
+ writeStatus("Mouse click outside calendar");
+ clickById(outputPanel);
+
+ inputDateString = getValueById(calendarInputDate);
+ try {
+ readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
+ } catch(ParseException parseException) {
+ // skip exception
+ }
+ Assert.assertEquals(readDate, newSelectedDate, "Date representation after selecting 15.May.2008 is wrong!");
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/calendar/calendarTest.xhtml";
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ComboBoxTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ComboBoxTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ComboBoxTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,88 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class ComboBoxTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public ComboBoxTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testComboBoxComponent() throws Exception {
+ _testComboBoxComponent(Templates.SIMPLE);
+ _testComboBoxComponent(Templates.DATATABLE);
+ _testComboBoxComponent(Templates.MODALPANEL);
+ }
+
+ private void _testComboBoxComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ String predefinedCBId = parentId + "predefined";
+ String selectItemsCBId = parentId + "selectItems";
+ String suggestionValuesCBId = parentId + "suggestionValues";
+
+ writeStatus("check components' default labels");
+
+ getTextById(predefinedCBId + "comboboxField").startsWith("Select a");
+ getTextById(selectItemsCBId + "comboboxField").startsWith("Select a");
+ getTextById(suggestionValuesCBId + "comboboxField").startsWith("Select a");
+
+ writeStatus("check a combobox with predefined suggestions");
+
+ clickById(predefinedCBId);
+ writeStatus("type \"Hunt\"");
+
+ selenium.type(predefinedCBId + "comboboxField", "Hunt");
+ selenium.typeKeys(predefinedCBId + "comboboxField", "Hunt");
+
+ Assert.assertTrue(isVisibleById(predefinedCBId + "list"), "Component pop-up should show up on click");
+
+ clickById(predefinedCBId + "list");
+
+ Assert.assertFalse(isVisibleById(predefinedCBId + "list"), "Component pop-up has to be closed");
+ Assert.assertEquals(getValue(predefinedCBId), "Hunter");
+
+ delay(2000);
+ }
+
+ /**
+ * Gets component value.
+ * @param clientId
+ * @return
+ */
+ private String getValue(String clientId) {
+ return runScript("$('" + clientId + "comboboxValue').value;");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/comboBox/comboBoxTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ContextMenuTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ContextMenuTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ContextMenuTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,124 @@
+/**
+ * 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.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class ContextMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public ContextMenuTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testContextMenuComponent() throws Exception {
+ _testContextMenuComponent(Templates.SIMPLE);
+ _testContextMenuComponent(Templates.DATATABLE);
+ _testContextMenuComponent(Templates.MODALPANEL);
+ }
+
+ private void _testContextMenuComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String inputId = parentId + "input";
+ String input2Id = parentId + "input2";
+ String outputId = parentId + "_value2";
+ String menuId = parentId + "menu_input_menu";
+ String menu2Id = parentId + "menu_input2_menu";
+
+ String menu1_item_ajax = parentId + "menu1_item1";
+ String menu1_item_server = parentId + "menu1_item2";
+ String menu2_item_ajax = parentId + "menu2_item1";
+ String menu2_item_server = parentId + "menu2_item2";
+
+ writeStatus("Click on first input");
+ clickById(inputId);
+ Assert.assertTrue(isVisibleById(menuId));
+
+ writeStatus("Click on second input");
+ clickById(input2Id);
+ Assert.assertFalse(isVisibleById(menuId));
+ Assert.assertTrue(isVisibleById(menu2Id));
+
+ writeStatus("Click on first input again");
+ clickById(inputId);
+ Assert.assertTrue(isVisibleById(menuId));
+ Assert.assertFalse(isVisibleById(menu2Id));
+
+ writeStatus("Click on ajax item in first menu");
+ clickById(menu1_item_ajax);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "menu1_item1");
+ AssertTextEquals(outputId, "1");
+
+ writeStatus("Click on server item in first menu");
+ clickCommandAndWait(menu1_item_server);
+ AssertValueEquals(inputId, "menu1_item2");
+ AssertTextEquals(outputId, "2");
+
+ writeStatus("Click on second input again");
+ clickById(input2Id);
+ Assert.assertTrue(isVisibleById(menu2Id));
+
+ writeStatus("Click on ajax item in first menu");
+ clickById(menu2_item_ajax);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "menu2_item1");
+ AssertTextEquals(outputId, "3");
+
+ writeStatus("Click on server item in second menu");
+ clickCommandAndWait(menu2_item_server);
+ AssertValueEquals(inputId, "menu2_item2");
+ AssertTextEquals(outputId, "4");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/contextMenu/contextMenu.xhtml";
+ }
+
+}
+
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/DataTableTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/DataTableTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/DataTableTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,235 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class DataTableTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public DataTableTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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();
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/dataTable/dataTableTest.xhtml";
+ }
+
+ @Test
+ public void testDataTable() {
+ _testDataTable(Templates.SIMPLE);
+ }
+
+ private void _testDataTable(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String dataTableId = parentId + "table";
+
+ writeStatus("Check columns count equals to 3 ");
+ assertColumnsCount(3, dataTableId);
+ writeStatus("Check rows count equals to 22 ");
+ assertRowsCount(22, dataTableId);
+
+ String columnsId = getColumnId(dataTableId, 0);
+
+ writeStatus("Check inputs' values ");
+ assertInputValue(dataTableId, 0, columnsId, "0");
+ assertInputValue(dataTableId, 5, columnsId, "5");
+ assertInputValue(dataTableId, 19, columnsId, "19");
+
+ columnsId = getColumnId(dataTableId, 1);
+
+ assertInputValue(dataTableId, 0, columnsId, "1");
+ assertInputValue(dataTableId, 7, columnsId, "8");
+ assertInputValue(dataTableId, 19, columnsId, "20");
+
+ columnsId = getColumnId(dataTableId, 2);
+
+ assertInputValue(dataTableId, 0, columnsId, "2");
+ assertInputValue(dataTableId, 11, columnsId, "13");
+ assertInputValue(dataTableId, 19, columnsId, "21");
+
+ writeStatus("Insert some values ");
+ insertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
+ insertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
+
+ writeStatus("Rerender table");
+ clickById("_form:submit");
+ waitForAjaxCompletion();
+
+ writeStatus("Check values entered ");
+ assertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
+ assertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
+
+ columnsId = getColumnId(dataTableId, 0);
+
+ writeStatus("Sort ASC by 1'st column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "000");
+ assertInputValue(dataTableId, 1, columnsId, "1");
+ assertInputValue(dataTableId, 18, columnsId, "8");
+ assertInputValue(dataTableId, 19, columnsId, "9");
+
+ writeStatus("Sort DESC by 1'st column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "9");
+ assertInputValue(dataTableId, 1, columnsId, "8");
+ assertInputValue(dataTableId, 18, columnsId, "1");
+ assertInputValue(dataTableId, 19, columnsId, "000");
+
+ columnsId = getColumnId(dataTableId, 2);
+
+ writeStatus("Sort ASC by 3'st column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "10");
+ assertInputValue(dataTableId, 1, columnsId, "11");
+ assertInputValue(dataTableId, 18, columnsId, "8");
+ assertInputValue(dataTableId, 19, columnsId, "9");
+
+ writeStatus("Set columns count == 5, rows count == 10");
+ changeColumnCount(10, 5, 0 ,100);
+
+
+ writeStatus("Check columns count equals to 5 ");
+ assertColumnsCount(5, dataTableId);
+ writeStatus("Check rows count equals to 12 ");
+ assertRowsCount(12, dataTableId);
+
+ columnsId = getColumnId(dataTableId, 0);
+
+ writeStatus("Check inputs' values ");
+ assertInputValue(dataTableId, 0, columnsId, "0");
+ assertInputValue(dataTableId, 5, columnsId, "5");
+ assertInputValue(dataTableId, 9, columnsId, "9");
+
+ columnsId = getColumnId(dataTableId, 1);
+
+ assertInputValue(dataTableId, 0, columnsId, "1");
+ assertInputValue(dataTableId, 7, columnsId, "8");
+ assertInputValue(dataTableId, 9, columnsId, "10");
+
+ columnsId = getColumnId(dataTableId, 4);
+
+ assertInputValue(dataTableId, 0, columnsId, "4");
+ assertInputValue(dataTableId, 2, columnsId, "6");
+ assertInputValue(dataTableId, 9, columnsId, "13");
+
+ writeStatus("Sort ASC by the last column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "10");
+ assertInputValue(dataTableId, 2, columnsId, "12");
+ assertInputValue(dataTableId, 9, columnsId, "9");
+
+ writeStatus("Sort DESC by the last column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "9");
+ assertInputValue(dataTableId, 2, columnsId, "7");
+ assertInputValue(dataTableId, 9, columnsId, "10");
+
+ columnsId = getColumnId(dataTableId, 2);
+ writeStatus("Sort ASC by the 3d column ");
+ sortColumn(dataTableId, columnsId);
+
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "10");
+ assertInputValue(dataTableId, 2, columnsId, "2");
+ assertInputValue(dataTableId, 9, columnsId, "9");
+
+ changeColumnCount(2, 5, 2 ,2);
+ assertColumnsCount(1, dataTableId);
+ assertRowsCount(4, dataTableId);
+
+ changeColumnCount(10, 5, 10 ,0);
+ assertRowsCount(0, dataTableId);
+
+
+
+ }
+
+ private String getColumnId (String tableId, int i) {
+ String script = "$('"+tableId+"').rows[0].cells["+String.valueOf(i)+"].id";
+ String id = runScript(script);
+ id = id.replace(tableId + ":", "");
+ id = id.replace("header", "");
+ return id;
+ }
+
+ private void changeColumnCount(int rows, int columns, int begin, int end) {
+ String script = "$('_controls:rows').value='" + String.valueOf(rows) + "';";
+ runScript(script);
+ script = "$('_controls:column').value='" + String.valueOf(columns) + "';";
+ runScript(script);
+ script = "$('_controls:begin').value='" + String.valueOf(begin) + "';";
+ runScript(script);
+ script = "$('_controls:end').value='" + String.valueOf(end) + "';";
+ runScript(script);
+ clickById("_controls:apply");
+ waitForAjaxCompletion();
+ }
+
+ private void sortColumn(String tableId, String columnId) {
+ clickById(tableId + ":" + columnId + "header");
+ waitForAjaxCompletion();
+ }
+
+
+ private void insertInputValue(String tableId, int row, String inputId, String value) {
+ String id = tableId + ":"+row+":"+inputId;
+ String script = ("$('" + id + "').firstChild.value='" + value + "';");
+ runScript(script);
+ }
+
+
+ private void assertInputValue(String tableId, int row, String inputId, String value) {
+ String id = tableId + ":"+row+":"+inputId;
+ String script = "$('" + id + "').firstChild.value";
+ Assert.assertEquals(runScript(script), value);
+ }
+
+
+ private void assertColumnsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows[0].cells.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+ private void assertRowsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/DropDownMenuTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/DropDownMenuTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/DropDownMenuTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,94 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class DropDownMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public DropDownMenuTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testDropDownMenuComponent() throws Exception {
+ _testDropDownMenuComponent(Templates.SIMPLE);
+ _testDropDownMenuComponent(Templates.DATATABLE);
+ _testDropDownMenuComponent(Templates.MODALPANEL);
+ }
+
+ private void _testDropDownMenuComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String file = parentId + "file";
+ String open = parentId + "open:anchor";
+ String saveAs = parentId + "saveAs:anchor";
+ String save = parentId + "save:anchor";
+ String saveAll = parentId + "saveAll:anchor";
+ String close = parentId + "close:anchor";
+ String exit = parentId + "exit:anchor";
+ String operation = parentId + "operation";
+
+ writeStatus("Check menu item in ajax mode");
+
+ selenium.mouseOver(file);
+ selenium.mouseOver(saveAs);
+ clickById(saveAll);
+
+ AssertTextEquals(operation, "Save All");
+
+ selenium.mouseOver(file);
+ selenium.mouseOver(saveAs);
+ clickById(save);
+
+ AssertTextEquals(operation, "Save");
+
+ writeStatus("Check the drop down menu closed");
+
+ AssertNotVisible(save);
+ AssertNotVisible(saveAs);
+
+ writeStatus("Check menu item in server mode");
+
+ selenium.mouseOver(file);
+ clickCommandAndWait(close);
+
+ AssertTextEquals(operation, "Close");
+
+ writeStatus("Check menu item in 'none' mode");
+
+ selenium.mouseOver(file);
+ selenium.mouseOver(exit);
+ clickById(exit);
+
+ AssertTextEquals(operation, "Close");
+ AssertNotVisible(exit);
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/dropDownMenu/dropDownMenuTest.xhtml";
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/InplaceSelectTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/InplaceSelectTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/InplaceSelectTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,120 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class InplaceSelectTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public InplaceSelectTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testInplaceSelectComponent() throws Exception {
+ _testInplaceSelectComponent(Templates.SIMPLE);
+ _testInplaceSelectComponent(Templates.DATATABLE);
+ _testInplaceSelectComponent(Templates.MODALPANEL);
+ }
+
+ private void _testInplaceSelectComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String inplaceSelectId = parentId + "inplaceSelect";
+ String okButton = parentId + "inplaceSelect" + "ok";
+ //String inplaceTmpValueElemId = parentId + "inplaceSelect" + "inplaceTmpValue";
+ String cancelButton = parentId + "inplaceSelect" + "cancel";
+ String popupId = "list" + inplaceSelectId;
+
+ writeStatus("click the component");
+
+ clickById(inplaceSelectId);
+ Assert.assertFalse(isVisibleById(popupId), "Component pop-up should not show up on solitary click");
+
+ writeStatus("double click the component");
+
+ selenium.doubleClick(inplaceSelectId);
+ Assert.assertTrue(isVisibleById(popupId), "Component pop-up should show up on double click");
+
+ writeStatus("Check that controls buttons are present");
+
+ Assert.assertTrue(isPresentById(okButton));
+ Assert.assertTrue(isPresentById(cancelButton));
+
+ writeStatus("Select second element"); //Birch
+
+ selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId + "']/span[2]");
+ selenium.fireEvent(okButton, "mousedown");
+
+ writeStatus("Check that a new element is selected");
+
+ Assert.assertEquals(getValue(inplaceSelectId), "Birch");
+
+ writeStatus("Select another element"); // Aspen
+
+ selenium.doubleClick(inplaceSelectId);
+
+ selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId + "']/span[3]");
+ selenium.fireEvent(cancelButton, "mousedown");
+
+ writeStatus("Cancel selected value.");
+ Assert.assertEquals(getValue(inplaceSelectId), "Birch", "A value has not to be changed");
+
+ writeStatus("Verify javascript event triggering");
+
+ runScript("theLatestEvent='undefined'");
+
+ writeStatus("Double click the component");
+ selenium.doubleClick(inplaceSelectId);
+
+ Assert.assertEquals(runScript("theLatestEvent"), "editactivated", "editactivated event has not been triggered");
+
+ writeStatus("Stop editing with ok");
+ selenium.fireEvent(okButton, "mousedown");
+ Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
+
+// viewactivated event is not fired ... almost sure bug
+// writeStatus("Stop editing with cancel");
+// selenium.fireEvent(cancelButton, "mousedown");
+// Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
+
+ }
+
+ /**
+ * Gets component value.
+ * Note: JavaScript component API getValue() doesn't exit
+ * @param clientId
+ * @return
+ */
+ private String getValue(String clientId) {
+ return runScript("$('" + clientId + "inplaceValue').value;");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/inplaceSelect/inplaceSelectTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/InputNumberSpinnerTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/InputNumberSpinnerTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/InputNumberSpinnerTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,97 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+
+public class InputNumberSpinnerTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public InputNumberSpinnerTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testInputNumberSpinnerComponent() throws Exception {
+ _testInputNumberSpinnerComponent(Templates.SIMPLE);
+ //it looks as if the spinner does not work inside rich:dataTable
+ _testInputNumberSpinnerComponent(Templates.DATATABLE);
+ _testInputNumberSpinnerComponent(Templates.MODALPANEL);
+ }
+
+ private void _testInputNumberSpinnerComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ writeStatus("check whether the spinner is invariant with respect to pair of sequential opposite operations");
+
+ //start value = 20
+ String before = getSpinnerValue();
+ clickUp();
+ clickDown();
+ String after = getSpinnerValue();
+ Assert.assertEquals(before, after);
+ Assert.assertEquals(after, "20");
+
+ writeStatus("check upper bound and cycling");
+
+ clickUp(); //+10
+ clickUp(); //+10
+ clickUp(); //+10
+ clickUp(); //+10
+ clickUp(); //+10
+ Assert.assertEquals(getSpinnerValue(), "10");
+
+ writeStatus("check lower bound and cycling");
+
+ clickDown(); //-10
+ Assert.assertEquals(getSpinnerValue(), "0");
+ clickDown(); //-10
+ Assert.assertEquals(getSpinnerValue(), "50");
+ clickDown(); //-10
+ Assert.assertEquals(getSpinnerValue(), "40");
+ }
+
+ private void clickUp() {
+ String id = getParentId() + "_form:" + "spinnerButtons";
+ selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[1]/td/input", "mousedown");
+ selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[1]/td/input", "mouseup");
+ }
+
+ private void clickDown() {
+ String id = getParentId() + "_form:" + "spinnerButtons";
+ selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[2]/td/input", "mousedown");
+ selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[2]/td/input", "mouseup");
+ }
+
+ private String getSpinnerValue() {
+ String id = getParentId() + "_form:" + "spinnerEdit";
+ return runScript("$('" + id + "').down('input').value");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/inputNumberSpinner/inputNumberSpinnerTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/JSFunctionTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/JSFunctionTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/JSFunctionTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,65 @@
+package org.richfaces.testng;
+
+import static org.testng.Assert.assertEquals;
+
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class JSFunctionTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public JSFunctionTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testJSFunctionComponent() throws Exception {
+ _testJSFunctionComponent(Templates.SIMPLE);
+ _testJSFunctionComponent(Templates.DATATABLE);
+ _testJSFunctionComponent(Templates.MODALPANEL);
+ }
+
+ private void _testJSFunctionComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String showNameElemId = getParentId() + "showname";
+ selenium.mouseOver("alex");
+ waitForAjaxCompletion();
+ assertEquals(getTextById(showNameElemId), "Alex");
+
+ selenium.mouseOver("jonh");
+ waitForAjaxCompletion();
+ assertEquals(getTextById(showNameElemId), "Jonh");
+
+ selenium.mouseOver("roger");
+ waitForAjaxCompletion();
+ assertEquals(getTextById(showNameElemId), "Roger");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/jsFunction/jsFunctionTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/KeepAliveTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/KeepAliveTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/KeepAliveTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,90 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.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 implements RichSeleniumTest {
+
+ public KeepAliveTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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.SIMPLE);
+ _testKeepAliveComponent(Templates.DATATABLE);
+ _testKeepAliveComponent(Templates.MODALPANEL);
+ }
+
+ private void _testKeepAliveComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId();
+
+ String sumElemId = parentId + "sum";
+ AssertValueEquals(sumElemId, "0");
+ String addButtonId = parentId + "form:add";
+ String addAjaxButtonId = parentId + "form:addAjax";
+
+ writeStatus("The sum has to be increased by 5 twice");
+
+ clickCommandAndWait(addButtonId);
+ clickCommandAndWait(addButtonId);
+ AssertValueEquals(sumElemId, "10");
+
+ writeStatus("The sum has to be increased by 5 twice again");
+
+ clickById(addAjaxButtonId);
+ clickById(addAjaxButtonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(sumElemId, "20");
+
+ writeStatus("Test ajax only regime ... ");
+
+ String sumAjaxOnlyElemId = parentId + "sumAjaxOnly";
+ AssertValueEquals(sumAjaxOnlyElemId, "0");
+ addButtonId = parentId + "formAjaxOnly:add";
+ addAjaxButtonId = parentId + "formAjaxOnly:addAjax";
+
+ writeStatus("State is not saved between full submits. The sum always is 5");
+
+ clickCommandAndWait(addButtonId);
+ clickCommandAndWait(addButtonId);
+ AssertValueNotEquals(sumAjaxOnlyElemId, "10");
+
+ writeStatus("Ajax request! The sum has to be increased by 5 twice");
+
+// This test doesn't pass! Bug?!
+
+// clickById(addAjaxButtonId);
+// clickById(addAjaxButtonId);
+// waitForAjaxCompletion();
+// AssertValueEquals(sumAjaxOnlyElemId, "10");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/keepAlive/keepAliveTest.xhtml";
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/LoadScriptTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/LoadScriptTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/LoadScriptTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,55 @@
+package org.richfaces.testng;
+
+import static org.testng.Assert.assertEquals;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class LoadScriptTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public LoadScriptTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testLoadScriptComponent() throws Exception {
+ _testLoadScriptComponent(Templates.SIMPLE);
+ _testLoadScriptComponent(Templates.DATATABLE);
+ _testLoadScriptComponent(Templates.MODALPANEL);
+ }
+
+ private void _testLoadScriptComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String jsCall = "summarize(%1$s, %2$s);";
+ int opr1 = 1;
+ int opr2 = 2;
+ String result = runScript(String.format(jsCall, opr1, opr2));
+ assertEquals(Integer.parseInt(result), opr1 + opr2);
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/loadScript/loadScriptTest.xhtml";
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/LoadStyleTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/LoadStyleTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/LoadStyleTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,54 @@
+package org.richfaces.testng;
+
+
+import static org.testng.Assert.assertEquals;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class LoadStyleTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public LoadStyleTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testLoadStyleComponent() throws Exception {
+ _testLoadStyleComponent(Templates.SIMPLE);
+ _testLoadStyleComponent(Templates.DATATABLE);
+ _testLoadStyleComponent(Templates.MODALPANEL);
+ }
+
+ private void _testLoadStyleComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String divId = getParentId() + "rectangle";
+ assertEquals(50, getWidthById(divId));
+ assertEquals(100, getHeightById(divId));
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/loadStyle/loadStyleTest.xhtml";
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/OrderingListTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/OrderingListTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/OrderingListTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,249 @@
+/**
+ * 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.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class OrderingListTest extends SeleniumTestBase implements RichSeleniumTest {
+ private String firstButton;
+ private String firstButtonDisabled;
+
+ private String upButton;
+ private String upButtonDisabled;
+
+ private String downButton;
+ private String downButtonDisabled;
+
+ private String lastButton;
+ private String lastButtonDisabled;
+
+ private String firstRow;
+
+ private String actionResultText;
+ private String ajax;
+ private String server;
+ private String thirdRow;
+ private String selectionText;
+ private String activeItemText;
+
+ public OrderingListTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ public OrderingListTest(String protocol, String host, String port) {
+ super(protocol, host, port);
+ }
+
+ /**
+ * 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 testOrderingListComponent() throws Exception {
+ _testOrderingListComponent(Templates.SIMPLE);
+ _testOrderingListComponent(Templates.DATATABLE);
+ _testOrderingListComponent(Templates.MODALPANEL);
+ }
+
+ private void _testOrderingListComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ initFields();
+
+ _testButtons();
+ _testActions();
+ _testJSFunctions();
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/orderingList/orderingListTest.xhtml";
+ }
+
+ private void _testButtons() {
+ writeStatus("Check if all buttons are disabled first time");
+ checkButtons(true, true, true, true);
+
+ writeStatus("Click on first row");
+ clickById(firstRow);
+ checkButtons(true, true, false, false);
+
+ writeStatus("Click on down button");
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
+ clickById(downButton);
+ checkButtons(false, false, false, false);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 1);
+
+ writeStatus("Click on last button");
+ clickById(lastButton);
+ checkButtons(false, false, true, true);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 3);
+
+ writeStatus("Click on first button");
+ clickById(firstButton);
+ checkButtons(true, true, false, false);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
+
+ cleanSelection();
+ }
+
+ private void _testActions() {
+ writeStatus("Select two rows");
+ clickById(firstRow);
+ selenium.controlKeyDown();
+ clickById(thirdRow);
+ selenium.controlKeyUp();
+ checkButtons(true, true, false, false);
+
+ writeStatus("Click on ajax button");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ AssertTextEquals(actionResultText, "item0");
+ AssertTextEquals(selectionText, "item0,item2");
+ AssertTextEquals(activeItemText, "Item [item2]");
+
+ writeStatus("Select one row");
+ clickById(firstRow);
+
+ writeStatus("Click on server link");
+ clickCommandAndWait(server);
+ AssertTextEquals(actionResultText, "item1");
+ AssertTextEquals(selectionText, "item0");
+ AssertTextEquals(activeItemText, "Item [item0]");
+ checkButtons(true, true, false, false);
+
+ cleanSelection();
+ }
+
+ private void _testJSFunctions() {
+ writeStatus("Select one row");
+ clickById(thirdRow);
+
+ writeStatus("Check if 'onupclick' event works");
+ clickById(upButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "up orderchanged");
+
+ writeStatus("Check if 'ondownclick' event works");
+ clickById(downButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "down orderchanged");
+
+ writeStatus("Check if 'ontopclick' event works");
+ clickById(firstButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "top orderchanged");
+
+ writeStatus("Check if 'onbottomclick' event works");
+ clickById(lastButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "bottom orderchanged");
+
+ cleanSelection();
+ }
+
+ private void cleanSelection() {
+ writeStatus("Unselect element");
+ clickById(firstRow);
+ selenium.controlKeyDown();
+ clickById(firstRow);
+ selenium.controlKeyUp();
+ checkButtons(true, true, true, true);
+
+ writeStatus("Submit empty selection to save it into server bean");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ }
+
+ private void checkButtons(boolean firstDisabled, boolean upDisabled, boolean downDisabled, boolean lastDisabled) {
+ if (firstDisabled) {
+ Assert.assertTrue(isVisibleById(firstButtonDisabled));
+ Assert.assertFalse(isVisibleById(firstButton));
+ } else {
+ Assert.assertFalse(isVisibleById(firstButtonDisabled));
+ Assert.assertTrue(isVisibleById(firstButton));
+ }
+
+ if (upDisabled) {
+ Assert.assertTrue(isVisibleById(upButtonDisabled));
+ Assert.assertFalse(isVisibleById(upButton));
+ } else {
+ Assert.assertFalse(isVisibleById(upButtonDisabled));
+ Assert.assertTrue(isVisibleById(upButton));
+ }
+
+ if (downDisabled) {
+ Assert.assertTrue(isVisibleById(downButtonDisabled));
+ Assert.assertFalse(isVisibleById(downButton));
+ } else {
+ Assert.assertFalse(isVisibleById(downButtonDisabled));
+ Assert.assertTrue(isVisibleById(downButton));
+ }
+
+ if (lastDisabled) {
+ Assert.assertTrue(isVisibleById(lastButtonDisabled));
+ Assert.assertFalse(isVisibleById(lastButton));
+ } else {
+ Assert.assertFalse(isVisibleById(lastButtonDisabled));
+ Assert.assertTrue(isVisibleById(lastButton));
+ }
+ }
+
+ private void initFields() {
+ String parentId = getParentId() + "_form:orderingList";
+
+ firstButton = parentId + "first";
+ firstButtonDisabled = parentId + "disfirst";
+
+ upButton = parentId + "up";
+ upButtonDisabled = parentId + "disup";
+
+ downButton = parentId + "down";
+ downButtonDisabled = parentId + "disdown";
+
+ lastButton = parentId + "last";
+ lastButtonDisabled = parentId + "dislast";
+
+ firstRow = parentId + ":0";
+ thirdRow = parentId + ":2";
+
+ actionResultText = getParentId() + "_form:actionResult";
+ selectionText = getParentId() + "_form:selection";
+ activeItemText = getParentId() + "_form:activeItem";
+ ajax = firstRow + ":_ajax";
+ server = parentId + ":1:_server";
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PanelBarTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PanelBarTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PanelBarTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,105 @@
+/**
+ * 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.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class PanelBarTest extends SeleniumTestBase implements RichSeleniumTest {
+
+
+ public PanelBarTest() {
+ super("http", "localhost", serverPort);
+ }
+
+
+ /**
+ * 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 testPanelBarComponent() throws Exception {
+ _testPanelBarComponent(Templates.SIMPLE);
+ _testPanelBarComponent(Templates.DATATABLE);
+ _testPanelBarComponent(Templates.MODALPANEL);
+ }
+
+ private void _testPanelBarComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+
+ String label2 = parentId + "label2";
+ String label3 = parentId + "label3";
+
+ String output1 = parentId + "output1";
+ String output2 = parentId + "output2";
+ String output3 = parentId + "output3";
+
+ String ajaxButton = parentId + "button_ajax";
+ String simpleButton = parentId + "button_simple";
+
+ clickById(label2);
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertTrue(isVisibleById(output2));
+ Assert.assertFalse(isVisibleById(output3));
+
+ clickCommandAndWait(simpleButton);
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertTrue(isVisibleById(output2));
+ Assert.assertFalse(isVisibleById(output3));
+
+ clickById(label3);
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertFalse(isVisibleById(output2));
+ Assert.assertTrue(isVisibleById(output3));
+
+ clickById(ajaxButton);
+ waitForAjaxCompletion();
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertFalse(isVisibleById(output2));
+ Assert.assertTrue(isVisibleById(output3));
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/panelBar/panelBarTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PanelMenuTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PanelMenuTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PanelMenuTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,227 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class PanelMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public PanelMenuTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testPanelMenuComponent() throws Exception {
+
+ _testPanelMenuComponent(Templates.SIMPLE);
+ _testPanelMenuComponent(Templates.DATATABLE);
+ _testPanelMenuComponent(Templates.MODALPANEL);
+
+ _testPanelMenuComponentSingleMode(Templates.SIMPLE);
+ _testPanelMenuComponentSingleMode(Templates.DATATABLE);
+ _testPanelMenuComponentSingleMode(Templates.MODALPANEL);
+
+ _testPanelMenuItemAction(Templates.SIMPLE);
+ _testPanelMenuItemAction(Templates.DATATABLE);
+ _testPanelMenuItemAction(Templates.MODALPANEL);
+
+ }
+
+ private void _testPanelMenuComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ String ajaxGroup = "tablehide" + parentId + "pGroup1";
+ String serverGroup = "tablehide" + parentId + "pGroup2";
+ String clientGroup = "tablehide" + parentId + "pGroup3";
+ String disabledGroup = "tablehide" + parentId + "pGroup4";
+
+ String ajaxItem = "tablehide" + parentId + "pItem1";
+ String serverItem = "tablehide" + parentId + "pItem2";
+ String clientItem = "tablehide" + parentId + "pItem3";
+ String disabledItem = "tablehide" + parentId + "pItem4";
+
+ writeStatus("Click on ajax group");
+ clickById(ajaxGroup);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(serverGroup);
+ AssertValueEquals(inputId, "pGroup2");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(ajaxItem));
+ Assert.assertTrue(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on ajax group");
+ clickById(ajaxGroup);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1");
+ AssertTextEquals(outputId, "3");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertTrue(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(serverGroup);
+
+ AssertValueEquals(inputId, "pGroup2");
+ AssertTextEquals(outputId, "4");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on client group");
+ clickById(clientGroup);
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertTrue(isVisibleById(clientItem));
+
+ writeStatus("Click on client group");
+ clickById(clientGroup);
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on disabled client group");
+ clickById(disabledGroup);
+ Assert.assertFalse(isVisibleById(disabledItem));
+ }
+
+ private void _testPanelMenuComponentSingleMode(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ String ajaxGroup = "tablehide" + parentId + "pGroup1_single";
+ String serverGroup = "tablehide" + parentId + "pGroup2_single";
+ String clientGroup = "tablehide" + parentId + "pGroup3_single";
+ String disabledGroup = "tablehide" + parentId + "pGroup4_single";
+
+ String ajaxItem = "tablehide" + parentId + "pItem1_single";
+ String serverItem = "tablehide" + parentId + "pItem2_single";
+ String clientItem = "tablehide" + parentId + "pItem3_single";
+ String disabledItem = "tablehide" + parentId + "pItem4_single";
+
+ writeStatus("Click on ajax group");
+ clickById(ajaxGroup);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1_single");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(serverGroup);
+ AssertValueEquals(inputId, "pGroup2_single");
+ AssertTextEquals(outputId, "2");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertTrue(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on ajax group");
+ clickById(ajaxGroup);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1_single");
+ AssertTextEquals(outputId, "3");
+ Assert.assertTrue(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(serverGroup);
+ AssertValueEquals(inputId, "pGroup2_single");
+ AssertTextEquals(outputId, "4");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertTrue(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on client group");
+ clickById(clientGroup);
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertTrue(isVisibleById(clientItem));
+
+ writeStatus("Click on client group");
+ clickById(clientGroup);
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on disabled client group");
+ clickById(disabledGroup);
+ Assert.assertFalse(isVisibleById(disabledItem));
+ }
+
+ private void _testPanelMenuItemAction(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ String group = "tablehide" + parentId + "pGroup1";
+ String groupSingle = "tablehide" + parentId + "pGroup1_single";
+
+ String item = "tablehide" + parentId + "pItem1";
+ String itemSingle = "tablehide" + parentId + "pItem1_single";
+
+ writeStatus("Click on ajax group");
+ clickById(group);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1");
+
+ writeStatus("Click on ajax group");
+ clickById(groupSingle);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1_single");
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(item);
+ AssertValueEquals(inputId, "pItem1");
+ AssertTextEquals(outputId, "1");
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(itemSingle);
+ AssertValueEquals(inputId, "pItem1_single");
+ AssertTextEquals(outputId, "2");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/panelMenu/panelMenuTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PickListTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PickListTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/PickListTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,103 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class PickListTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public PickListTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testPickListComponent() throws Exception {
+ _testPickListComponent(Templates.SIMPLE);
+ _testPickListComponent(Templates.DATATABLE);
+ _testPickListComponent(Templates.MODALPANEL);
+ }
+
+ private void _testPickListComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String pickListId = "pickList";
+ String copyElemId = parentId + pickListId + "discopy";
+ String copyAllElemId = parentId + pickListId + "copyAll";
+ String removeElemId = parentId + pickListId + "disremove";
+ String removeAllElemId = parentId + pickListId + "removeAll";
+
+ writeStatus("Check move controls customized labels");
+
+ AssertTextEquals(copyElemId, "MOVE");
+ AssertTextEquals(copyAllElemId, "MOVE ALL");
+ AssertTextEquals(removeElemId, "TAKE AWAY");
+ AssertTextEquals(removeAllElemId, "TAKE ALL AWAY");
+
+ String destListId = parentId + pickListId + "tlTbody";
+ String srcListId = parentId + pickListId + "tbody";
+
+ writeStatus("Check initial disposition");
+
+ Assert.assertEquals(getNumberOfChildren(srcListId), 6);
+ Assert.assertEquals(getNumberOfChildren(destListId), 2);
+
+ writeStatus("Verify initial selected items.");
+
+ Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[1]"), "ZHURIK");
+ Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[2]"), "MELESHKO");
+
+ writeStatus("Try to select first item and check state thereafter");
+
+ selenium.doubleClick("xpath=//tbody[@id='" + srcListId + "']/tr/td");
+
+ Assert.assertEquals(getNumberOfChildren(srcListId), 5);
+ Assert.assertEquals(getNumberOfChildren(destListId), 3);
+ Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[3]"), "LEONTIEV");
+
+ }
+
+ /**
+ * Returns number of children for DOM element with given id.
+ * @param elemId DOM element id
+ * @return number of children
+ */
+ private int getNumberOfChildren(String elemId) {
+ int retVal = -1;
+ try {
+ retVal = Integer.parseInt(runScript("dom=selenium.browserbot.getCurrentWindow().$('" + elemId
+ + "').childElements().size()"));
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+
+ return retVal;
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/pickList/pickListTest.xhtml";
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ProgressBarTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ProgressBarTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/ProgressBarTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,139 @@
+package org.richfaces.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class ProgressBarTest extends SeleniumTestBase implements
+ RichSeleniumTest {
+
+ public ProgressBarTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testProgressBarComponent() {
+ _testProgressBarComponent(Templates.SIMPLE);
+ _testProgressBarComponent(Templates.DATATABLE);
+ _testProgressBarComponent(Templates.MODALPANEL);
+ }
+
+ private void _testProgressBarComponent(Templates template) {
+
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ String progressBarId = parentId + "progressBar1";
+ int value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value < 0);
+ String text = getTextById(progressBarId);
+ writeStatus("Check if process not started");
+ Assert.assertTrue(text.startsWith("Process not started"));
+
+ writeStatus("Enable polling");
+ enableProgressBar(progressBarId, true);
+
+ pause(5000, progressBarId);
+
+ writeStatus("Disable polling");
+ enableProgressBar(progressBarId, false);
+
+ writeStatus("Check label");
+ text = getTextById(progressBarId + ":remain");
+ Assert.assertTrue(text.endsWith("%"));
+
+ writeStatus("Check value");
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value > 0);
+
+ writeStatus("Enable polling");
+ enableProgressBar(progressBarId, true);
+
+ pause(5000, progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value));
+
+ writeStatus("Disable polling");
+ enableProgressBar(progressBarId, false);
+
+ value = getProgressBarValue(progressBarId);
+ pause(1500, progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(getProgressBarValue(progressBarId) == value);
+
+ clickById(parentId + "_complete");
+ waitForAjaxCompletion();
+ writeStatus("Check if process completed");
+ text = getTextById(progressBarId);
+ Assert.assertTrue(text.startsWith("Process completed"));
+
+
+ // - Test client mode
+
+ writeStatus("Check value");
+ progressBarId = parentId + "progressBar2";
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value == -5);
+
+ text = getTextById(progressBarId);
+ writeStatus("Check if process not started");
+ Assert.assertTrue(text.startsWith("Process not started"));
+
+ setProgressBarValue(progressBarId, 20);
+ value = getProgressBarValue(progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(value == 20);
+
+ setProgressBarValue(progressBarId, 60);
+ value = getProgressBarValue(progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(value == 60);
+
+ clickById(parentId + "_reset");
+ waitForAjaxCompletion();
+
+ }
+
+ private void enableProgressBar(String id, boolean enable) {
+ invokeFromComponent(id, (enable ? "enable" : "disable"), null);
+ }
+
+ private void setProgressBarValue(String id, Object value) {
+ invokeFromComponent(id, "setValue", value);
+ }
+
+ private Integer getProgressBarValue(String id) {
+ String value = invokeFromComponent(id, "getValue", null); //runScript(script.toString());
+ Integer v = Integer.parseInt(value);
+ return v;
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/progressBar/progressBarTest.xhtml";
+ }
+
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/SimpleTogglePanelTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/SimpleTogglePanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/SimpleTogglePanelTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,110 @@
+/**
+ * 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.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public SimpleTogglePanelTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testSimpleTogglePanelComponent() throws Exception {
+ _testSimpleTogglePanelComponent(Templates.SIMPLE);
+ _testSimpleTogglePanelComponent(Templates.DATATABLE);
+ _testSimpleTogglePanelComponent(Templates.MODALPANEL);
+ }
+
+ private void _testSimpleTogglePanelComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ String ajaxHeader = parentId + "panel1_header";
+ String serverHeader = parentId + "panel2_header";
+ String clientHeader = parentId + "panel3_header";
+
+ String ajaxBody = parentId + "panel1_body";
+ String serverBody = parentId + "panel2_body";
+ String clientBody = parentId + "panel3_body";
+
+ clickById(clientHeader);
+ Assert.assertTrue(isVisibleById(clientBody));
+ clickById(clientHeader);
+ Assert.assertFalse(isVisibleById(clientBody));
+
+ clickById(ajaxHeader);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "panel1");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(ajaxBody));
+
+ clickById(ajaxHeader);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "panel1");
+ AssertTextEquals(outputId, "2");
+ Assert.assertFalse(isVisibleById(ajaxBody));
+
+ clickCommandAndWait(serverHeader);
+ AssertValueEquals(inputId, "panel2");
+ AssertTextEquals(outputId, "3");
+ Assert.assertTrue(isVisibleById(serverBody));
+
+ clickCommandAndWait(serverHeader);
+ AssertValueEquals(inputId, "panel2");
+ AssertTextEquals(outputId, "4");
+ Assert.assertFalse(isVisibleById(serverBody));
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/simpleTogglePanel/simpleTogglePanel.xhtml";
+ }
+
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/SpacerTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/SpacerTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/SpacerTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,123 @@
+/**
+ * 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.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class SpacerTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public SpacerTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testSimpleTogglePanelComponent() throws Exception {
+ _testSimpleTogglePanelComponent(Templates.SIMPLE);
+ _testSimpleTogglePanelComponent(Templates.DATATABLE);
+ _testSimpleTogglePanelComponent(Templates.MODALPANEL);
+ }
+
+ private void _testSimpleTogglePanelComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId();
+ String spacerId = parentId + "sp";
+
+ writeStatus("Check width ");
+ assertWidth(1 + 2, spacerId);
+
+ writeStatus("Check height ");
+ assertHeight(5 + 2, spacerId);
+
+ writeStatus("Check styleClass ");
+ assertStyleClass("sp", spacerId);
+
+ writeStatus("Check style ");
+ assertStyleClass("border: solid 1px green;", spacerId);
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/spacer/spacerTest.xhtml";
+ }
+
+ private void assertWidth(int width, String spacerId) {
+ StringBuffer script = new StringBuffer(" document.getElementById('");
+ script.append(spacerId);
+ script.append("').offsetWidth");
+
+ String w = runScript(script.toString());
+ Assert.assertEquals(w, String.valueOf(width));
+ }
+
+ private void assertHeight(int height, String spacerId) {
+ StringBuffer script = new StringBuffer(" document.getElementById('");
+ script.append(spacerId);
+ script.append("').offsetHeight");
+
+ String h = runScript(script.toString());
+ Assert.assertEquals(h, String.valueOf(height));
+ }
+
+ private void assertStyleClass(String styleClass, String spacerId) {
+ StringBuffer script = new StringBuffer(" document.getElementById('");
+ script.append(spacerId);
+ script.append("').className");
+
+ String sc = runScript(script.toString());
+ if (sc != null) {
+ Assert.assertTrue(sc.endsWith("sp"));
+ } else {
+ Assert.fail("ClassName is null");
+ }
+ }
+ private void assertStyle(String style, String spacerId) {
+ StringBuffer script = new StringBuffer(" document.getElementById('");
+ script.append(spacerId);
+ script.append("').style");
+
+ String s = runScript(script.toString());
+ Assert.assertEquals(s, style);
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/TabPanelTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/TabPanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/TabPanelTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,127 @@
+/**
+ * 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.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+import com.thoughtworks.selenium.SeleniumException;
+
+public class TabPanelTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public TabPanelTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testTabPanelComponent() throws Exception {
+ _testRichTabPanelComponent(Templates.SIMPLE);
+ _testRichTabPanelComponent(Templates.DATATABLE);
+ _testRichTabPanelComponent(Templates.MODALPANEL);
+ }
+
+ private void _testRichTabPanelComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+ String linkId = parentId + "tab2_lbl";
+ String tabId1 = parentId + "tab1";
+ String tabId2 = parentId + "tab2";
+ String tabId4 = parentId + "tab4";
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ writeStatus("Click on tab1");
+ clickById(linkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "tab2");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(tabId2));
+ Assert.assertFalse(isVisibleById(tabId4));
+ try {
+ getTextById(tabId1);
+ Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
+ } catch (SeleniumException se) {
+
+ }
+
+ writeStatus("Click on tab2");
+ linkId = parentId + "tab1_lbl";
+ clickCommandAndWait(linkId);
+ AssertValueEquals(inputId, "tab1");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(tabId1));
+ Assert.assertFalse(isVisibleById(tabId4));
+ try {
+ getTextById(tabId2);
+ Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
+ } catch (SeleniumException se) {
+
+ }
+
+ writeStatus("Click on tab3");
+ linkId = parentId + "tab3_lbl";
+ clickById(linkId);
+ AssertValueEquals(inputId, "tab1");
+ Assert.assertTrue(isVisibleById(tabId1));
+
+ writeStatus("Click on tab4");
+ linkId = parentId + "tab4_lbl";
+ clickById(linkId);
+ Assert.assertTrue(isVisibleById(tabId4));
+ Assert.assertFalse(isVisibleById(tabId1));
+ try {
+ getTextById(tabId2);
+ Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
+ } catch (SeleniumException se) {
+
+ }
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/tabPanel/tabPanelTest.xhtml";
+ }
+
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/TogglePanelTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/TogglePanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/test/TogglePanelTest.java 2008-05-26 14:23:42 UTC (rev 8760)
@@ -0,0 +1,194 @@
+/**
+ * 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.testng;
+
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+import com.thoughtworks.selenium.SeleniumException;
+
+public class TogglePanelTest extends SeleniumTestBase implements
+ RichSeleniumTest {
+
+ public TogglePanelTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * 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 testTogglePanelComponent() throws Exception {
+ _testTogglePanelComponent(Templates.SIMPLE);
+ _testTogglePanelComponent(Templates.DATATABLE);
+ _testTogglePanelComponent(Templates.MODALPANEL);
+ }
+
+ private void _testTogglePanelComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ String controlNext = parentId + "ajax_next";
+ String controlOne = parentId + "ajax_one";
+ String controlTwo = parentId + "ajax_two";
+
+ String oneFacet = parentId + "ajax_state_one";
+ String twoFacet = parentId + "ajax_state_two";
+
+ writeStatus("Click on ajax controlNext");
+ clickById(controlNext);
+ waitForAjaxCompletion();
+ //pause(6000, "panel_ajax");
+ AssertValueEquals(inputId, "ajax_next");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert
+ .fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
+ } catch (SeleniumException se) {
+
+ }
+
+ writeStatus("Click on ajax controlOne");
+ clickById(controlOne);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "ajax_one");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(oneFacet));
+ try {
+ getTextById(twoFacet);
+ Assert
+ .fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
+ } catch (SeleniumException se) {
+
+ }
+
+ writeStatus("Click on ajax controlTwo");
+ clickById(controlTwo);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "ajax_two");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert
+ .fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
+ } catch (SeleniumException se) {
+
+ }
+
+ controlNext = parentId + "server_next";
+ controlOne = parentId + "server_one";
+ controlTwo = parentId + "server_two";
+ oneFacet = parentId + "server_state_one";
+ twoFacet = parentId + "server_state_two";
+
+ writeStatus("Click on controlNext");
+ clickCommandAndWait(controlNext);
+ AssertValueEquals(inputId, "server_next");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert
+ .fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
+ } catch (SeleniumException se) {
+
+ }
+
+ writeStatus("Click on server controlOne");
+ clickCommandAndWait(controlOne);
+ AssertValueEquals(inputId, "server_one");
+ AssertTextEquals(outputId, "3");
+ Assert.assertTrue(isVisibleById(oneFacet));
+ try {
+ getTextById(twoFacet);
+ Assert
+ .fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
+ } catch (SeleniumException se) {
+
+ }
+
+ writeStatus("Click on server controlTwo");
+ clickCommandAndWait(controlTwo);
+ AssertValueEquals(inputId, "server_two");
+ AssertTextEquals(outputId, "4");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert
+ .fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
+ } catch (SeleniumException se) {
+
+ }
+
+ controlNext = parentId + "client_next";
+ controlOne = parentId + "client_one";
+ controlTwo = parentId + "client_two";
+ oneFacet = parentId + "client_state_one";
+ twoFacet = parentId + "client_state_two";
+
+ writeStatus("Click on client controlNext");
+ clickById(controlNext);
+ Assert.assertTrue(isVisibleById(twoFacet));
+ Assert.assertFalse(isVisibleById(oneFacet));
+
+ writeStatus("Click on client controlOne");
+ clickById(controlOne);
+ Assert.assertTrue(isVisibleById(oneFacet));
+ Assert.assertFalse(isVisibleById(twoFacet));
+
+ writeStatus("Click on client controlTwo");
+ clickById(controlTwo);
+ Assert.assertTrue(isVisibleById(twoFacet));
+ Assert.assertFalse(isVisibleById(oneFacet));
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/togglePanel/togglePanelTest.xhtml";
+ }
+
+}
16 years, 7 months
JBoss Rich Faces SVN: r8759 - in trunk/test-applications/seleniumTest: src/main/java/org/ajax4jsf and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-05-26 10:22:44 -0400 (Mon, 26 May 2008)
New Revision: 8759
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java
Removed:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JCommandTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JPollTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JRegionTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ComboBoxTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ContextMenuTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PickListTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestListener.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-05-26 14:22:44 UTC (rev 8759)
@@ -63,7 +63,7 @@
<dependency>
<groupId>el-impl</groupId>
<artifactId>el-impl</artifactId>
- </dependency>
+ </dependency>
</dependencies>
<type>embedded</type>
</container>
@@ -234,6 +234,11 @@
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
<version>3.2.1-SNAPSHOT</version>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_07</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JCommandTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JCommandTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JCommandTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,55 +0,0 @@
-package org.ajax4jsf;
-
-import java.util.Date;
-
-import javax.faces.event.ActionEvent;
-
-public class A4JCommandTestBean {
-
- private String value = "1";
-
- private String param;
-
- public void actionListener(ActionEvent event) {
- this.value = this.value + "3";
- }
-
- public String action () {
- this.value = this.value + "4";
- return null;
- }
-
- public String getDate() {
- return String.valueOf(new Date().getTime());
- }
-
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * @param value the value to set
- */
- public void setValue(String value) {
- value = value + "2";
- this.value = value;
- }
-
- /**
- * @return the param
- */
- public String getParam() {
- return param;
- }
-
- /**
- * @param param the param to set
- */
- public void setParam(String param) {
- this.param = param;
- }
-
-}
\ No newline at end of file
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,47 +0,0 @@
-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;
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JPollTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JPollTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JPollTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,58 +0,0 @@
-package org.ajax4jsf;
-
-import javax.faces.event.ActionEvent;
-
-public class A4JPollTestBean {
-
- private Integer i = 1;
-
- private static final String POLLING = "Polling";
-
- private boolean enabled = false;
-
- public void start(ActionEvent event) {
- enabled = true;
- }
-
- public void listener(ActionEvent event) {
- i++;
- if (i == 8) {
- enabled = false;
- }
- }
-
- public String getText() {
- return POLLING.substring(0, i);
- }
-
- /**
- * @return the i
- */
- public Integer getI() {
- return i;
- }
-
- /**
- * @param i the i to set
- */
- public void setI(Integer i) {
- this.i = i;
- }
-
- /**
- * @return the enabled
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /**
- * @param enabled the enabled to set
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
-
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JRegionTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JRegionTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JRegionTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,67 +0,0 @@
-package org.ajax4jsf;
-
-public class A4JRegionTestBean {
-
- private Integer internal = 0;
-
- private Integer external = 0;
-
- private Integer value = 0;
-
- /**
- * Gets value of internal field.
- *
- * @return value of internal field
- */
- public Integer getInternal() {
- return internal;
- }
-
- /**
- * Set a new value for internal field.
- *
- * @param internal
- * a new value for internal field
- */
- public void setInternal(Integer internal) {
- this.internal = internal;
- }
-
- /**
- * Gets value of external field.
- *
- * @return value of external field
- */
- public Integer getExternal() {
- return external;
- }
-
- /**
- * Set a new value for external field.
- *
- * @param external
- * a new value for external field
- */
- public void setExternal(Integer external) {
- this.external = external;
- }
-
- /**
- * Gets value of value field.
- *
- * @return value of value field
- */
- public Integer getValue() {
- return value;
- }
-
- /**
- * Set a new value for value field.
- *
- * @param value
- * a new value for value field
- */
- public void setValue(Integer value) {
- this.value = value;
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,16 +0,0 @@
-package org.ajax4jsf;
-
-import javax.faces.event.ActionEvent;
-
-public class A4JStatusTestBean {
-
- public void actionListener(ActionEvent event) {
- //mega time-consuming operation - sleeping
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,45 +0,0 @@
-package org.ajax4jsf;
-
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-
-public class A4jTestBean {
-
- private String param = "Not set yet";
- private boolean checked;
-
- public String getParam() {
- return param;
- }
-
- public void setParam(String param) {
- this.param = param;
- }
-
- private void checkMap() {
- Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- for (String key : params.keySet()) {
- System.out.println(key + "=" + params.get(key));
- }
- }
-
- public void perform(ActionEvent actionEvent) {
- System.out.println("A4jTestBean.perform(ActionEvent) = " + param);
- checkMap();
- }
-
- public void perform() {
- System.out.println("A4jTestBean.perform() = " + param);
- checkMap();
- }
-
- public boolean isChecked() {
- return checked;
- }
-
- public void setChecked(boolean checked) {
- this.checked = checked;
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,206 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * 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;
-
-import java.text.DateFormat;
-import java.util.Date;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.component.html.HtmlOutputText;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ValueChangeEvent;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-/**
- * @author $Autor$
- *
- */
-public class Bean {
-
- private java.lang.String text;
-
- private String text2="<%%%>";
-
- private String[] array = {"one]","two]]>"};
-
- private String[][] array2 = {{"one","two"},{"three","four"}};
-
- private UIComponent component;
-
- private HtmlOutputText outputComponent;
-
- /**
- * @return the component
- */
- public UIComponent getComponent() {
- return component;
- }
-
- /**
- * @param component the component to set
- */
- public void setComponent(UIComponent component) {
- this.component = component;
- }
-
- public java.lang.String getText() {
- return text;
- }
-
- public void setText(java.lang.String text) {
- this.text = text;
- }
-
- public String ok(){
- System.out.println("Button pressed");
- setText("testOk");
- return null;
- }
-
- public String setCookie() {
- ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
- HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();
- Cookie cookie = new Cookie("test", "Setted at time "+System.currentTimeMillis());
- cookie.setMaxAge(60 * 60 * 24 * 365);
- response.addCookie(cookie);
- return "verify_cookie";
- }
-
- public String getTestCookie(){
- ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
- HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
- Cookie[] cookies = request.getCookies();
- for (int i = 0; i < cookies.length; i++) {
- if("test".equals(cookies[i].getName())){
- return cookies[i].getValue();
- }
- }
- return null;
- }
-
- /**
- * @return the array
- */
- public String[] getArray() {
- return array;
- }
-
- /**
- * @param array the array to set
- */
- public void setArray(String[] array) {
- this.array = array;
- }
-
- /**
- * @return the array2
- */
- public String[][] getArray2() {
- return array2;
- }
-
- /**
- * @param array2 the array2 to set
- */
- public void setArray2(String[][] array2) {
- this.array2 = array2;
- }
-
- /**
- * @return the text2
- */
- public String getText2() {
- return text2;
- }
-
- /**
- * @param text2 the text2 to set
- */
- public void setText2(String test2) {
- this.text2 = test2;
- }
-
- public void validate(FacesContext context, UIComponent input,Object newValue) {
- FacesMessage msg = new FacesMessage("#{bean.validate} called");
- context.addMessage(input.getClientId(context), msg);
- System.out.println("validate");
- }
-
- public void onChange(ValueChangeEvent event) {
- FacesContext context = FacesContext.getCurrentInstance();
- UIComponent input = event.getComponent();
- FacesMessage msg = new FacesMessage("#{bean.onChange} called");
- context.addMessage(input.getClientId(context), msg);
- System.out.println("onChange");
-
- }
-
- public void validate2(FacesContext context, UIComponent input,Object newValue) {
- FacesMessage msg = new FacesMessage("#{bean.validate2} called");
- context.addMessage(input.getClientId(context), msg);
- System.out.println("validate2");
-
- }
-
- public void onChange2(ValueChangeEvent event) {
- FacesContext context = FacesContext.getCurrentInstance();
- UIComponent input = event.getComponent();
- FacesMessage msg = new FacesMessage("#{bean.onChange2} called");
- context.addMessage(input.getClientId(context), msg);
- System.out.println("onChange2");
-
- }
-
- public String getTime(){
- return (new Date(System.currentTimeMillis())).toString();
- }
-
- public String clearSession(){
- ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
- HttpSession session = (HttpSession) externalContext.getSession(false);
- if(null != session){
- session.setMaxInactiveInterval(5);
- }
- return null;
- }
-
- /**
- * @return the outputComponent
- */
- public HtmlOutputText getOutputComponent() {
- outputComponent = new HtmlOutputText();
- return outputComponent;
- }
-
- /**
- * @param outputComponent the outputComponent to set
- */
- public void setOutputComponent(HtmlOutputText outputComponent) {
- this.outputComponent = outputComponent;
- }
-
-}
\ No newline at end of file
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,170 +0,0 @@
-/**
- * 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;
-
-import java.lang.reflect.Method;
-import java.text.DateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Locale;
-import java.util.TimeZone;
-
-import javax.faces.convert.DateTimeConverter;
-
-public class CalendarTestBean {
-
- public static final String DATE_PATTERN = "MM/dd/yyyy HH:mm";
-
- public static final Locale LOCALE = new Locale("US");
-
- public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("GMT+2");
-
- public static Date DEFAULT_DATE;
-
- private static DateTimeConverter DEFAULT_CONVERTER;
-
- public static DateFormat DATE_FORMAT;
-
- // constructor for static fields
- static {
- setupDefaultConverter();
- setupDefaultDate();
- }
-
- private String datePattern ;
-
- private Locale locale;
-
- private TimeZone timeZone;
-
- private Date selectedDate;
-
- private String selectedDateString;
-
- public CalendarTestBean() {
- selectedDate = DEFAULT_DATE;
- resetSelectedDateString();
-
- datePattern = DATE_PATTERN;
- locale = LOCALE;
- timeZone = TIME_ZONE;
- }
-
- public Date getSelectedDate() {
- return selectedDate;
- }
-
- public void setSelectedDate(Date selectedDate) {
- this.selectedDate = selectedDate;
- resetSelectedDateString();
- }
-
- public void resetSelectedDateString() {
- setSelectedDateString(DATE_FORMAT.format(getSelectedDate()));
- }
-
- public String getSelectedDateString() {
- return selectedDateString;
- }
-
- public void setSelectedDateString(String selectedDateString) {
- this.selectedDateString = selectedDateString;
- }
-
- public String getDatePattern() {
- return datePattern;
- }
-
- public Locale getLocale() {
- return locale;
- }
-
- public TimeZone getTimeZone() {
- return timeZone;
- }
-
- public void setDatePattern(String datePattern) {
- this.datePattern = datePattern;
- }
-
- public void setLocale(Locale locale) {
- this.locale = locale;
- }
-
- public void setTimeZone(TimeZone timeZone) {
- this.timeZone = timeZone;
- }
-
- public static Calendar getCalendar() {
- return Calendar.getInstance(CalendarTestBean.TIME_ZONE, CalendarTestBean.LOCALE);
- }
-
- /**
- * Setup the default date
- */
- private static void setupDefaultDate() {
- DEFAULT_DATE = getDayInMay(10);
- }
-
- public static Date getDayInMay(int dayOfMonth) {
- Calendar calendar = getCalendar();
- calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
- calendar.set(Calendar.MONTH, Calendar.MAY);
- calendar.set(Calendar.YEAR, 2008);
- calendar.set(Calendar.HOUR_OF_DAY, 18);
- calendar.set(Calendar.MINUTE, 25);
- calendar.set(Calendar.SECOND, 0);
- calendar.set(Calendar.MILLISECOND, 0);
-
- return calendar.getTime();
- }
-
- /**
- * Setup the default converter
- */
- private static void setupDefaultConverter() {
- DEFAULT_CONVERTER = new DateTimeConverter();
-
- DEFAULT_CONVERTER.setPattern(DATE_PATTERN);
- DEFAULT_CONVERTER.setLocale(LOCALE);
- DEFAULT_CONVERTER.setTimeZone(TIME_ZONE);
-
- try {
- Method method = null;
- Method[] declaredMethods = DateTimeConverter.class.getDeclaredMethods();
- for (int i = 0; i < declaredMethods.length; i++) {
- if (declaredMethods[i].getName().equals("getDateFormat")) {
- method = declaredMethods[i];
- break;
- }
- }
- if (method != null) {
-
- method.setAccessible(true);
- DATE_FORMAT = (DateFormat) method.invoke(DEFAULT_CONVERTER, DEFAULT_CONVERTER.getLocale());
- DATE_FORMAT.setTimeZone(DEFAULT_CONVERTER.getTimeZone());
- }
- } catch (Exception e) {
- // skip exception
- }
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,62 +0,0 @@
-/**
- * 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;
-
-/**
- * @author shura
- *
- */
-public class ChildBean {
-
- private String name;
-
- private int qty;
-
- /**
- * @return the name
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @return the qty
- */
- public int getQty() {
- return this.qty;
- }
-
- /**
- * @param qty the qty to set
- */
- public void setQty(int qty) {
- this.qty = qty;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ComboBoxTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ComboBoxTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ComboBoxTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,38 +0,0 @@
-package org.ajax4jsf;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.faces.model.SelectItem;
-
-public class ComboBoxTestBean {
-
- private List<SelectItem> treeItems;
- private List<String> treeNames;
-
- public ComboBoxTestBean() {
- treeNames = Arrays.asList("Pine", "Birch", "Aspen", "Spruce", "Oak", "Maple", "Ash", "Lime");
- treeItems = new ArrayList<SelectItem>();
- for (String treeName : treeNames) {
- treeItems.add(new SelectItem(treeName, treeName));
- }
- }
-
- /**
- * Gets value of treeItems field.
- * @return value of treeItems field
- */
- public List<SelectItem> getTreeItems() {
- return treeItems;
- }
-
- /**
- * Gets value of treeNames field.
- * @return value of treeNames field
- */
- public List<String> getTreeNames() {
- return treeNames;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ContextMenuTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ContextMenuTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ContextMenuTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,65 +0,0 @@
-/**
- * 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;
-
-import javax.faces.event.ActionEvent;
-
-public class ContextMenuTestBean {
-
- private String value;
- private int value2;
-
- public ContextMenuTestBean() {
- value = "";
- value2 = 0;
- }
-
- public void actionListener(ActionEvent event) {
- this.value = event.getComponent().getId();
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String action() {
- if (4 == value2 ) {
- value2 = 1;
- } else {
- value2++;
- }
- return null;
- }
-
- public int getValue2() {
- return value2;
- }
-
- public void setValue2(int value2) {
- this.value2 = value2;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,135 +0,0 @@
-/**
- * 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;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Properties;
-
-public class Data {
-
- private static final String[] mnames={"Jan","Feb","Mar","Apr","May"};
-
- private List mounths = new ArrayList();
-
- private List numbers = new ArrayList();
-
- private boolean c3rendered=true;
-
- private boolean c2rendered=true;
-
- /**
- * @return the c3rendered
- */
- public boolean isC3rendered() {
- return this.c3rendered;
- }
-
- /**
- * @param c3rendered the c3rendered to set
- */
- public void setC3rendered(boolean c3rendered) {
- this.c3rendered = c3rendered;
- }
-
- public String toggleColumn() {
- this.c3rendered = !this.c3rendered;
- return null;
- }
- /**
- * @return the numbers
- */
- public List getNumbers() {
- return this.numbers;
- }
-
- /**
- * @param numbers the numbers to set
- */
- public void setNumbers(List numbers) {
- this.numbers = numbers;
- }
-
- public Data() {
- Properties properties = System.getProperties();
- Enumeration keys = properties.keys();
- for(int i=0;i<5;i++){
- DataBean bean = new DataBean();
- int l = (int)(Math.random()*5)+1;
- bean.setTotal(0);
- bean.setMounth(mnames[i]);
- mounths.add(bean);
- for(int j=0;j<l;j++){
- ChildBean child = new ChildBean();
- child.setName((String) keys.nextElement());
- int qty = (int)(Math.random()*10);
- bean.setTotal(bean.getTotal()+qty);
- child.setQty(qty);
- bean.getDetail().add(child);
- }
- }
- for(int i=0;i<16;i++){
- numbers.add(new Integer(i));
- }
- }
-
- /**
- * @return the mounths
- */
- public List getMounths() {
- return this.mounths;
- }
-
- /**
- * @param mounths the mounths to set
- */
- public void setMounths(List mounths) {
- this.mounths = mounths;
- }
-
- /**
- * @return the c2rendered
- */
- public boolean isC2rendered() {
- return this.c2rendered;
- }
-
- /**
- * @param c2rendered the c2rendered to set
- */
- public void setC2rendered(boolean c2rendered) {
- this.c2rendered = c2rendered;
- }
-
- public int getC2span(){
- return c3rendered?1:2;
- }
-
- public int getC1span(){
- int i = c2rendered?1:c3rendered?2:3;
- return i;
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,119 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.faces.event.ValueChangeEvent;
-
-/**
- * @author asmirnov
- *
- */
-public class DataBean {
- private List detail = new ArrayList();
-
- private String mounth;
-
- private int total;
-
- private int price;
-
- private boolean checked=true;
- /**
- *
- */
- public DataBean() {
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @return the detail
- */
- public List getDetail() {
- return this.detail;
- }
-
- /**
- * @param detail the detail to set
- */
- public void setDetail(List detail) {
- this.detail = detail;
- }
-
- /**
- * @return the mounth
- */
- public String getMounth() {
- return this.mounth;
- }
-
- /**
- * @param mounth the mounth to set
- */
- public void setMounth(String mounth) {
- this.mounth = mounth;
- }
-
- /**
- * @return the total
- */
- public int getTotal() {
- return this.total;
- }
-
- /**
- * @param total the total to set
- */
- public void setTotal(int total) {
- this.total = total;
- }
-
- /**
- * @return the checked
- */
- public boolean isChecked() {
- System.out.println("Invoke get checked for mounth "+getMounth()+", checked:"+checked);
- return this.checked;
- }
-
- /**
- * @param checked the checked to set
- */
- public void setChecked(boolean checked) {
- System.out.println("Invoke set checked for mounth "+getMounth()+", checked:"+checked);
- this.checked = checked;
- }
-
- public String check(){
- checked = !checked;
- System.out.println("Invoke check action for mounth "+getMounth()+", checked:"+checked);
- return null;
- }
-
- public String inc(){
- total++;
- return null;
- }
-
- public void checkChanged(ValueChangeEvent event) {
- System.out.println("Checked changed for mounth "+getMounth());
- }
-
- /**
- * @return the price
- */
- public int getPrice() {
- return price;
- }
-
- /**
- * @param price the price to set
- */
- public void setPrice(int price) {
- this.price = price;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,159 +0,0 @@
-package org.ajax4jsf;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.faces.event.ActionEvent;
-
-import org.ajax4jsf.model.Column;
-import org.richfaces.model.Ordering;
-
-@SuppressWarnings("unchecked")
-public class DataTableBean {
-
- private int rows = 20;
-
- private int column = 3;
-
- private int begin = 1;
-
- private int end = 10;
-
- private List model;
-
- private List columns;
-
- private Ordering ordering;
-
- public DataTableBean() {
- init();
- }
-
- public void init(ActionEvent event) {
- init();
- }
-
- public String getDate() {
- return new Date().toLocaleString();
- }
-
- private void init() {
- model = new ArrayList();
- for (int i = 0; i < rows; i++) {
- String [] m = new String[column];
- for (int j = 0; j < column; j++) {
- m[j] = String.valueOf(i + j);
- }
- model.add(m);
- }
-
- columns = new ArrayList();
- for (int i = 0; i < column; i++) {
- columns.add(new Column("header","footer", i));
- }
- }
-
- /**
- * @return the columns
- */
- public int getColumn() {
- return column;
- }
-
- /**
- * @param columns
- * the columns to set
- */
- public void setColumn(int column) {
- this.column = column;
- }
-
- /**
- * @return the rows
- */
- public int getRows() {
- return rows;
- }
-
- /**
- * @param rows
- * the rows to set
- */
- public void setRows(int rows) {
- this.rows = rows;
- }
-
- /**
- * @return the model
- */
- public List getModel() {
- return model;
- }
-
- /**
- * @param model
- * the model to set
- */
- public void setModel(List model) {
- this.model = model;
- }
-
- /**
- * @return the columns
- */
- public List getColumns() {
- return columns;
- }
-
- /**
- * @param columns
- * the columns to set
- */
- public void setColumns(List columns) {
- this.columns = columns;
- }
-
- /**
- * @return the ordering
- */
- public Ordering getOrdering() {
- return ordering;
- }
-
- /**
- * @param ordering the ordering to set
- */
- public void setOrdering(Ordering ordering) {
- this.ordering = ordering;
- }
-
- /**
- * @return the begin
- */
- public int getBegin() {
- return begin;
- }
-
- /**
- * @param begin the begin to set
- */
- public void setBegin(int begin) {
- this.begin = begin;
- }
-
- /**
- * @return the end
- */
- public int getEnd() {
- return end;
- }
-
- /**
- * @param end the end to set
- */
- public void setEnd(int end) {
- this.end = end;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,53 +0,0 @@
-package org.ajax4jsf;
-
-public class DropDownMenuTestBean {
-
- private String actionName = "";
-
- /**
- * Gets value of actionName field.
- * @return value of actionName field
- */
- public String getActionName() {
- return actionName;
- }
-
- /**
- * Set a new value for actionName field.
- * @param actionName a new value for actionName field
- */
- public void setActionName(String actionName) {
- this.actionName = actionName;
- }
-
- public String doNew() {
- setActionName("New");
- return null;
- }
-
- public String doOpen() {
- setActionName("Open");
- return null;
- }
-
- public String doSave() {
- setActionName("Save");
- return null;
- }
-
- public String doSaveAll() {
- setActionName("Save All");
- return null;
- }
-
- public String doClose() {
- setActionName("Close");
- return null;
- }
-
- public String doExit() {
- setActionName("Exit");
- return null;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,42 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author asmirnov
- *
- */
-public class EnclosedData {
-
- private List<RepeatData> repeatData;
-
- public EnclosedData() {
- repeatData = new ArrayList<RepeatData>();
- for(int i=0;i<5;i++){
- RepeatData data = new RepeatData();
- data.setText("Top row "+i);
- repeatData.add(data);
- }
- }
-
- /**
- * @return the repeatData
- */
- public List<RepeatData> getRepeatData() {
- return repeatData;
- }
-
- /**
- * @param repeatData the repeatData to set
- */
- public void setRepeatData(List<RepeatData> repeatData) {
- this.repeatData = repeatData;
- }
-
-
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,51 +0,0 @@
-package org.ajax4jsf;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.faces.model.SelectItem;
-
-public class InplaceSelectTestBean {
-
- private List<SelectItem> treeItems = new ArrayList<SelectItem>();
-
- private List<String> treeNames = Arrays.asList("Pine", "Birch", "Aspen", "Spruce", "Oak", "Maple", "Ash", "Lime");
-
- private String tree = "";
-
- /**
- * Gets value of tree field.
- *
- * @return value of tree field
- */
- public String getTree() {
- return tree;
- }
-
- /**
- * Set a new value for tree field.
- *
- * @param tree
- * a new value for tree field
- */
- public void setTree(String tree) {
- this.tree = tree;
- }
-
- public InplaceSelectTestBean() {
- for (String treeName : treeNames) {
- treeItems.add(new SelectItem(treeName, treeName));
- }
- }
-
- /**
- * Gets value of treeItems field.
- *
- * @return value of treeItems field
- */
- public List<SelectItem> getTreeItems() {
- return treeItems;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,23 +0,0 @@
-package org.ajax4jsf;
-
-public class JSFunctionBean {
-
- private String name = "";
-
- /**
- * Gets value of name field.
- * @return value of name field
- */
- public String getName() {
- return name;
- }
-
- /**
- * Set a new value for name field.
- * @param name a new value for name field
- */
- public void setName(String name) {
- this.name = name;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,52 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author asmirnov
- *
- */
-public class ListAction {
-
- private List data;
-
- private Set keys;
-
- /**
- * @return the data
- */
- public List getData() {
- return data;
- }
-
- /**
- * @param data the data to set
- */
- public void setData(List data) {
- this.data = data;
- }
-
- public Set getKeys(){
- return keys;
- }
-
- public String timer(){
- if(null != data){
- keys=new HashSet();
- int random = (int)(Math.random()*10.0);
- for(int i=0;i<random;i++){
- Bean bean = (Bean) data.get(i);
- bean.setText(bean.getText()+" X");
- keys.add(new Integer(i));
- }
- }
- return null;
- }
-
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,17 +0,0 @@
-package org.ajax4jsf;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-
-public interface Media {
-
- public void paint(OutputStream out, Object data) throws IOException;
-
- public void initData();
-
- public void setData(MediaData data);
-
- public MediaData getData();
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,55 +0,0 @@
-package org.ajax4jsf;
-
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.imageio.ImageIO;
-
-
-public class MediaBean implements Media {
-
- private MediaData data;
-
- /**
- * @return the data
- */
- public MediaData getData() {
- return data;
- }
-
- /**
- * @param data the data to set
- */
- public void setData(MediaData data) {
- this.data = data;
- }
-
- public void initData(){
- data= new MediaData();
- data.setWidth(100);
- data.setHeight(100);
- data.setBackground(Color.BLUE);
- data.setDrawColor(Color.RED);
- }
-
- public void paint(OutputStream out, Object data) throws IOException{
- if (data instanceof MediaData) {
-
- MediaData paintData = (MediaData) data;
- BufferedImage img = new BufferedImage(paintData.getWidth(),paintData.getHeight(),BufferedImage.TYPE_INT_RGB);
- Graphics2D graphics2D = img.createGraphics();
- graphics2D.setBackground(paintData.getBackground());
- graphics2D.setColor(paintData.getDrawColor());
- graphics2D.clearRect(0,0,paintData.getWidth(),paintData.getHeight());
- graphics2D.drawLine(5,5,paintData.getWidth()-5,paintData.getHeight()-5);
- graphics2D.drawChars(new String("RichFaces").toCharArray(),0,9,40,15);
- graphics2D.drawChars(new String("mediaOutput").toCharArray(),0,11,5,45);
-
- ImageIO.write(img,"jpeg",out);
-
- }
- }
-}
\ No newline at end of file
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,39 +0,0 @@
-package org.ajax4jsf;
-
-import java.awt.Color;
-import java.io.Serializable;
-
-public class MediaData implements Serializable{
-
- private static final long serialVersionUID = 1L;
- Integer Width=110;
- Integer Height=50;
- Color Background=new Color(0,0,0);
- Color DrawColor=new Color(255,255,255);
- public MediaData() {
- }
- public Color getBackground() {
- return Background;
- }
- public void setBackground(Color background) {
- Background = background;
- }
- public Color getDrawColor() {
- return DrawColor;
- }
- public void setDrawColor(Color drawColor) {
- DrawColor = drawColor;
- }
- public Integer getHeight() {
- return Height;
- }
- public void setHeight(Integer height) {
- Height = height;
- }
- public Integer getWidth() {
- return Width;
- }
- public void setWidth(Integer width) {
- Width = width;
- }
-}
\ No newline at end of file
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,103 +0,0 @@
-package org.ajax4jsf;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.EventListener;
-import java.util.EventObject;
-import java.util.List;
-
-import org.ajax4jsf.event.PushEventListener;
-
-
-public class MessageBean implements Runnable {
-
- private String result;
-
- private boolean running = true;
-
- private PushEventListener listener;
-
- private List messages = new ArrayList(10);
-
- private int counter = 0;
-
- public MessageBean() {
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @return the result
- */
- public String getResult() {
- return result;
- }
-
- /**
- * @param result
- * the result to set
- */
- public void setResult(String result) {
- this.result = result;
- }
-
- public void addListener(EventListener listener) {
- synchronized (listener) {
- if (this.listener != listener) {
- this.listener = (PushEventListener) listener;
- Thread th = new Thread(this);
- th.start();
-
- }
- }
- }
-
- public void run() {
- try {
- while (isRunning()) {
- Thread.sleep(10000);
- Date current = new Date(System.currentTimeMillis());
- if(messages.size()>=10){
- messages.remove(0);
- }
- messages.add(messages.size(),String.valueOf(counter++)+" at "+current.toString());
- System.out.println("event occurs");
- synchronized (listener) {
- listener.onEvent(new EventObject(this));
- }
- }
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- }
-
- /**
- * @return the running
- */
- public synchronized boolean isRunning() {
- return running;
- }
-
- /**
- * @param running
- * the running to set
- */
- public synchronized void setRunning(boolean running) {
- this.running = running;
- }
-
- /**
- * @return the messages
- */
- public List getMessages() {
- return messages;
- }
-
- /**
- * @param messages the messages to set
- */
- public void setMessages(List messages) {
- this.messages = messages;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,64 +0,0 @@
-package org.ajax4jsf;
-
-import java.io.Serializable;
-
-import org.ajax4jsf.component.UIInclude;
-
-public class NavigateBean implements Serializable {
-
- private String viewId="/pages/hello.jsp";
-
- transient private UIInclude include;
-
- public String navigateOne() {
-
- return "sucessOne";
- }
-
- public String navigateTwo() {
-
- return "sucessTwo";
- }
-
- public String navigateHello() {
-
- return "sucessHello";
- }
-
- /**
- * @return the viewId
- */
- public String getViewId() {
- return viewId;
- }
-
- /**
- * @param viewId the viewId to set
- */
- public void setViewId(String viewId) {
- this.viewId = viewId;
- }
-
- public String reset(){
- setViewId("/pages/hello.jsp");
- if(null != include){
- include.setViewId("/pages/hello.jsp");
- }
- return null;
- }
-
- /**
- * @return the include
- */
- public UIInclude getInclude() {
- return include;
- }
-
- /**
- * @param include the include to set
- */
- public void setInclude(UIInclude include) {
- this.include = include;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,12 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf;
-
-/**
- * @author asmirnov
- *
- */
-public class ObjectNotFoundException extends Exception {
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,174 +0,0 @@
-/**
- * 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;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-public class OrderingListTestBean {
- private Converter converter;
- private List<Item> items;
- private Collection<Item> selection;
- private Object activeItem;
-
- public OrderingListTestBean() {
- converter = new ItemConverter();
- items = new ArrayList<Item>();
- for (int i = 0; i < 4; i++) {
- items.add(new Item("item" + i));
- }
- selection = new HashSet<Item>();
- }
-
- public Object getActionResult() {
- return FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("actionResult");
- }
-
- public Collection<Item> getSelection() {
- return selection;
- }
-
- public void setSelection(Collection<Item> selection) {
- this.selection = selection;
- }
-
- public Object getActiveItem() {
- return activeItem;
- }
-
- public void setActiveItem(Object activeItem) {
- this.activeItem = activeItem;
- }
-
- public Converter getConverter() {
- return converter;
- }
-
- public void setConverter(Converter converter) {
- this.converter = converter;
- }
-
- public List<Item> getItems() {
- return items;
- }
-
- public void setItems(List<Item> items) {
- this.items = items;
- }
-
- public String getSelectionString() {
- StringBuffer buff = new StringBuffer();
- for (Iterator<Item> it = selection.iterator(); it.hasNext();) {
- Item item = it.next();
- buff.append(item.getName());
- if (it.hasNext()) {
- buff.append(',');
- }
- }
- return buff.toString();
- }
-
-
- private class ItemConverter implements Converter {
-
- /* (non-Javadoc)
- * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)
- */
- public Object getAsObject(FacesContext context, UIComponent component,
- String value) {
- return new Item(value);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
- */
- public String getAsString(FacesContext context, UIComponent component,
- Object value) {
- Item optionItem = (Item) value;
- return optionItem.getName();
- }
-
- }
-
- public class Item implements Serializable {
-
- private static final long serialVersionUID = 1083694594537030790L;
-
- private String name;
-
- public String action() {
- FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("actionResult", name);
- return null;
- }
-
- public Item(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String toString() {
- return this.getClass().getSimpleName() + " [" + name + "]";
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Item other = (Item) obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
-
- return true;
- }
-
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,44 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf;
-
-/**
- * @author asmirnov
- *
- */
-public class PageDescriptionBean {
-
- private String _path;
-
- private String _title;
-
- /**
- * @return the path
- */
- public String getPath() {
- return _path;
- }
-
- /**
- * @param path the path to set
- */
- public void setPath(String path) {
- _path = path;
- }
-
- /**
- * @return the title
- */
- public String getTitle() {
- return _title;
- }
-
- /**
- * @param title the title to set
- */
- public void setTitle(String title) {
- _title = title;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,125 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.servlet.ServletContext;
-
-/**
- * @author asmirnov
- *
- */
-public class PagesBean {
-
- private static final Pattern JSP_PATTERN = Pattern.compile(".*\\.jspx?");
-
- private static final Pattern XHTML_PATTERN = Pattern.compile(".*\\.xhtml");
-
- private static final Pattern TITLE_PATTERN = Pattern.compile("<title>(.*)</title>",Pattern.CASE_INSENSITIVE|Pattern.MULTILINE);
-
- private ServletContext _servletContext;
-
- private List<PageDescriptionBean> _jspPages;
-
- private String _path;
-
- private List<PageDescriptionBean> _xhtmlPages;
-
- /**
- * @return the path
- */
- public String getPath() {
- return _path;
- }
-
- /**
- * @param path
- * the path to set
- */
- public void setPath(String path) {
- _path = path;
- }
-
- /**
- * @return the servletContext
- */
- public ServletContext getServletContext() {
- return _servletContext;
- }
-
- /**
- * @param servletContext
- * the servletContext to set
- */
- public void setServletContext(ServletContext servletContext) {
- _servletContext = servletContext;
- }
-
- public List<PageDescriptionBean> getJspPages() {
- if (_jspPages == null && null != getServletContext()) {
- _jspPages = getPagesByPattern(JSP_PATTERN);
- }
-
- return _jspPages;
- }
-
- public List<PageDescriptionBean> getXhtmlPages() {
- if (_xhtmlPages == null && null != getServletContext()) {
- _xhtmlPages = getPagesByPattern(XHTML_PATTERN);
- }
-
- return _xhtmlPages;
- }
-
- /**
- *
- */
- private List<PageDescriptionBean> getPagesByPattern(Pattern pattern) {
- List<PageDescriptionBean> jspPages = new ArrayList<PageDescriptionBean>();
- Set resourcePaths = getServletContext().getResourcePaths(getPath());
- for (Iterator iterator = resourcePaths.iterator(); iterator
- .hasNext();) {
- String page = (String) iterator.next();
- if (pattern.matcher(page).matches()) {
- PageDescriptionBean pageBean = new PageDescriptionBean();
- pageBean.setPath(page);
- InputStream pageInputStream = getServletContext().getResourceAsStream(page);
- if(null != pageInputStream){
- byte[] head = new byte[1024];
- try {
- int readed = pageInputStream.read(head);
- String headString = new String(head,0,readed);
- Matcher titleMatcher = TITLE_PATTERN.matcher(headString);
- if(titleMatcher.find() && titleMatcher.group(1).length()>0){
- pageBean.setTitle(titleMatcher.group(1));
- } else {
- pageBean.setTitle(page);
- }
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } finally {
- try {
- pageInputStream.close();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- jspPages.add(pageBean);
- }
- }
- return jspPages;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PickListTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PickListTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PickListTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,110 +0,0 @@
-package org.ajax4jsf;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.faces.model.SelectItem;
-
-public class PickListTestBean {
-
- private String copyAllLabel = "MOVE ALL";
-
- private String copyLabel = "MOVE";
-
- private String removeLabel = "TAKE AWAY";
-
- private String removeAllLabel = "TAKE ALL AWAY";
-
- private List<String> items = Arrays.asList("ZHURIK", "MELESHKO", "LEONTIEV", "KOVAL", "KALYUZHNY", "DUDIK",
- "KOSTITSYN", "GRABOVSKI");
-
- private List<SelectItem> options = new ArrayList<SelectItem>();
-
- private List<String> result = new ArrayList<String>();
-
- public PickListTestBean() {
- for (String player : items) {
- options.add(new SelectItem(player, player));
- }
-
- // preselected items
- result.add(items.get(0));
- result.add(items.get(1));
- }
-
- /**
- * Gets value of copyAllLabel field.
- *
- * @return value of copyAllLabel field
- */
- public String getCopyAllLabel() {
- return copyAllLabel;
- }
-
- /**
- * Gets value of copyLabel field.
- *
- * @return value of copyLabel field
- */
- public String getCopyLabel() {
- return copyLabel;
- }
-
- /**
- * Gets value of removeLabel field.
- *
- * @return value of removeLabel field
- */
- public String getRemoveLabel() {
- return removeLabel;
- }
-
- /**
- * Gets value of removeAllLabel field.
- *
- * @return value of removeAllLabel field
- */
- public String getRemoveAllLabel() {
- return removeAllLabel;
- }
-
- /**
- * Gets value of options field.
- *
- * @return value of options field
- */
- public List<SelectItem> getOptions() {
- return options;
- }
-
- /**
- * Set a new value for options field.
- *
- * @param options
- * a new value for options field
- */
- public void setOptions(List<SelectItem> options) {
- this.options = options;
- }
-
- /**
- * Gets value of result field.
- *
- * @return value of result field
- */
- public List<String> getResult() {
- return result;
- }
-
- /**
- * Set a new value for result field.
- *
- * @param result
- * a new value for result field
- */
- public void setResult(List<String> result) {
- this.result = result;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,60 +0,0 @@
-package org.ajax4jsf;
-
-import java.util.Date;
-
-import javax.faces.event.ActionEvent;
-
-public class ProgressBarTestBean {
-
- private boolean enabled = false;
-
- private Long value = -5L;
-
- public String getDate() {
- return String.valueOf(new Date().getTime());
- }
-
- public String getCompleteDate() {
- return String.valueOf(new Date().getTime());
- }
-
- public void reset(ActionEvent event) {
- this.value = -5L;
- }
-
- public void complete(ActionEvent event) {
- this.value = 120L;
- }
-
- /**
- * @return the enabled
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /**
- * @param enabled the enabled to set
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * @return the value
- */
- public Long getValue() {
- value++;
- return value;
- }
-
- /**
- * @param value the value to set
- */
- public void setValue(Long value) {
- this.value = value;
- }
-
-
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,62 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author asmirnov
- *
- */
-public class RepeatData {
-
- private List data;
-
- private String text;
-
-
- /**
- * @return the text
- */
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- public void setText(String text) {
- this.text = text;
- }
-
- public RepeatData() {
- data = new ArrayList(10);
- for(int i=0;i<10;i++){
- Bean bean = new Bean();
- bean.setText("Row "+i);
- data.add(bean);
- }
- }
-
- public String ok(){
- System.out.println("Row command pressed");
- return null;
- }
-
- /**
- * @return the data
- */
- public List getData() {
- return data;
- }
-
- /**
- * @param data the data to set
- */
- public void setData(List data) {
- this.data = data;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,73 +0,0 @@
-/**
- * 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;
-
-import javax.faces.event.ActionEvent;
-
-public class RichPanelTestBean {
- private String value;
- private int value2;
-
- public RichPanelTestBean() {
- value = "";
- value2 = 0;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public void actionListener(ActionEvent event) {
- this.value = event.getComponent().getId();
- }
-
- public String action1() {
- this.value2 = 1;
- return null;
- }
-
- public String action2() {
- this.value2 = 2;
- return null;
- }
-
- public String increment() {
- if (4 == this.value2) {
- this.value2 = 0;
- }
- this.value2++;
- return null;
- }
-
- public int getValue2() {
- return value2;
- }
-
- public void setValue2(int value2) {
- this.value2 = value2;
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,61 +0,0 @@
-/**
- * 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;
-
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-
-public class TemplateBean {
- public static final String PARAM_NAME = "t";
-
- private String template = "simple";
-
- public void initTemplate (ActionEvent event) {
- Map<String, String> reqMap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- String template = reqMap.get(PARAM_NAME);
- this.template = template != null ? template : "simple";
- }
-
- public String getTemplateId() {
- return template;
- }
-
-
- /**
- * @return the template
- */
- public String getTemplate() {
- return "../../template/" + template + ".xhtml";
- }
-
-
- /**
- * @param template the template to set
- */
- public void setTemplate(String template) {
- this.template = template;
- }
-
-
-}
\ No newline at end of file
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,64 +0,0 @@
-package org.ajax4jsf;
-
-
-
-import java.util.logging.Logger;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-
-/**
- * @author krasi
- *
- */
-public class TestBean {
- String id = "";
- static final Logger LOGGER = Logger.getLogger(TestBean.class.getName());
-
- public TestBean() {
- }
-
- public String getId() {
-
- FacesContext.getCurrentInstance().addMessage(
- null,
- new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 1.",
- ""));
-
- System.out.println("GET 1 ------" + id);
- if (!id.equals("")) {
- System.out.println("GET 2 ------" + id);
- FacesContext.getCurrentInstance().addMessage(
- null,
- new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 2.",
- "11"));
-
- try {
- System.out.println("GET 3 ------" + id);
- throw new ObjectNotFoundException();
-
- } catch (ObjectNotFoundException e) {
- System.out.println("GET 4 ------" + id);
- FacesContext.getCurrentInstance().addMessage(
- null,
- new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 3.",
- "11"));
- }
-
- }
-
- return id;
- }
-
- public void setId(String id) {
- System.out.println("SET 1-" + id);
- this.id = id;
- }
-
- public String searchByID() {
- System.out.println("searchByID");
- return null;
-
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestListener.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestListener.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestListener.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,31 +0,0 @@
-package org.ajax4jsf;
-
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.event.AjaxEvent;
-import org.ajax4jsf.event.AjaxListener;
-
-public class TestListener implements AjaxListener {
-
- public void processAjax(AjaxEvent event) {
- FacesContext context = FacesContext.getCurrentInstance();
- ExternalContext etx = context.getExternalContext();
- Map<String, String> requestParams = etx.getRequestParameterMap();
- String Id = requestParams.get("_ID");
- UIComponent component = event.getComponent().findComponent(Id);
- if (component instanceof UIInput) {
- UIInput i = (UIInput)component;
- String v = (String)i.getValue();
- i.setValue(v + "5");
- i.setSubmittedValue(null);
- }
-
-
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java 2008-05-26 14:22:02 UTC (rev 8758)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -1,43 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf;
-
-import java.util.Date;
-
-/**
- * @author asmirnov
- *
- */
-public class TimerBean {
-
- private boolean _enabled;
-
- /**
- * @return the enabled
- */
- public boolean isEnabled() {
- return _enabled;
- }
-
- /**
- * @param enabled the enabled to set
- */
- public void setEnabled(boolean enabled) {
- _enabled = enabled;
- }
-
- public Date getTimer(){
- return new Date(System.currentTimeMillis());
- }
-
- public String go() {
- setEnabled(true);
- return null;
- }
-
- public String stop() {
- setEnabled(false);
- return null;
- }
-}
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java 2008-05-26 14:22:44 UTC (rev 8759)
@@ -0,0 +1,9 @@
+package org.ajax4jsf.template;
+
+public interface Template {
+
+ public static final String COMPONENT_PREFIX_INSIDE_TABLE = "_Selenium_Test_DataTable:0:";
+
+ public static final String COMPONENT_PREFIX_SIMPLE = "";
+
+}
16 years, 7 months
JBoss Rich Faces SVN: r8758 - in trunk/test-applications/seleniumTest/src/test: testng/win and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-05-26 10:22:02 -0400 (Mon, 26 May 2008)
New Revision: 8758
Removed:
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/
Modified:
trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml
Log:
Modified: trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml 2008-05-26 14:19:15 UTC (rev 8757)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml 2008-05-26 14:22:02 UTC (rev 8758)
@@ -3,14 +3,14 @@
<test name="IEFunctionalTests">
<parameter name="browser" value="*iexplore"/>
<packages>
- <package name="org.richfaces" />
+ <package name="org.richfaces.test" />
</packages>
</test>
<test name="FireFoxFunctionalTests">
<parameter name="browser" value="*firefox"/>
<packages>
- <package name="org.richfaces" />
+ <package name="org.richfaces.test" />
</packages>
</test>
</suite>
16 years, 7 months
JBoss Rich Faces SVN: r8757 - trunk/test-applications/seleniumTest/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-05-26 10:19:15 -0400 (Mon, 26 May 2008)
New Revision: 8757
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java
Removed:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
Log:
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,94 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-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 AjaxCommandButtonTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public AjaxCommandButtonTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testAjaxCommandButtonComponent() throws Exception {
- _testAjaxCommandButtonComponent(Templates.SIMPLE);
- _testAjaxCommandButtonComponent(Templates.DATATABLE);
- _testAjaxCommandButtonComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxCommandButtonComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
-
- String buttonId = parentId + "b1";
- String inputId = parentId + "_value";
-
- writeStatus("Click button 1 : ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345");
-
- writeStatus("Click button 1 again: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "123452345");
-
- buttonId = parentId + "b2";
-
- writeStatus("Click button 2: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1234523455");
-
- buttonId = parentId + "b3";
-
- writeStatus("Click button 3: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1234523455");
-
- buttonId = parentId + "b4";
-
- writeStatus("Click button 4: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345234555");
-
- buttonId = parentId + "b5";
-
- writeStatus("Click button 5: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345234555");
-
- }
-
- public String getTestUrl() {
- return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,93 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-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 AjaxCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public AjaxCommandLinkTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Templates.SIMPLE);
- _testAjaxCommandLinkComponent(Templates.DATATABLE);
- _testAjaxCommandLinkComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxCommandLinkComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
-
- String LinkId = parentId + "l1";
- String inputId = parentId + "_value";
-
- writeStatus("Click link 1 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345");
-
- writeStatus("Click link 1 again: ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "123452345");
-
- LinkId = parentId + "l2";
-
- writeStatus("Click link 2 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1234523455");
-
- LinkId = parentId + "l3";
-
- writeStatus("Click link 3 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1234523455");
-
- LinkId = parentId + "l4";
-
- writeStatus("Click link 4 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345234555");
-
- LinkId = parentId + "l5";
-
- writeStatus("Click link 5 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345234555");
-
- }
-
- public String getTestUrl() {
- return "/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,80 +0,0 @@
-/**
- *
- */
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-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;
-
-/**
- * @author Andrey Markavstov
- *
- */
-public class AjaxPollTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public AjaxPollTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testAjaxPollComponent() {
- _testAjaxPollComponent(Templates.SIMPLE);
- _testAjaxPollComponent(Templates.DATATABLE);
- _testAjaxPollComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxPollComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
- String pollId = parentId + "poll";
- String inputId = parentId + "_value";
-
- writeStatus("Start polling...");
- clickById(parentId + "_enabled");
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1");
-
- writeStatus("Polling in progress...");
- pause(1500, pollId);
- AssertValueNotEquals(inputId, "1");
- waiteForCondition("document.getElementById('"+inputId+"').value == 8", 7000);
-
- pause(1500, pollId);
- writeStatus("Polling should be stopped...");
- AssertValueEquals(inputId, "8");
- AssertTextEquals(parentId + "_text", "Polling");
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.test.base.RichSeleniumTest#getTestUrl()
- */
- public String getTestUrl() {
- return "/faces/pages/ajaxPoll/ajaxPollTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,103 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-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 AjaxRegionTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public AjaxRegionTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testAjaxRegionComponent() throws Exception {
- _testAjaxRegionComponent(Templates.SIMPLE);
- _testAjaxRegionComponent(Templates.DATATABLE);
- _testAjaxRegionComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxRegionComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
-
- writeStatus("check nested regions");
-
- String externalLink = parentId + "externalLink";
- String internalLink = parentId + "internalLink";
-
- String internalElemId = parentId + "internal";
- String externalElemId = parentId + "external";
-
- selenium.type(internalElemId, "5");
- selenium.type(externalElemId, "5");
-
- clickById(internalLink);
- waitForAjaxCompletion();
- AssertValueEquals(internalElemId, "5");
- AssertValueEquals(externalElemId, "0");
-
- selenium.type(internalElemId, "10");
- selenium.type(externalElemId, "10");
-
- clickById(externalLink);
- waitForAjaxCompletion();
- AssertValueEquals(internalElemId, "10");
- AssertValueEquals(externalElemId, "10");
-
- writeStatus("verify \"selfRendered\" component's attribute");
-
- String selfRenderedLink = parentId + "selfRenderedLink";
- clickById(selfRenderedLink);
- waitForAjaxCompletion();
- AssertNotPresent("transientText");
-
- writeStatus("verify \"renderRegionOnly\" component's attribute");
-
- String renderOnlyLink = parentId + "renderOnlyLink";
- String renderLink = parentId + "renderLink";
-
- String renderOnlyElemId = parentId + "renderOnly";
- String renderElemId = parentId + "render";
-
- selenium.type(renderOnlyElemId, "7");
-
- clickById(renderOnlyLink);
-
- AssertValueEquals(renderOnlyElemId, "7");
- AssertValueEquals(renderElemId, "0");
-
- selenium.type(renderElemId, "11");
- clickById(renderLink);
-
- AssertValueEquals(renderOnlyElemId, "11");
- AssertValueEquals(renderElemId, "11");
- }
-
- public String getTestUrl() {
- return "/faces/pages/ajaxRegion/ajaxRegionTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,91 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class AjaxStatusTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public AjaxStatusTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testAjaxStatusComponent() throws Exception {
- _testAjaxStatusComponent(Templates.SIMPLE);
- _testAjaxStatusComponent(Templates.DATATABLE);
- _testAjaxStatusComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxStatusComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String btn1 = parentId + "button1";
- clickById(btn1);
-
- String reg1Status = parentId + "region1:status";
-
- writeStatus("Ajax request is in progress");
-
- AssertVisible(reg1Status + ".start");
- AssertNotVisible(reg1Status + ".stop");
- String start = getTextById(reg1Status + ".start");
- Assert.assertTrue(start.startsWith("In progress..."));
- pause(3000, reg1Status);
-
- writeStatus("Ajax request completed");
-
- AssertNotVisible(reg1Status + ".start");
- AssertVisible(reg1Status + ".stop");
- String stop = getTextById(reg1Status + ".stop");
- Assert.assertTrue(stop.startsWith("Complete"));
-
- String btn2 = parentId + "button2";
- clickById(btn2);
-
- String reg2Status = parentId + "region2:status";
-
- writeStatus("Ajax request is in progress");
-
- AssertVisible(reg2Status + ".start");
- AssertNotVisible(reg2Status + ".stop");
- start = getTextById(reg2Status + ".start");
- Assert.assertTrue(start.startsWith("In progress..."));
- pause(3000, reg2Status);
-
- writeStatus("Ajax request completed");
-
- AssertNotVisible(reg2Status + ".start");
- AssertVisible(reg2Status + ".stop");
- stop = getTextById(reg1Status + ".stop");
- Assert.assertTrue(stop.startsWith("Complete"));
-
- }
-
- public String getTestUrl() {
- return "/faces/pages/ajaxStatus/ajaxStatusTest.xhtml";
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,148 +0,0 @@
-/**
- * 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 java.text.ParseException;
-import java.util.Date;
-
-import org.ajax4jsf.CalendarTestBean;
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class CalendarTest extends SeleniumTestBase implements RichSeleniumTest {
-
- /**
- * Default constructor
- */
- public CalendarTest() {
- super("http", "localhost", serverPort);
- }
-
-
- /**
- * 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 testContextMenuComponent() throws Exception {
- _testSelectDateComponent(Templates.SIMPLE);
- _testCalendarComponent(Templates.DATATABLE);
- _testCalendarComponent(Templates.MODALPANEL);
- }
-
- private void _testCalendarComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String containerId = getParentId() + "_form:";
- String calendarOpenedId = containerId + "calendar";
- String calendarCollapsedId = calendarOpenedId + "Popup";
- String calendarInputDate = calendarOpenedId + "InputDate";
- String calendarPopupButton = calendarCollapsedId + "Button";
- String outputPanel = containerId + "outputPanel";
-
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
-
- writeStatus("Mouse click on calendar InputDate field");
- clickById(calendarInputDate);
-
- Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
-
- writeStatus("Mouse click outside calendar");
- clickById(outputPanel);
-
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
-
- writeStatus("Mouse click on calendar popup button");
- clickById(calendarPopupButton);
-
- Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
- }
-
- private void _testSelectDateComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- Date newSelectedDate = CalendarTestBean.getDayInMay(15);
-
- String containerId = getParentId() + "_form:";
- String calendarOpenedId = containerId + "calendar";
- String calendarCollapsedId = calendarOpenedId + "Popup";
- String calendarInputDate = calendarOpenedId + "InputDate";
- String calendarPopupButton = calendarCollapsedId + "Button";
- String outputPanel = containerId + "outputPanel";
-
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
- writeStatus("Mouse click on calendar popup button");
- clickById(calendarPopupButton);
- Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
-
- String inputDateString = getValueById(calendarInputDate);
- Date readDate = null;
- try {
- readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
- } catch(ParseException parseException) {
- // skip exception
- }
- Assert.assertEquals(readDate, CalendarTestBean.DEFAULT_DATE, "Default date representation is wrong!");
-
- // click on 15th of May
- String newSelectedDateId = calendarOpenedId + "DayCell18";
- clickById(newSelectedDateId);
-
- writeStatus("Mouse click outside calendar");
- clickById(outputPanel);
-
- inputDateString = getValueById(calendarInputDate);
- try {
- readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
- } catch(ParseException parseException) {
- // skip exception
- }
- Assert.assertEquals(readDate, newSelectedDate, "Date representation after selecting 15.May.2008 is wrong!");
-
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
-
-
- }
-
- public String getTestUrl() {
- return "/faces/pages/calendar/calendarTest.xhtml";
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,115 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class ComboBoxTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public ComboBoxTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testComboBoxComponent() throws Exception {
- _testComboBoxComponent(Templates.SIMPLE);
- _testComboBoxComponent(Templates.DATATABLE);
- _testComboBoxComponent(Templates.MODALPANEL);
- }
-
- private void _testComboBoxComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
-
- String predefinedCBId = parentId + "predefined";
- String selectItemsCBId = parentId + "selectItems";
- String suggestionValuesCBId = parentId + "suggestionValues";
-
- writeStatus("check components' default labels");
-
- getTextById(predefinedCBId + "comboboxField").startsWith("Select a");
- getTextById(selectItemsCBId + "comboboxField").startsWith("Select a");
- getTextById(suggestionValuesCBId + "comboboxField").startsWith("Select a");
-
- writeStatus("check a combobox with predefined suggestions");
-
- clickById(predefinedCBId);
- writeStatus("type \"Hunt\"");
-
- selenium.type(predefinedCBId + "comboboxField", "Hunt");
- selenium.typeKeys(predefinedCBId + "comboboxField", "Hunt");
-
- Assert.assertTrue(isVisibleById(predefinedCBId + "list"), "Component's pop-up must show up on key typing");
-
- clickById(predefinedCBId + "list");
-
- Assert.assertFalse(isVisibleById(predefinedCBId + "list"), "Component's pop-up has to be closed");
- Assert.assertEquals(getValue(predefinedCBId), "Hunter");
-
- writeStatus("check a combobox with dynamic suggestions list");
-
- clickById(selectItemsCBId);
-
- writeStatus("verify \"directInputSuggestions\" component's attribute");
-
- writeStatus("type \"O\"");
-
- selenium.type(selectItemsCBId + "comboboxField", "O");
- selenium.typeKeys(selectItemsCBId + "comboboxField", "O");
-
- Assert.assertTrue(isVisibleById(selectItemsCBId + "list"), "Component's pop-up must show up on key typing");
- Assert.assertEquals(getValue(selectItemsCBId), "Oak");
-
- writeStatus("check a combobox with a simple String list as suggestions list");
-
- clickById(suggestionValuesCBId);
- writeStatus("type \"Ma\"");
-
- selenium.type(suggestionValuesCBId + "comboboxField", "Ma");
- selenium.typeKeys(suggestionValuesCBId + "comboboxField", "Ma");
-
- Assert.assertTrue(isVisibleById(suggestionValuesCBId + "list"), "Component's pop-up must show up on key typing");
-
- clickById(suggestionValuesCBId + "list");
-
- Assert.assertFalse(isVisibleById(suggestionValuesCBId + "list"), "Component's pop-up has to be closed");
- Assert.assertEquals(getValue(suggestionValuesCBId), "Maple");
- }
-
- /**
- * Gets component value.
- * @param clientId
- * @return
- */
- private String getValue(String clientId) {
- return runScript("$('" + clientId + "comboboxValue').value;");
- }
-
- public String getTestUrl() {
- return "/faces/pages/comboBox/comboBoxTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,124 +0,0 @@
-/**
- * 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.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class ContextMenuTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public ContextMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testContextMenuComponent() throws Exception {
- _testContextMenuComponent(Templates.SIMPLE);
- _testContextMenuComponent(Templates.DATATABLE);
- _testContextMenuComponent(Templates.MODALPANEL);
- }
-
- private void _testContextMenuComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String inputId = parentId + "input";
- String input2Id = parentId + "input2";
- String outputId = parentId + "_value2";
- String menuId = parentId + "menu_input_menu";
- String menu2Id = parentId + "menu_input2_menu";
-
- String menu1_item_ajax = parentId + "menu1_item1";
- String menu1_item_server = parentId + "menu1_item2";
- String menu2_item_ajax = parentId + "menu2_item1";
- String menu2_item_server = parentId + "menu2_item2";
-
- writeStatus("Click on first input");
- clickById(inputId);
- Assert.assertTrue(isVisibleById(menuId));
-
- writeStatus("Click on second input");
- clickById(input2Id);
- Assert.assertFalse(isVisibleById(menuId));
- Assert.assertTrue(isVisibleById(menu2Id));
-
- writeStatus("Click on first input again");
- clickById(inputId);
- Assert.assertTrue(isVisibleById(menuId));
- Assert.assertFalse(isVisibleById(menu2Id));
-
- writeStatus("Click on ajax item in first menu");
- clickById(menu1_item_ajax);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "menu1_item1");
- AssertTextEquals(outputId, "1");
-
- writeStatus("Click on server item in first menu");
- clickCommandAndWait(menu1_item_server);
- AssertValueEquals(inputId, "menu1_item2");
- AssertTextEquals(outputId, "2");
-
- writeStatus("Click on second input again");
- clickById(input2Id);
- Assert.assertTrue(isVisibleById(menu2Id));
-
- writeStatus("Click on ajax item in first menu");
- clickById(menu2_item_ajax);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "menu2_item1");
- AssertTextEquals(outputId, "3");
-
- writeStatus("Click on server item in second menu");
- clickCommandAndWait(menu2_item_server);
- AssertValueEquals(inputId, "menu2_item2");
- AssertTextEquals(outputId, "4");
- }
-
- public String getTestUrl() {
- return "/faces/pages/contextMenu/contextMenu.xhtml";
- }
-
-}
-
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,235 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class DataTableTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public DataTableTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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();
- }
-
- public String getTestUrl() {
- return "/faces/pages/dataTable/dataTableTest.xhtml";
- }
-
- @Test
- public void testDataTable() {
- _testDataTable(Templates.SIMPLE);
- }
-
- private void _testDataTable(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String dataTableId = parentId + "table";
-
- writeStatus("Check columns count equals to 3 ");
- assertColumnsCount(3, dataTableId);
- writeStatus("Check rows count equals to 22 ");
- assertRowsCount(22, dataTableId);
-
- String columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Check inputs' values ");
- assertInputValue(dataTableId, 0, columnsId, "0");
- assertInputValue(dataTableId, 5, columnsId, "5");
- assertInputValue(dataTableId, 19, columnsId, "19");
-
- columnsId = getColumnId(dataTableId, 1);
-
- assertInputValue(dataTableId, 0, columnsId, "1");
- assertInputValue(dataTableId, 7, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "20");
-
- columnsId = getColumnId(dataTableId, 2);
-
- assertInputValue(dataTableId, 0, columnsId, "2");
- assertInputValue(dataTableId, 11, columnsId, "13");
- assertInputValue(dataTableId, 19, columnsId, "21");
-
- writeStatus("Insert some values ");
- insertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
- insertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
-
- writeStatus("Rerender table");
- clickById("_form:submit");
- waitForAjaxCompletion();
-
- writeStatus("Check values entered ");
- assertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
- assertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
-
- columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Sort ASC by 1'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "000");
- assertInputValue(dataTableId, 1, columnsId, "1");
- assertInputValue(dataTableId, 18, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "9");
-
- writeStatus("Sort DESC by 1'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "9");
- assertInputValue(dataTableId, 1, columnsId, "8");
- assertInputValue(dataTableId, 18, columnsId, "1");
- assertInputValue(dataTableId, 19, columnsId, "000");
-
- columnsId = getColumnId(dataTableId, 2);
-
- writeStatus("Sort ASC by 3'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 1, columnsId, "11");
- assertInputValue(dataTableId, 18, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "9");
-
- writeStatus("Set columns count == 5, rows count == 10");
- changeColumnCount(10, 5, 0 ,100);
-
-
- writeStatus("Check columns count equals to 5 ");
- assertColumnsCount(5, dataTableId);
- writeStatus("Check rows count equals to 12 ");
- assertRowsCount(12, dataTableId);
-
- columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Check inputs' values ");
- assertInputValue(dataTableId, 0, columnsId, "0");
- assertInputValue(dataTableId, 5, columnsId, "5");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- columnsId = getColumnId(dataTableId, 1);
-
- assertInputValue(dataTableId, 0, columnsId, "1");
- assertInputValue(dataTableId, 7, columnsId, "8");
- assertInputValue(dataTableId, 9, columnsId, "10");
-
- columnsId = getColumnId(dataTableId, 4);
-
- assertInputValue(dataTableId, 0, columnsId, "4");
- assertInputValue(dataTableId, 2, columnsId, "6");
- assertInputValue(dataTableId, 9, columnsId, "13");
-
- writeStatus("Sort ASC by the last column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 2, columnsId, "12");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- writeStatus("Sort DESC by the last column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "9");
- assertInputValue(dataTableId, 2, columnsId, "7");
- assertInputValue(dataTableId, 9, columnsId, "10");
-
- columnsId = getColumnId(dataTableId, 2);
- writeStatus("Sort ASC by the 3d column ");
- sortColumn(dataTableId, columnsId);
-
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 2, columnsId, "2");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- changeColumnCount(2, 5, 2 ,2);
- assertColumnsCount(1, dataTableId);
- assertRowsCount(4, dataTableId);
-
- changeColumnCount(10, 5, 10 ,0);
- assertRowsCount(0, dataTableId);
-
-
-
- }
-
- private String getColumnId (String tableId, int i) {
- String script = "$('"+tableId+"').rows[0].cells["+String.valueOf(i)+"].id";
- String id = runScript(script);
- id = id.replace(tableId + ":", "");
- id = id.replace("header", "");
- return id;
- }
-
- private void changeColumnCount(int rows, int columns, int begin, int end) {
- String script = "$('_controls:rows').value='" + String.valueOf(rows) + "';";
- runScript(script);
- script = "$('_controls:column').value='" + String.valueOf(columns) + "';";
- runScript(script);
- script = "$('_controls:begin').value='" + String.valueOf(begin) + "';";
- runScript(script);
- script = "$('_controls:end').value='" + String.valueOf(end) + "';";
- runScript(script);
- clickById("_controls:apply");
- waitForAjaxCompletion();
- }
-
- private void sortColumn(String tableId, String columnId) {
- clickById(tableId + ":" + columnId + "header");
- waitForAjaxCompletion();
- }
-
-
- private void insertInputValue(String tableId, int row, String inputId, String value) {
- String id = tableId + ":"+row+":"+inputId;
- String script = ("$('" + id + "').firstChild.value='" + value + "';");
- runScript(script);
- }
-
-
- private void assertInputValue(String tableId, int row, String inputId, String value) {
- String id = tableId + ":"+row+":"+inputId;
- String script = "$('" + id + "').firstChild.value";
- Assert.assertEquals(runScript(script), value);
- }
-
-
- private void assertColumnsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows[0].cells.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
-
- private void assertRowsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,94 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-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 DropDownMenuTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public DropDownMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testDropDownMenuComponent() throws Exception {
- _testDropDownMenuComponent(Templates.SIMPLE);
- _testDropDownMenuComponent(Templates.DATATABLE);
- _testDropDownMenuComponent(Templates.MODALPANEL);
- }
-
- private void _testDropDownMenuComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String file = parentId + "file";
- String open = parentId + "open:anchor";
- String saveAs = parentId + "saveAs:anchor";
- String save = parentId + "save:anchor";
- String saveAll = parentId + "saveAll:anchor";
- String close = parentId + "close:anchor";
- String exit = parentId + "exit:anchor";
- String operation = parentId + "operation";
-
- writeStatus("Check menu item in ajax mode");
-
- selenium.mouseOver(file);
- selenium.mouseOver(saveAs);
- clickById(saveAll);
-
- AssertTextEquals(operation, "Save All");
-
- selenium.mouseOver(file);
- selenium.mouseOver(saveAs);
- clickById(save);
-
- AssertTextEquals(operation, "Save");
-
- writeStatus("Check the drop down menu closed");
-
- AssertNotVisible(save);
- AssertNotVisible(saveAs);
-
- writeStatus("Check menu item in server mode");
-
- selenium.mouseOver(file);
- clickCommandAndWait(close);
-
- AssertTextEquals(operation, "Close");
-
- writeStatus("Check menu item in 'none' mode");
-
- selenium.mouseOver(file);
- selenium.mouseOver(exit);
- clickById(exit);
-
- AssertTextEquals(operation, "Close");
- AssertNotVisible(exit);
-
- }
-
- public String getTestUrl() {
- return "/faces/pages/dropDownMenu/dropDownMenuTest.xhtml";
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,120 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class InplaceSelectTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public InplaceSelectTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testInplaceSelectComponent() throws Exception {
- _testInplaceSelectComponent(Templates.SIMPLE);
- _testInplaceSelectComponent(Templates.DATATABLE);
- _testInplaceSelectComponent(Templates.MODALPANEL);
- }
-
- private void _testInplaceSelectComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String inplaceSelectId = parentId + "inplaceSelect";
- String okButton = parentId + "inplaceSelect" + "ok";
- //String inplaceTmpValueElemId = parentId + "inplaceSelect" + "inplaceTmpValue";
- String cancelButton = parentId + "inplaceSelect" + "cancel";
- String popupId = "list" + inplaceSelectId;
-
- writeStatus("click the component");
-
- clickById(inplaceSelectId);
- Assert.assertFalse(isVisibleById(popupId), "Component pop-up should not show up on solitary click");
-
- writeStatus("double click the component");
-
- selenium.doubleClick(inplaceSelectId);
- Assert.assertTrue(isVisibleById(popupId), "Component pop-up should show up on double click");
-
- writeStatus("Check that controls buttons are present");
-
- Assert.assertTrue(isPresentById(okButton));
- Assert.assertTrue(isPresentById(cancelButton));
-
- writeStatus("Select second element"); //Birch
-
- selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId + "']/span[2]");
- selenium.fireEvent(okButton, "mousedown");
-
- writeStatus("Check that a new element is selected");
-
- Assert.assertEquals(getValue(inplaceSelectId), "Birch");
-
- writeStatus("Select another element"); // Aspen
-
- selenium.doubleClick(inplaceSelectId);
-
- selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId + "']/span[3]");
- selenium.fireEvent(cancelButton, "mousedown");
-
- writeStatus("Cancel selected value.");
- Assert.assertEquals(getValue(inplaceSelectId), "Birch", "A value has not to be changed");
-
- writeStatus("Verify javascript event triggering");
-
- runScript("theLatestEvent='undefined'");
-
- writeStatus("Double click the component");
- selenium.doubleClick(inplaceSelectId);
-
- Assert.assertEquals(runScript("theLatestEvent"), "editactivated", "editactivated event has not been triggered");
-
- writeStatus("Stop editing with ok");
- selenium.fireEvent(okButton, "mousedown");
- Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
-
-// viewactivated event is not fired ... almost sure bug
-// writeStatus("Stop editing with cancel");
-// selenium.fireEvent(cancelButton, "mousedown");
-// Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
-
- }
-
- /**
- * Gets component value.
- * Note: JavaScript component API getValue() doesn't exit
- * @param clientId
- * @return
- */
- private String getValue(String clientId) {
- return runScript("$('" + clientId + "inplaceValue').value;");
- }
-
- public String getTestUrl() {
- return "/faces/pages/inplaceSelect/inplaceSelectTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,97 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-
-public class InputNumberSpinnerTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public InputNumberSpinnerTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testInputNumberSpinnerComponent() throws Exception {
- _testInputNumberSpinnerComponent(Templates.SIMPLE);
- //it looks as if the spinner does not work inside rich:dataTable
- _testInputNumberSpinnerComponent(Templates.DATATABLE);
- _testInputNumberSpinnerComponent(Templates.MODALPANEL);
- }
-
- private void _testInputNumberSpinnerComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- writeStatus("check whether the spinner is invariant with respect to pair of sequential opposite operations");
-
- //start value = 20
- String before = getSpinnerValue();
- clickUp();
- clickDown();
- String after = getSpinnerValue();
- Assert.assertEquals(before, after);
- Assert.assertEquals(after, "20");
-
- writeStatus("check upper bound and cycling");
-
- clickUp(); //+10
- clickUp(); //+10
- clickUp(); //+10
- clickUp(); //+10
- clickUp(); //+10
- Assert.assertEquals(getSpinnerValue(), "10");
-
- writeStatus("check lower bound and cycling");
-
- clickDown(); //-10
- Assert.assertEquals(getSpinnerValue(), "0");
- clickDown(); //-10
- Assert.assertEquals(getSpinnerValue(), "50");
- clickDown(); //-10
- Assert.assertEquals(getSpinnerValue(), "40");
- }
-
- private void clickUp() {
- String id = getParentId() + "_form:" + "spinnerButtons";
- selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[1]/td/input", "mousedown");
- selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[1]/td/input", "mouseup");
- }
-
- private void clickDown() {
- String id = getParentId() + "_form:" + "spinnerButtons";
- selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[2]/td/input", "mousedown");
- selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[2]/td/input", "mouseup");
- }
-
- private String getSpinnerValue() {
- String id = getParentId() + "_form:" + "spinnerEdit";
- return runScript("$('" + id + "').down('input').value");
- }
-
- public String getTestUrl() {
- return "/faces/pages/inputNumberSpinner/inputNumberSpinnerTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,65 +0,0 @@
-package org.richfaces;
-
-import static org.testng.Assert.assertEquals;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-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 JSFunctionTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public JSFunctionTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testJSFunctionComponent() throws Exception {
- _testJSFunctionComponent(Templates.SIMPLE);
- _testJSFunctionComponent(Templates.DATATABLE);
- _testJSFunctionComponent(Templates.MODALPANEL);
- }
-
- private void _testJSFunctionComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String showNameElemId = getParentId() + "showname";
- selenium.mouseOver("alex");
- waitForAjaxCompletion();
- assertEquals(getTextById(showNameElemId), "Alex");
-
- selenium.mouseOver("jonh");
- waitForAjaxCompletion();
- assertEquals(getTextById(showNameElemId), "Jonh");
-
- selenium.mouseOver("roger");
- waitForAjaxCompletion();
- assertEquals(getTextById(showNameElemId), "Roger");
- }
-
- public String getTestUrl() {
- return "/faces/pages/jsFunction/jsFunctionTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,90 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-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 implements RichSeleniumTest {
-
- public KeepAliveTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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.SIMPLE);
- _testKeepAliveComponent(Templates.DATATABLE);
- _testKeepAliveComponent(Templates.MODALPANEL);
- }
-
- private void _testKeepAliveComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId();
-
- String sumElemId = parentId + "sum";
- AssertValueEquals(sumElemId, "0");
- String addButtonId = parentId + "form:add";
- String addAjaxButtonId = parentId + "form:addAjax";
-
- writeStatus("The sum has to be increased by 5 twice");
-
- clickCommandAndWait(addButtonId);
- clickCommandAndWait(addButtonId);
- AssertValueEquals(sumElemId, "10");
-
- writeStatus("The sum has to be increased by 5 twice again");
-
- clickById(addAjaxButtonId);
- clickById(addAjaxButtonId);
- waitForAjaxCompletion();
- AssertValueEquals(sumElemId, "20");
-
- writeStatus("Test ajax only regime ... ");
-
- String sumAjaxOnlyElemId = parentId + "sumAjaxOnly";
- AssertValueEquals(sumAjaxOnlyElemId, "0");
- addButtonId = parentId + "formAjaxOnly:add";
- addAjaxButtonId = parentId + "formAjaxOnly:addAjax";
-
- writeStatus("State is not saved between full submits. The sum always is 5");
-
- clickCommandAndWait(addButtonId);
- clickCommandAndWait(addButtonId);
- AssertValueNotEquals(sumAjaxOnlyElemId, "10");
-
- writeStatus("Ajax request! The sum has to be increased by 5 twice");
-
-// This test doesn't pass! Bug?!
-
-// clickById(addAjaxButtonId);
-// clickById(addAjaxButtonId);
-// waitForAjaxCompletion();
-// AssertValueEquals(sumAjaxOnlyElemId, "10");
- }
-
- public String getTestUrl() {
- return "/faces/pages/keepAlive/keepAliveTest.xhtml";
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,55 +0,0 @@
-package org.richfaces;
-
-import static org.testng.Assert.assertEquals;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-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 LoadScriptTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public LoadScriptTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testLoadScriptComponent() throws Exception {
- _testLoadScriptComponent(Templates.SIMPLE);
- _testLoadScriptComponent(Templates.DATATABLE);
- _testLoadScriptComponent(Templates.MODALPANEL);
- }
-
- private void _testLoadScriptComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String jsCall = "summarize(%1$s, %2$s);";
- int opr1 = 1;
- int opr2 = 2;
- String result = runScript(String.format(jsCall, opr1, opr2));
- assertEquals(Integer.parseInt(result), opr1 + opr2);
- }
-
- public String getTestUrl() {
- return "/faces/pages/loadScript/loadScriptTest.xhtml";
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,53 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-
-import static org.testng.Assert.assertEquals;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class LoadStyleTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public LoadStyleTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testLoadStyleComponent() throws Exception {
- _testLoadStyleComponent(Templates.SIMPLE);
- _testLoadStyleComponent(Templates.DATATABLE);
- _testLoadStyleComponent(Templates.MODALPANEL);
- }
-
- private void _testLoadStyleComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String divId = getParentId() + "rectangle";
- assertEquals(50, getWidthById(divId));
- assertEquals(100, getHeightById(divId));
- }
-
- public String getTestUrl() {
- return "/faces/pages/loadStyle/loadStyleTest.xhtml";
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,249 +0,0 @@
-/**
- * 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.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class OrderingListTest extends SeleniumTestBase implements RichSeleniumTest {
- private String firstButton;
- private String firstButtonDisabled;
-
- private String upButton;
- private String upButtonDisabled;
-
- private String downButton;
- private String downButtonDisabled;
-
- private String lastButton;
- private String lastButtonDisabled;
-
- private String firstRow;
-
- private String actionResultText;
- private String ajax;
- private String server;
- private String thirdRow;
- private String selectionText;
- private String activeItemText;
-
- public OrderingListTest() {
- super("http", "localhost", serverPort);
- }
-
- public OrderingListTest(String protocol, String host, String port) {
- super(protocol, host, port);
- }
-
- /**
- * 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 testOrderingListComponent() throws Exception {
- _testOrderingListComponent(Templates.SIMPLE);
- _testOrderingListComponent(Templates.DATATABLE);
- _testOrderingListComponent(Templates.MODALPANEL);
- }
-
- private void _testOrderingListComponent(Templates template) {
- renderPage(getTestUrl(), template);
- initFields();
-
- _testButtons();
- _testActions();
- _testJSFunctions();
- }
-
- public String getTestUrl() {
- return "/faces/pages/orderingList/orderingListTest.xhtml";
- }
-
- private void _testButtons() {
- writeStatus("Check if all buttons are disabled first time");
- checkButtons(true, true, true, true);
-
- writeStatus("Click on first row");
- clickById(firstRow);
- checkButtons(true, true, false, false);
-
- writeStatus("Click on down button");
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
- clickById(downButton);
- checkButtons(false, false, false, false);
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 1);
-
- writeStatus("Click on last button");
- clickById(lastButton);
- checkButtons(false, false, true, true);
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 3);
-
- writeStatus("Click on first button");
- clickById(firstButton);
- checkButtons(true, true, false, false);
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
-
- cleanSelection();
- }
-
- private void _testActions() {
- writeStatus("Select two rows");
- clickById(firstRow);
- selenium.controlKeyDown();
- clickById(thirdRow);
- selenium.controlKeyUp();
- checkButtons(true, true, false, false);
-
- writeStatus("Click on ajax button");
- clickById(ajax);
- waitForAjaxCompletion();
- AssertTextEquals(actionResultText, "item0");
- AssertTextEquals(selectionText, "item0,item2");
- AssertTextEquals(activeItemText, "Item [item2]");
-
- writeStatus("Select one row");
- clickById(firstRow);
-
- writeStatus("Click on server link");
- clickCommandAndWait(server);
- AssertTextEquals(actionResultText, "item1");
- AssertTextEquals(selectionText, "item0");
- AssertTextEquals(activeItemText, "Item [item0]");
- checkButtons(true, true, false, false);
-
- cleanSelection();
- }
-
- private void _testJSFunctions() {
- writeStatus("Select one row");
- clickById(thirdRow);
-
- writeStatus("Check if 'onupclick' event works");
- clickById(upButton);
- Assert.assertEquals(selenium.getEval("window.status"), "up orderchanged");
-
- writeStatus("Check if 'ondownclick' event works");
- clickById(downButton);
- Assert.assertEquals(selenium.getEval("window.status"), "down orderchanged");
-
- writeStatus("Check if 'ontopclick' event works");
- clickById(firstButton);
- Assert.assertEquals(selenium.getEval("window.status"), "top orderchanged");
-
- writeStatus("Check if 'onbottomclick' event works");
- clickById(lastButton);
- Assert.assertEquals(selenium.getEval("window.status"), "bottom orderchanged");
-
- cleanSelection();
- }
-
- private void cleanSelection() {
- writeStatus("Unselect element");
- clickById(firstRow);
- selenium.controlKeyDown();
- clickById(firstRow);
- selenium.controlKeyUp();
- checkButtons(true, true, true, true);
-
- writeStatus("Submit empty selection to save it into server bean");
- clickById(ajax);
- waitForAjaxCompletion();
- }
-
- private void checkButtons(boolean firstDisabled, boolean upDisabled, boolean downDisabled, boolean lastDisabled) {
- if (firstDisabled) {
- Assert.assertTrue(isVisibleById(firstButtonDisabled));
- Assert.assertFalse(isVisibleById(firstButton));
- } else {
- Assert.assertFalse(isVisibleById(firstButtonDisabled));
- Assert.assertTrue(isVisibleById(firstButton));
- }
-
- if (upDisabled) {
- Assert.assertTrue(isVisibleById(upButtonDisabled));
- Assert.assertFalse(isVisibleById(upButton));
- } else {
- Assert.assertFalse(isVisibleById(upButtonDisabled));
- Assert.assertTrue(isVisibleById(upButton));
- }
-
- if (downDisabled) {
- Assert.assertTrue(isVisibleById(downButtonDisabled));
- Assert.assertFalse(isVisibleById(downButton));
- } else {
- Assert.assertFalse(isVisibleById(downButtonDisabled));
- Assert.assertTrue(isVisibleById(downButton));
- }
-
- if (lastDisabled) {
- Assert.assertTrue(isVisibleById(lastButtonDisabled));
- Assert.assertFalse(isVisibleById(lastButton));
- } else {
- Assert.assertFalse(isVisibleById(lastButtonDisabled));
- Assert.assertTrue(isVisibleById(lastButton));
- }
- }
-
- private void initFields() {
- String parentId = getParentId() + "_form:orderingList";
-
- firstButton = parentId + "first";
- firstButtonDisabled = parentId + "disfirst";
-
- upButton = parentId + "up";
- upButtonDisabled = parentId + "disup";
-
- downButton = parentId + "down";
- downButtonDisabled = parentId + "disdown";
-
- lastButton = parentId + "last";
- lastButtonDisabled = parentId + "dislast";
-
- firstRow = parentId + ":0";
- thirdRow = parentId + ":2";
-
- actionResultText = getParentId() + "_form:actionResult";
- selectionText = getParentId() + "_form:selection";
- activeItemText = getParentId() + "_form:activeItem";
- ajax = firstRow + ":_ajax";
- server = parentId + ":1:_server";
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,105 +0,0 @@
-/**
- * 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.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class PanelBarTest extends SeleniumTestBase implements RichSeleniumTest {
-
-
- public PanelBarTest() {
- super("http", "localhost", serverPort);
- }
-
-
- /**
- * 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 testPanelBarComponent() throws Exception {
- _testPanelBarComponent(Templates.SIMPLE);
- _testPanelBarComponent(Templates.DATATABLE);
- _testPanelBarComponent(Templates.MODALPANEL);
- }
-
- private void _testPanelBarComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String label2 = parentId + "label2";
- String label3 = parentId + "label3";
-
- String output1 = parentId + "output1";
- String output2 = parentId + "output2";
- String output3 = parentId + "output3";
-
- String ajaxButton = parentId + "button_ajax";
- String simpleButton = parentId + "button_simple";
-
- clickById(label2);
- Assert.assertFalse(isVisibleById(output1));
- Assert.assertTrue(isVisibleById(output2));
- Assert.assertFalse(isVisibleById(output3));
-
- clickCommandAndWait(simpleButton);
- Assert.assertFalse(isVisibleById(output1));
- Assert.assertTrue(isVisibleById(output2));
- Assert.assertFalse(isVisibleById(output3));
-
- clickById(label3);
- Assert.assertFalse(isVisibleById(output1));
- Assert.assertFalse(isVisibleById(output2));
- Assert.assertTrue(isVisibleById(output3));
-
- clickById(ajaxButton);
- waitForAjaxCompletion();
- Assert.assertFalse(isVisibleById(output1));
- Assert.assertFalse(isVisibleById(output2));
- Assert.assertTrue(isVisibleById(output3));
- }
-
- public String getTestUrl() {
- return "/faces/pages/panelBar/panelBarTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,227 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class PanelMenuTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public PanelMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testPanelMenuComponent() throws Exception {
-
- _testPanelMenuComponent(Templates.SIMPLE);
- _testPanelMenuComponent(Templates.DATATABLE);
- _testPanelMenuComponent(Templates.MODALPANEL);
-
- _testPanelMenuComponentSingleMode(Templates.SIMPLE);
- _testPanelMenuComponentSingleMode(Templates.DATATABLE);
- _testPanelMenuComponentSingleMode(Templates.MODALPANEL);
-
- _testPanelMenuItemAction(Templates.SIMPLE);
- _testPanelMenuItemAction(Templates.DATATABLE);
- _testPanelMenuItemAction(Templates.MODALPANEL);
-
- }
-
- private void _testPanelMenuComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- String ajaxGroup = "tablehide" + parentId + "pGroup1";
- String serverGroup = "tablehide" + parentId + "pGroup2";
- String clientGroup = "tablehide" + parentId + "pGroup3";
- String disabledGroup = "tablehide" + parentId + "pGroup4";
-
- String ajaxItem = "tablehide" + parentId + "pItem1";
- String serverItem = "tablehide" + parentId + "pItem2";
- String clientItem = "tablehide" + parentId + "pItem3";
- String disabledItem = "tablehide" + parentId + "pItem4";
-
- writeStatus("Click on ajax group");
- clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
- AssertValueEquals(inputId, "pGroup2");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(ajaxItem));
- Assert.assertTrue(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on ajax group");
- clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1");
- AssertTextEquals(outputId, "3");
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertTrue(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
-
- AssertValueEquals(inputId, "pGroup2");
- AssertTextEquals(outputId, "4");
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on client group");
- clickById(clientGroup);
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertTrue(isVisibleById(clientItem));
-
- writeStatus("Click on client group");
- clickById(clientGroup);
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on disabled client group");
- clickById(disabledGroup);
- Assert.assertFalse(isVisibleById(disabledItem));
- }
-
- private void _testPanelMenuComponentSingleMode(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- String ajaxGroup = "tablehide" + parentId + "pGroup1_single";
- String serverGroup = "tablehide" + parentId + "pGroup2_single";
- String clientGroup = "tablehide" + parentId + "pGroup3_single";
- String disabledGroup = "tablehide" + parentId + "pGroup4_single";
-
- String ajaxItem = "tablehide" + parentId + "pItem1_single";
- String serverItem = "tablehide" + parentId + "pItem2_single";
- String clientItem = "tablehide" + parentId + "pItem3_single";
- String disabledItem = "tablehide" + parentId + "pItem4_single";
-
- writeStatus("Click on ajax group");
- clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1_single");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
- AssertValueEquals(inputId, "pGroup2_single");
- AssertTextEquals(outputId, "2");
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertTrue(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on ajax group");
- clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1_single");
- AssertTextEquals(outputId, "3");
- Assert.assertTrue(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
- AssertValueEquals(inputId, "pGroup2_single");
- AssertTextEquals(outputId, "4");
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertTrue(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on client group");
- clickById(clientGroup);
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertTrue(isVisibleById(clientItem));
-
- writeStatus("Click on client group");
- clickById(clientGroup);
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on disabled client group");
- clickById(disabledGroup);
- Assert.assertFalse(isVisibleById(disabledItem));
- }
-
- private void _testPanelMenuItemAction(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- String group = "tablehide" + parentId + "pGroup1";
- String groupSingle = "tablehide" + parentId + "pGroup1_single";
-
- String item = "tablehide" + parentId + "pItem1";
- String itemSingle = "tablehide" + parentId + "pItem1_single";
-
- writeStatus("Click on ajax group");
- clickById(group);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1");
-
- writeStatus("Click on ajax group");
- clickById(groupSingle);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1_single");
-
- writeStatus("Click on server group");
- clickCommandAndWait(item);
- AssertValueEquals(inputId, "pItem1");
- AssertTextEquals(outputId, "1");
-
- writeStatus("Click on server group");
- clickCommandAndWait(itemSingle);
- AssertValueEquals(inputId, "pItem1_single");
- AssertTextEquals(outputId, "2");
- }
-
- public String getTestUrl() {
- return "/faces/pages/panelMenu/panelMenuTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,103 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class PickListTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public PickListTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testPickListComponent() throws Exception {
- _testPickListComponent(Templates.SIMPLE);
- _testPickListComponent(Templates.DATATABLE);
- _testPickListComponent(Templates.MODALPANEL);
- }
-
- private void _testPickListComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String pickListId = "pickList";
- String copyElemId = parentId + pickListId + "discopy";
- String copyAllElemId = parentId + pickListId + "copyAll";
- String removeElemId = parentId + pickListId + "disremove";
- String removeAllElemId = parentId + pickListId + "removeAll";
-
- writeStatus("Check move controls customized labels");
-
- AssertTextEquals(copyElemId, "MOVE");
- AssertTextEquals(copyAllElemId, "MOVE ALL");
- AssertTextEquals(removeElemId, "TAKE AWAY");
- AssertTextEquals(removeAllElemId, "TAKE ALL AWAY");
-
- String destListId = parentId + pickListId + "tlTbody";
- String srcListId = parentId + pickListId + "tbody";
-
- writeStatus("Check initial disposition");
-
- Assert.assertEquals(getNumberOfChildren(srcListId), 6);
- Assert.assertEquals(getNumberOfChildren(destListId), 2);
-
- writeStatus("Verify initial selected items.");
-
- Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[1]"), "ZHURIK");
- Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[2]"), "MELESHKO");
-
- writeStatus("Try to select first item and check state thereafter");
-
- selenium.doubleClick("xpath=//tbody[@id='" + srcListId + "']/tr/td");
-
- Assert.assertEquals(getNumberOfChildren(srcListId), 5);
- Assert.assertEquals(getNumberOfChildren(destListId), 3);
- Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[3]"), "LEONTIEV");
-
- }
-
- /**
- * Returns number of children for DOM element with given id.
- * @param elemId DOM element id
- * @return number of children
- */
- private int getNumberOfChildren(String elemId) {
- int retVal = -1;
- try {
- retVal = Integer.parseInt(runScript("dom=selenium.browserbot.getCurrentWindow().$('" + elemId
- + "').childElements().size()"));
- } catch (Exception e) {
- Assert.fail(e.getMessage());
- }
-
- return retVal;
- }
-
- public String getTestUrl() {
- return "/faces/pages/pickList/pickListTest.xhtml";
- }
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,139 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class ProgressBarTest extends SeleniumTestBase implements
- RichSeleniumTest {
-
- public ProgressBarTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testProgressBarComponent() {
- _testProgressBarComponent(Templates.SIMPLE);
- _testProgressBarComponent(Templates.DATATABLE);
- _testProgressBarComponent(Templates.MODALPANEL);
- }
-
- private void _testProgressBarComponent(Templates template) {
-
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
-
- String progressBarId = parentId + "progressBar1";
- int value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value < 0);
- String text = getTextById(progressBarId);
- writeStatus("Check if process not started");
- Assert.assertTrue(text.startsWith("Process not started"));
-
- writeStatus("Enable polling");
- enableProgressBar(progressBarId, true);
-
- pause(5000, progressBarId);
-
- writeStatus("Disable polling");
- enableProgressBar(progressBarId, false);
-
- writeStatus("Check label");
- text = getTextById(progressBarId + ":remain");
- Assert.assertTrue(text.endsWith("%"));
-
- writeStatus("Check value");
- value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value > 0);
-
- writeStatus("Enable polling");
- enableProgressBar(progressBarId, true);
-
- pause(5000, progressBarId);
- writeStatus("Check value");
- Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value));
-
- writeStatus("Disable polling");
- enableProgressBar(progressBarId, false);
-
- value = getProgressBarValue(progressBarId);
- pause(1500, progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(getProgressBarValue(progressBarId) == value);
-
- clickById(parentId + "_complete");
- waitForAjaxCompletion();
- writeStatus("Check if process completed");
- text = getTextById(progressBarId);
- Assert.assertTrue(text.startsWith("Process completed"));
-
-
- // - Test client mode
-
- writeStatus("Check value");
- progressBarId = parentId + "progressBar2";
- value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value == -5);
-
- text = getTextById(progressBarId);
- writeStatus("Check if process not started");
- Assert.assertTrue(text.startsWith("Process not started"));
-
- setProgressBarValue(progressBarId, 20);
- value = getProgressBarValue(progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(value == 20);
-
- setProgressBarValue(progressBarId, 60);
- value = getProgressBarValue(progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(value == 60);
-
- clickById(parentId + "_reset");
- waitForAjaxCompletion();
-
- }
-
- private void enableProgressBar(String id, boolean enable) {
- invokeFromComponent(id, (enable ? "enable" : "disable"), null);
- }
-
- private void setProgressBarValue(String id, Object value) {
- invokeFromComponent(id, "setValue", value);
- }
-
- private Integer getProgressBarValue(String id) {
- String value = invokeFromComponent(id, "getValue", null); //runScript(script.toString());
- Integer v = Integer.parseInt(value);
- return v;
- }
-
- public String getTestUrl() {
- return "/faces/pages/progressBar/progressBarTest.xhtml";
- }
-
-
-}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/RichSeleniumTest.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -0,0 +1,11 @@
+package org.richfaces;
+
+public interface RichSeleniumTest {
+
+ public void startSelenium (String browser);
+
+ public void stopSelenium();
+
+ public String getTestUrl();
+
+}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -0,0 +1,498 @@
+/**
+ * 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.javascript.ScriptUtils;
+import org.testng.Assert;
+
+import com.thoughtworks.selenium.DefaultSelenium;
+
+/**
+ * The base java class for selenium tests implementation.
+ *
+ * @author Andrey Markavtsov
+ *
+ */
+public abstract class SeleniumTestBase {
+
+ /** 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().";
+
+ /** Parent component id */
+ private String parentId;
+
+ /** The default selenium instance */
+ public DefaultSelenium selenium;
+
+ /** Host */
+ public String host;
+
+ /** Port */
+ public String port;
+
+ /** Protocol */
+ public 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 SeleniumTestBase(String protocol, String host, String port) {
+ this.host = host;
+ this.port = port;
+ this.protocol = protocol;
+ }
+
+ /**
+ * @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) {
+ selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
+ selenium.start();
+ }
+
+ /**
+ * Renders page
+ */
+ protected void renderPage(String homePage) {
+ selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + 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
+ */
+ protected void renderPage(String homePage, Templates template) {
+ selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + 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();
+
+ }
+
+ /**
+ * 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 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 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 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 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;
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,110 +0,0 @@
-/**
- * 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.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public SimpleTogglePanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Templates.SIMPLE);
- _testSimpleTogglePanelComponent(Templates.DATATABLE);
- _testSimpleTogglePanelComponent(Templates.MODALPANEL);
- }
-
- private void _testSimpleTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- String ajaxHeader = parentId + "panel1_header";
- String serverHeader = parentId + "panel2_header";
- String clientHeader = parentId + "panel3_header";
-
- String ajaxBody = parentId + "panel1_body";
- String serverBody = parentId + "panel2_body";
- String clientBody = parentId + "panel3_body";
-
- clickById(clientHeader);
- Assert.assertTrue(isVisibleById(clientBody));
- clickById(clientHeader);
- Assert.assertFalse(isVisibleById(clientBody));
-
- clickById(ajaxHeader);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "panel1");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(ajaxBody));
-
- clickById(ajaxHeader);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "panel1");
- AssertTextEquals(outputId, "2");
- Assert.assertFalse(isVisibleById(ajaxBody));
-
- clickCommandAndWait(serverHeader);
- AssertValueEquals(inputId, "panel2");
- AssertTextEquals(outputId, "3");
- Assert.assertTrue(isVisibleById(serverBody));
-
- clickCommandAndWait(serverHeader);
- AssertValueEquals(inputId, "panel2");
- AssertTextEquals(outputId, "4");
- Assert.assertFalse(isVisibleById(serverBody));
- }
-
- public String getTestUrl() {
- return "/faces/pages/simpleTogglePanel/simpleTogglePanel.xhtml";
- }
-
-
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,123 +0,0 @@
-/**
- * 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.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class SpacerTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public SpacerTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Templates.SIMPLE);
- _testSimpleTogglePanelComponent(Templates.DATATABLE);
- _testSimpleTogglePanelComponent(Templates.MODALPANEL);
- }
-
- private void _testSimpleTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId();
- String spacerId = parentId + "sp";
-
- writeStatus("Check width ");
- assertWidth(1 + 2, spacerId);
-
- writeStatus("Check height ");
- assertHeight(5 + 2, spacerId);
-
- writeStatus("Check styleClass ");
- assertStyleClass("sp", spacerId);
-
- writeStatus("Check style ");
- assertStyleClass("border: solid 1px green;", spacerId);
- }
-
- public String getTestUrl() {
- return "/faces/pages/spacer/spacerTest.xhtml";
- }
-
- private void assertWidth(int width, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').offsetWidth");
-
- String w = runScript(script.toString());
- Assert.assertEquals(w, String.valueOf(width));
- }
-
- private void assertHeight(int height, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').offsetHeight");
-
- String h = runScript(script.toString());
- Assert.assertEquals(h, String.valueOf(height));
- }
-
- private void assertStyleClass(String styleClass, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').className");
-
- String sc = runScript(script.toString());
- if (sc != null) {
- Assert.assertTrue(sc.endsWith("sp"));
- } else {
- Assert.fail("ClassName is null");
- }
- }
- private void assertStyle(String style, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').style");
-
- String s = runScript(script.toString());
- Assert.assertEquals(s, style);
- }
-}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,127 +0,0 @@
-/**
- * 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.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-import com.thoughtworks.selenium.SeleniumException;
-
-public class TabPanelTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public TabPanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testTabPanelComponent() throws Exception {
- _testRichTabPanelComponent(Templates.SIMPLE);
- _testRichTabPanelComponent(Templates.DATATABLE);
- _testRichTabPanelComponent(Templates.MODALPANEL);
- }
-
- private void _testRichTabPanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
- String linkId = parentId + "tab2_lbl";
- String tabId1 = parentId + "tab1";
- String tabId2 = parentId + "tab2";
- String tabId4 = parentId + "tab4";
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- writeStatus("Click on tab1");
- clickById(linkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "tab2");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(tabId2));
- Assert.assertFalse(isVisibleById(tabId4));
- try {
- getTextById(tabId1);
- Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
- } catch (SeleniumException se) {
-
- }
-
- writeStatus("Click on tab2");
- linkId = parentId + "tab1_lbl";
- clickCommandAndWait(linkId);
- AssertValueEquals(inputId, "tab1");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(tabId1));
- Assert.assertFalse(isVisibleById(tabId4));
- try {
- getTextById(tabId2);
- Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
- } catch (SeleniumException se) {
-
- }
-
- writeStatus("Click on tab3");
- linkId = parentId + "tab3_lbl";
- clickById(linkId);
- AssertValueEquals(inputId, "tab1");
- Assert.assertTrue(isVisibleById(tabId1));
-
- writeStatus("Click on tab4");
- linkId = parentId + "tab4_lbl";
- clickById(linkId);
- Assert.assertTrue(isVisibleById(tabId4));
- Assert.assertFalse(isVisibleById(tabId1));
- try {
- getTextById(tabId2);
- Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
- } catch (SeleniumException se) {
-
- }
- }
-
- public String getTestUrl() {
- return "/faces/pages/tabPanel/tabPanelTest.xhtml";
- }
-
-
-}
Copied: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java (from rev 8749, trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/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-05-26 14:19:15 UTC (rev 8757)
@@ -0,0 +1,48 @@
+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);
+ }
+ }
+
+ public void loadTemplate(SeleniumTestBase 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;
+ }
+
+
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java 2008-05-26 14:16:02 UTC (rev 8756)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java 2008-05-26 14:19:15 UTC (rev 8757)
@@ -1,194 +0,0 @@
-/**
- * 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.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-import com.thoughtworks.selenium.SeleniumException;
-
-public class TogglePanelTest extends SeleniumTestBase implements
- RichSeleniumTest {
-
- public TogglePanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * 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 testTogglePanelComponent() throws Exception {
- _testTogglePanelComponent(Templates.SIMPLE);
- _testTogglePanelComponent(Templates.DATATABLE);
- _testTogglePanelComponent(Templates.MODALPANEL);
- }
-
- private void _testTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- String controlNext = parentId + "ajax_next";
- String controlOne = parentId + "ajax_one";
- String controlTwo = parentId + "ajax_two";
-
- String oneFacet = parentId + "ajax_state_one";
- String twoFacet = parentId + "ajax_state_two";
-
- writeStatus("Click on ajax controlNext");
- clickById(controlNext);
- waitForAjaxCompletion();
- //pause(6000, "panel_ajax");
- AssertValueEquals(inputId, "ajax_next");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- } catch (SeleniumException se) {
-
- }
-
- writeStatus("Click on ajax controlOne");
- clickById(controlOne);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "ajax_one");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(oneFacet));
- try {
- getTextById(twoFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- } catch (SeleniumException se) {
-
- }
-
- writeStatus("Click on ajax controlTwo");
- clickById(controlTwo);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "ajax_two");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- } catch (SeleniumException se) {
-
- }
-
- controlNext = parentId + "server_next";
- controlOne = parentId + "server_one";
- controlTwo = parentId + "server_two";
- oneFacet = parentId + "server_state_one";
- twoFacet = parentId + "server_state_two";
-
- writeStatus("Click on controlNext");
- clickCommandAndWait(controlNext);
- AssertValueEquals(inputId, "server_next");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
- } catch (SeleniumException se) {
-
- }
-
- writeStatus("Click on server controlOne");
- clickCommandAndWait(controlOne);
- AssertValueEquals(inputId, "server_one");
- AssertTextEquals(outputId, "3");
- Assert.assertTrue(isVisibleById(oneFacet));
- try {
- getTextById(twoFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
- } catch (SeleniumException se) {
-
- }
-
- writeStatus("Click on server controlTwo");
- clickCommandAndWait(controlTwo);
- AssertValueEquals(inputId, "server_two");
- AssertTextEquals(outputId, "4");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
- } catch (SeleniumException se) {
-
- }
-
- controlNext = parentId + "client_next";
- controlOne = parentId + "client_one";
- controlTwo = parentId + "client_two";
- oneFacet = parentId + "client_state_one";
- twoFacet = parentId + "client_state_two";
-
- writeStatus("Click on client controlNext");
- clickById(controlNext);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
-
- writeStatus("Click on client controlOne");
- clickById(controlOne);
- Assert.assertTrue(isVisibleById(oneFacet));
- Assert.assertFalse(isVisibleById(twoFacet));
-
- writeStatus("Click on client controlTwo");
- clickById(controlTwo);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
- }
-
- public String getTestUrl() {
- return "/faces/pages/togglePanel/togglePanelTest.xhtml";
- }
-
-}
16 years, 7 months
JBoss Rich Faces SVN: r8756 - in trunk/test-applications/seleniumTest/src/main/webapp: layout and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-05-26 10:16:02 -0400 (Mon, 26 May 2008)
New Revision: 8756
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml
Log:
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-05-26 14:15:36 UTC (rev 8755)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-26 14:16:02 UTC (rev 8756)
@@ -11,14 +11,14 @@
<managed-bean>
<managed-bean-name>indexBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.IndexBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.IndexBean</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<!-- queue.xhtml -->
<managed-bean>
<managed-bean-name>bean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.Bean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.Bean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>text</property-name>
@@ -29,89 +29,89 @@
<managed-bean>
<managed-bean-name>templateBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.TemplateBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.TemplateBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>commandBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JCommandTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JCommandTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>progressBarBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.ProgressBarTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.ProgressBarTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>panelBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.RichPanelTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.RichPanelTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>jsFunctionBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.JSFunctionBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.JSFunctionBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>statusBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JStatusTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JStatusTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>pollBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JPollTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.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-class>org.ajax4jsf.bean.A4JKeepAliveTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>keepAliveAjaxOnlyBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JKeepAliveTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JKeepAliveTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>regionBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.A4JRegionTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.A4JRegionTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>comboBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.ComboBoxTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.ComboBoxTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>ddmenuBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.DropDownMenuTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.DropDownMenuTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>contextMenuBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.ContextMenuTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.ContextMenuTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>pickListBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.PickListTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.PickListTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>inplaceSelectBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.InplaceSelectTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.InplaceSelectTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>orderingListBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.OrderingListTestBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.OrderingListTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>dataTableBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.DataTableBean</managed-bean-class>
+ <managed-bean-class>org.ajax4jsf.bean.DataTableBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
+ </managed-bean>
</faces-config>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-26 14:15:36 UTC (rev 8755)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-26 14:16:02 UTC (rev 8756)
@@ -27,16 +27,20 @@
}
function reRenderAll () {
- document.getElementById('_Selenium_Test_ReRender_Form:_reRender').onclick();
+ document.getElementById('_Selenium_Test_Template_Form:_reRender').onclick();
return;
}
function loadTemplate (name) {
- document.getElementById('_Selenium_Template_Name').value = name;
- document.getElementById('_Selenium_Test_ReRender_Form:_Selenium_Template_Setup').onclick();
+ document.getElementById('_Selenium_Test_Template_Form:_Selenium_Test_Template_id').value = name;
+ document.getElementById('_Selenium_Test_Template_Form:_Selenium_Test_loadTemplate').onclick();
return;
}
+ function getParentId () {
+ return '#{templateBean.parentId}';
+ }
+
function writeStatus (mess) {
document.getElementById('_Selenium_Test_Status_Message').value = mess;
}
@@ -49,18 +53,6 @@
<body>
<div style="padding: 10px; font-size: 24px;">Rich faces component testing by Selenium</div><br/>
-<h:form id="_Selenium_Test_ReRender_Form">
-<input type="hidden" name="t" value="" id="_Selenium_Template_Name" />
- <table border="0" cellpadding="5" cellspacing="0" style="display: none">
- <tr>
- <td colspan="2">
- <a4j:commandLink reRender="_Selenium_Test_Common_Grid" value="ReRenderAll" id="_reRender">
- </a4j:commandLink>
- <h:commandLink value="setTemplate" style="" id="_Selenium_Template_Setup" actionListener="#{templateBean.initTemplate}" />
- </td>
- </tr>
- </table>
-</h:form>
<div id="_Selenium_Test_ControlPoint1" style="display: none;">Control1</div>
<h:panelGrid id="_Selenium_Test_Common_Grid">
<div>
@@ -69,36 +61,41 @@
<br/>
<div>
<ui:insert name="template"/>
- </div>
+ </div>
</h:panelGrid>
-<script type="text/javascript">
- window.done=false; A4J.AJAX.AddListener(new A4J.AJAX.Listener(function(){window.done=true;}));
-</script>
<div id="_Selenium_Test_ControlPoint2" style="display: none;">Control2</div>
<hr />
+<h:form id="_Selenium_Test_Template_Form">
<table style="background-color: #F2F2F2">
<tr>
<td>
Current Template:
</td>
<td>
- <h:selectOneMenu value="#{templateBean.templateId}" readonly="true" id="_Selenium_Test_Template_id">
+ <h:selectOneMenu value="#{templateBean.templateId}" id="_Selenium_Test_Template_id">
<f:selectItem itemValue="simple" itemLabel="Simple"/>
<f:selectItem itemValue="dataTable" itemLabel="DataTable"/>
<f:selectItem itemValue="modalPanel" itemLabel="Modal Panel"/>
</h:selectOneMenu>
</td>
<td>
- <a href="#" onclick="loadTemplate(document.getElementById('_Selenium_Test_Template_id').value); return false;">Load</a>
+ <h:commandLink id="_Selenium_Test_loadTemplate" value="Load"></h:commandLink>
</td>
</tr>
<tr>
-<td colspan="2">
- <a href="#{facesContext.externalContext.requestContextPath}/faces/index.xhtml">home</a>
+<td>
+ <a href="#{facesContext.externalContext.requestContextPath}/faces/index.xhtml">Home</a>
</td>
+<td>
+ <a4j:commandLink reRender="_Selenium_Test_Common_Grid" value="ReRenderAll" id="_reRender"/>
+</td>
</tr>
</table>
+</h:form>
+<script type="text/javascript">
+ window.done=false; A4J.AJAX.AddListener(new A4J.AJAX.Listener(function(){window.done=true;}));
+</script>
</body>
</f:view>
</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml 2008-05-26 14:15:36 UTC (rev 8755)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml 2008-05-26 14:16:02 UTC (rev 8756)
@@ -7,64 +7,165 @@
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="#{templateBean.template}">
+ <ui:define name="style">
+ .yes {
+ font-weight: bold;
+ }
+
+ .no {
+ color: gray;
+ }
+ </ui:define>
<ui:define name="component">
- <h:form id="_form">
- <a4j:commandButton
- id="b1"
- action="#{commandBean.action}"
- actionListener="#{commandBean.actionListener}"
- reRender="_value"
- value="Button1">
- <a4j:ajaxListener type="org.ajax4jsf.TestListener"></a4j:ajaxListener>
- <f:param name="_ID" value="_value" />
- </a4j:commandButton>
+ <script type="text/javascript">
+ <!--
+ var responseData = null;
+ function onCompleteHandler (data) {
+ responseData = data;
+ }
+
+ function checkButton(id, testData ,testAction, testActionListener, testFListener, testInput) {
+ var b = '';
+ if (responseData) {
+ if (!equals(responseData.action,testAction)) {
+ b = (!responseData.action) ? 'Error: action has been skipped' : 'Error: action should be skipped';
+ }
+ if (!equals(responseData.actionListener,testActionListener)) {
+ b = (!responseData.actionListener) ? 'Error: actionListener has been skipped' : 'Error: actionListener should be skipped';
+ }
+ if (!equals(responseData.FListener,testFListener)) {
+ b = (!responseData.FListener) ? 'Error: calling f:listener has been skipped' : 'Error: f:listener should be skipped';
+ }
+ if (!equals(responseData.input,testInput)) {
+ b = (!responseData.input) ? 'Error: input value has not been updated' : 'Error: input value should not been updated';
+ }
+ }else if (testData){
+ return "Error: no response data received";
+ }
+ responseData = null;
+ if (b == '') {
+ writeStatus('Test button id=['+id+'] passed succesfully');
+ }else {
+ writeStatus('Test button id=['+id+'] failed');
+ }
+ return b;
+ }
- <a4j:commandButton
- id="b2"
- action="#{commandBean.action}"
- actionListener="#{commandBean.actionListener}"
- immediate="true"
- reRender="_value"
- value="Button2">
- <a4j:ajaxListener type="org.ajax4jsf.TestListener"></a4j:ajaxListener>
- <f:param name="_ID" value="_value" />
- </a4j:commandButton>
-
- <a4j:commandButton
- id="b3"
- action="#{commandBean.action}"
- immediate="true"
- reRender="_value"
- value="Button3">
- </a4j:commandButton>
+ function equals(o1, o2) {
+ if ((!o1 && o2) || (o1 && !o2)) {
+ return false;
+ }
+ return true;
+ }
- <a4j:commandButton
- id="b4"
- action="#{commandBean.action}"
- immediate="true"
- ajaxSingle="true"
- reRender="_value"
- value="Button4">
- <a4j:ajaxListener type="org.ajax4jsf.TestListener"></a4j:ajaxListener>
- <f:param name="_ID" value="_value" />
- </a4j:commandButton>
+ function setValidation(success) {
+ var i = document.getElementById(getParentId() + '_form:_value');
+ if (i) {
+ if (success) {
+ i.value = 'text';
+ }else {
+ i.value = '';
+ }
+ }
+ }
+
+ -->
+ </script>
- <a4j:commandButton
- id="b5"
- action="#{commandBean.action}"
- actionListener="#{commandBean.actionListener}"
- ajaxSingle="true"
- reRender="_value"
- value="Button5">
- </a4j:commandButton>
-
- <br/>
- <h:inputText value="#{commandBean.value}" id="_value"></h:inputText>
+ <h:form id="_form">
+ <table border="1px" cellspacing="0" cellpadding="3">
+ <thead style="font-size: 13px; color: green; font-style: italic;">
+ <tr>
+ <th>button</th><th>Action</th><th>ActionListener</th><th>F:listener</th><th>AjaxSingle</th><th>Immediate</th><th>Validation</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <a4j:commandButton value="Button [id=b1]"
+ id="b1"
+ action="#{commandBean.action}"
+ actionListener="#{commandBean.actionListener}"
+ oncomplete="onCompleteHandler(data);"
+ onmousedown="setValidation(true)"
+ reRender="_value"
+ >
+ <a4j:ajaxListener type="org.ajax4jsf.bean.TestListener"></a4j:ajaxListener>
+ </a4j:commandButton>
+ </td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="no">No</td>
+ <td class="no">No</td>
+ <td class="no">Passed</td>
+ </tr>
+ <tr>
+ <td>
+ <a4j:commandButton value="Button [id=b2]"
+ id="b2"
+ action="#{commandBean.action}"
+ actionListener="#{commandBean.actionListener}"
+ oncomplete="onCompleteHandler(data);"
+ onmousedown="setValidation(false)"
+ reRender="_value"
+ >
+ </a4j:commandButton>
+ </td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="no">No</td>
+ <td class="no">No</td>
+ <td class="no">No</td>
+ <td class="yes">Failed</td>
+ </tr>
+ <tr>
+ <td>
+ <a4j:commandButton value="Button [id=b3]"
+ id="b3"
+ immediate="true"
+ action="#{commandBean.action}"
+ actionListener="#{commandBean.actionListener}"
+ oncomplete="onCompleteHandler(data);"
+ onmousedown="setValidation(true)"
+ reRender="_value"
+ >
+ <a4j:ajaxListener type="org.ajax4jsf.bean.TestListener"></a4j:ajaxListener>
+ </a4j:commandButton>
+ </td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="no">No</td>
+ <td class="yes">Yes</td>
+ <td class="no">Passed</td>
+ </tr>
+ <tr>
+ <td>
+ <a4j:commandButton value="Button [id=b4]"
+ id="b4"
+ immediate="true"
+ ajaxSingle="true"
+ action="#{commandBean.action}"
+ actionListener="#{commandBean.actionListener}"
+ oncomplete="onCompleteHandler(data);"
+ onmousedown="setValidation(false)"
+ reRender="_value"
+ >
+ <a4j:ajaxListener type="org.ajax4jsf.bean.TestListener"></a4j:ajaxListener>
+ </a4j:commandButton>
+ </td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Yes</td>
+ <td class="yes">Failed</td>
+ </tr>
+ </tbody>
+ </table>
+ <h:inputHidden id="_value" required="true" value="#{commandBean.value}"></h:inputHidden>
</h:form>
- <br/>
</ui:define>
- <ui:define name="description">
- <ui:include src="ajaxButtonDescription.xhtml" />
- </ui:define>
</ui:composition>
</html>
\ No newline at end of file
16 years, 7 months
JBoss Rich Faces SVN: r8755 - in trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf: bean and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-05-26 10:15:36 -0400 (Mon, 26 May 2008)
New Revision: 8755
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JCommandTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JKeepAliveTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JRegionTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JStatusTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4jTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Bean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ChildBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ContextMenuTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Data.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataTableBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DropDownMenuTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/EnclosedData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/IndexBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/JSFunctionBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ListAction.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Media.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MessageBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/NavigateBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ObjectNotFoundException.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PageDescriptionBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PagesBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PickListTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RepeatData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestListener.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TimerBean.java
Log:
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JCommandTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JCommandTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JCommandTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,65 @@
+package org.ajax4jsf.bean;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.AjaxContextImpl;
+
+import com.sun.faces.context.FacesContextImpl;
+
+public class A4JCommandTestBean {
+
+ private String value;
+
+ private AjaxContext getAjaxContext () {
+ FacesContext context = FacesContextImpl.getCurrentInstance();
+ if (context != null) {
+ return AjaxContextImpl.getCurrentInstance(context);
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void put2ResponseData(String key, Object value) {
+ AjaxContext ajaxContext = getAjaxContext();
+ if (ajaxContext != null) {
+ Map<String, Object> data = (Map<String, Object>)ajaxContext.getResponseData();
+ if (null == data) {
+ data = new HashMap<String, Object>();
+ ajaxContext.setResponseData(data);
+ }
+ data.put(key, value);
+ }
+ }
+
+ public String action () {
+ put2ResponseData("action", true);
+ return null;
+ }
+
+ public void actionListener (ActionEvent event) {
+ put2ResponseData("actionListener", true);
+ }
+
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ put2ResponseData("input", true);
+ }
+
+
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JKeepAliveTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JKeepAliveTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JKeepAliveTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JKeepAliveTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,47 @@
+package org.ajax4jsf.bean;
+
+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;
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JPollTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,58 @@
+package org.ajax4jsf.bean;
+
+import javax.faces.event.ActionEvent;
+
+public class A4JPollTestBean {
+
+ private Integer i = 1;
+
+ private static final String POLLING = "Polling";
+
+ private boolean enabled = false;
+
+ public void start(ActionEvent event) {
+ enabled = true;
+ }
+
+ public void listener(ActionEvent event) {
+ i++;
+ if (i == 8) {
+ enabled = false;
+ }
+ }
+
+ public String getText() {
+ return POLLING.substring(0, i);
+ }
+
+ /**
+ * @return the i
+ */
+ public Integer getI() {
+ return i;
+ }
+
+ /**
+ * @param i the i to set
+ */
+ public void setI(Integer i) {
+ this.i = i;
+ }
+
+ /**
+ * @return the enabled
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JRegionTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JRegionTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JRegionTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JRegionTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,67 @@
+package org.ajax4jsf.bean;
+
+public class A4JRegionTestBean {
+
+ private Integer internal = 0;
+
+ private Integer external = 0;
+
+ private Integer value = 0;
+
+ /**
+ * Gets value of internal field.
+ *
+ * @return value of internal field
+ */
+ public Integer getInternal() {
+ return internal;
+ }
+
+ /**
+ * Set a new value for internal field.
+ *
+ * @param internal
+ * a new value for internal field
+ */
+ public void setInternal(Integer internal) {
+ this.internal = internal;
+ }
+
+ /**
+ * Gets value of external field.
+ *
+ * @return value of external field
+ */
+ public Integer getExternal() {
+ return external;
+ }
+
+ /**
+ * Set a new value for external field.
+ *
+ * @param external
+ * a new value for external field
+ */
+ public void setExternal(Integer external) {
+ this.external = external;
+ }
+
+ /**
+ * Gets value of value field.
+ *
+ * @return value of value field
+ */
+ public Integer getValue() {
+ return value;
+ }
+
+ /**
+ * Set a new value for value field.
+ *
+ * @param value
+ * a new value for value field
+ */
+ public void setValue(Integer value) {
+ this.value = value;
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JStatusTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JStatusTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JStatusTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,16 @@
+package org.ajax4jsf.bean;
+
+import javax.faces.event.ActionEvent;
+
+public class A4JStatusTestBean {
+
+ public void actionListener(ActionEvent event) {
+ //mega time-consuming operation - sleeping
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4jTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4jTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4jTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,45 @@
+package org.ajax4jsf.bean;
+
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+public class A4jTestBean {
+
+ private String param = "Not set yet";
+ private boolean checked;
+
+ public String getParam() {
+ return param;
+ }
+
+ public void setParam(String param) {
+ this.param = param;
+ }
+
+ private void checkMap() {
+ Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ for (String key : params.keySet()) {
+ System.out.println(key + "=" + params.get(key));
+ }
+ }
+
+ public void perform(ActionEvent actionEvent) {
+ System.out.println("A4jTestBean.perform(ActionEvent) = " + param);
+ checkMap();
+ }
+
+ public void perform() {
+ System.out.println("A4jTestBean.perform() = " + param);
+ checkMap();
+ }
+
+ public boolean isChecked() {
+ return checked;
+ }
+
+ public void setChecked(boolean checked) {
+ this.checked = checked;
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Bean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Bean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Bean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,206 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ValueChangeEvent;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+ private java.lang.String text;
+
+ private String text2="<%%%>";
+
+ private String[] array = {"one]","two]]>"};
+
+ private String[][] array2 = {{"one","two"},{"three","four"}};
+
+ private UIComponent component;
+
+ private HtmlOutputText outputComponent;
+
+ /**
+ * @return the component
+ */
+ public UIComponent getComponent() {
+ return component;
+ }
+
+ /**
+ * @param component the component to set
+ */
+ public void setComponent(UIComponent component) {
+ this.component = component;
+ }
+
+ public java.lang.String getText() {
+ return text;
+ }
+
+ public void setText(java.lang.String text) {
+ this.text = text;
+ }
+
+ public String ok(){
+ System.out.println("Button pressed");
+ setText("testOk");
+ return null;
+ }
+
+ public String setCookie() {
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();
+ Cookie cookie = new Cookie("test", "Setted at time "+System.currentTimeMillis());
+ cookie.setMaxAge(60 * 60 * 24 * 365);
+ response.addCookie(cookie);
+ return "verify_cookie";
+ }
+
+ public String getTestCookie(){
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
+ Cookie[] cookies = request.getCookies();
+ for (int i = 0; i < cookies.length; i++) {
+ if("test".equals(cookies[i].getName())){
+ return cookies[i].getValue();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return the array
+ */
+ public String[] getArray() {
+ return array;
+ }
+
+ /**
+ * @param array the array to set
+ */
+ public void setArray(String[] array) {
+ this.array = array;
+ }
+
+ /**
+ * @return the array2
+ */
+ public String[][] getArray2() {
+ return array2;
+ }
+
+ /**
+ * @param array2 the array2 to set
+ */
+ public void setArray2(String[][] array2) {
+ this.array2 = array2;
+ }
+
+ /**
+ * @return the text2
+ */
+ public String getText2() {
+ return text2;
+ }
+
+ /**
+ * @param text2 the text2 to set
+ */
+ public void setText2(String test2) {
+ this.text2 = test2;
+ }
+
+ public void validate(FacesContext context, UIComponent input,Object newValue) {
+ FacesMessage msg = new FacesMessage("#{bean.validate} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("validate");
+ }
+
+ public void onChange(ValueChangeEvent event) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIComponent input = event.getComponent();
+ FacesMessage msg = new FacesMessage("#{bean.onChange} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("onChange");
+
+ }
+
+ public void validate2(FacesContext context, UIComponent input,Object newValue) {
+ FacesMessage msg = new FacesMessage("#{bean.validate2} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("validate2");
+
+ }
+
+ public void onChange2(ValueChangeEvent event) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIComponent input = event.getComponent();
+ FacesMessage msg = new FacesMessage("#{bean.onChange2} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("onChange2");
+
+ }
+
+ public String getTime(){
+ return (new Date(System.currentTimeMillis())).toString();
+ }
+
+ public String clearSession(){
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ HttpSession session = (HttpSession) externalContext.getSession(false);
+ if(null != session){
+ session.setMaxInactiveInterval(5);
+ }
+ return null;
+ }
+
+ /**
+ * @return the outputComponent
+ */
+ public HtmlOutputText getOutputComponent() {
+ outputComponent = new HtmlOutputText();
+ return outputComponent;
+ }
+
+ /**
+ * @param outputComponent the outputComponent to set
+ */
+ public void setOutputComponent(HtmlOutputText outputComponent) {
+ this.outputComponent = outputComponent;
+ }
+
+}
\ No newline at end of file
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,170 @@
+/**
+ * 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;
+
+import java.lang.reflect.Method;
+import java.text.DateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import javax.faces.convert.DateTimeConverter;
+
+public class CalendarTestBean {
+
+ public static final String DATE_PATTERN = "MM/dd/yyyy HH:mm";
+
+ public static final Locale LOCALE = new Locale("US");
+
+ public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("GMT+2");
+
+ public static Date DEFAULT_DATE;
+
+ private static DateTimeConverter DEFAULT_CONVERTER;
+
+ public static DateFormat DATE_FORMAT;
+
+ // constructor for static fields
+ static {
+ setupDefaultConverter();
+ setupDefaultDate();
+ }
+
+ private String datePattern ;
+
+ private Locale locale;
+
+ private TimeZone timeZone;
+
+ private Date selectedDate;
+
+ private String selectedDateString;
+
+ public CalendarTestBean() {
+ selectedDate = DEFAULT_DATE;
+ resetSelectedDateString();
+
+ datePattern = DATE_PATTERN;
+ locale = LOCALE;
+ timeZone = TIME_ZONE;
+ }
+
+ public Date getSelectedDate() {
+ return selectedDate;
+ }
+
+ public void setSelectedDate(Date selectedDate) {
+ this.selectedDate = selectedDate;
+ resetSelectedDateString();
+ }
+
+ public void resetSelectedDateString() {
+ setSelectedDateString(DATE_FORMAT.format(getSelectedDate()));
+ }
+
+ public String getSelectedDateString() {
+ return selectedDateString;
+ }
+
+ public void setSelectedDateString(String selectedDateString) {
+ this.selectedDateString = selectedDateString;
+ }
+
+ public String getDatePattern() {
+ return datePattern;
+ }
+
+ public Locale getLocale() {
+ return locale;
+ }
+
+ public TimeZone getTimeZone() {
+ return timeZone;
+ }
+
+ public void setDatePattern(String datePattern) {
+ this.datePattern = datePattern;
+ }
+
+ public void setLocale(Locale locale) {
+ this.locale = locale;
+ }
+
+ public void setTimeZone(TimeZone timeZone) {
+ this.timeZone = timeZone;
+ }
+
+ public static Calendar getCalendar() {
+ return Calendar.getInstance(CalendarTestBean.TIME_ZONE, CalendarTestBean.LOCALE);
+ }
+
+ /**
+ * Setup the default date
+ */
+ private static void setupDefaultDate() {
+ DEFAULT_DATE = getDayInMay(10);
+ }
+
+ public static Date getDayInMay(int dayOfMonth) {
+ Calendar calendar = getCalendar();
+ calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
+ calendar.set(Calendar.MONTH, Calendar.MAY);
+ calendar.set(Calendar.YEAR, 2008);
+ calendar.set(Calendar.HOUR_OF_DAY, 18);
+ calendar.set(Calendar.MINUTE, 25);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ return calendar.getTime();
+ }
+
+ /**
+ * Setup the default converter
+ */
+ private static void setupDefaultConverter() {
+ DEFAULT_CONVERTER = new DateTimeConverter();
+
+ DEFAULT_CONVERTER.setPattern(DATE_PATTERN);
+ DEFAULT_CONVERTER.setLocale(LOCALE);
+ DEFAULT_CONVERTER.setTimeZone(TIME_ZONE);
+
+ try {
+ Method method = null;
+ Method[] declaredMethods = DateTimeConverter.class.getDeclaredMethods();
+ for (int i = 0; i < declaredMethods.length; i++) {
+ if (declaredMethods[i].getName().equals("getDateFormat")) {
+ method = declaredMethods[i];
+ break;
+ }
+ }
+ if (method != null) {
+
+ method.setAccessible(true);
+ DATE_FORMAT = (DateFormat) method.invoke(DEFAULT_CONVERTER, DEFAULT_CONVERTER.getLocale());
+ DATE_FORMAT.setTimeZone(DEFAULT_CONVERTER.getTimeZone());
+ }
+ } catch (Exception e) {
+ // skip exception
+ }
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ChildBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ChildBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ChildBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,62 @@
+/**
+ * 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;
+
+/**
+ * @author shura
+ *
+ */
+public class ChildBean {
+
+ private String name;
+
+ private int qty;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the qty
+ */
+ public int getQty() {
+ return this.qty;
+ }
+
+ /**
+ * @param qty the qty to set
+ */
+ public void setQty(int qty) {
+ this.qty = qty;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ComboBoxTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ComboBoxTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,38 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class ComboBoxTestBean {
+
+ private List<SelectItem> treeItems;
+ private List<String> treeNames;
+
+ public ComboBoxTestBean() {
+ treeNames = Arrays.asList("Pine", "Birch", "Aspen", "Spruce", "Oak", "Maple", "Ash", "Lime");
+ treeItems = new ArrayList<SelectItem>();
+ for (String treeName : treeNames) {
+ treeItems.add(new SelectItem(treeName, treeName));
+ }
+ }
+
+ /**
+ * Gets value of treeItems field.
+ * @return value of treeItems field
+ */
+ public List<SelectItem> getTreeItems() {
+ return treeItems;
+ }
+
+ /**
+ * Gets value of treeNames field.
+ * @return value of treeNames field
+ */
+ public List<String> getTreeNames() {
+ return treeNames;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ContextMenuTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ContextMenuTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ContextMenuTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ContextMenuTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,65 @@
+/**
+ * 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;
+
+import javax.faces.event.ActionEvent;
+
+public class ContextMenuTestBean {
+
+ private String value;
+ private int value2;
+
+ public ContextMenuTestBean() {
+ value = "";
+ value2 = 0;
+ }
+
+ public void actionListener(ActionEvent event) {
+ this.value = event.getComponent().getId();
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String action() {
+ if (4 == value2 ) {
+ value2 = 1;
+ } else {
+ value2++;
+ }
+ return null;
+ }
+
+ public int getValue2() {
+ return value2;
+ }
+
+ public void setValue2(int value2) {
+ this.value2 = value2;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Data.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Data.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Data.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,135 @@
+/**
+ * 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;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+
+public class Data {
+
+ private static final String[] mnames={"Jan","Feb","Mar","Apr","May"};
+
+ private List mounths = new ArrayList();
+
+ private List numbers = new ArrayList();
+
+ private boolean c3rendered=true;
+
+ private boolean c2rendered=true;
+
+ /**
+ * @return the c3rendered
+ */
+ public boolean isC3rendered() {
+ return this.c3rendered;
+ }
+
+ /**
+ * @param c3rendered the c3rendered to set
+ */
+ public void setC3rendered(boolean c3rendered) {
+ this.c3rendered = c3rendered;
+ }
+
+ public String toggleColumn() {
+ this.c3rendered = !this.c3rendered;
+ return null;
+ }
+ /**
+ * @return the numbers
+ */
+ public List getNumbers() {
+ return this.numbers;
+ }
+
+ /**
+ * @param numbers the numbers to set
+ */
+ public void setNumbers(List numbers) {
+ this.numbers = numbers;
+ }
+
+ public Data() {
+ Properties properties = System.getProperties();
+ Enumeration keys = properties.keys();
+ for(int i=0;i<5;i++){
+ DataBean bean = new DataBean();
+ int l = (int)(Math.random()*5)+1;
+ bean.setTotal(0);
+ bean.setMounth(mnames[i]);
+ mounths.add(bean);
+ for(int j=0;j<l;j++){
+ ChildBean child = new ChildBean();
+ child.setName((String) keys.nextElement());
+ int qty = (int)(Math.random()*10);
+ bean.setTotal(bean.getTotal()+qty);
+ child.setQty(qty);
+ bean.getDetail().add(child);
+ }
+ }
+ for(int i=0;i<16;i++){
+ numbers.add(new Integer(i));
+ }
+ }
+
+ /**
+ * @return the mounths
+ */
+ public List getMounths() {
+ return this.mounths;
+ }
+
+ /**
+ * @param mounths the mounths to set
+ */
+ public void setMounths(List mounths) {
+ this.mounths = mounths;
+ }
+
+ /**
+ * @return the c2rendered
+ */
+ public boolean isC2rendered() {
+ return this.c2rendered;
+ }
+
+ /**
+ * @param c2rendered the c2rendered to set
+ */
+ public void setC2rendered(boolean c2rendered) {
+ this.c2rendered = c2rendered;
+ }
+
+ public int getC2span(){
+ return c3rendered?1:2;
+ }
+
+ public int getC1span(){
+ int i = c2rendered?1:c3rendered?2:3;
+ return i;
+ }
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,119 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class DataBean {
+ private List detail = new ArrayList();
+
+ private String mounth;
+
+ private int total;
+
+ private int price;
+
+ private boolean checked=true;
+ /**
+ *
+ */
+ public DataBean() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return the detail
+ */
+ public List getDetail() {
+ return this.detail;
+ }
+
+ /**
+ * @param detail the detail to set
+ */
+ public void setDetail(List detail) {
+ this.detail = detail;
+ }
+
+ /**
+ * @return the mounth
+ */
+ public String getMounth() {
+ return this.mounth;
+ }
+
+ /**
+ * @param mounth the mounth to set
+ */
+ public void setMounth(String mounth) {
+ this.mounth = mounth;
+ }
+
+ /**
+ * @return the total
+ */
+ public int getTotal() {
+ return this.total;
+ }
+
+ /**
+ * @param total the total to set
+ */
+ public void setTotal(int total) {
+ this.total = total;
+ }
+
+ /**
+ * @return the checked
+ */
+ public boolean isChecked() {
+ System.out.println("Invoke get checked for mounth "+getMounth()+", checked:"+checked);
+ return this.checked;
+ }
+
+ /**
+ * @param checked the checked to set
+ */
+ public void setChecked(boolean checked) {
+ System.out.println("Invoke set checked for mounth "+getMounth()+", checked:"+checked);
+ this.checked = checked;
+ }
+
+ public String check(){
+ checked = !checked;
+ System.out.println("Invoke check action for mounth "+getMounth()+", checked:"+checked);
+ return null;
+ }
+
+ public String inc(){
+ total++;
+ return null;
+ }
+
+ public void checkChanged(ValueChangeEvent event) {
+ System.out.println("Checked changed for mounth "+getMounth());
+ }
+
+ /**
+ * @return the price
+ */
+ public int getPrice() {
+ return price;
+ }
+
+ /**
+ * @param price the price to set
+ */
+ public void setPrice(int price) {
+ this.price = price;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataTableBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataTableBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DataTableBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,159 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.model.Column;
+import org.richfaces.model.Ordering;
+
+@SuppressWarnings("unchecked")
+public class DataTableBean {
+
+ private int rows = 20;
+
+ private int column = 3;
+
+ private int begin = 1;
+
+ private int end = 10;
+
+ private List model;
+
+ private List columns;
+
+ private Ordering ordering;
+
+ public DataTableBean() {
+ init();
+ }
+
+ public void init(ActionEvent event) {
+ init();
+ }
+
+ public String getDate() {
+ return new Date().toLocaleString();
+ }
+
+ private void init() {
+ model = new ArrayList();
+ for (int i = 0; i < rows; i++) {
+ String [] m = new String[column];
+ for (int j = 0; j < column; j++) {
+ m[j] = String.valueOf(i + j);
+ }
+ model.add(m);
+ }
+
+ columns = new ArrayList();
+ for (int i = 0; i < column; i++) {
+ columns.add(new Column("header","footer", i));
+ }
+ }
+
+ /**
+ * @return the columns
+ */
+ public int getColumn() {
+ return column;
+ }
+
+ /**
+ * @param columns
+ * the columns to set
+ */
+ public void setColumn(int column) {
+ this.column = column;
+ }
+
+ /**
+ * @return the rows
+ */
+ public int getRows() {
+ return rows;
+ }
+
+ /**
+ * @param rows
+ * the rows to set
+ */
+ public void setRows(int rows) {
+ this.rows = rows;
+ }
+
+ /**
+ * @return the model
+ */
+ public List getModel() {
+ return model;
+ }
+
+ /**
+ * @param model
+ * the model to set
+ */
+ public void setModel(List model) {
+ this.model = model;
+ }
+
+ /**
+ * @return the columns
+ */
+ public List getColumns() {
+ return columns;
+ }
+
+ /**
+ * @param columns
+ * the columns to set
+ */
+ public void setColumns(List columns) {
+ this.columns = columns;
+ }
+
+ /**
+ * @return the ordering
+ */
+ public Ordering getOrdering() {
+ return ordering;
+ }
+
+ /**
+ * @param ordering the ordering to set
+ */
+ public void setOrdering(Ordering ordering) {
+ this.ordering = ordering;
+ }
+
+ /**
+ * @return the begin
+ */
+ public int getBegin() {
+ return begin;
+ }
+
+ /**
+ * @param begin the begin to set
+ */
+ public void setBegin(int begin) {
+ this.begin = begin;
+ }
+
+ /**
+ * @return the end
+ */
+ public int getEnd() {
+ return end;
+ }
+
+ /**
+ * @param end the end to set
+ */
+ public void setEnd(int end) {
+ this.end = end;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DropDownMenuTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DropDownMenuTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/DropDownMenuTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,53 @@
+package org.ajax4jsf.bean;
+
+public class DropDownMenuTestBean {
+
+ private String actionName = "";
+
+ /**
+ * Gets value of actionName field.
+ * @return value of actionName field
+ */
+ public String getActionName() {
+ return actionName;
+ }
+
+ /**
+ * Set a new value for actionName field.
+ * @param actionName a new value for actionName field
+ */
+ public void setActionName(String actionName) {
+ this.actionName = actionName;
+ }
+
+ public String doNew() {
+ setActionName("New");
+ return null;
+ }
+
+ public String doOpen() {
+ setActionName("Open");
+ return null;
+ }
+
+ public String doSave() {
+ setActionName("Save");
+ return null;
+ }
+
+ public String doSaveAll() {
+ setActionName("Save All");
+ return null;
+ }
+
+ public String doClose() {
+ setActionName("Close");
+ return null;
+ }
+
+ public String doExit() {
+ setActionName("Exit");
+ return null;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/EnclosedData.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/EnclosedData.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/EnclosedData.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class EnclosedData {
+
+ private List<RepeatData> repeatData;
+
+ public EnclosedData() {
+ repeatData = new ArrayList<RepeatData>();
+ for(int i=0;i<5;i++){
+ RepeatData data = new RepeatData();
+ data.setText("Top row "+i);
+ repeatData.add(data);
+ }
+ }
+
+ /**
+ * @return the repeatData
+ */
+ public List<RepeatData> getRepeatData() {
+ return repeatData;
+ }
+
+ /**
+ * @param repeatData the repeatData to set
+ */
+ public void setRepeatData(List<RepeatData> repeatData) {
+ this.repeatData = repeatData;
+ }
+
+
+
+}
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/IndexBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/IndexBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/IndexBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,86 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class IndexBean {
+
+ private List<ComponentItem> list = new ArrayList<ComponentItem>();
+
+ public class ComponentItem {
+ String name;
+ String link;
+
+
+ public ComponentItem(String name, String link) {
+ this.name = name;
+ this.link = link;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the link
+ */
+ public String getLink() {
+ return link;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof ComponentItem)) {
+ return false;
+ }
+
+ if (obj == null) {
+ return true;
+ }
+ return name.equals(((ComponentItem)obj).name);
+ }
+
+ };
+
+ public IndexBean() {
+ list.add(new ComponentItem("<a4j:commandButton>", "ajaxCommandButton/ajaxButtonTest.xhtml"));
+ list.add(new ComponentItem("<a4j:commandLink>", "ajaxCommandLink/ajaxLinkTest.xhtml"));
+ list.add(new ComponentItem("<a4j:poll>", "ajaxPoll/ajaxPollTest.xhtml"));
+ list.add(new ComponentItem("<a4j:region>", "ajaxRegion/ajaxRegionTest.xhtml"));
+ list.add(new ComponentItem("<rich:calendar>", "ajaxStatus/ajaxStatusTest.xhtml"));
+ list.add(new ComponentItem("<rich:combobox>", "calendar/calendarTest.xhtml"));
+ list.add(new ComponentItem("<rich:contextMenu>", "comboBox/comboBoxTest.xhtml"));
+ list.add(new ComponentItem("<rich:dataTable>", "contextMenu/contextMenu.xhtml"));
+ list.add(new ComponentItem("<rich:dropDownMenu>", "dataTable/dataTableTest.xhtml"));
+ list.add(new ComponentItem("<rich:inplaceSelect>", "inplaceSelect/inplaceSelectTest.xhtml"));
+ list.add(new ComponentItem("<rich:inputNumberSpinner>", "inputNumberSpinner/inputNumberSpinnerTest.xhtml"));
+ list.add(new ComponentItem("<rich:jsFunction>", "jsFunction/jsFunctionTest.xhtml"));
+ list.add(new ComponentItem("<a4j:keepAlive>", "keepAlive/keepAliveTest.xhtml"));
+ list.add(new ComponentItem("<a4j:loadScript>", "loadScript/loadScriptTest.xhtml"));
+ list.add(new ComponentItem("<a4j:loadStyle>", "loadStyle/loadStyleTest.xhtml"));
+ list.add(new ComponentItem("<rich:orderingList>", "orderingList/orderingListTest.xhtml"));
+ list.add(new ComponentItem("<rich:panelBar>", "panelBar/panelBarTest.xhtml"));
+ list.add(new ComponentItem("<rich:panelMenu>", "panelMenu/panelMenuTest.xhtml"));
+ list.add(new ComponentItem("<rich:pickList>", "pickList/pickListTest.xhtml"));
+ list.add(new ComponentItem("<rich:progressBar>", "progressBar/progressBarTest.xhtml"));
+ list.add(new ComponentItem("<rich:simpleTogglePanel>", "simpleTogglePanel/simpleTogglePanel.xhtml"));
+ list.add(new ComponentItem("<rich:tabPanel>", "tabPanel/tabPanelTest.xhtml"));
+ list.add(new ComponentItem("<rich:togglePanel>", "togglePanel/togglePanelTest.xhtml"));
+
+ }
+
+ /**
+ * @return the list
+ */
+ public List<ComponentItem> getList() {
+ return list;
+ }
+
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,51 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class InplaceSelectTestBean {
+
+ private List<SelectItem> treeItems = new ArrayList<SelectItem>();
+
+ private List<String> treeNames = Arrays.asList("Pine", "Birch", "Aspen", "Spruce", "Oak", "Maple", "Ash", "Lime");
+
+ private String tree = "";
+
+ /**
+ * Gets value of tree field.
+ *
+ * @return value of tree field
+ */
+ public String getTree() {
+ return tree;
+ }
+
+ /**
+ * Set a new value for tree field.
+ *
+ * @param tree
+ * a new value for tree field
+ */
+ public void setTree(String tree) {
+ this.tree = tree;
+ }
+
+ public InplaceSelectTestBean() {
+ for (String treeName : treeNames) {
+ treeItems.add(new SelectItem(treeName, treeName));
+ }
+ }
+
+ /**
+ * Gets value of treeItems field.
+ *
+ * @return value of treeItems field
+ */
+ public List<SelectItem> getTreeItems() {
+ return treeItems;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/JSFunctionBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/JSFunctionBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/JSFunctionBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,23 @@
+package org.ajax4jsf.bean;
+
+public class JSFunctionBean {
+
+ private String name = "";
+
+ /**
+ * Gets value of name field.
+ * @return value of name field
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set a new value for name field.
+ * @param name a new value for name field
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ListAction.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ListAction.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ListAction.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ListAction {
+
+ private List data;
+
+ private Set keys;
+
+ /**
+ * @return the data
+ */
+ public List getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public Set getKeys(){
+ return keys;
+ }
+
+ public String timer(){
+ if(null != data){
+ keys=new HashSet();
+ int random = (int)(Math.random()*10.0);
+ for(int i=0;i<random;i++){
+ Bean bean = (Bean) data.get(i);
+ bean.setText(bean.getText()+" X");
+ keys.add(new Integer(i));
+ }
+ }
+ return null;
+ }
+
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Media.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Media.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/Media.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,17 @@
+package org.ajax4jsf.bean;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+
+public interface Media {
+
+ public void paint(OutputStream out, Object data) throws IOException;
+
+ public void initData();
+
+ public void setData(MediaData data);
+
+ public MediaData getData();
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,55 @@
+package org.ajax4jsf.bean;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.imageio.ImageIO;
+
+
+public class MediaBean implements Media {
+
+ private MediaData data;
+
+ /**
+ * @return the data
+ */
+ public MediaData getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(MediaData data) {
+ this.data = data;
+ }
+
+ public void initData(){
+ data= new MediaData();
+ data.setWidth(100);
+ data.setHeight(100);
+ data.setBackground(Color.BLUE);
+ data.setDrawColor(Color.RED);
+ }
+
+ public void paint(OutputStream out, Object data) throws IOException{
+ if (data instanceof MediaData) {
+
+ MediaData paintData = (MediaData) data;
+ BufferedImage img = new BufferedImage(paintData.getWidth(),paintData.getHeight(),BufferedImage.TYPE_INT_RGB);
+ Graphics2D graphics2D = img.createGraphics();
+ graphics2D.setBackground(paintData.getBackground());
+ graphics2D.setColor(paintData.getDrawColor());
+ graphics2D.clearRect(0,0,paintData.getWidth(),paintData.getHeight());
+ graphics2D.drawLine(5,5,paintData.getWidth()-5,paintData.getHeight()-5);
+ graphics2D.drawChars(new String("RichFaces").toCharArray(),0,9,40,15);
+ graphics2D.drawChars(new String("mediaOutput").toCharArray(),0,11,5,45);
+
+ ImageIO.write(img,"jpeg",out);
+
+ }
+ }
+}
\ No newline at end of file
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaData.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaData.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MediaData.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,39 @@
+package org.ajax4jsf.bean;
+
+import java.awt.Color;
+import java.io.Serializable;
+
+public class MediaData implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+ Integer Width=110;
+ Integer Height=50;
+ Color Background=new Color(0,0,0);
+ Color DrawColor=new Color(255,255,255);
+ public MediaData() {
+ }
+ public Color getBackground() {
+ return Background;
+ }
+ public void setBackground(Color background) {
+ Background = background;
+ }
+ public Color getDrawColor() {
+ return DrawColor;
+ }
+ public void setDrawColor(Color drawColor) {
+ DrawColor = drawColor;
+ }
+ public Integer getHeight() {
+ return Height;
+ }
+ public void setHeight(Integer height) {
+ Height = height;
+ }
+ public Integer getWidth() {
+ return Width;
+ }
+ public void setWidth(Integer width) {
+ Width = width;
+ }
+}
\ No newline at end of file
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MessageBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MessageBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/MessageBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,103 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.EventListener;
+import java.util.EventObject;
+import java.util.List;
+
+import org.ajax4jsf.event.PushEventListener;
+
+
+public class MessageBean implements Runnable {
+
+ private String result;
+
+ private boolean running = true;
+
+ private PushEventListener listener;
+
+ private List messages = new ArrayList(10);
+
+ private int counter = 0;
+
+ public MessageBean() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return the result
+ */
+ public String getResult() {
+ return result;
+ }
+
+ /**
+ * @param result
+ * the result to set
+ */
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public void addListener(EventListener listener) {
+ synchronized (listener) {
+ if (this.listener != listener) {
+ this.listener = (PushEventListener) listener;
+ Thread th = new Thread(this);
+ th.start();
+
+ }
+ }
+ }
+
+ public void run() {
+ try {
+ while (isRunning()) {
+ Thread.sleep(10000);
+ Date current = new Date(System.currentTimeMillis());
+ if(messages.size()>=10){
+ messages.remove(0);
+ }
+ messages.add(messages.size(),String.valueOf(counter++)+" at "+current.toString());
+ System.out.println("event occurs");
+ synchronized (listener) {
+ listener.onEvent(new EventObject(this));
+ }
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * @return the running
+ */
+ public synchronized boolean isRunning() {
+ return running;
+ }
+
+ /**
+ * @param running
+ * the running to set
+ */
+ public synchronized void setRunning(boolean running) {
+ this.running = running;
+ }
+
+ /**
+ * @return the messages
+ */
+ public List getMessages() {
+ return messages;
+ }
+
+ /**
+ * @param messages the messages to set
+ */
+ public void setMessages(List messages) {
+ this.messages = messages;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/NavigateBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/NavigateBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/NavigateBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,64 @@
+package org.ajax4jsf.bean;
+
+import java.io.Serializable;
+
+import org.ajax4jsf.component.UIInclude;
+
+public class NavigateBean implements Serializable {
+
+ private String viewId="/pages/hello.jsp";
+
+ transient private UIInclude include;
+
+ public String navigateOne() {
+
+ return "sucessOne";
+ }
+
+ public String navigateTwo() {
+
+ return "sucessTwo";
+ }
+
+ public String navigateHello() {
+
+ return "sucessHello";
+ }
+
+ /**
+ * @return the viewId
+ */
+ public String getViewId() {
+ return viewId;
+ }
+
+ /**
+ * @param viewId the viewId to set
+ */
+ public void setViewId(String viewId) {
+ this.viewId = viewId;
+ }
+
+ public String reset(){
+ setViewId("/pages/hello.jsp");
+ if(null != include){
+ include.setViewId("/pages/hello.jsp");
+ }
+ return null;
+ }
+
+ /**
+ * @return the include
+ */
+ public UIInclude getInclude() {
+ return include;
+ }
+
+ /**
+ * @param include the include to set
+ */
+ public void setInclude(UIInclude include) {
+ this.include = include;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ObjectNotFoundException.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ObjectNotFoundException.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ObjectNotFoundException.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ObjectNotFoundException extends Exception {
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,174 @@
+/**
+ * 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;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+public class OrderingListTestBean {
+ private Converter converter;
+ private List<Item> items;
+ private Collection<Item> selection;
+ private Object activeItem;
+
+ public OrderingListTestBean() {
+ converter = new ItemConverter();
+ items = new ArrayList<Item>();
+ for (int i = 0; i < 4; i++) {
+ items.add(new Item("item" + i));
+ }
+ selection = new HashSet<Item>();
+ }
+
+ public Object getActionResult() {
+ return FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("actionResult");
+ }
+
+ public Collection<Item> getSelection() {
+ return selection;
+ }
+
+ public void setSelection(Collection<Item> selection) {
+ this.selection = selection;
+ }
+
+ public Object getActiveItem() {
+ return activeItem;
+ }
+
+ public void setActiveItem(Object activeItem) {
+ this.activeItem = activeItem;
+ }
+
+ public Converter getConverter() {
+ return converter;
+ }
+
+ public void setConverter(Converter converter) {
+ this.converter = converter;
+ }
+
+ public List<Item> getItems() {
+ return items;
+ }
+
+ public void setItems(List<Item> items) {
+ this.items = items;
+ }
+
+ public String getSelectionString() {
+ StringBuffer buff = new StringBuffer();
+ for (Iterator<Item> it = selection.iterator(); it.hasNext();) {
+ Item item = it.next();
+ buff.append(item.getName());
+ if (it.hasNext()) {
+ buff.append(',');
+ }
+ }
+ return buff.toString();
+ }
+
+
+ private class ItemConverter implements Converter {
+
+ /* (non-Javadoc)
+ * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)
+ */
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+ return new Item(value);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
+ */
+ public String getAsString(FacesContext context, UIComponent component,
+ Object value) {
+ Item optionItem = (Item) value;
+ return optionItem.getName();
+ }
+
+ }
+
+ public class Item implements Serializable {
+
+ private static final long serialVersionUID = 1083694594537030790L;
+
+ private String name;
+
+ public String action() {
+ FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("actionResult", name);
+ return null;
+ }
+
+ public Item(String name) {
+ super();
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String toString() {
+ return this.getClass().getSimpleName() + " [" + name + "]";
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Item other = (Item) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+
+ return true;
+ }
+
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PageDescriptionBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PageDescriptionBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PageDescriptionBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,44 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PageDescriptionBean {
+
+ private String _path;
+
+ private String _title;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return _title;
+ }
+
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ _title = title;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PagesBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PagesBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PagesBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,125 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PagesBean {
+
+ private static final Pattern JSP_PATTERN = Pattern.compile(".*\\.jspx?");
+
+ private static final Pattern XHTML_PATTERN = Pattern.compile(".*\\.xhtml");
+
+ private static final Pattern TITLE_PATTERN = Pattern.compile("<title>(.*)</title>",Pattern.CASE_INSENSITIVE|Pattern.MULTILINE);
+
+ private ServletContext _servletContext;
+
+ private List<PageDescriptionBean> _jspPages;
+
+ private String _path;
+
+ private List<PageDescriptionBean> _xhtmlPages;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path
+ * the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the servletContext
+ */
+ public ServletContext getServletContext() {
+ return _servletContext;
+ }
+
+ /**
+ * @param servletContext
+ * the servletContext to set
+ */
+ public void setServletContext(ServletContext servletContext) {
+ _servletContext = servletContext;
+ }
+
+ public List<PageDescriptionBean> getJspPages() {
+ if (_jspPages == null && null != getServletContext()) {
+ _jspPages = getPagesByPattern(JSP_PATTERN);
+ }
+
+ return _jspPages;
+ }
+
+ public List<PageDescriptionBean> getXhtmlPages() {
+ if (_xhtmlPages == null && null != getServletContext()) {
+ _xhtmlPages = getPagesByPattern(XHTML_PATTERN);
+ }
+
+ return _xhtmlPages;
+ }
+
+ /**
+ *
+ */
+ private List<PageDescriptionBean> getPagesByPattern(Pattern pattern) {
+ List<PageDescriptionBean> jspPages = new ArrayList<PageDescriptionBean>();
+ Set resourcePaths = getServletContext().getResourcePaths(getPath());
+ for (Iterator iterator = resourcePaths.iterator(); iterator
+ .hasNext();) {
+ String page = (String) iterator.next();
+ if (pattern.matcher(page).matches()) {
+ PageDescriptionBean pageBean = new PageDescriptionBean();
+ pageBean.setPath(page);
+ InputStream pageInputStream = getServletContext().getResourceAsStream(page);
+ if(null != pageInputStream){
+ byte[] head = new byte[1024];
+ try {
+ int readed = pageInputStream.read(head);
+ String headString = new String(head,0,readed);
+ Matcher titleMatcher = TITLE_PATTERN.matcher(headString);
+ if(titleMatcher.find() && titleMatcher.group(1).length()>0){
+ pageBean.setTitle(titleMatcher.group(1));
+ } else {
+ pageBean.setTitle(page);
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally {
+ try {
+ pageInputStream.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ jspPages.add(pageBean);
+ }
+ }
+ return jspPages;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PickListTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PickListTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PickListTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/PickListTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,110 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class PickListTestBean {
+
+ private String copyAllLabel = "MOVE ALL";
+
+ private String copyLabel = "MOVE";
+
+ private String removeLabel = "TAKE AWAY";
+
+ private String removeAllLabel = "TAKE ALL AWAY";
+
+ private List<String> items = Arrays.asList("ZHURIK", "MELESHKO", "LEONTIEV", "KOVAL", "KALYUZHNY", "DUDIK",
+ "KOSTITSYN", "GRABOVSKI");
+
+ private List<SelectItem> options = new ArrayList<SelectItem>();
+
+ private List<String> result = new ArrayList<String>();
+
+ public PickListTestBean() {
+ for (String player : items) {
+ options.add(new SelectItem(player, player));
+ }
+
+ // preselected items
+ result.add(items.get(0));
+ result.add(items.get(1));
+ }
+
+ /**
+ * Gets value of copyAllLabel field.
+ *
+ * @return value of copyAllLabel field
+ */
+ public String getCopyAllLabel() {
+ return copyAllLabel;
+ }
+
+ /**
+ * Gets value of copyLabel field.
+ *
+ * @return value of copyLabel field
+ */
+ public String getCopyLabel() {
+ return copyLabel;
+ }
+
+ /**
+ * Gets value of removeLabel field.
+ *
+ * @return value of removeLabel field
+ */
+ public String getRemoveLabel() {
+ return removeLabel;
+ }
+
+ /**
+ * Gets value of removeAllLabel field.
+ *
+ * @return value of removeAllLabel field
+ */
+ public String getRemoveAllLabel() {
+ return removeAllLabel;
+ }
+
+ /**
+ * Gets value of options field.
+ *
+ * @return value of options field
+ */
+ public List<SelectItem> getOptions() {
+ return options;
+ }
+
+ /**
+ * Set a new value for options field.
+ *
+ * @param options
+ * a new value for options field
+ */
+ public void setOptions(List<SelectItem> options) {
+ this.options = options;
+ }
+
+ /**
+ * Gets value of result field.
+ *
+ * @return value of result field
+ */
+ public List<String> getResult() {
+ return result;
+ }
+
+ /**
+ * Set a new value for result field.
+ *
+ * @param result
+ * a new value for result field
+ */
+ public void setResult(List<String> result) {
+ this.result = result;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,60 @@
+package org.ajax4jsf.bean;
+
+import java.util.Date;
+
+import javax.faces.event.ActionEvent;
+
+public class ProgressBarTestBean {
+
+ private boolean enabled = false;
+
+ private Long value = -5L;
+
+ public String getDate() {
+ return String.valueOf(new Date().getTime());
+ }
+
+ public String getCompleteDate() {
+ return String.valueOf(new Date().getTime());
+ }
+
+ public void reset(ActionEvent event) {
+ this.value = -5L;
+ }
+
+ public void complete(ActionEvent event) {
+ this.value = 120L;
+ }
+
+ /**
+ * @return the enabled
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ /**
+ * @return the value
+ */
+ public Long getValue() {
+ value++;
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(Long value) {
+ this.value = value;
+ }
+
+
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RepeatData.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RepeatData.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RepeatData.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,62 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class RepeatData {
+
+ private List data;
+
+ private String text;
+
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public RepeatData() {
+ data = new ArrayList(10);
+ for(int i=0;i<10;i++){
+ Bean bean = new Bean();
+ bean.setText("Row "+i);
+ data.add(bean);
+ }
+ }
+
+ public String ok(){
+ System.out.println("Row command pressed");
+ return null;
+ }
+
+ /**
+ * @return the data
+ */
+ public List getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(List data) {
+ this.data = data;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,73 @@
+/**
+ * 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;
+
+import javax.faces.event.ActionEvent;
+
+public class RichPanelTestBean {
+ private String value;
+ private int value2;
+
+ public RichPanelTestBean() {
+ value = "";
+ value2 = 0;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void actionListener(ActionEvent event) {
+ this.value = event.getComponent().getId();
+ }
+
+ public String action1() {
+ this.value2 = 1;
+ return null;
+ }
+
+ public String action2() {
+ this.value2 = 2;
+ return null;
+ }
+
+ public String increment() {
+ if (4 == this.value2) {
+ this.value2 = 0;
+ }
+ this.value2++;
+ return null;
+ }
+
+ public int getValue2() {
+ return value2;
+ }
+
+ public void setValue2(int value2) {
+ this.value2 = value2;
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,73 @@
+/**
+ * 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;
+
+import org.ajax4jsf.template.Template;
+
+
+public class TemplateBean {
+ public static final String PARAM_NAME = "t";
+
+ private String template = "simple";
+
+ /*public void initTemplate (ActionEvent event) {
+ Map<String, String> reqMap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ String template = reqMap.get(PARAM_NAME);
+ this.template = template != null ? template : "simple";
+ }*/
+
+ public String getTemplateId() {
+ return template;
+ }
+
+ public void setTemplateId(String template) {
+ if (this.template != null && !this.template.equals(template)) {
+ this.template = template;
+ }
+ }
+
+
+ public String getParentId () {
+ if ("dataTable".equals(template)) {
+ return Template.COMPONENT_PREFIX_INSIDE_TABLE;
+ }
+ return Template.COMPONENT_PREFIX_SIMPLE;
+ }
+
+
+ /**
+ * @return the template
+ */
+ public String getTemplate() {
+ return "../../template/" + template + ".xhtml";
+ }
+
+
+ /**
+ * @param template the template to set
+ */
+ public void setTemplate(String template) {
+ this.template = template;
+ }
+
+
+}
\ No newline at end of file
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,64 @@
+package org.ajax4jsf.bean;
+
+
+
+import java.util.logging.Logger;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author krasi
+ *
+ */
+public class TestBean {
+ String id = "";
+ static final Logger LOGGER = Logger.getLogger(TestBean.class.getName());
+
+ public TestBean() {
+ }
+
+ public String getId() {
+
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 1.",
+ ""));
+
+ System.out.println("GET 1 ------" + id);
+ if (!id.equals("")) {
+ System.out.println("GET 2 ------" + id);
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 2.",
+ "11"));
+
+ try {
+ System.out.println("GET 3 ------" + id);
+ throw new ObjectNotFoundException();
+
+ } catch (ObjectNotFoundException e) {
+ System.out.println("GET 4 ------" + id);
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 3.",
+ "11"));
+ }
+
+ }
+
+ return id;
+ }
+
+ public void setId(String id) {
+ System.out.println("SET 1-" + id);
+ this.id = id;
+ }
+
+ public String searchByID() {
+ System.out.println("searchByID");
+ return null;
+
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestListener.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestListener.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestListener.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TestListener.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,34 @@
+package org.ajax4jsf.bean;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.AjaxContextImpl;
+import org.ajax4jsf.event.AjaxEvent;
+import org.ajax4jsf.event.AjaxListener;
+
+public class TestListener implements AjaxListener {
+
+ @SuppressWarnings("unchecked")
+ public void processAjax(AjaxEvent event) {
+ System.out.println("TestListener");
+ FacesContext context = FacesContext.getCurrentInstance();
+ if (context != null) {
+ AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance(context);
+ if (ajaxContext != null) {
+ Map<String, Object> data = (Map<String, Object>)ajaxContext.getResponseData();
+ if (null == data) {
+ data = new HashMap<String, Object>();
+ ajaxContext.setResponseData(data);
+ }
+ data.put("FListener", true);
+ }
+
+ }
+
+ }
+
+}
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TimerBean.java (from rev 8749, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TimerBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TimerBean.java 2008-05-26 14:15:36 UTC (rev 8755)
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.Date;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class TimerBean {
+
+ private boolean _enabled;
+
+ /**
+ * @return the enabled
+ */
+ public boolean isEnabled() {
+ return _enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ _enabled = enabled;
+ }
+
+ public Date getTimer(){
+ return new Date(System.currentTimeMillis());
+ }
+
+ public String go() {
+ setEnabled(true);
+ return null;
+ }
+
+ public String stop() {
+ setEnabled(false);
+ return null;
+ }
+}
16 years, 7 months
JBoss Rich Faces SVN: r8754 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-05-26 10:06:26 -0400 (Mon, 26 May 2008)
New Revision: 8754
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/extendedDataModel.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-3543
fixed work under tomcat 6.0.14 (el libraries defferences). was illegal argument after submit.
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/extendedDataModel.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/extendedDataModel.xhtml 2008-05-26 10:59:45 UTC (rev 8753)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/extendedDataModel.xhtml 2008-05-26 14:06:26 UTC (rev 8754)
@@ -50,8 +50,7 @@
<rich:message for="bid" /><br/>
<h:inputText id="bid" value="#{item.bid}" label="Bid">
- <f:convertNumber />
- <f:validateLongRange minimum = "0" maximum = "1000000"/>
+ <f:validateDoubleRange minimum="0" maximum="1000000"/>
</h:inputText>
<a4j:commandLink id="bid_link" actionListener="#{item.placeBid}" value="Place a bid!" reRender="bid,amount,highestBid" />
16 years, 7 months
JBoss Rich Faces SVN: r8753 - trunk/test-applications/seleniumTest/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-05-26 06:59:45 -0400 (Mon, 26 May 2008)
New Revision: 8753
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
Log:
combobox component test extension
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-26 09:50:09 UTC (rev 8752)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-26 10:59:45 UTC (rev 8753)
@@ -62,14 +62,41 @@
selenium.type(predefinedCBId + "comboboxField", "Hunt");
selenium.typeKeys(predefinedCBId + "comboboxField", "Hunt");
- Assert.assertTrue(isVisibleById(predefinedCBId + "list"), "Component pop-up should show up on click");
+ Assert.assertTrue(isVisibleById(predefinedCBId + "list"), "Component's pop-up must show up on key typing");
clickById(predefinedCBId + "list");
- Assert.assertFalse(isVisibleById(predefinedCBId + "list"), "Component pop-up has to be closed");
+ Assert.assertFalse(isVisibleById(predefinedCBId + "list"), "Component's pop-up has to be closed");
Assert.assertEquals(getValue(predefinedCBId), "Hunter");
- delay(2000);
+ writeStatus("check a combobox with dynamic suggestions list");
+
+ clickById(selectItemsCBId);
+
+ writeStatus("verify \"directInputSuggestions\" component's attribute");
+
+ writeStatus("type \"O\"");
+
+ selenium.type(selectItemsCBId + "comboboxField", "O");
+ selenium.typeKeys(selectItemsCBId + "comboboxField", "O");
+
+ Assert.assertTrue(isVisibleById(selectItemsCBId + "list"), "Component's pop-up must show up on key typing");
+ Assert.assertEquals(getValue(selectItemsCBId), "Oak");
+
+ writeStatus("check a combobox with a simple String list as suggestions list");
+
+ clickById(suggestionValuesCBId);
+ writeStatus("type \"Ma\"");
+
+ selenium.type(suggestionValuesCBId + "comboboxField", "Ma");
+ selenium.typeKeys(suggestionValuesCBId + "comboboxField", "Ma");
+
+ Assert.assertTrue(isVisibleById(suggestionValuesCBId + "list"), "Component's pop-up must show up on key typing");
+
+ clickById(suggestionValuesCBId + "list");
+
+ Assert.assertFalse(isVisibleById(suggestionValuesCBId + "list"), "Component's pop-up has to be closed");
+ Assert.assertEquals(getValue(suggestionValuesCBId), "Maple");
}
/**
@@ -81,8 +108,8 @@
return runScript("$('" + clientId + "comboboxValue').value;");
}
- public String getTestUrl() {
- return "/faces/pages/comboBox/comboBoxTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/comboBox/comboBoxTest.xhtml";
+ }
}
16 years, 7 months
JBoss Rich Faces SVN: r8752 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-05-26 05:50:09 -0400 (Mon, 26 May 2008)
New Revision: 8752
Modified:
trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
trunk/docs/userguide/en/src/main/docbook/included/column.xml
trunk/docs/userguide/en/src/main/docbook/included/columnGroup.xml
trunk/docs/userguide/en/src/main/docbook/included/columns.xml
trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml
trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml
trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml
trunk/docs/userguide/en/src/main/docbook/included/dataList.xml
trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml
trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml
trunk/docs/userguide/en/src/main/docbook/included/gmap.xml
trunk/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml
trunk/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml
trunk/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml
trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml
trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml
trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml
trunk/docs/userguide/en/src/main/docbook/included/message.xml
trunk/docs/userguide/en/src/main/docbook/included/messages.xml
trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml
trunk/docs/userguide/en/src/main/docbook/included/panel.xml
trunk/docs/userguide/en/src/main/docbook/included/panelBar.xml
trunk/docs/userguide/en/src/main/docbook/included/panelBarItem.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml
trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
trunk/docs/userguide/en/src/main/docbook/included/separator.xml
trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml
trunk/docs/userguide/en/src/main/docbook/included/subTable.xml
trunk/docs/userguide/en/src/main/docbook/included/suggestionbox.xml
trunk/docs/userguide/en/src/main/docbook/included/tab.xml
trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml
trunk/docs/userguide/en/src/main/docbook/included/toggleControl.xml
trunk/docs/userguide/en/src/main/docbook/included/togglePanel.xml
trunk/docs/userguide/en/src/main/docbook/included/toolBar.xml
trunk/docs/userguide/en/src/main/docbook/included/toolBarGroup.xml
trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml
trunk/docs/userguide/en/src/main/docbook/included/tree.xml
Log:
RF-3189 - role="CSS" attribute is corrected and replaced with role="XML"
Modified: trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/calendar.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/calendar.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -1693,7 +1693,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:calendar ... inputClass="myFontClass"/>
+ <programlisting role="XML"><![CDATA[<rich:calendar ... inputClass="myFontClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/column.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/column.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/column.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -548,7 +548,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:column styleClass="myClass">
+ <programlisting role="XML"><![CDATA[<rich:column styleClass="myClass">
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/columnGroup.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/columnGroup.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/columnGroup.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -263,7 +263,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:columnGroup columnClasses="myClass">
+ <programlisting role="XML"><![CDATA[<rich:columnGroup columnClasses="myClass">
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/columns.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/columns.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/columns.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -325,7 +325,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:columns styleClass="myClass">
+ <programlisting role="XML"><![CDATA[<rich:columns styleClass="myClass">
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -904,7 +904,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:comboBox ... listClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:comboBox ... listClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -624,7 +624,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<h:panelGrid ... rowClasses="myClass"/>
+ <programlisting role="XML"><![CDATA[<h:panelGrid ... rowClasses="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -265,7 +265,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:dataDefinitionList ... rowClasses="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:dataDefinitionList ... rowClasses="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -261,7 +261,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:dataGrid ... columnClasses="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:dataGrid ... columnClasses="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataList.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataList.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -277,7 +277,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:dataList ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:dataList ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -259,7 +259,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:dataOrderedList ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:dataOrderedList ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -478,7 +478,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:dataTable ... headerClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:dataTable ... headerClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -459,7 +459,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:datascroller ... selectedStyleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:datascroller ... selectedStyleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -661,7 +661,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:dropDownMenu ... itemClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:dropDownMenu ... itemClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -892,7 +892,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:fileUpload ... addButtonClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:fileUpload ... addButtonClass="myClass"/>
]]></programlisting>
<para>This is the result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/gmap.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/gmap.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/gmap.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -240,7 +240,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:gmap ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:gmap ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -880,7 +880,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[...<rich:inplaceSelect value="click to edit" viewClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:inplaceSelect value="click to edit" viewClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -414,7 +414,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich: inputNumberSlider ... inputClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich: inputNumberSlider ... inputClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -310,7 +310,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich: inputNumberSpinner ... inputClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich: inputNumberSpinner ... inputClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -1187,7 +1187,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:listShuttle ... rowClasses="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:listShuttle ... rowClasses="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -374,7 +374,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:menuGroup value="Save As..." selectClass="myClass">
+ <programlisting role="XML"><![CDATA[<rich:menuGroup value="Save As..." selectClass="myClass">
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -414,7 +414,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:menuItem ... selectStyle="myClass">
+ <programlisting role="XML"><![CDATA[<rich:menuItem ... selectStyle="myClass">
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/message.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/message.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/message.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -232,7 +232,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:message ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:message ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/messages.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/messages.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/messages.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -230,7 +230,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:messages ... errorClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:messages ... errorClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -643,7 +643,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:modalPanel ... headerClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:modalPanel ... headerClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -1166,7 +1166,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:orderingList ... rowClasses="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:orderingList ... rowClasses="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -351,7 +351,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<h:panel... bodyClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<h:panel... bodyClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelBar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelBar.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelBar.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -261,7 +261,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:panelBar ... contentClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:panelBar ... contentClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelBarItem.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelBarItem.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelBarItem.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -303,7 +303,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:panelBarItem ... contentClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:panelBarItem ... contentClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -355,7 +355,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:panelMenu ... hoveredItemClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:panelMenu ... hoveredItemClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -587,7 +587,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:panelMenuGroup ... hoverClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:panelMenuGroup ... hoverClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -507,7 +507,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:panelMenuItem ... disabledClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:panelMenuItem ... disabledClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -925,7 +925,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:pickList ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:pickList ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -621,7 +621,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:scrollableDataTable ... selectedClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:scrollableDataTable ... selectedClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/separator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/separator.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/separator.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -193,7 +193,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:separator ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:separator ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -359,7 +359,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:simpleTogglePanel ... bodyClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:simpleTogglePanel ... bodyClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/subTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/subTable.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/subTable.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -339,7 +339,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:subTable ... columnClasses="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:subTable ... columnClasses="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/suggestionbox.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/suggestionbox.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/suggestionbox.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -553,7 +553,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:suggestionbox ... selectedClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:suggestionbox ... selectedClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/tab.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tab.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/tab.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -402,7 +402,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:tab ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:tab ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -376,7 +376,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:tabPanel ... activeTabClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:tabPanel ... activeTabClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/toggleControl.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/toggleControl.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/toggleControl.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -195,7 +195,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:toggleControl ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:toggleControl ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/togglePanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/togglePanel.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/togglePanel.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -226,7 +226,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:togglePanel ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:togglePanel ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/toolBar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/toolBar.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/toolBar.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -299,7 +299,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:toolBar ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:toolBar ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/toolBarGroup.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/toolBarGroup.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/toolBarGroup.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -176,7 +176,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:toolBarGroup ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:toolBarGroup ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -392,7 +392,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[<rich:toolTip ... styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:toolTip ... styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2008-05-26 09:40:23 UTC (rev 8751)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2008-05-26 09:50:09 UTC (rev 8752)
@@ -888,9 +888,8 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="CSS"><![CDATA[...
-<rich:tree ... styleClass="myClass"/>
-...]]></programlisting>
+ <programlisting role="XML"><![CDATA[<rich:tree ... styleClass="myClass"/>
+]]></programlisting>
<para>This is a result:</para>
16 years, 7 months