[seam/faces] 8e4f20: SEAMFACES-136: Refactor the security related class...
by noreply@github.com
Branch: refs/heads/master
Home: https://github.com/seam/faces
Commit: 8e4f20a6c66a9f350b243b024c47b89b76578520
https://github.com/seam/faces/commit/8e4f20a6c66a9f350b243b024c47b89b7657...
Author: Brian Leathem <bleathem(a)gmail.com>
Date: 2011-04-08 (Fri, 08 Apr 2011)
Changed paths:
A api/src/main/java/org/jboss/seam/faces/security/AccessDeniedView.java
A api/src/main/java/org/jboss/seam/faces/security/LoginView.java
A api/src/main/java/org/jboss/seam/faces/security/RestrictAtPhase.java
A api/src/main/java/org/jboss/seam/faces/security/RestrictAtPhaseDefault.java
A api/src/main/java/org/jboss/seam/faces/security/package-info.java
R api/src/main/java/org/jboss/seam/faces/view/config/AccessDeniedView.java
R api/src/main/java/org/jboss/seam/faces/view/config/LoginView.java
R api/src/main/java/org/jboss/seam/faces/view/config/RestrictAtPhase.java
R api/src/main/java/org/jboss/seam/faces/view/config/RestrictAtPhaseDefault.java
M examples/faces-security/pom.xml
M examples/faces-security/src/main/java/org/jboss/seam/faces/examples/security/Pages.java
A impl/src/main/java/org/jboss/seam/faces/security/SecurityPhaseListener.java
R impl/src/main/java/org/jboss/seam/faces/view/config/SecurityPhaseListener.java
M impl/src/main/java/org/jboss/seam/faces/view/config/ViewConfigStoreImpl.java
M impl/src/test/java/org/jboss/seam/faces/test/view/config/SecurityPhaseListenerTest.java
M impl/src/test/java/org/jboss/seam/faces/test/view/config/annotation/ViewConfigEnum.java
Log Message:
-----------
SEAMFACES-136: Refactor the security related classes into a security package
13 years, 2 months
[seam/faces] 1d9304: Added package-info.java documentation to the API a...
by noreply@github.com
Branch: refs/heads/master
Home: https://github.com/seam/faces
Commit: 1d93049cf672d1e7c120a34f234ac52521ca9508
https://github.com/seam/faces/commit/1d93049cf672d1e7c120a34f234ac52521ca...
Author: Brian Leathem <bleathem(a)gmail.com>
Date: 2011-04-08 (Fri, 08 Apr 2011)
Changed paths:
A api/src/main/java/org/jboss/seam/faces/component/package-info.java
A api/src/main/java/org/jboss/seam/faces/context/conversation/package-info.java
A api/src/main/java/org/jboss/seam/faces/context/package-info.java
A api/src/main/java/org/jboss/seam/faces/conversion/package-info.java
A api/src/main/java/org/jboss/seam/faces/event/package-info.java
A api/src/main/java/org/jboss/seam/faces/event/qualifier/package-info.java
A api/src/main/java/org/jboss/seam/faces/qualifier/package-info.java
A api/src/main/java/org/jboss/seam/faces/transaction/package-info.java
A api/src/main/java/org/jboss/seam/faces/validation/package-info.java
A api/src/main/java/org/jboss/seam/faces/view/config/package-info.java
Log Message:
-----------
Added package-info.java documentation to the API artifact
13 years, 2 months
[seam/wicket] c50701: SEAM-27
by noreply@github.com
Branch: refs/heads/master
Home: https://github.com/seam/wicket
Commit: c507015466b87a0bc96a7fa5abe47ee07ea72bad
https://github.com/seam/wicket/commit/c507015466b87a0bc96a7fa5abe47ee07ea...
Author: mgencur(a)redhat.com <mgencur(a)redhat.com>
Date: 2011-04-07 (Thu, 07 Apr 2011)
Changed paths:
M examples/numberguess/pom.xml
R examples/numberguess/src/jetty/java/org/jboss/seam/wicket/example/numberguess/Start.java
A examples/numberguess/src/jetty/java/org/jboss/seam/wicket/examples/numberguess/Start.java
R examples/numberguess/src/main/java/org/jboss/seam/wicket/example/numberguess/Game.java
R examples/numberguess/src/main/java/org/jboss/seam/wicket/example/numberguess/Generator.java
R examples/numberguess/src/main/java/org/jboss/seam/wicket/example/numberguess/HomePage.html
R examples/numberguess/src/main/java/org/jboss/seam/wicket/example/numberguess/HomePage.java
R examples/numberguess/src/main/java/org/jboss/seam/wicket/example/numberguess/MaxNumber.java
R examples/numberguess/src/main/java/org/jboss/seam/wicket/example/numberguess/NumberGuessApplication.java
R examples/numberguess/src/main/java/org/jboss/seam/wicket/example/numberguess/Random.java
A examples/numberguess/src/main/java/org/jboss/seam/wicket/examples/numberguess/Game.java
A examples/numberguess/src/main/java/org/jboss/seam/wicket/examples/numberguess/Generator.java
A examples/numberguess/src/main/java/org/jboss/seam/wicket/examples/numberguess/HomePage.html
A examples/numberguess/src/main/java/org/jboss/seam/wicket/examples/numberguess/HomePage.java
A examples/numberguess/src/main/java/org/jboss/seam/wicket/examples/numberguess/MaxNumber.java
A examples/numberguess/src/main/java/org/jboss/seam/wicket/examples/numberguess/NumberGuessApplication.java
A examples/numberguess/src/main/java/org/jboss/seam/wicket/examples/numberguess/Random.java
M examples/numberguess/src/main/webapp/WEB-INF/web.xml
R examples/numberguess/src/test/java/org/jboss/seam/wicket/example/numberguess/ftest/HomePage.java
R examples/numberguess/src/test/java/org/jboss/seam/wicket/example/numberguess/ftest/NumberGuessTest.java
R examples/numberguess/src/test/java/org/jboss/seam/wicket/example/numberguess/test/HomePageTest.java
R examples/numberguess/src/test/java/org/jboss/seam/wicket/example/numberguess/test/util/MavenArtifactResolver.java
A examples/numberguess/src/test/java/org/jboss/seam/wicket/examples/numberguess/ftest/HomePage.java
A examples/numberguess/src/test/java/org/jboss/seam/wicket/examples/numberguess/ftest/NumberGuessTest.java
A examples/numberguess/src/test/java/org/jboss/seam/wicket/examples/numberguess/test/HomePageTest.java
A examples/numberguess/src/test/java/org/jboss/seam/wicket/examples/numberguess/test/util/MavenArtifactResolver.java
M examples/numberguess/src/test/resources-jbossas/test-web.xml
M examples/numberguess/src/test/resources-jetty/test-web.xml
M examples/numberguess/src/test/resources/ftests.xml
Log Message:
-----------
SEAM-27
13 years, 2 months
Seam SVN: r14073 - in branches/enterprise/JBPAPP_5_0/src/test/ftest: examples and 2 other directories.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2011-04-07 05:59:45 -0400 (Thu, 07 Apr 2011)
New Revision: 14073
Added:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5-cluster-booking.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5-cluster-slink.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/cluster/selenium/SLinkTest.java
Removed:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5cluster.xml
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/readme.txt
Log:
add slink test for booking in cluster
Added: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5-cluster-booking.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5-cluster-booking.xml (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5-cluster-booking.xml 2011-04-07 09:59:45 UTC (rev 14073)
@@ -0,0 +1,26 @@
+<!--
+ JBoss, Home of Professional Open Source Copyright 2008, Red Hat
+ Middleware LLC, and individual contributors by the @authors tag. See
+ the copyright.txt in the distribution for a full listing of individual
+ contributors. This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version. This software is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not, write
+ to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Booking example" verbose="2" parallel="false">
+ <test name="booking_jboss5_cluster">
+ <parameter name="PROPERTY_FILE"
+ value="/org/jboss/seam/example/booking/test/selenium/booking.properties" />
+ <classes>
+ <class name="org.jboss.seam.example.common.test.booking.cluster.selenium.FailoverTest" />
+ </classes>
+ </test>
+</suite>
Added: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5-cluster-slink.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5-cluster-slink.xml (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5-cluster-slink.xml 2011-04-07 09:59:45 UTC (rev 14073)
@@ -0,0 +1,26 @@
+<!--
+ JBoss, Home of Professional Open Source Copyright 2008, Red Hat
+ Middleware LLC, and individual contributors by the @authors tag. See
+ the copyright.txt in the distribution for a full listing of individual
+ contributors. This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version. This software is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not, write
+ to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Booking example" verbose="2" parallel="false">
+ <test name="booking_jboss5_cluster">
+ <parameter name="PROPERTY_FILE"
+ value="/org/jboss/seam/example/booking/test/selenium/booking.properties" />
+ <classes>
+ <class name="org.jboss.seam.example.common.test.booking.cluster.selenium.SLinkTest" />
+ </classes>
+ </test>
+</suite>
Deleted: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5cluster.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5cluster.xml 2011-04-05 14:47:22 UTC (rev 14072)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/booking/jboss5cluster.xml 2011-04-07 09:59:45 UTC (rev 14073)
@@ -1,26 +0,0 @@
-<!--
- JBoss, Home of Professional Open Source Copyright 2008, Red Hat
- Middleware LLC, and individual contributors by the @authors tag. See
- the copyright.txt in the distribution for a full listing of individual
- contributors. This is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version. This software is
- distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- License for more details. You should have received a copy of the GNU
- Lesser General Public License along with this software; if not, write
- to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
--->
-<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-<suite name="Booking example" verbose="2" parallel="false">
- <test name="booking_jboss5_cluster">
- <parameter name="PROPERTY_FILE"
- value="/org/jboss/seam/example/booking/test/selenium/booking.properties" />
- <classes>
- <class name="org.jboss.seam.example.common.test.booking.cluster.selenium.FailoverTest" />
- </classes>
- </test>
-</suite>
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml 2011-04-05 14:47:22 UTC (rev 14072)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml 2011-04-07 09:59:45 UTC (rev 14073)
@@ -99,14 +99,21 @@
<target name="selenium.test" depends="build, container.properties" description="Run Tests">
<taskdef resource="testngtasks" classpathref="classpath.test" />
<mkdir dir="${test.output.dir}" />
-
- <condition property="clusterxml" value="cluster">
- <equals arg1="${cluster}" arg2="true"/>
+ <condition property="clusterxml" value="-cluster-booking">
+ <equals arg1="${test-booking}" arg2="true"/>
</condition>
+ <condition property="clusterxml" value="-cluster-slink">
+ <equals arg1="${test-slink}" arg2="true"/>
+ </condition>
<condition property="clusterxml" value="">
- <not>
- <equals arg1="${cluster}" arg2="true"/>
- </not>
+ <and>
+ <not>
+ <equals arg1="${cluster-booking}" arg2="true"/>
+ </not>
+ <not>
+ <equals arg1="${cluster-slink}" arg2="true"/>
+ </not>
+ </and>
</condition>
<!-- execute testng tests -->
<testng haltonfailure="false" outputdir="${test.output.dir}" classpathref="classpath.test" listener="${functional.listener}">
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/readme.txt
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/readme.txt 2011-04-05 14:47:22 UTC (rev 14072)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/readme.txt 2011-04-07 09:59:45 UTC (rev 14073)
@@ -55,9 +55,17 @@
* jboss.service.binding.set=ports-default) and the application is deployed to server/all/farm
* directory at "jboss5.home" location specified in ftest.properties
-To run cluster test for booking example:
-ant test -Dtest=booking -Dcluster=true
+There are two cluster tests for the Booking application in the distribution. Before running any of them, you have
+to start both (master and slave) JBoss AS instances manually.
+
+1) simple booking with failover
+ ant test -Dtest=booking -Dcluster=true -Dtest-booking=true
+
+2) s:link test after failover
+
+ ant test -Dtest=booking -Dcluster=true -Dtest-slink=true
+
Known Limitations:
---------------------
* Only tested on Firefox and IE
Added: branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/cluster/selenium/SLinkTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/cluster/selenium/SLinkTest.java (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/cluster/selenium/SLinkTest.java 2011-04-07 09:59:45 UTC (rev 14073)
@@ -0,0 +1,256 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.example.common.test.booking.cluster.selenium;
+
+import java.io.IOException;
+import java.text.MessageFormat;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.*;
+
+import org.jboss.seam.example.common.test.selenium.SeamSelenium;
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+
+import com.thoughtworks.selenium.Wait;
+
+/**
+ * This class tests functionality of an s:link component in cluster.
+ * Two instances of JBoss AS are used. First part of the test is executed at first
+ * (master) instance. Then the first instance is killed and the second (slave) instance
+ * takes over execution of the application. This behavior simulates recovery from breakdown.
+ *
+ * @author mgencur
+ *
+ */
+public class SLinkTest extends SeamSeleniumTest
+{
+ private final String HOTEL_NAME = "W Hotel";
+ private final String DEFAULT_USERNAME = "demo";
+ private final String DEFAULT_PASSWORD = "demo";
+// private final String EXPECTED_NAME = "Demo User";
+// private final String CREDIT_CARD = "0123456789012345";
+// private final String CREDIT_CARD_NAME = "visa";
+ private final long JBOSS_SHUTDOWN_TIMEOUT = 20000;
+ private final int SECOND_BROWSER_PORT = 8180;
+ private final String SECOND_INSTANCE_BROWSER_URL = "http://localhost:" + SECOND_BROWSER_PORT;
+
+ private SeamSelenium browser2;
+
+ @Override
+ @BeforeMethod
+ public void setUp()
+ {
+ super.setUp();
+ deleteCookies(browser);
+ browser2 = startSecondBrowser();
+ deleteCookies(browser2);
+ assertTrue("Login failed.", login(browser));
+ }
+
+ @Override
+ @AfterMethod
+ public void tearDown()
+ {
+ logout(browser2);
+ super.tearDown();
+ stopSecondBrowser();
+ }
+
+ /**
+ * Test s:link functionality with failover
+ */
+ @Test
+ public void testSLinkFunctionality()
+ {
+ preFailurePart(browser);
+
+ String newAddress = getAddressForSecondInstance(browser);
+
+ shutdownMasterJBossInstance();
+
+ postFailurePart(browser2, newAddress);
+ }
+
+ public void shutdownMasterJBossInstance()
+ {
+ String command = JBOSS_HOME + "/bin/shutdown.sh -s localhost:1099 -S";
+ try
+ {
+ Process process = Runtime.getRuntime().exec(command);
+ process.waitFor();
+ Thread.sleep(JBOSS_SHUTDOWN_TIMEOUT);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e.getCause());
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+
+ public void preFailurePart(SeamSelenium browser)
+ {
+ if (!isLoggedIn(browser))
+ fail();
+ if (!browser.isElementPresent(getProperty("SEARCH_SUBMIT")))
+ {
+ browser.open(CONTEXT_PATH + getProperty("MAIN_PAGE"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+ enterSearchQueryUsingAJAX(browser, HOTEL_NAME);
+ browser.clickAndWait(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK")); //s:link
+ assertTrue(browser.isTextPresent(HOTEL_NAME));
+ assertTrue(browser.isElementPresent(getProperty("BOOKING_BOOK")));
+ browser.goBackAndWait();
+ assertTrue(browser.isElementPresent(getProperty("SEARCH_SUBMIT")));
+ }
+
+
+ public void postFailurePart(SeamSelenium browser, String newAddress)
+ {
+ browser2.open(newAddress);
+
+ //a jsessionid cookie has to be deleted because at this moment there already exists one
+ deleteCookies(browser);
+
+ browser2.clickAndWait(getProperty("SEARCH_SUBMIT"));
+ browser2.clickAndWait(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK")); //s:link
+ assertTrue(browser.isTextPresent(HOTEL_NAME));
+ assertTrue(browser.isElementPresent(getProperty("BOOKING_BOOK")));
+ }
+
+ public SeamSelenium startSecondBrowser()
+ {
+ BROWSER_URL = SECOND_INSTANCE_BROWSER_URL;
+ return super.startBrowser();
+ }
+
+ public void stopSecondBrowser()
+ {
+ browser2.stop();
+ }
+
+ public String getAddressForSecondInstance(SeamSelenium browser)
+ {
+ String[] parsedStrings = browser.getLocation().split("/");
+ StringBuilder sb = new StringBuilder();
+ for (int i = 3; i != parsedStrings.length; i++){
+ sb.append("/").append(parsedStrings[i]);
+ }
+ String sid = browser.getCookieByName("JSESSIONID");
+ String newAddress = sb.toString();
+ String firstPart = newAddress.substring(0, newAddress.indexOf("?"));
+ String secondPart = newAddress.substring(newAddress.indexOf("?") , newAddress.length());
+
+ newAddress = firstPart + ";jsessionid=" + sid + secondPart;
+
+ return newAddress;
+ }
+
+ private void deleteCookies(SeamSelenium browser)
+ {
+ browser.deleteCookie("JSESSIONID", "path=" + CONTEXT_PATH + ", domain=localhost, recurse=true");
+ }
+
+ public boolean login(SeamSelenium browser)
+ {
+ return login(browser, DEFAULT_USERNAME, DEFAULT_PASSWORD);
+ }
+
+ public boolean login(SeamSelenium browser, String username, String password)
+ {
+ if (isLoggedIn(browser))
+ {
+ fail("User already logged in.");
+ }
+
+ browser.open(CONTEXT_PATH + getProperty("HOME_PAGE"));
+ browser.waitForPageToLoad(TIMEOUT);
+
+ if (!browser.getTitle().equals(getProperty("PAGE_TITLE")))
+ {
+ return false;
+ }
+
+ browser.type(getProperty("LOGIN_USERNAME_FIELD"), username);
+ browser.type(getProperty("LOGIN_PASSWORD_FIELD"), password);
+ browser.click(getProperty("LOGIN_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+
+ return isLoggedIn(browser);
+ }
+
+ public void logout(SeamSelenium browser)
+ {
+ if (isLoggedIn(browser))
+ {
+ browser.click(getProperty("LOGOUT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+ }
+
+ public boolean isLoggedIn(SeamSelenium browser)
+ {
+ return browser.isElementPresent(getProperty("LOGOUT"));
+ }
+
+ public void enterSearchQueryUsingAJAX(final SeamSelenium browser, String query)
+ {
+ browser.type(getProperty("SEARCH_STRING_FIELD"), "");
+ browser.type(getProperty("SEARCH_STRING_FIELD"), query.substring(0, query.length() - 1));
+ browser.typeKeys(getProperty("SEARCH_STRING_FIELD"), query.substring(query.length() - 1));
+
+ browser.click(getProperty("SEARCH_SUBMIT"));
+
+ // wait for javascript to show spinner
+ try
+ {
+ Thread.sleep(1000);
+ }
+ catch (InterruptedException e)
+ {
+ }
+
+ // wait for page to get updated
+ new Wait()
+ {
+ @Override
+ public boolean until()
+ {
+ return !browser.isVisible(getProperty("SPINNER"));
+ }
+ }.wait("Spinner hasn't come out.");
+
+ new Wait()
+ {
+ @Override
+ public boolean until()
+ {
+ return (browser.isElementPresent(getProperty("SEARCH_RESULT_TABLE")) ||
+ browser.isElementPresent(getProperty("NO_HOTELS_FOUND")));
+ }
+ }.wait("Search results not found.");
+ }
+}
13 years, 2 months