001: /*
002: DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:
004: Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:
006:
007: The contents of this file are subject to the terms of either the GNU
008: General Public License Version 2 only ("GPL") or the Common
009: Development and Distribution License("CDDL") (collectively, the
010: "License"). You may not use this file except in compliance with the
011: License. You can obtain a copy of the License at
012: http://www.netbeans.org/cddl-gplv2.html
013: or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
014: specific language governing permissions and limitations under the
015: License. When distributing the software, include this License Header
016: Notice in each file and include the License file at
017: nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
018: particular file as subject to the "Classpath" exception as provided
019: by Sun in the GPL Version 2 section of the License file that
020: accompanied this code. If applicable, add the following below the
021: License Header, with the fields enclosed by brackets [] replaced by
022: your own identifying information:
023: "Portions Copyrighted [year] [name of copyright owner]"
024:
025: Contributor(s):
026:
027: The Original Software is NetBeans. The Initial Developer of the Original
028: Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
029: Microsystems, Inc. All Rights Reserved.
030:
031: If you wish your version of this file to be governed by only the CDDL
032: or only the GPL Version 2, indicate your decision by adding
033: "[Contributor] elects to include this software in this distribution
034: under the [CDDL or GPL Version 2] license." If you do not indicate a
035: single choice of license, a recipient has the option to distribute
036: your version of this file under either the CDDL, the GPL Version 2 or
037: to extend the choice of license to its licensees as provided above.
038: However, if you add GPL Version 2 code and therefore, elected the GPL
039: Version 2 license, then the option applies only if the new code is
040: made subject to such option by the copyright holder.
041: */
042: package org.netbeans.test.dataprovider.cachedrowsetdataprovider;
043:
044: import java.util.*;
045: import java.io.*;
046: import junit.framework.Test;
047: import junit.framework.*;
048: import org.netbeans.junit.*;
049: import org.netbeans.modules.visualweb.gravy.*;
050: import org.netbeans.jemmy.*;
051: import org.netbeans.test.dataprovider.common.*;
052:
053: public class CachedRowSetDataProvider_AcceptanceTests extends BaseTests {
054: static {
055: TEST_METHOD_ARRAY = new String[] { "testAcceptance_01",
056: "testAcceptance_02", "testAcceptance_03",
057: "testAcceptance_04", "testAcceptance_05",
058: "testAcceptance_06", "testAcceptance_07",
059: "testAcceptance_08", "testAcceptance_09",
060:
061: "testAcceptance_00" };
062: }
063:
064: public CachedRowSetDataProvider_AcceptanceTests(String testName) {
065: super (testName);
066: }
067:
068: public static Test suite() {
069: return suite(CachedRowSetDataProvider_AcceptanceTests.class,
070: "CachedRowSet DataProvider Acceptance Tests");
071: }
072:
073: public void testAcceptance_04() { // bind Drop Dow List to DB table
074: Utils.logMsg("=== testAcceptance_04() ===");
075: if (errMsg != null)
076: fail(STOP_TEST_BECAUSE_PREVIOUS_TEST_FAILS);
077:
078: //JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK);
079: Util.wait(1000);
080: errMsg = new PersonDropDownList().makePersonDropDownList();
081: Util.wait(1000);
082: new QueueTool().waitEmpty();
083: if (errMsg != null) {
084: fail(errMsg);
085: }
086: }
087:
088: public void testAcceptance_05() { // bind Table to DB table
089: Utils.logMsg("=== testAcceptance_05() ===");
090: if (errMsg != null)
091: fail(STOP_TEST_BECAUSE_PREVIOUS_TEST_FAILS);
092:
093: //JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK);
094: Util.wait(1000);
095: TripTable tripTable = new TripTable();
096: errMsg = tripTable.makeTripTable();
097: Util.wait(500);
098: new QueueTool().waitEmpty();
099: if (errMsg != null) {
100: fail(errMsg);
101: }
102: }
103:
104: public void testAcceptance_06() { // modify java code for Drop Down List event handler and method prerender()
105: Utils.logMsg("=== testAcceptance_06() ===");
106: if (errMsg != null)
107: fail(STOP_TEST_BECAUSE_PREVIOUS_TEST_FAILS);
108:
109: //JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK);
110: Util.wait(1000);
111: String componentID = TestPropertiesHandler
112: .getTestProperty("ID_DropDownList_For_DBTablePerson");
113: errMsg = new PersonDropDownList(componentID).modifyJavaCode();
114: Util.wait(1000);
115: new QueueTool().waitEmpty();
116: if (errMsg != null) {
117: fail(errMsg);
118: }
119: }
120:
121: /**
122: Test case for checking the bug
123: http://www.netbeans.org/issues/show_bug.cgi?id=119529
124: */
125: public void testAcceptance_07() { // bind Text Field to DB table
126: Utils.logMsg("=== testAcceptance_07() ===");
127: if (errMsg != null)
128: fail(STOP_TEST_BECAUSE_PREVIOUS_TEST_FAILS);
129:
130: //JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK);
131: Util.wait(1000);
132: TextFieldPageBeanDataProvider textField = new TextFieldPageBeanDataProvider();
133: errMsg = textField.makeTextField();
134: Util.wait(500);
135: new QueueTool().waitEmpty();
136: if (errMsg != null) {
137: fail(errMsg);
138: }
139: }
140:
141: /**
142: Test case for checking the bug
143: http://www.netbeans.org/issues/show_bug.cgi?id=119919
144: */
145: public void testAcceptance_08() { // bind Text Field to data provider from SessionBean
146: Utils.logMsg("=== testAcceptance_08() ===");
147: if (errMsg != null)
148: fail(STOP_TEST_BECAUSE_PREVIOUS_TEST_FAILS);
149:
150: //JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK);
151: Util.wait(1000);
152: TextFieldSessionBeanDataProvider textField = new TextFieldSessionBeanDataProvider();
153: errMsg = textField.makeTextField();
154: Util.wait(500);
155: new QueueTool().waitEmpty();
156: if (errMsg != null) {
157: fail(errMsg);
158: }
159: }
160:
161: public void testAcceptance_09() { // run a project and check a working of a web-application
162: Utils.logMsg("=== testAcceptance_09() ===");
163: if (errMsg != null)
164: fail(STOP_TEST_BECAUSE_PREVIOUS_TEST_FAILS);
165:
166: //JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK);
167: Util.wait(1000);
168: RunProject runProjectInstance = new RunProject();
169: errMsg = runProjectInstance.runProject();
170: webResponseCode = runProjectInstance.getWebResponseCode();
171: Util.wait(1000);
172: new QueueTool().waitEmpty();
173: if (errMsg != null) {
174: fail(errMsg);
175: }
176: }
177: }
|