JBoss Rich Faces SVN: r9683 - in trunk/ui: componentControl/src/main/config/component and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-07-18 08:10:24 -0400 (Fri, 18 Jul 2008)
New Revision: 9683
Modified:
trunk/ui/calendar/src/main/config/component/calendar.xml
trunk/ui/componentControl/src/main/config/component/componentControl.xml
trunk/ui/core/src/main/config/component/commandButton.xml
trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml
trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
trunk/ui/menu-components/src/main/config/component/menucomponents.xml
trunk/ui/orderingList/src/main/config/component/orderinglist.xml
trunk/ui/pickList/src/main/config/component/picklist.xml
trunk/ui/toolBar/src/main/config/component/toolBar.xml
Log:
RF-696 - corrected descriptions of attributes for calendar, componentControl, commandButton, column(s), inputNumberSpinner, listShuttle, menuGroup, orderingList, pickList, toolBar components.
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2008-07-18 12:10:24 UTC (rev 9683)
@@ -165,10 +165,10 @@
<name>direction</name>
<classname>java.lang.String</classname>
<description>
- Defines direction of the calendar popup (top-left,
- top-right, bottom-left, bottom-right (Default), auto). Default value is "bottom-right".
+ Defines direction of the calendar popup ("top-left",
+ "top-right", "bottom-left", "bottom-right" (Default), "auto"). Default value is "bottom-right".
</description>
- <defaultvalue>"bottom-right"</defaultvalue>
+ <defaultvalue>"bottom-right"</defaultvalue>
</property>
<property>
<name>weekDayLabels</name>
Modified: trunk/ui/componentControl/src/main/config/component/componentControl.xml
===================================================================
--- trunk/ui/componentControl/src/main/config/component/componentControl.xml 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/componentControl/src/main/config/component/componentControl.xml 2008-07-18 12:10:24 UTC (rev 9683)
@@ -36,7 +36,7 @@
<name>disableDefault</name>
<classname>boolean</classname>
<description>
- Disable default action for target event ( append "return false;" to javascript )
+ Disable default action for target event ( append "return false;" to JavaScript )
</description>
</property>
<property>
@@ -67,7 +67,7 @@
<name>operation</name>
<classname>java.lang.String</classname>
<description>
- The function of Javascript API that will be invoked. The API method
+ The function of JavaScript API that will be invoked. The API method
is attached to the 'component' property of the root DOM element that represents
the target component. The function has two parameters - event and params. See: 'params'
attribute for details.
@@ -93,7 +93,7 @@
<description>
Client identifier of the component or id of the existing DOM element that is a source
for given event. If attachTo is defined, the event is attached on the client according
- to the AttachTiming attribute.
+ to the attachTiming attribute.
If attachTo is not defined, the event is attached on the server to the closest in the
component tree parent component.
</description>
Modified: trunk/ui/core/src/main/config/component/commandButton.xml
===================================================================
--- trunk/ui/core/src/main/config/component/commandButton.xml 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/core/src/main/config/component/commandButton.xml 2008-07-18 12:10:24 UTC (rev 9683)
@@ -107,10 +107,10 @@
<classname>int</classname>
<description>Timeout ( in ms ) for request.</description>
</property>
- <property>
- <name>disabled</name>
- <classname>boolean</classname>
- <description>If true, disable this component on page.</description>
- </property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>If "true", disable this component on page.</description>
+ </property>
</component>
</components>
\ No newline at end of file
Modified: trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
===================================================================
--- trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-07-18 12:10:24 UTC (rev 9683)
@@ -102,7 +102,7 @@
<property>
<name>filterEvent</name>
<classname>java.lang.String</classname>
- <description>Event for filter input that forces the filtration (default = onchange)</description>
+ <description>Event for filter input that forces the filtration (default value is "onchange")</description>
<defaultvalue>"onchange"</defaultvalue>
</property>
<property>
Modified: trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml
===================================================================
--- trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml 2008-07-18 12:10:24 UTC (rev 9683)
@@ -115,7 +115,7 @@
<property>
<name>clientErrorMessage</name>
<classname>java.lang.String</classname>
- <description>client error message</description>
+ <description>An error message to use in client side validation events</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
Modified: trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
===================================================================
--- trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2008-07-18 12:10:24 UTC (rev 9683)
@@ -437,10 +437,12 @@
<property>
<name>onfocus</name>
<classname>java.lang.String</classname>
+ <description>HTML: script expression; the element got the focus</description>
</property>
<property>
<name>onblur</name>
<classname>java.lang.String</classname>
+ <description>HTML: script expression; the element lost the focus</description>
</property>
<property>
Modified: trunk/ui/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/ui/menu-components/src/main/config/component/menucomponents.xml 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/menu-components/src/main/config/component/menucomponents.xml 2008-07-18 12:10:24 UTC (rev 9683)
@@ -60,7 +60,7 @@
<name>direction</name>
<classname>java.lang.String</classname>
<description>Defines direction of the popup sublist to appear
- (right, left, auto(Default), left-down, left-up, right-down, right-up)</description>
+ ("right", "left", "auto"(Default), "left-down", "left-up", "right-down", "right-up")</description>
</property>
<property>
<name>iconFolder</name>
Modified: trunk/ui/orderingList/src/main/config/component/orderinglist.xml
===================================================================
--- trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-07-18 12:10:24 UTC (rev 9683)
@@ -132,8 +132,8 @@
<classname>java.lang.String</classname>
<description>
Controls horizontal rendering. Possible values:
- left - controls should be rendered to the left side of a list.
- right- controls should be rendered to the right side of a list. Default value is "right".
+ "left" - controls should be rendered to the left side of a list.
+ "right"- controls should be rendered to the right side of a list. Default value is "right".
</description>
<defaultvalue><![CDATA["right"]]></defaultvalue>
</property>
@@ -142,9 +142,9 @@
<classname>java.lang.String</classname>
<description>
Controls vertical rendering. Possible values:
- top - controls should be rendered aligned to top side of a list.
- bottom - controls should be rendered aligned to bottom side of a list.
- middle (default) - controls should be rendered centered relatively to a list.
+ "top" - controls should be rendered aligned to top side of a list.
+ "bottom" - controls should be rendered aligned to bottom side of a list.
+ "middle" (default) - controls should be rendered centered relatively to a list.
</description>
<defaultvalue><![CDATA["middle"]]></defaultvalue>
</property>
Modified: trunk/ui/pickList/src/main/config/component/picklist.xml
===================================================================
--- trunk/ui/pickList/src/main/config/component/picklist.xml 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/pickList/src/main/config/component/picklist.xml 2008-07-18 12:10:24 UTC (rev 9683)
@@ -224,10 +224,12 @@
<property>
<name>onfocus</name>
<classname>java.lang.String</classname>
+ <description>HTML: script expression; the element got the focus</description>
</property>
<property>
<name>onblur</name>
<classname>java.lang.String</classname>
+ <description>HTML: script expression; the element lost the focus</description>
</property>
</properties>
Modified: trunk/ui/toolBar/src/main/config/component/toolBar.xml
===================================================================
--- trunk/ui/toolBar/src/main/config/component/toolBar.xml 2008-07-18 11:12:38 UTC (rev 9682)
+++ trunk/ui/toolBar/src/main/config/component/toolBar.xml 2008-07-18 12:10:24 UTC (rev 9683)
@@ -40,7 +40,7 @@
<name>width</name>
<classname>java.lang.String</classname>
<description>
- <![CDATA[A width of a bar that can be defined in pixels or as percentage. Default value is 100%.]]>
+ <![CDATA[A width of a bar that can be defined in pixels or as percentage. Default value is "100%".]]>
</description>
<defaultvalue>
<![CDATA["100%"]]>
16 years, 2 months
JBoss Rich Faces SVN: r9682 - in trunk/test-applications/seleniumTest/src/test/java/org/richfaces: testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-07-18 07:12:38 -0400 (Fri, 18 Jul 2008)
New Revision: 9682
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxIncludeTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxListenerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLoadBundleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxMediaOutputTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPushTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRepeatTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxSupportTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java
Log:
adapted all tests to the new fixture
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -29,8 +29,9 @@
import org.ajax4jsf.template.Template;
import org.openqa.selenium.server.SeleniumServer;
import org.testng.Assert;
+import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterSuite;
-import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
@@ -92,7 +93,7 @@
@BeforeSuite
public void startSeleniumServer() throws Exception {
- seleniumServer = new SeleniumServer();
+ seleniumServer = new SeleniumServer();
seleniumServer.start();
}
@@ -105,7 +106,7 @@
/**
* This method are invoked before selenium tests started
*/
- @BeforeTest
+ @BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
synchronized (MUTEX) {
@@ -125,7 +126,7 @@
/**
* This method are invoked after selenium tests completed
*/
- @AfterTest(alwaysRun=true)
+ @AfterClass(alwaysRun=true)
public void stopSelenium() {
synchronized (MUTEX) {
selenium.stop();
@@ -150,7 +151,7 @@
@AfterSuite
public void stopSeleniumServer() throws Exception {
- seleniumServer.stop();
+ seleniumServer.stop();
}
/**
@@ -163,7 +164,6 @@
}
private static final Object MUTEX = new Object();
-
/**
* Renders page
@@ -776,7 +776,7 @@
selenium.mouseUp(testElementId);
AssertTextEquals(testElementResultId, afterResult);
}
-
+
/**
* Checks whether client is FireFox
*
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxActionParameterTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -2,102 +2,66 @@
import org.ajax4jsf.bean.A4JActionParam;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxActionParameterTest extends SeleniumTestBase implements
- RichSeleniumTest {
+public class AjaxActionParameterTest extends SeleniumTestBase {
- public AjaxActionParameterTest() {
- super("http", "localhost", serverPort);
- }
+ /**
+ * Tests ajax action parameter component
+ *
+ * @param template
+ */
+ @Test
+ public void testAjaxActionParameterComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId();
+ String parameter = null;
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters( { "browser", "filterPrefix" })
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
+ String paramID = parentId + "_parameter";
+ String ajaxButttonID = parentId + "_form1:ajaxSubmit";
+ String htmlButttonID = parentId + "_form2:htmlSubmit";
- @BeforeMethod
- @Parameters( { "loadStyleStrategy", "loadScriptStrategy" })
- protected void loadConfiguration(String loadStyleStrategy,
- String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
+ // test ajax submit
+ clickById(ajaxButttonID);
+ waitForAjaxCompletion();
+ parameter = getTextById(paramID);
+ checkParameter(parameter);
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun = true)
- public void stopSelenium() {
- super.stopSelenium();
- }
+ // test html submit
+ clickCommandAndWait(htmlButttonID);
+ parameter = getTextById(paramID);
+ checkParameter(parameter);
+ }
- @Test
- public void testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Template.SIMPLE);
- _testAjaxCommandLinkComponent(Template.DATA_TABLE);
- }
-
- /**
- * Tests ajax action parameter component
- * @param template
- */
- private void _testAjaxCommandLinkComponent(Template template) {
- renderPage(template);
- String parentId = getParentId();
- String parameter = null;
-
- String paramID = parentId + "_parameter";
- String ajaxButttonID = parentId + "_form1:ajaxSubmit";
- String htmlButttonID = parentId + "_form2:htmlSubmit";
-
- // test ajax submit
- clickById(ajaxButttonID);
- waitForAjaxCompletion();
- parameter = getTextById(paramID);
- checkParameter(parameter);
-
-
- // test html submit
- clickCommandAndWait(htmlButttonID);
- parameter = getTextById(paramID);
- checkParameter(parameter);
- }
-
- /**
- * Checks action parameter
- * @param parameter - Action Parameter value
- */
- private void checkParameter (String parameter) {
- if ("".equals(parameter)) {
- writeStatus("<a4j:actionParameter> failed. ActionListener skipped.", true);
- Assert.fail("<a4j:actionParameter> failed. ActionListener skipped.");
- } else if (parameter.equals(A4JActionParam.ERRORS.NO_PARAM)) {
- writeStatus("<a4j:actionParameter> failed. Parameter has been not sent with ajax request.", true);
- Assert.fail("<a4j:actionParameter> failed. Parameter has been not sent with ajax request.");
- } else if (parameter.equals(A4JActionParam.ERRORS.NOT_ASSIGNED)) {
- writeStatus("<a4j:actionParameter> failed. Parameter value has been not assigned to bean", true);
- Assert.fail("<a4j:actionParameter> failed. Parameter value has been not assigned to bean");
- } else if (parameter.equals(A4JActionParam.ERRORS.INVALID_VALUE)) {
- writeStatus("<a4j:actionParameter> failed. Parameter value is incorrect", true);
- Assert.fail("<a4j:actionParameter> failed. Parameter value is incorrect");
- } else {
- writeStatus("<a4j:actionParameter> passed successfully");
- }
- }
+ /**
+ * Checks action parameter
+ *
+ * @param parameter -
+ * Action Parameter value
+ */
+ private void checkParameter(String parameter) {
+ if ("".equals(parameter)) {
+ writeStatus("<a4j:actionParameter> failed. ActionListener skipped.", true);
+ Assert.fail("<a4j:actionParameter> failed. ActionListener skipped.");
+ } else if (parameter.equals(A4JActionParam.ERRORS.NO_PARAM)) {
+ writeStatus("<a4j:actionParameter> failed. Parameter has been not sent with ajax request.", true);
+ Assert.fail("<a4j:actionParameter> failed. Parameter has been not sent with ajax request.");
+ } else if (parameter.equals(A4JActionParam.ERRORS.NOT_ASSIGNED)) {
+ writeStatus("<a4j:actionParameter> failed. Parameter value has been not assigned to bean", true);
+ Assert.fail("<a4j:actionParameter> failed. Parameter value has been not assigned to bean");
+ } else if (parameter.equals(A4JActionParam.ERRORS.INVALID_VALUE)) {
+ writeStatus("<a4j:actionParameter> failed. Parameter value is incorrect", true);
+ Assert.fail("<a4j:actionParameter> failed. Parameter value is incorrect");
+ } else {
+ writeStatus("<a4j:actionParameter> passed successfully");
+ }
+ }
- @Override
- public String getTestUrl() {
- return "pages/actionParam/actionParam.xhtml";
- }
+ @Override
+ public String getTestUrl() {
+ return "pages/actionParam/actionParam.xhtml";
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -8,7 +8,7 @@
public class AjaxCommandButtonTest extends SeleniumTestBase {
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxCommandButtonComponent(Template template) {
renderPage(template);
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,53 +1,15 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxCommandLinkTest extends SeleniumTestBase {
- public AjaxCommandLinkTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Template.SIMPLE);
- _testAjaxCommandLinkComponent(Template.DATA_TABLE);
- _testAjaxCommandLinkComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxCommandLinkComponent(Template template) {
+ public void testAjaxCommandLinkComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,16 +1,11 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.ajax4jsf.template.TestConstants;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxFormTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxFormTest extends SeleniumTestBase {
private final static String TEST_URL = "pages/ajaxForm/ajaxFormTest.xhtml";
@@ -43,24 +38,24 @@
private final static String RERENDER_ID = "rerender";
private final static String LINK_ID = "link";
-
+
@Test
- public void testAttrAjaxSubmit() throws Exception {
- renderPage(Template.SIMPLE);
-
+ public void testAttrAjaxSubmit(Template template) throws Exception {
+ renderPage(template);
+
//clickOnCheckbox(CHECK_ID_AJAXSUBMIT, BUTTON_ID);
test(BUTTON_ID, INNER_INPUT_ID, STANDART_FORM.concat(":").concat(OUTER_INPUT_ID), TEST_FIELD_ID, true, null, null, null, "testAttrAjaxSubmit");
}
-
+
@Test
- public void testAttrPrependId() {
- renderPage(Template.SIMPLE);
-
+ public void testAttrPrependId(Template template) {
+ renderPage(template);
+
if (!PREV_TEXT.equals(getValueById(getFullComponentId(INNER_INPUT_ID, "1")))) {
assertFail(null, null, true, null, "testAttrPrependId");
}
}
-
+
/*@Test
public void testAttrIgnoreDupResponses() {
//TODO: will be implemented in future
@@ -70,42 +65,19 @@
public void testAttrTimeout() {
//TODO: will be implemented in future
}*/
-
+
@Test
- public void testProcessingLinks() {
- renderPage(Template.SIMPLE);
-
+ public void testProcessingLinks(Template template) {
+ renderPage(template);
+
clickOnCheckbox(CHECK_ID_RENDERED, BUTTON_ID, "2");
clickById(LINK_ID.concat("2"));
waitForAjaxCompletion();
if (!NEXT_TEXT.equals(getTextById(TEST_FIELD_ID.concat("2")))) {
assertFail(null, null, null, null, "testProcessingLinks");
}
-
}
-
- public AjaxFormTest() {
- super(TestConstants.PROTOCOL, TestConstants.HOST, serverPort);
- }
-
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
+
private String getFullComponentId(String componentId, String index) {
return FORM_ID.concat(index).concat(":").concat(componentId.concat(index));
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,128 +1,90 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
+public class AjaxHTMLCommandLinkTest extends SeleniumTestBase {
-public class AjaxHTMLCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest {
+ @Test
+ public void testAjaxHTMLCommandLinkComponent(Template template) {
+ renderPage(template);
- public AjaxHTMLCommandLinkTest() {
- super("http", "localhost", serverPort);
- }
+ String parentId = getParentId() + "_form:";
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
+ String linkId = parentId + "l1";
+ boolean immediate = false;
+ writeStatus("Click link 1");
+ setValidation(true);
+ clickById(linkId);
+ waitForAjaxCompletion();
+ waitForOnCompleteHndler();
+ checkButton(linkId, true, immediate, true, true, true);
- @Test
- public void testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Template.SIMPLE);
- _testAjaxCommandLinkComponent(Template.DATA_TABLE);
- _testAjaxCommandLinkComponent(Template.MODAL_PANEL);
- }
+ linkId = parentId + "l2";
+ immediate = false;
+ writeStatus("Click link 2");
+ setValidation(false);
+ clickById(linkId);
+ waitForAjaxCompletion();
+ waitForOnCompleteHndler();
+ checkButton(linkId, false, immediate, false, false, false);
- private void _testAjaxCommandLinkComponent(Template template) {
- renderPage(template);
+ linkId = parentId + "l3";
+ immediate = true;
+ writeStatus("Click link 3");
+ setValidation(true);
+ clickById(linkId);
+ waitForAjaxCompletion();
+ waitForOnCompleteHndler();
+ checkButton(linkId, true, immediate, true, true, false);
- String parentId = getParentId() + "_form:";
+ linkId = parentId + "l4";
+ immediate = true;
+ writeStatus("Click link 4");
+ setValidation(false);
+ clickById(linkId);
+ waitForAjaxCompletion();
+ waitForOnCompleteHndler();
+ checkButton(linkId, true, immediate, true, true, false);
- String linkId = parentId + "l1";
- boolean immediate = false;
- writeStatus("Click link 1");
- setValidation(true);
- clickById(linkId);
- waitForAjaxCompletion();
- waitForOnCompleteHndler();
- checkButton(linkId, true, immediate, true, true, true);
-
- linkId = parentId + "l2";
- immediate = false;
- writeStatus("Click link 2");
- setValidation(false);
- clickById(linkId);
- waitForAjaxCompletion();
- waitForOnCompleteHndler();
- checkButton(linkId, false, immediate, false, false, false);
-
- linkId = parentId + "l3";
- immediate = true;
- writeStatus("Click link 3");
- setValidation(true);
- clickById(linkId);
- waitForAjaxCompletion();
- waitForOnCompleteHndler();
- checkButton(linkId, true, immediate, true, true, false);
-
- linkId = parentId + "l4";
- immediate = true;
- writeStatus("Click link 4");
- setValidation(false);
- clickById(linkId);
- waitForAjaxCompletion();
- waitForOnCompleteHndler();
- checkButton(linkId, true, immediate, true, true, false);
-
-
}
-
+
private void setValidation(boolean success) {
- StringBuffer buffer = new StringBuffer("setValidation(");
- buffer.append(success);
- buffer.append(");");
- runScript(buffer.toString());
+ StringBuffer buffer = new StringBuffer("setValidation(");
+ buffer.append(success);
+ buffer.append(");");
+ runScript(buffer.toString());
}
-
- private void waitForOnCompleteHndler () {
- waiteForCondition("_onCompleteHandler == true;", 3000);
- runScript("_onCompleteHandler = false;");
+
+ private void waitForOnCompleteHndler() {
+ waiteForCondition("_onCompleteHandler == true;", 3000);
+ runScript("_onCompleteHandler = false;");
}
-
- private void checkButton(String id, boolean testData, boolean immediate, boolean testAction, boolean testFListener, boolean testInput) {
- writeStatus("Checking link...");
- StringBuffer buffer = new StringBuffer("checkLink('");
- buffer.append(id);
- buffer.append("',");
- buffer.append(testData);
- buffer.append(",");
- buffer.append(testAction);
- 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:htmlCommandLink> [immediate="+immediate+"] test failure caused by " + result);
- }
-
+
+ private void checkButton(String id, boolean testData, boolean immediate, boolean testAction, boolean testFListener,
+ boolean testInput) {
+ writeStatus("Checking link...");
+ StringBuffer buffer = new StringBuffer("checkLink('");
+ buffer.append(id);
+ buffer.append("',");
+ buffer.append(testData);
+ buffer.append(",");
+ buffer.append(testAction);
+ 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:htmlCommandLink> [immediate=" + immediate + "] test failure caused by " + result);
+ }
+
}
+ @Override
public String getTestUrl() {
return "pages/ajaxHTMLCommandLink/ajaxHTMLLinkTest.xhtml";
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxIncludeTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxIncludeTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxIncludeTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -46,8 +46,8 @@
public String getTestUrl() {
return "pages/ajaxInclude/ajaxIncludeTest.xhtml";
}
-
- @Test(dataProvider = "templates")
+
+ @Test
public void testAjaxInclude(Template template) throws Exception {
renderPage(template);
String include1Prefix = getParentId() + FORM2_ID + INCLUDE4_ID + ":";
@@ -71,7 +71,7 @@
}
- @Test(dataProvider = "templates")
+ @Test
public void testLayoutAttribute(Template template) throws Exception {
renderPage(template);
// inlude_1 has layout=inline(default)
@@ -108,7 +108,7 @@
clickReset();
}
- @Test(dataProvider = "templates")
+ @Test
public void testRenderedAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rendered attribute...");
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxListenerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxListenerTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxListenerTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -6,7 +6,7 @@
public class AjaxListenerTest extends SeleniumTestBase {
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxListenerComponent(Template template) {
renderPage(template);
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLoadBundleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLoadBundleTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLoadBundleTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -7,38 +7,43 @@
import org.testng.annotations.Test;
public class AjaxLoadBundleTest extends SeleniumTestBase {
- private static final String URL = "pages/loadBundle/loadBundle.xhtml";
- private static final String BUTTON_ID = "b1";
- private static final String SAMPLE_MESSAGE = "Error was occured.";
- private final static String FORM_ID = "form:";
- private final static String FIRST_LINK_ID = FORM_ID + "error";
- private final static String SECOND_LINK_ID = FORM_ID + "_link";
+ private static final String URL = "pages/loadBundle/loadBundle.xhtml";
- /**
- * @see org.richfaces.SeleniumTestBase#getTestUrl()
- */
- @Override
- public String getTestUrl() {
- return URL;
- }
+ private static final String BUTTON_ID = "b1";
- @Test(dataProvider = "templates")
- public void testAjaxMediaOutput(Template template) throws Exception {
- renderPage(template);
- writeStatus("Testing loadBundle component");
- String textId = getParentId() + FIRST_LINK_ID;
- AssertPresent(textId);
- AssertNotPresent(getParentId() + SECOND_LINK_ID);
- Assert.assertEquals(getTextById(textId), SAMPLE_MESSAGE);
- }
+ private static final String SAMPLE_MESSAGE = "Error was occured.";
- @Test(dataProvider = "templates")
- public void testAjaxReRender(Template template) throws Exception {
- renderPage(template);
- writeStatus("Testing loadBundle component after ajax rerender");
- String buttonId = getParentId() + FORM_ID + BUTTON_ID;
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertPresent(getParentId() + SECOND_LINK_ID);
- }
+ private final static String FORM_ID = "form:";
+
+ private final static String FIRST_LINK_ID = FORM_ID + "error";
+
+ private final static String SECOND_LINK_ID = FORM_ID + "_link";
+
+ /**
+ * @see org.richfaces.SeleniumTestBase#getTestUrl()
+ */
+ @Override
+ public String getTestUrl() {
+ return URL;
+ }
+
+ @Test
+ public void testAjaxLoadBundleComponent(Template template) throws Exception {
+ renderPage(template);
+ writeStatus("Testing loadBundle component");
+ String textId = getParentId() + FIRST_LINK_ID;
+ AssertPresent(textId);
+ AssertNotPresent(getParentId() + SECOND_LINK_ID);
+ Assert.assertEquals(getTextById(textId), SAMPLE_MESSAGE);
+ }
+
+ @Test
+ public void testAjaxReRender(Template template) throws Exception {
+ renderPage(template);
+ writeStatus("Testing loadBundle component after ajax rerender");
+ String buttonId = getParentId() + FORM_ID + BUTTON_ID;
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertPresent(getParentId() + SECOND_LINK_ID);
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -7,7 +7,7 @@
public class AjaxLogTest extends SeleniumTestBase {
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxLogLayout(Template template) {
renderPage(template);
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxMediaOutputTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxMediaOutputTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxMediaOutputTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -32,8 +32,8 @@
public String getTestUrl() {
return "pages/ajaxMediaOutput/ajaxMediaOutputTest.xhtml";
}
-
- @Test(dataProvider = "templates")
+
+ @Test
public void testAjaxMediaOutput(Template template) throws Exception {
renderPage(template);
writeStatus("Testing media output");
@@ -44,12 +44,9 @@
String tagName = runScript("getElementType('" + imageId +"');");
Assert.assertEquals(tagName.toLowerCase(), "img");
-
-
-
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnclickEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 1;
@@ -57,7 +54,7 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID + "');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnDblclickEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 2;
@@ -65,7 +62,7 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID + "');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnmousedownEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 7;
@@ -73,7 +70,7 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID + "');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnmousemoveEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 8;
@@ -81,7 +78,7 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID + "');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnmouseoutEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 9;
@@ -89,15 +86,15 @@
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID + "');");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnmouseoverEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 10;
super.testOnmouseoverEvent(imageId, imageId + EVENT_RESULT_ID, EVENT_TEST_RESULT_FAILED_TEXT, EVENT_TEST_RESULT_PASSED_TEXT);
runScript("resetEventTestResult('" + imageId + EVENT_RESULT_ID + "');");
}
-
- @Test(dataProvider = "templates")
+
+ @Test
public void testOnmouseupEvent(Template template) throws Exception {
renderPage(template);
String imageId = getParentId() + IMAGE_EVENT_ID + 11;
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -47,7 +47,7 @@
return "pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml";
}
- @Test(dataProvider = "templates")
+ @Test
public void testLayoutAttribute(Template template) throws Exception {
renderPage(template);
// panel_1 has layout=inline(default)
@@ -84,7 +84,7 @@
clickReset();
}
- @Test(dataProvider = "templates")
+ @Test
public void testRenderedAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rendered attribute...");
@@ -104,7 +104,7 @@
clickReset();
}
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxRenderedAttribute(Template template) throws Exception {
renderPage(template);
// panel_1 has ajaxRendered=false and is reRender by b1
@@ -135,7 +135,7 @@
}
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxRenderedAttributeWithLimitToList(Template template) throws Exception {
renderPage(template);
// panel_1 has ajaxRendered=false and is reRender by b1 with
@@ -165,7 +165,7 @@
clickReset();
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnDoubleClickEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -177,7 +177,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnKeyDownEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -189,7 +189,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnKeyPressEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -201,7 +201,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnKeyUpEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -213,7 +213,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseDownEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -225,7 +225,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseMoveEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -237,7 +237,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseOutEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -249,7 +249,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseOverEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -261,7 +261,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnMouseUpEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
@@ -273,7 +273,7 @@
AssertTextEquals(panelResultId, "Yes");
}
- @Test(dataProvider = "templates")
+ @Test
public void testOnClickEvent(Template template) throws Exception {
renderPage(template);
String parentId = getParentId() + FORM_ID;
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -4,56 +4,18 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
/**
* @author Andrey Markavstov
*
*/
-public class AjaxPollTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxPollTest extends SeleniumTestBase {
- public AjaxPollTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testAjaxPollComponent() {
- _testAjaxPollComponent(Template.SIMPLE);
- _testAjaxPollComponent(Template.DATA_TABLE);
- _testAjaxPollComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxPollComponent(Template template) {
+ public void testAjaxPollComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
String pollId = parentId + "poll";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPushTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPushTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPushTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -7,7 +7,7 @@
public class AjaxPushTest extends SeleniumTestBase {
- @Test(dataProvider = "templates")
+ @Test
public void testAjaxPushComponent(Template template) throws Exception {
renderPage(template);
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,51 +1,13 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxRegionTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxRegionTest extends SeleniumTestBase {
- public AjaxRegionTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testAjaxRegionComponent() throws Exception {
- _testAjaxRegionComponent(Template.SIMPLE);
- _testAjaxRegionComponent(Template.DATA_TABLE);
- _testAjaxRegionComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxRegionComponent(Template template) {
+ public void testAjaxRegionComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRepeatTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRepeatTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRepeatTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -60,7 +60,7 @@
return "pages/ajaxRepeat/ajaxRepeatTest.xhtml";
}
- @Test(dataProvider = "templates")
+ @Test
public void testRerenderingRowsWithAjaxKeysAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rerendering rows with ajaxKeys attribute...");
@@ -98,7 +98,7 @@
}
}
- @Test(dataProvider = "templates")
+ @Test
public void testRerenderingRowsWithoutAjaxKeysAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rerendering rows without ajaxKeys attribute...");
@@ -125,7 +125,7 @@
}
}
- @Test(dataProvider = "templates")
+ @Test
public void testRerenderingRowsWithValidation(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rerendering rows with validation...");
@@ -159,7 +159,7 @@
}
}
- @Test(dataProvider = "templates")
+ @Test
public void testRenderedAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rendered attribute...");
@@ -181,7 +181,7 @@
assertRowsCount(0, TABLE_ID);
}
- @Test(dataProvider = "templates")
+ @Test
public void testFirstAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing first attribute...");
@@ -207,7 +207,7 @@
AssertPresent(fullInput1Id);
}
- @Test(dataProvider = "templates")
+ @Test
public void testRowsAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rows attribute...");
@@ -231,7 +231,7 @@
assertInputValue(2, INPUT_ID, "2");
}
- @Test(dataProvider = "templates")
+ @Test
public void testRowKeyVarAttribute(Template template) throws Exception {
renderPage(template);
writeStatus("Testing rowKeyVar attribute...");
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,52 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxStatusTest extends SeleniumTestBase implements RichSeleniumTest {
+public class AjaxStatusTest extends SeleniumTestBase {
- public AjaxStatusTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testAjaxStatusComponent() throws Exception {
- _testAjaxStatusComponent(Template.SIMPLE);
- _testAjaxStatusComponent(Template.DATA_TABLE);
- _testAjaxStatusComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxStatusComponent(Template template) {
+ public void testAjaxStatusComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxSupportTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -5,108 +5,73 @@
import org.ajax4jsf.bean.A4JSupport;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
/**
* @author Andrey Markavstov
- *
+ *
*/
-public class AjaxSupportTest extends SeleniumTestBase implements
- RichSeleniumTest {
+public class AjaxSupportTest extends SeleniumTestBase {
- public AjaxSupportTest() {
- super("http", "localhost", serverPort);
- }
+ @Test
+ public void testAjaxSupportComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters( { "browser", "filterPrefix" })
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
+ String dataId = parentId + "data";
+ String linkId = parentId + "link";
+ String checkBoxId = parentId + "checkbox";
+ String command = parentId + "command";
- @BeforeMethod
- @Parameters( { "loadStyleStrategy", "loadScriptStrategy" })
- protected void loadConfiguration(String loadStyleStrategy,
- String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
+ clickById(linkId);
+ waitForAjaxCompletion();
+ String data = getTextById(dataId);
+ checkMessage(data, A4JSupport.Messages.FOR_LINK, "'onclick' ajax support for link[id='_form:link'] failed.",
+ A4JSupport.Messages.FOR_LINK + " successful");
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun = true)
- public void stopSelenium() {
- super.stopSelenium();
- }
+ clickById(checkBoxId);
+ waitForAjaxCompletion();
+ data = getTextById(dataId);
+ checkMessage(data, A4JSupport.Messages.FOR_CHECKBOX,
+ "'onchange' ajax support for checkbox[id='_form:checkbox'] failed.", A4JSupport.Messages.FOR_CHECKBOX
+ + " successful");
- @Test
- public void testAjaxSupportComponent() throws Exception {
- _testAjaxSupportComponent(Template.SIMPLE);
- _testAjaxSupportComponent(Template.DATA_TABLE);
- _testAjaxSupportComponent(Template.MODAL_PANEL);
- }
-
- private void _testAjaxSupportComponent(Template template) {
- renderPage(template);
- String parentId = getParentId() + "_form:";
-
- String dataId = parentId + "data";
- String linkId = parentId + "link";
- String checkBoxId = parentId + "checkbox";
- String command = parentId + "command";
-
- clickById(linkId);
- waitForAjaxCompletion();
- String data = getTextById(dataId);
- checkMessage(data, A4JSupport.Messages.FOR_LINK, "'onclick' ajax support for link[id='_form:link'] failed.", A4JSupport.Messages.FOR_LINK + " successful");
-
- clickById(checkBoxId);
- waitForAjaxCompletion();
- data = getTextById(dataId);
- checkMessage(data, A4JSupport.Messages.FOR_CHECKBOX, "'onchange' ajax support for checkbox[id='_form:checkbox'] failed.", A4JSupport.Messages.FOR_CHECKBOX+ " successful");
-
- clickById(command);
- pause(1000, command);
- if (!data.equals(getTextById(dataId))) {
- writeStatus("<a4j:support failed. 'requestDelay' attribute does not work.");
- Assert.fail("<a4j:support failed. 'requestDelay' attribute does not work.");
- }
- waitForAjaxCompletion();
- data = getTextById(dataId);
- checkMessage(data, A4JSupport.Messages.FOR_COMMAND, "'onclick' ajax support for command link[id='_form:command'] failed.", A4JSupport.Messages.FOR_COMMAND+ " successful");
-
- if (A4JSupport.Messages.FOR_SUBMIT.equals(data)) {
- writeStatus("<a4j:support failed. 'disableDefault' attribute does not work");
- Assert.fail("<a4j:support failed. 'disableDefault' attribute does not work.");
- }
-
-
- }
+ clickById(command);
+ pause(1000, command);
+ if (!data.equals(getTextById(dataId))) {
+ writeStatus("<a4j:support failed. 'requestDelay' attribute does not work.");
+ Assert.fail("<a4j:support failed. 'requestDelay' attribute does not work.");
+ }
+ waitForAjaxCompletion();
+ data = getTextById(dataId);
+ checkMessage(data, A4JSupport.Messages.FOR_COMMAND,
+ "'onclick' ajax support for command link[id='_form:command'] failed.", A4JSupport.Messages.FOR_COMMAND
+ + " successful");
- private void checkMessage(String data, String message, String errorMessage, String okMessage) {
- if (message.equals(data)) {
- writeStatus(okMessage);
- }else if (A4JSupport.Messages.NO_DATA.equals(data)) {
- writeStatus(errorMessage + " Caused by: action listener for <a4j:support> skipped", true);
- Assert.fail(errorMessage + " Caused by: action listener for <a4j:support> skipped");
- }else if ("".equals(data)) {
- writeStatus(errorMessage + "Caused by: no ajax request has been sent.", true);
- Assert.fail(errorMessage + "Caused by: no ajax request has been sent.");
- }
- }
-
- @Override
- public String getTestUrl() {
- return "pages/ajaxSupport/ajaxSupport.xhtml";
- }
+ if (A4JSupport.Messages.FOR_SUBMIT.equals(data)) {
+ writeStatus("<a4j:support failed. 'disableDefault' attribute does not work");
+ Assert.fail("<a4j:support failed. 'disableDefault' attribute does not work.");
+ }
+ }
+
+ private void checkMessage(String data, String message, String errorMessage, String okMessage) {
+ if (message.equals(data)) {
+ writeStatus(okMessage);
+ } else if (A4JSupport.Messages.NO_DATA.equals(data)) {
+ writeStatus(errorMessage + " Caused by: action listener for <a4j:support> skipped", true);
+ Assert.fail(errorMessage + " Caused by: action listener for <a4j:support> skipped");
+ } else if ("".equals(data)) {
+ writeStatus(errorMessage + "Caused by: no ajax request has been sent.", true);
+ Assert.fail(errorMessage + "Caused by: no ajax request has been sent.");
+ }
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/ajaxSupport/ajaxSupport.xhtml";
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -26,56 +26,14 @@
import org.ajax4jsf.bean.CalendarTestBean;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-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);
- }
+public class CalendarTest extends SeleniumTestBase {
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testCalendarComponent() throws Exception {
- _testSelectDateComponent(Template.SIMPLE);
- _testCalendarComponent(Template.DATA_TABLE);
- _testCalendarComponent(Template.MODAL_PANEL);
- }
-
- private void _testCalendarComponent(Template template) {
+ public void testCalendarComponent(Template template) {
renderPage(template);
String containerId = getParentId() + "_form:";
@@ -102,8 +60,9 @@
Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
}
-
- private void _testSelectDateComponent(Template template) {
+
+ @Test
+ public void testSelectDateComponent(Template template) {
renderPage(template);
Date newSelectedDate = CalendarTestBean.getDayInMay(15);
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,52 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class ComboBoxTest extends SeleniumTestBase implements RichSeleniumTest {
+public class ComboBoxTest extends SeleniumTestBase {
- public ComboBoxTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testComboBoxComponent() throws Exception {
- _testComboBoxComponent(Template.SIMPLE);
- _testComboBoxComponent(Template.DATA_TABLE);
- _testComboBoxComponent(Template.MODAL_PANEL);
- }
-
- private void _testComboBoxComponent(Template template) {
+ public void testComboBoxComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -22,52 +22,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class ContextMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+public class ContextMenuTest extends SeleniumTestBase {
- public ContextMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testContextMenuComponent() throws Exception {
- _testContextMenuComponent(Template.SIMPLE);
- _testContextMenuComponent(Template.DATA_TABLE);
- _testContextMenuComponent(Template.MODAL_PANEL);
- }
-
- private void _testContextMenuComponent(Template template) {
+ public void testContextMenuComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,54 +1,18 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class DataTableTest extends SeleniumTestBase implements RichSeleniumTest {
+public class DataTableTest extends SeleniumTestBase {
- public DataTableTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
public String getTestUrl() {
return "pages/dataTable/dataTableTest.xhtml";
}
@Test
- public void testDataTable() {
- _testDataTable(Template.SIMPLE);
- }
-
- private void _testDataTable(Template template) {
+ public void testDataTable(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,51 +1,13 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class DropDownMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+public class DropDownMenuTest extends SeleniumTestBase {
- public DropDownMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testDropDownMenuComponent() throws Exception {
- _testDropDownMenuComponent(Template.SIMPLE);
- _testDropDownMenuComponent(Template.DATA_TABLE);
- _testDropDownMenuComponent(Template.MODAL_PANEL);
- }
-
- private void _testDropDownMenuComponent(Template template) {
+ public void testDropDownMenuComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,52 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class InplaceSelectTest extends SeleniumTestBase implements RichSeleniumTest {
+public class InplaceSelectTest extends SeleniumTestBase {
- public InplaceSelectTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testInplaceSelectComponent() throws Exception {
- _testInplaceSelectComponent(Template.SIMPLE);
- _testInplaceSelectComponent(Template.DATA_TABLE);
- _testInplaceSelectComponent(Template.MODAL_PANEL);
- }
-
- private void _testInplaceSelectComponent(Template template) {
+ public void testInplaceSelectComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
@@ -103,11 +65,9 @@
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");
-
+ writeStatus("Stop editing with cancel");
+ selenium.fireEvent(cancelButton, "mousedown");
+ Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
}
public String getTestUrl() {
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -21,53 +21,16 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class InputNumberSliderTest extends SeleniumTestBase implements RichSeleniumTest {
+public class InputNumberSliderTest extends SeleniumTestBase {
+
private static final int BAR_SCALE = 10;
- public InputNumberSliderTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testInputNumberSliderComponent() throws Exception {
- _testInputNumberSlider(Template.SIMPLE);
- _testInputNumberSlider(Template.DATA_TABLE);
-// _testInputNumberSlider(Template.MODAL_PANEL);
- }
-
- private void _testInputNumberSlider(Template template) {
+ public void testInputNumberSlider(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,54 +1,15 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class InputNumberSpinnerTest extends SeleniumTestBase implements RichSeleniumTest {
+public class InputNumberSpinnerTest extends SeleniumTestBase {
- public InputNumberSpinnerTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testInputNumberSpinnerComponent() throws Exception {
- _testInputNumberSpinnerComponent(Template.SIMPLE);
- //it looks as if the spinner does not work inside rich:dataTable
- _testInputNumberSpinnerComponent(Template.DATA_TABLE);
- _testInputNumberSpinnerComponent(Template.MODAL_PANEL);
- }
-
- private void _testInputNumberSpinnerComponent(Template template) {
+ public void testInputNumberSpinnerComponent(Template template) {
renderPage(template);
writeStatus("check whether the spinner is invariant with respect to pair of sequential opposite operations");
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -3,51 +3,13 @@
import static org.testng.Assert.assertEquals;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class JSFunctionTest extends SeleniumTestBase implements RichSeleniumTest {
+public class JSFunctionTest extends SeleniumTestBase {
- public JSFunctionTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testJSFunctionComponent() throws Exception {
- _testJSFunctionComponent(Template.SIMPLE);
- _testJSFunctionComponent(Template.DATA_TABLE);
- _testJSFunctionComponent(Template.MODAL_PANEL);
- }
-
- private void _testJSFunctionComponent(Template template) {
+ public void testJSFunctionComponent(Template template) {
renderPage(template);
String showNameElemId = getParentId() + "showname";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,51 +1,13 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class KeepAliveTest extends SeleniumTestBase implements RichSeleniumTest {
+public class KeepAliveTest extends SeleniumTestBase {
- public KeepAliveTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testKeepAliveComponent() throws Exception {
- _testKeepAliveComponent(Template.SIMPLE);
- _testKeepAliveComponent(Template.DATA_TABLE);
- _testKeepAliveComponent(Template.MODAL_PANEL);
- }
-
- private void _testKeepAliveComponent(Template template) {
+ public void _testKeepAliveComponent(Template template) {
renderPage(template);
String parentId = getParentId();
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -13,245 +13,250 @@
*
*/
public class ListShuttleTest extends SeleniumTestBase {
-
- String parentId;
- String availebleListId;
- String targetListId;
- String copyAllId;
- String copyId;
- String removeId;
- String removeAllId;
- String firstId;
- String upId;
- String downId;
- String lastId ;
- String submitId;
- String resetId;
- String hideId;
-
-
- @Test(dataProvider = "templates")
- public void testListShuttleComponent(Template template) {
- _testListShuttleComponent(template);
- }
-
- private void init() {
- parentId = getParentId() + "_form:";
- availebleListId = parentId + "lstbody";
- targetListId = parentId + "lstlTbody";
- copyAllId = parentId + "lscopyAll";
- copyId = parentId + "lscopy";
- removeId = parentId + "lsremove";
- removeAllId = parentId + "lsremoveAll";
- firstId = parentId + "lsfirst";
- upId = parentId + "lsup";
- downId = parentId + "lsdown";
- lastId = parentId + "lslast";
- submitId = parentId + "submit";
- resetId = parentId + "reset";
- hideId = parentId + "hide";
-
- }
-
- private void _testListShuttleComponent(Template template) {
- renderPage(template);
- init();
- reset();
-
- _checkVisibility(true);
-
- // Check count
- _assertTableRowsCount(availebleListId, 5);
- _assertTableRowsCount(targetListId, 0);
-
- // Copy all and check count
- try {
- clickById(copyAllId);
- _assertTableRowsCount(availebleListId, 0);
- _assertTableRowsCount(targetListId, 5);
- }catch (Exception e) {
- writeStatus("Test failed. Copy all does not work. Cause: " + e, true);
- Assert.fail("Test failed. Copy all does not work. Cause: " + e);
- }
+ String parentId;
- // Remove all and check count
- try {
- clickById(removeAllId);
- _assertTableRowsCount(availebleListId, 5);
- _assertTableRowsCount(targetListId, 0);
- }catch (Exception e) {
- writeStatus("Test failed. Remove all does not work. Cause: " + e, true);
- Assert.fail("Test failed. Remove all does not work. Cause: " + e);
- }
+ String availebleListId;
-
- try {
- // Copy 1st & 2nd item
- _doItemAction(parentId + "ls:0", copyId, "Copy");
- _doItemAction(parentId + "ls:1", copyId, "Copy");
- _doItemAction(parentId + "ls:2", copyId, "Copy");
-
- // Check count
- _assertTableRowsCount(availebleListId, 2);
- _assertTableRowsCount(targetListId, 3);
- }catch (Exception e) {
- writeStatus("Test failed. Copy does not work. Cause: " + e, true);
- Assert.fail("Test failed. Copy does not work. cause: " + e);
- }
-
- // Check posting to server
- _checkDataPost2Server(2,3);
-
- // Check ordering
- _checkOrdering(targetListId, "1Item1", "2Item2", "3Item3","");
-
- // Move the first to to the last
- _doItemAction(parentId + "ls:t0", downId, "Down");
- _checkOrdering(targetListId, "2Item2", "1Item1", "3Item3","Test failed. Down control does not work");
+ String targetListId;
+ String copyAllId;
- _doItemAction(parentId + "ls:t0", lastId, "Last");
- _checkOrdering(targetListId, "2Item2", "3Item3", "1Item1","Test failed. Last control does not work");
-
- _doItemAction(parentId + "ls:t2", firstId, "first");
- _checkOrdering(targetListId, "3Item3", "2Item2", "1Item1","Test failed. First control does not work");
+ String copyId;
- _doItemAction(parentId + "ls:t0", upId, "Up");
- _checkOrdering(targetListId, "3Item3", "1Item1", "2Item2","Test failed. Up control does not work");
-
- _doItemAction(parentId + "ls:t1", removeId, "Remove");
- _checkOrdering(targetListId, "3Item3", "1Item1", null,"Test failed. Remove control does not work");
+ String removeId;
- _assertTableRowsCount(targetListId, 2);
-
- hideControls();
- _checkVisibility(false);
+ String removeAllId;
- }
-
- private void hideControls() {
- clickAjaxCommandAndWait(hideId);
- }
-
-
- private void _checkVisibility(boolean isVisible) {
- if (isVisible) {
- AssertVisible(copyAllId);
- AssertVisible(parentId + "lsdisremoveAll");
- AssertVisible(parentId + "lsdisremove");
- AssertVisible(parentId + "lsdisremove");
-
- AssertVisible(parentId + "lsdisfirst");
- AssertVisible(parentId + "lsdisup");
- AssertVisible(parentId + "lsdisdown");
- AssertVisible(parentId + "lsdislast");
- }else {
- AssertNotRendered(copyAllId);
- AssertNotRendered(removeAllId);
- AssertNotRendered(copyId);
- AssertNotRendered(removeId);
- AssertNotRendered(firstId);
- AssertNotRendered(lastId);
- AssertNotRendered(downId);
- AssertNotRendered(upId);
- }
- }
-
- private void _checkOrdering (String listId, String first, String second, String fird, String errorMessage) {
- try {
- if (first != null)
- _checkItemText(first, listId, 0);
- if (second != null) {
- _checkItemText(second, listId, 1);
- }
- if (fird != null) {
- _checkItemText(fird, listId, 2);
- }
- }catch (Exception e) {
- writeStatus(errorMessage, true);
- Assert.fail(errorMessage + e.getMessage());
- }
- }
-
- private void reset() {
- clickAjaxCommandAndWait(resetId);
- }
-
- private void _assertTableRowsCount(String tbId, int rows) {
- writeStatus("Check items count for list id : " + tbId);
- StringBuffer b = new StringBuffer("$('");
- b.append(tbId);
- b.append("').rows.length");
- String l = runScript(b.toString());
- int r;
- try {
- r = Integer.parseInt(l);
- if (r != rows) {
- writeStatus("Incorrect list item count in table id: " + tbId, true);
- Assert.fail("Incorrect list item count in table id: " + tbId);
- }
- }catch (Exception e) {
- writeStatus("List shuttle test failed. Cause: " + e.getMessage(), true);
- Assert.fail("List shuttle test failed. Cause: " + e);
- }
- }
-
- private void _doItemAction(String itemId, String actionId, String actionName) {
- writeStatus(actionName + " the item id: " + itemId);
- _selectItem(itemId);
- clickById(actionId);
- }
-
- private void _checkDataPost2Server(int availableCount, int targetCount) {
- writeStatus("Rerender form. List items should be changed.");
- clickAjaxCommandAndWait(submitId);
+ String firstId;
- try {
- _assertTableRowsCount(availebleListId, availableCount);
- _assertTableRowsCount(targetListId, targetCount);
- } catch (Exception e) {
- writeStatus("Data was post to server incorrectly. List data before rerendering does not match after", true);
- Assert.fail("Data was post to server incorrectly. List data before rerendering does not match after. Cause: " + e);
- }
- }
-
- private void _selectItem(String itemId) {
- writeStatus("Select item id: " + itemId);
- try {
- clickById(itemId);
- }catch (Exception e) {
- writeStatus("Selection item id: " + itemId + " failed.");
- Assert.fail("No item was found. Item id: " + itemId);
- }
- }
-
- private void _checkItemText(String text, String listId, int i) {
- StringBuffer b = new StringBuffer("$('");
- b.append(listId);
- b.append("').rows[");
- b.append(i);
- b.append("].id");
-
- String id = null;
- try {
- id = runScript(b.toString());
- AssertTextEquals(id, text, "Invalid item's text");
- }catch (Exception e) {
- writeStatus("Invalid item text. Item id: " + id);
- Assert.fail("Invalid item text. Item id: " + id);
- }
- }
+ String upId;
+ String downId;
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.SeleniumTestBase#getTestUrl()
- */
- @Override
- public String getTestUrl() {
- return "pages/listShuttle/listShuttleTest.xhtml";
- }
+ String lastId;
+ String submitId;
+
+ String resetId;
+
+ String hideId;
+
+ private void init() {
+ parentId = getParentId() + "_form:";
+ availebleListId = parentId + "lstbody";
+ targetListId = parentId + "lstlTbody";
+ copyAllId = parentId + "lscopyAll";
+ copyId = parentId + "lscopy";
+ removeId = parentId + "lsremove";
+ removeAllId = parentId + "lsremoveAll";
+ firstId = parentId + "lsfirst";
+ upId = parentId + "lsup";
+ downId = parentId + "lsdown";
+ lastId = parentId + "lslast";
+ submitId = parentId + "submit";
+ resetId = parentId + "reset";
+ hideId = parentId + "hide";
+
+ }
+
+ @Test
+ public void testListShuttleComponent(Template template) {
+ renderPage(template);
+ init();
+ reset();
+
+ _checkVisibility(true);
+
+ // Check count
+ _assertTableRowsCount(availebleListId, 5);
+ _assertTableRowsCount(targetListId, 0);
+
+ // Copy all and check count
+ try {
+ clickById(copyAllId);
+ _assertTableRowsCount(availebleListId, 0);
+ _assertTableRowsCount(targetListId, 5);
+ } catch (Exception e) {
+ writeStatus("Test failed. Copy all does not work. Cause: " + e, true);
+ Assert.fail("Test failed. Copy all does not work. Cause: " + e);
+ }
+
+ // Remove all and check count
+ try {
+ clickById(removeAllId);
+ _assertTableRowsCount(availebleListId, 5);
+ _assertTableRowsCount(targetListId, 0);
+ } catch (Exception e) {
+ writeStatus("Test failed. Remove all does not work. Cause: " + e, true);
+ Assert.fail("Test failed. Remove all does not work. Cause: " + e);
+ }
+
+ try {
+ // Copy 1st & 2nd item
+ _doItemAction(parentId + "ls:0", copyId, "Copy");
+ _doItemAction(parentId + "ls:1", copyId, "Copy");
+ _doItemAction(parentId + "ls:2", copyId, "Copy");
+
+ // Check count
+ _assertTableRowsCount(availebleListId, 2);
+ _assertTableRowsCount(targetListId, 3);
+ } catch (Exception e) {
+ writeStatus("Test failed. Copy does not work. Cause: " + e, true);
+ Assert.fail("Test failed. Copy does not work. cause: " + e);
+ }
+
+ // Check posting to server
+ _checkDataPost2Server(2, 3);
+
+ // Check ordering
+ _checkOrdering(targetListId, "1Item1", "2Item2", "3Item3", "");
+
+ // Move the first to to the last
+ _doItemAction(parentId + "ls:t0", downId, "Down");
+ _checkOrdering(targetListId, "2Item2", "1Item1", "3Item3", "Test failed. Down control does not work");
+
+ _doItemAction(parentId + "ls:t0", lastId, "Last");
+ _checkOrdering(targetListId, "2Item2", "3Item3", "1Item1", "Test failed. Last control does not work");
+
+ _doItemAction(parentId + "ls:t2", firstId, "first");
+ _checkOrdering(targetListId, "3Item3", "2Item2", "1Item1", "Test failed. First control does not work");
+
+ _doItemAction(parentId + "ls:t0", upId, "Up");
+ _checkOrdering(targetListId, "3Item3", "1Item1", "2Item2", "Test failed. Up control does not work");
+
+ _doItemAction(parentId + "ls:t1", removeId, "Remove");
+ _checkOrdering(targetListId, "3Item3", "1Item1", null, "Test failed. Remove control does not work");
+
+ _assertTableRowsCount(targetListId, 2);
+
+ hideControls();
+ _checkVisibility(false);
+
+ }
+
+ private void hideControls() {
+ clickAjaxCommandAndWait(hideId);
+ }
+
+ private void _checkVisibility(boolean isVisible) {
+ if (isVisible) {
+ AssertVisible(copyAllId);
+ AssertVisible(parentId + "lsdisremoveAll");
+ AssertVisible(parentId + "lsdisremove");
+ AssertVisible(parentId + "lsdisremove");
+
+ AssertVisible(parentId + "lsdisfirst");
+ AssertVisible(parentId + "lsdisup");
+ AssertVisible(parentId + "lsdisdown");
+ AssertVisible(parentId + "lsdislast");
+ } else {
+ AssertNotRendered(copyAllId);
+ AssertNotRendered(removeAllId);
+ AssertNotRendered(copyId);
+ AssertNotRendered(removeId);
+ AssertNotRendered(firstId);
+ AssertNotRendered(lastId);
+ AssertNotRendered(downId);
+ AssertNotRendered(upId);
+ }
+ }
+
+ private void _checkOrdering(String listId, String first, String second, String fird, String errorMessage) {
+ try {
+ if (first != null)
+ _checkItemText(first, listId, 0);
+ if (second != null) {
+ _checkItemText(second, listId, 1);
+ }
+ if (fird != null) {
+ _checkItemText(fird, listId, 2);
+ }
+ } catch (Exception e) {
+ writeStatus(errorMessage, true);
+ Assert.fail(errorMessage + e.getMessage());
+ }
+ }
+
+ private void reset() {
+ clickAjaxCommandAndWait(resetId);
+ }
+
+ private void _assertTableRowsCount(String tbId, int rows) {
+ writeStatus("Check items count for list id : " + tbId);
+ StringBuffer b = new StringBuffer("$('");
+ b.append(tbId);
+ b.append("').rows.length");
+ String l = runScript(b.toString());
+ int r;
+ try {
+ r = Integer.parseInt(l);
+ if (r != rows) {
+ writeStatus("Incorrect list item count in table id: " + tbId, true);
+ Assert.fail("Incorrect list item count in table id: " + tbId);
+ }
+ } catch (Exception e) {
+ writeStatus("List shuttle test failed. Cause: " + e.getMessage(), true);
+ Assert.fail("List shuttle test failed. Cause: " + e);
+ }
+ }
+
+ private void _doItemAction(String itemId, String actionId, String actionName) {
+ writeStatus(actionName + " the item id: " + itemId);
+ _selectItem(itemId);
+ clickById(actionId);
+ }
+
+ private void _checkDataPost2Server(int availableCount, int targetCount) {
+ writeStatus("Rerender form. List items should be changed.");
+ clickAjaxCommandAndWait(submitId);
+
+ try {
+ _assertTableRowsCount(availebleListId, availableCount);
+ _assertTableRowsCount(targetListId, targetCount);
+ } catch (Exception e) {
+ writeStatus("Data was post to server incorrectly. List data before rerendering does not match after", true);
+ Assert
+ .fail("Data was post to server incorrectly. List data before rerendering does not match after. Cause: "
+ + e);
+ }
+ }
+
+ private void _selectItem(String itemId) {
+ writeStatus("Select item id: " + itemId);
+ try {
+ clickById(itemId);
+ } catch (Exception e) {
+ writeStatus("Selection item id: " + itemId + " failed.");
+ Assert.fail("No item was found. Item id: " + itemId);
+ }
+ }
+
+ private void _checkItemText(String text, String listId, int i) {
+ StringBuffer b = new StringBuffer("$('");
+ b.append(listId);
+ b.append("').rows[");
+ b.append(i);
+ b.append("].id");
+
+ String id = null;
+ try {
+ id = runScript(b.toString());
+ AssertTextEquals(id, text, "Invalid item's text");
+ } catch (Exception e) {
+ writeStatus("Invalid item text. Item id: " + id);
+ Assert.fail("Invalid item text. Item id: " + id);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.SeleniumTestBase#getTestUrl()
+ */
+ @Override
+ public String getTestUrl() {
+ return "pages/listShuttle/listShuttleTest.xhtml";
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -3,51 +3,13 @@
import static org.testng.Assert.assertEquals;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class LoadScriptTest extends SeleniumTestBase implements RichSeleniumTest {
+public class LoadScriptTest extends SeleniumTestBase {
- public LoadScriptTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testLoadScriptComponent() throws Exception {
- _testLoadScriptComponent(Template.SIMPLE);
- _testLoadScriptComponent(Template.DATA_TABLE);
- _testLoadScriptComponent(Template.MODAL_PANEL);
- }
-
- private void _testLoadScriptComponent(Template template) {
+ public void testLoadScriptComponent(Template template) throws Exception {
renderPage(template);
String jsCall = "summarize(%1$s, %2$s);";
int opr1 = 1;
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -4,51 +4,13 @@
import static org.testng.Assert.assertEquals;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class LoadStyleTest extends SeleniumTestBase implements RichSeleniumTest {
+public class LoadStyleTest extends SeleniumTestBase {
- public LoadStyleTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testLoadStyleComponent() throws Exception {
- _testLoadStyleComponent(Template.SIMPLE);
- _testLoadStyleComponent(Template.DATA_TABLE);
- _testLoadStyleComponent(Template.MODAL_PANEL);
- }
-
- private void _testLoadStyleComponent(Template template) {
+ public void testLoadStyleComponent(Template template) {
renderPage(template);
String divId = getParentId() + "rectangle";
assertEquals(50, getWidthById(divId));
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -22,15 +22,11 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class OrderingListTest extends SeleniumTestBase implements RichSeleniumTest {
+public class OrderingListTest extends SeleniumTestBase {
private String firstButton;
private String firstButtonDisabled;
@@ -61,55 +57,11 @@
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
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testOrderingListComponent() throws Exception {
- _testOrderingListComponent(Template.SIMPLE);
- _testOrderingListComponent(Template.DATA_TABLE);
- _testOrderingListComponent(Template.MODAL_PANEL);
- }
-
- private void _testOrderingListComponent(Template template) {
+ public void testButtons(Template template) {
renderPage(template);
initFields();
- _testButtons();
- _testActions();
- _testJSFunctions();
- }
-
- private void _testButtons() {
writeStatus("Check if all buttons are disabled first time");
checkButtons(true, true, true, true);
@@ -134,7 +86,11 @@
Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
}
- private void _testActions() {
+ @Test
+ public void testActions(Template template) {
+ renderPage(template);
+ initFields();
+
writeStatus("Select two rows");
clickById(firstRow);
selenium.controlKeyDown();
@@ -160,7 +116,11 @@
checkButtons(true, true, false, false);
}
- private void _testJSFunctions() {
+ @Test
+ public void testJSFunctions(Template template) {
+ renderPage(template);
+ initFields();
+
writeStatus("Select one row");
clickById(thirdRow);
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -22,52 +22,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PanelBarTest extends SeleniumTestBase implements RichSeleniumTest {
+public class PanelBarTest extends SeleniumTestBase {
- public PanelBarTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testPanelBarComponent() throws Exception {
- _testPanelBarComponent(Template.SIMPLE);
- _testPanelBarComponent(Template.DATA_TABLE);
- _testPanelBarComponent(Template.MODAL_PANEL);
- }
-
- private void _testPanelBarComponent(Template template) {
+ public void testPanelBarComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,65 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PanelMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+public class PanelMenuTest extends SeleniumTestBase {
- public PanelMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testPanelMenuComponent() throws Exception {
-
- _testPanelMenuComponent(Template.SIMPLE);
- _testPanelMenuComponent(Template.DATA_TABLE);
- _testPanelMenuComponent(Template.MODAL_PANEL);
-
- _testPanelMenuComponentSingleMode(Template.SIMPLE);
- _testPanelMenuComponentSingleMode(Template.DATA_TABLE);
- _testPanelMenuComponentSingleMode(Template.MODAL_PANEL);
-
- _testPanelMenuItemAction(Template.SIMPLE);
- _testPanelMenuItemAction(Template.DATA_TABLE);
- _testPanelMenuItemAction(Template.MODAL_PANEL);
-
- _testPanelMenuClientAPI(Template.SIMPLE);
- _testPanelMenuClientAPI(Template.DATA_TABLE);
- _testPanelMenuClientAPI(Template.MODAL_PANEL);
- }
-
- private void _testPanelMenuClientAPI(Template template) {
+ public void testPanelMenuClientAPI(Template template) {
renderPage(template);
String form1 = getParentId() + "_form1:";
@@ -103,7 +52,8 @@
tearDown();
}
- private void _testPanelMenuComponent(Template template) {
+ @Test
+ public void testPanelMenuComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form1:";
@@ -174,7 +124,8 @@
tearDown();
}
- private void _testPanelMenuComponentSingleMode(Template template) {
+ @Test
+ public void testPanelMenuComponentSingleMode(Template template) {
renderPage(template);
String parentId = getParentId() + "_form2:";
@@ -244,7 +195,8 @@
tearDown();
}
- private void _testPanelMenuItemAction(Template template) {
+ @Test
+ public void testPanelMenuItemAction(Template template) {
renderPage(template);
String parentId = getParentId() + "_form";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,52 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PickListTest extends SeleniumTestBase implements RichSeleniumTest {
+public class PickListTest extends SeleniumTestBase {
- public PickListTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testPickListComponent() throws Exception {
- _testPickListComponent(Template.SIMPLE);
- _testPickListComponent(Template.DATA_TABLE);
- _testPickListComponent(Template.MODAL_PANEL);
- }
-
- private void _testPickListComponent(Template template) {
+ public void testPickListComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -1,53 +1,15 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class ProgressBarTest extends SeleniumTestBase implements RichSeleniumTest {
+public class ProgressBarTest extends SeleniumTestBase {
- public ProgressBarTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testProgressBarComponent() {
- _testProgressBarComponent(Template.SIMPLE);
- _testProgressBarComponent(Template.DATA_TABLE);
- _testProgressBarComponent(Template.MODAL_PANEL);
- }
+ public void testProgressBarComponent(Template template) {
- private void _testProgressBarComponent(Template template) {
-
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -22,52 +22,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
+public class SimpleTogglePanelTest extends SeleniumTestBase {
- public SimpleTogglePanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Template.SIMPLE);
- _testSimpleTogglePanelComponent(Template.DATA_TABLE);
- _testSimpleTogglePanelComponent(Template.MODAL_PANEL);
- }
-
- private void _testSimpleTogglePanelComponent(Template template) {
+ public void _testSimpleTogglePanelComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
String inputId = parentId + "_value";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -22,52 +22,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class SpacerTest extends SeleniumTestBase implements RichSeleniumTest {
+public class SpacerTest extends SeleniumTestBase {
- public SpacerTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Template.SIMPLE);
- _testSimpleTogglePanelComponent(Template.DATA_TABLE);
- _testSimpleTogglePanelComponent(Template.MODAL_PANEL);
- }
-
- private void _testSimpleTogglePanelComponent(Template template) {
+ public void testSimpleTogglePanelComponent(Template template) {
renderPage(template);
String parentId = getParentId();
String spacerId = parentId + "sp";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -22,54 +22,16 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import com.thoughtworks.selenium.SeleniumException;
-public class TabPanelTest extends SeleniumTestBase implements RichSeleniumTest {
+public class TabPanelTest extends SeleniumTestBase {
- public TabPanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testTabPanelComponent() throws Exception {
- _testRichTabPanelComponent(Template.SIMPLE);
- _testRichTabPanelComponent(Template.DATA_TABLE);
- _testRichTabPanelComponent(Template.MODAL_PANEL);
- }
-
- private void _testRichTabPanelComponent(Template template) {
+ public void testRichTabPanelComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
String linkId = parentId + "tab2_lbl";
@@ -126,6 +88,7 @@
}
}
+ @Override
public String getTestUrl() {
return "pages/tabPanel/tabPanelTest.xhtml";
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java 2008-07-18 10:48:48 UTC (rev 9681)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java 2008-07-18 11:12:38 UTC (rev 9682)
@@ -22,54 +22,16 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import com.thoughtworks.selenium.SeleniumException;
-public class TogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
+public class TogglePanelTest extends SeleniumTestBase {
- public TogglePanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters({"browser", "filterPrefix"})
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
- }
-
-
- @BeforeMethod
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun=true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
@Test
- public void testTogglePanelComponent() throws Exception {
- _testTogglePanelComponent(Template.SIMPLE);
- _testTogglePanelComponent(Template.DATA_TABLE);
- _testTogglePanelComponent(Template.MODAL_PANEL);
- }
-
- private void _testTogglePanelComponent(Template template) {
+ public void testTogglePanelComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
16 years, 2 months
JBoss Rich Faces SVN: r9681 - trunk/test-applications/facelets/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-07-18 06:48:48 -0400 (Fri, 18 Jul 2008)
New Revision: 9681
Modified:
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-Validator.xml
Log:
dataValidator instead of data
Modified: trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-Validator.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-Validator.xml 2008-07-18 10:47:05 UTC (rev 9680)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-Validator.xml 2008-07-18 10:48:48 UTC (rev 9681)
@@ -8,7 +8,7 @@
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
- <managed-bean-name>data</managed-bean-name>
+ <managed-bean-name>dataValidator</managed-bean-name>
<managed-bean-class>validator.DataBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
16 years, 2 months
JBoss Rich Faces SVN: r9680 - trunk/test-applications/facelets/src/main/webapp/Columns.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-07-18 06:47:05 -0400 (Fri, 18 Jul 2008)
New Revision: 9680
Modified:
trunk/test-applications/facelets/src/main/webapp/Columns/Columns.xhtml
trunk/test-applications/facelets/src/main/webapp/Columns/ColumnsProperty.xhtml
Log:
Modified: trunk/test-applications/facelets/src/main/webapp/Columns/Columns.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Columns/Columns.xhtml 2008-07-18 10:46:52 UTC (rev 9679)
+++ trunk/test-applications/facelets/src/main/webapp/Columns/Columns.xhtml 2008-07-18 10:47:05 UTC (rev 9680)
@@ -32,7 +32,7 @@
columns="#{columns.columns}" index="index" rowspan="#{columns.rowspan}" begin="#{columns.begin}" end="#{columns.end}" width="#{columns.width}" style="#{style.style}" styleClass="#{style.styleClass}"
sortOrder="#{columns.orderings[index]}" sortBy="#{d1.str0}"
filterBy="#{d1.str0}"
- filterValue="#{columns.filterValue[index]}">
+ filterValue="#{columns.filterValue[index]}" filterMethod="#{columns.filterMethod}">
<f:facet name="header">
<h:outputText value="header #{d2.int0}"></h:outputText>
</f:facet>
Modified: trunk/test-applications/facelets/src/main/webapp/Columns/ColumnsProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Columns/ColumnsProperty.xhtml 2008-07-18 10:46:52 UTC (rev 9679)
+++ trunk/test-applications/facelets/src/main/webapp/Columns/ColumnsProperty.xhtml 2008-07-18 10:47:05 UTC (rev 9680)
@@ -17,6 +17,10 @@
<h:inputText value="#{columns.length2}" />
<h:commandButton action="#{columns.addNewItem2}" value="ok"></h:commandButton>
</h:panelGroup>
+
+ <h:outputText value="filterMethod"></h:outputText>
+ <h:inputText value="#{columns.filterInput}"
+ onchange="submit();" />
<h:outputText value="columns (*):"></h:outputText>
<h:inputText value="#{columns.columns}" onchange="submit();">
16 years, 2 months
JBoss Rich Faces SVN: r9679 - trunk/test-applications/facelets/src/main/java/columns.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-07-18 06:46:52 -0400 (Fri, 18 Jul 2008)
New Revision: 9679
Modified:
trunk/test-applications/facelets/src/main/java/columns/Columns.java
Log:
Modified: trunk/test-applications/facelets/src/main/java/columns/Columns.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/columns/Columns.java 2008-07-18 10:43:24 UTC (rev 9678)
+++ trunk/test-applications/facelets/src/main/java/columns/Columns.java 2008-07-18 10:46:52 UTC (rev 9679)
@@ -27,6 +27,22 @@
private boolean dataTableRendered;
private Ordering sortOrder;
private String[] filterValue;
+ private String filterInput;
+
+ public String getFilterInput() {
+ return filterInput;
+ }
+
+ public void setFilterInput(String filterInput) {
+ this.filterInput = filterInput;
+ }
+
+ public boolean filterMethod(Object obj) {
+ Data d = (Data)obj;
+ if(d.getStr0().startsWith(filterInput)) return true;
+ return false;
+ }
+
public String[] getFilterValue() {
return filterValue;
}
@@ -59,6 +75,7 @@
this.data2 = new ArrayList<Data>();
this.filterValue = new String[length2];
this.sortOrder = Ordering.ASCENDING;
+ this.filterInput = "";
for (int i = 0; i < length1; i++) {
data1.add(new Data(i, "data 1 [" + i + "]", "Button " + i, "Link " + i, "select" + (i % 5)));
data2.add(new Data(i, "data 2 [" + i + "]", "Button " + i, "Link " + i, statusIcon[i % 5]));
16 years, 2 months
JBoss Rich Faces SVN: r9678 - trunk/test-applications/facelets/src/main/java/validator.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-07-18 06:43:24 -0400 (Fri, 18 Jul 2008)
New Revision: 9678
Modified:
trunk/test-applications/facelets/src/main/java/validator/ValidatorBean.java
Log:
Modified: trunk/test-applications/facelets/src/main/java/validator/ValidatorBean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/validator/ValidatorBean.java 2008-07-18 10:43:10 UTC (rev 9677)
+++ trunk/test-applications/facelets/src/main/java/validator/ValidatorBean.java 2008-07-18 10:43:24 UTC (rev 9678)
@@ -7,10 +7,12 @@
import org.hibernate.validator.AssertFalse;
import org.hibernate.validator.AssertTrue;
import org.hibernate.validator.CreditCardNumber;
+import org.hibernate.validator.Digits;
import org.hibernate.validator.EAN;
import org.hibernate.validator.Email;
import org.hibernate.validator.Future;
import org.hibernate.validator.Pattern;
+import org.hibernate.validator.Range;
import org.hibernate.validator.Size;
import org.richfaces.component.UIBeanValidator;
import util.componentInfo.ComponentInfo;
@@ -51,7 +53,27 @@
private boolean selfRendered;
private boolean submitted;
private int timeout;
+ @Digits(integerDigits=1,fractionalDigits=3,message="Digits validation failed!")
+ private double digit;
+ @Range(min=0,max=15,message="Range validation failed!")
+ private String rangeValue;
+ public double getDigit() {
+ return digit;
+ }
+
+ public void setDigit(double digit) {
+ this.digit = digit;
+ }
+
+ public String getRangeValue() {
+ return rangeValue;
+ }
+
+ public void setRangeValue(String rangeValue) {
+ this.rangeValue = rangeValue;
+ }
+
public int getTimeout() {
return timeout;
}
@@ -235,7 +257,7 @@
this.rendered = true;
this.renderRegionOnly = true;
this.requestDelay = 500;
- this.selfRendered = false;
+ this.selfRendered = true;
this.submitted = false;
this.timeout = 3000;
}
16 years, 2 months
JBoss Rich Faces SVN: r9677 - trunk/test-applications/facelets/src/main/webapp/Validator.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-07-18 06:43:10 -0400 (Fri, 18 Jul 2008)
New Revision: 9677
Modified:
trunk/test-applications/facelets/src/main/webapp/Validator/ValidatorProperty.xhtml
Log:
Modified: trunk/test-applications/facelets/src/main/webapp/Validator/ValidatorProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Validator/ValidatorProperty.xhtml 2008-07-18 10:41:17 UTC (rev 9676)
+++ trunk/test-applications/facelets/src/main/webapp/Validator/ValidatorProperty.xhtml 2008-07-18 10:43:10 UTC (rev 9677)
@@ -70,12 +70,12 @@
<h:panelGrid columns="2" border="2" style="float:top;">
- <h:commandButton actionListener="#{data.checkBinding}"
+ <h:commandButton actionListener="#{dataValidator.checkBinding}"
value="Binding" />
- <h:outputText value="#{data.bindLabel}" />
+ <h:outputText value="#{dataValidator.bindLabel}" />
<h:outputText value="rendered" />
- <h:selectBooleanCheckbox value="#{data.rendered}"
+ <h:selectBooleanCheckbox value="#{dataValidator.rendered}"
onchange="submit();" />
</h:panelGrid>
16 years, 2 months
JBoss Rich Faces SVN: r9676 - trunk/test-applications/facelets/src/main/webapp/Validator.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-07-18 06:41:17 -0400 (Fri, 18 Jul 2008)
New Revision: 9676
Modified:
trunk/test-applications/facelets/src/main/webapp/Validator/Validator.xhtml
trunk/test-applications/facelets/src/main/webapp/Validator/ValidatorStraightforward.xhtml
Log:
Modified: trunk/test-applications/facelets/src/main/webapp/Validator/Validator.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Validator/Validator.xhtml 2008-07-18 10:08:40 UTC (rev 9675)
+++ trunk/test-applications/facelets/src/main/webapp/Validator/Validator.xhtml 2008-07-18 10:41:17 UTC (rev 9676)
@@ -16,10 +16,10 @@
</rich:panel>
<h2>Input fields with label and message in the JSF dataTable.
Each field validated by AJAX on "onchange" event</h2>
- <rich:graphValidator value="#{data}"
- binding="#{data.graphValidatorComponent}" id="graphValidatorID"
- rendered="#{data.rendered}">
- <rich:dataTable value="#{data.beans}" var="vBean" id="table">
+ <rich:graphValidator value="#{dataValidator}"
+ binding="#{dataValidator.graphValidatorComponent}" id="graphValidatorID"
+ rendered="#{dataValidator.rendered}">
+ <rich:dataTable value="#{dataValidator.beans}" var="vBean" id="table">
<f:facet name="header">
<h:outputText
value="Validate values in the data table. Total sum for an all integer values validated for a value less then 20" />
Modified: trunk/test-applications/facelets/src/main/webapp/Validator/ValidatorStraightforward.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Validator/ValidatorStraightforward.xhtml 2008-07-18 10:08:40 UTC (rev 9675)
+++ trunk/test-applications/facelets/src/main/webapp/Validator/ValidatorStraightforward.xhtml 2008-07-18 10:41:17 UTC (rev 9676)
@@ -5,7 +5,7 @@
xmlns:rich="http://richfaces.org/rich"
id="validatorStraightforwardSubviewID">
<a4j:region>
- <rich:dataTable value="#{data.data}" var="data" id="SizeValidationID">
+ <rich:dataTable value="#{dataValidator.data}" var="data" id="SizeValidationID">
showSummary="true" />
<rich:column>
<f:facet name="header">
@@ -63,8 +63,8 @@
<a4j:region>
<h:outputText value="Enter quantity of lines [data]" />
<h:panelGroup>
- <h:inputText value="#{data.length}"/>
- <a4j:commandButton action="#{data.addNewItem}" value="ok"
+ <h:inputText value="#{dataValidator.length}"/>
+ <a4j:commandButton action="#{dataValidator.addNewItem}" value="ok"
reRender="SizeValidationID"></a4j:commandButton>
</h:panelGroup>
</a4j:region>
16 years, 2 months
JBoss Rich Faces SVN: r9675 - trunk/test-applications/jsp/src/main/java/columns.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-07-18 06:08:40 -0400 (Fri, 18 Jul 2008)
New Revision: 9675
Modified:
trunk/test-applications/jsp/src/main/java/columns/Columns.java
Log:
Modified: trunk/test-applications/jsp/src/main/java/columns/Columns.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/columns/Columns.java 2008-07-18 10:08:27 UTC (rev 9674)
+++ trunk/test-applications/jsp/src/main/java/columns/Columns.java 2008-07-18 10:08:40 UTC (rev 9675)
@@ -4,6 +4,16 @@
import java.util.Comparator;
import java.util.Map;
+import javax.faces.model.SelectItem;
+
+import org.richfaces.component.UIColumn;
+import org.richfaces.component.UIComboBox;
+import org.richfaces.component.UIComponentControl;
+import org.richfaces.component.UIContextMenu;
+import org.richfaces.component.UIDataDefinitionList;
+import org.richfaces.component.UIDataFltrSlider;
+import org.richfaces.component.UIDataList;
+import org.richfaces.component.UIDatascroller;
import org.richfaces.model.Ordering;
import orderingList.OrderingList;
@@ -18,8 +28,8 @@
private int length1;
private int length2;
private String columns;
- private String begin;
- private String end;
+ private int begin;
+ private int end;
private String width;
private String title;
private Ordering[] orderings = new Ordering[100];
@@ -29,9 +39,37 @@
private boolean sortable;
private boolean dataTableRendered;
private boolean selfSorted;
- private String[] filterValue;
+ private String[] filterValue;
+ private String filterInput;
+ private String filterEvent;
+ private ArrayList<SelectItem> filterEvents;
+
+ public ArrayList<SelectItem> getFilterEvents() {
+ return filterEvents;
+ }
+
+ public void setFilterEvents(ArrayList<SelectItem> filterEvents) {
+ this.filterEvents = filterEvents;
+ }
+
+ public String getFilterEvent() {
+ return filterEvent;
+ }
+
+ public void setFilterEvent(String filterEvent) {
+ this.filterEvent = filterEvent;
+ }
+
+ public String getFilterInput() {
+ return filterInput;
+ }
+
+ public void setFilterInput(String filterInput) {
+ this.filterInput = filterInput;
+ }
+
public String[] getFilterValue() {
- return filterValue;
+ return filterValue;
}
public void setFilterValue(String[] filterValue) {
@@ -48,10 +86,11 @@
public Columns() {
this.columns = "3";
- this.begin = "0";
- this.end = "10";
+ this.begin = 0;
+ this.end = 10;
this.width = "100";
this.title = "Title columns";
+ filterInput = "";
this.colspan = 1;
this.rowspan = 1;
this.breakBefore = false;
@@ -62,13 +101,24 @@
this.length2 = 5;
this.data1 = new ArrayList<Data>();
this.data2 = new ArrayList<Data>();
- this.filterValue = new String[length2];
+ this.filterValue = new String[length2];
+ this.filterEvent = "onchange";
+ this.filterEvents = new ArrayList<SelectItem>();
+ filterEvents.add(new SelectItem("onchange", "onchange"));
+ filterEvents.add(new SelectItem("onkeyup", "onkeyup"));
+ filterEvents.add(new SelectItem("ondbclick", "ondbclick"));
for (int i = 0; i < length1; i++) {
data1.add(new Data(i, "data 1 [" + i + "]", "Button " + i, "Link " + i, "select" + (i % 5)));
data2.add(new Data(i, "data 2 [" + i + "]", "Button " + i, "Link " + i, statusIcon[i % 5]));
}
}
+ public boolean filterMethod(Object obj) {
+ Data d = (Data)obj;
+ if(d.getStr0().startsWith(filterInput)) return true;
+ return false;
+ }
+
public String getColumns() {
return columns;
}
@@ -77,19 +127,19 @@
this.columns = columns;
}
- public String getBegin() {
+ public int getBegin() {
return begin;
}
- public void setBegin(String begin) {
+ public void setBegin(int begin) {
this.begin = begin;
}
- public String getEnd() {
+ public int getEnd() {
return end;
}
- public void setEnd(String end) {
+ public void setEnd(int end) {
this.end = end;
}
16 years, 2 months
JBoss Rich Faces SVN: r9674 - trunk/test-applications/jsp/src/main/webapp/Columns.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-07-18 06:08:27 -0400 (Fri, 18 Jul 2008)
New Revision: 9674
Modified:
trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp
trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp 2008-07-18 08:22:49 UTC (rev 9673)
+++ trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp 2008-07-18 10:08:27 UTC (rev 9674)
@@ -36,7 +36,7 @@
columns="#{columns.columns}" index="index" rowspan="#{columns.rowspan}"
begin="#{columns.begin}" end="#{columns.end}" width="#{columns.width}" style="#{style.style}" styleClass="#{style.styleClass}"
comparator="#{columns}" sortBy="#{d2.str0}" selfSorted="true" sortOrder="#{columns.orderings[index]}" dir="LTR" filterBy="#{d1.str0}"
- filterValue="#{columns.filterValue[index]}">
+ filterValue="#{columns.filterValue[index]}" filterMethod="#{columns.filterMethod}" filterEvent="#{columns.filterEvent}">
<f:facet name="header">
<h:outputText value="header #{d2.int0}"></h:outputText>
</f:facet>
Modified: trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp 2008-07-18 08:22:49 UTC (rev 9673)
+++ trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp 2008-07-18 10:08:27 UTC (rev 9674)
@@ -21,11 +21,15 @@
<h:inputText value="#{columns.length2}" />
<h:commandButton action="#{columns.addNewItem2}" value="ok"></h:commandButton>
</h:panelGroup>
+
+ <h:outputText value="filterMethod"></h:outputText>
+ <h:inputText value="#{columns.filterInput}"
+ onchange="submit();" />
<h:outputText value="columns (*):"></h:outputText>
<h:inputText value="#{columns.columns}" onchange="submit();">
</h:inputText>
-
+ <%-- JSP comments paste here--%>
<h:outputText value="rowspan:"></h:outputText>
<h:inputText value="#{columns.rowspan}" onchange="submit();">
</h:inputText>
@@ -45,7 +49,12 @@
<h:outputText value="width:"></h:outputText>
<h:inputText value="#{columns.width}" onchange="submit();">
</h:inputText>
-
+
+ <h:outputText value="filterEvent" />
+ <h:selectOneMenu value="#{columns.filterEvent}" onchange="submit();">
+ <f:selectItems value="#{columns.filterEvents}"/>
+ </h:selectOneMenu>
+
<h:outputText value="breakBefore:"></h:outputText>
<h:selectBooleanCheckbox value="#{columns.breakBefore}" onchange="submit();">
</h:selectBooleanCheckbox>
16 years, 2 months