001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portalweb.portlet.calendar;
022:
023: import com.liferay.portalweb.portal.BaseTestCase;
024:
025: /**
026: * <a href="GetEventsTest.java.html"><b><i>View Source</i></b></a>
027: *
028: * @author Brian Wing Shun Chan
029: *
030: */
031: public class GetEventsTest extends BaseTestCase {
032: public void testGetEvents() throws Exception {
033: selenium.click("link=Day");
034: selenium.waitForPageToLoad("30000");
035:
036: for (int second = 0;; second++) {
037: if (second >= 60) {
038: fail("timeout");
039: }
040:
041: try {
042: if (selenium.isElementPresent("link=Test Event")) {
043: break;
044: }
045: } catch (Exception e) {
046: }
047:
048: Thread.sleep(1000);
049: }
050:
051: selenium.click("link=Week");
052: selenium.waitForPageToLoad("30000");
053:
054: for (int second = 0;; second++) {
055: if (second >= 60) {
056: fail("timeout");
057: }
058:
059: try {
060: if (selenium.isElementPresent("link=Test Event")) {
061: break;
062: }
063: } catch (Exception e) {
064: }
065:
066: Thread.sleep(1000);
067: }
068:
069: selenium.click("link=Month");
070: selenium.waitForPageToLoad("30000");
071:
072: for (int second = 0;; second++) {
073: if (second >= 60) {
074: fail("timeout");
075: }
076:
077: try {
078: if (selenium.isElementPresent("link=Test Event")) {
079: break;
080: }
081: } catch (Exception e) {
082: }
083:
084: Thread.sleep(1000);
085: }
086:
087: selenium.click("link=Events");
088: selenium.waitForPageToLoad("30000");
089:
090: for (int second = 0;; second++) {
091: if (second >= 60) {
092: fail("timeout");
093: }
094:
095: try {
096: if (selenium.isElementPresent("link=Test Event")) {
097: break;
098: }
099: } catch (Exception e) {
100: }
101:
102: Thread.sleep(1000);
103: }
104: }
105: }
|