KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > gui > web > extbrowser > using > Using


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.test.gui.web.extbrowser.using;
21
22 import org.netbeans.jellytools.JellyTestCase;
23 import org.netbeans.jellytools.Bundle;
24 import org.netbeans.jellytools.ExplorerOperator;
25 import org.netbeans.jellytools.OptionsOperator;
26 import org.netbeans.jellytools.NbDialogOperator;
27
28 import org.netbeans.jellytools.properties.ComboBoxProperty;
29 import org.netbeans.jellytools.properties.PropertySheetTabOperator;
30 import org.netbeans.jellytools.properties.PropertySheetOperator;
31 import org.netbeans.jellytools.properties.editors.FileCustomEditorOperator;
32 import org.netbeans.jellytools.actions.Action;
33
34
35
36 import org.netbeans.test.gui.web.util.BrowserUtils;
37
38 import org.netbeans.jemmy.operators.JButtonOperator;
39 import org.netbeans.jemmy.operators.JTextFieldOperator;
40 import org.netbeans.jemmy.operators.JTextComponentOperator;
41 import org.netbeans.junit.NbTestSuite;
42 import java.io.File JavaDoc;
43
44 public class Using extends JellyTestCase {
45     private static String JavaDoc fSep = System.getProperty("file.separator");
46     private static String JavaDoc iSep = "|";
47    
48
49     public Using(java.lang.String JavaDoc testName) {
50         super(testName);
51     }
52
53     public static void main(java.lang.String JavaDoc[] args) {
54         junit.textui.TestRunner.run(suite());
55     }
56          
57     //method required by JUnit
58
public static junit.framework.Test suite() {
59     if(System.getProperty("os.name").indexOf("Windows")!=-1) { //Add WINDOWS tests
60

61         }else { //Add UNIX tests
62

63     }
64     return new NbTestSuite(Using.class);
65     }
66
67     /**
68        Using : External (Command Line) : Internet Explorer 5.x in Path
69      **/

70     public void testEBCLIeInPath() {
71     String JavaDoc ie = BrowserUtils.getIEInPath();
72     if(ie == null) {
73         fail("Internet Explorer not found in path");
74     }
75     BrowserUtils.setCLBrowser();
76     BrowserUtils.setCLBrowserCommand(ie);
77     view();
78     }
79     /**
80        Using : External (Command Line) : Internet Explorer 5.x FullPath
81      **/

82     public void testEBCLIeFullPath() {
83     String JavaDoc iefp = BrowserUtils.getIEFullPath();
84     if(iefp == null) {
85         fail("Internet Explorer not found. See output for details.");
86     }
87     BrowserUtils.setCLBrowser();
88     BrowserUtils.setCLBrowserCommand(iefp);
89     view();
90     }
91
92     /**
93        Using: External (Command Line) : Netscape Navigator 4.7x in Path
94      **/

95
96     public void testEBCLNetscapeInPath() {
97     String JavaDoc ns = BrowserUtils.getNetscapeInPath();
98     if(ns == null) {
99         fail("Netscape not found in path");
100     }
101     BrowserUtils.setCLBrowser();
102     BrowserUtils.setCLBrowserCommand(ns);
103     view();
104     }
105
106     /**
107        Using: External (Command Line) : Netscape Navigator 4.7x FullPath
108      **/

109
110     public void testEBCLNetscapeFullPath() {
111     String JavaDoc nsfp = BrowserUtils.getNetscapeFullPath();
112     if(nsfp == null) {
113         fail("Netscape not found. See output for details.");
114     }
115     BrowserUtils.setCLBrowser();
116     BrowserUtils.setCLBrowserCommand(nsfp);
117     view();
118     }
119
120     /**
121        Using: External (Command Line) : Netscape 6.x in Path
122      **/

123
124     public void testEBCLNetscape6InPath() {
125     String JavaDoc ns = BrowserUtils.getNetscape6InPath();
126     if(ns == null) {
127         fail("Netscape6 not found in path.");
128     }
129     BrowserUtils.setCLBrowser();
130     BrowserUtils.setCLBrowserCommand(ns);
131     System.out.println("before view");
132     view();
133     System.out.println("after view");
134     if(BrowserUtils.handleErrorInCLBrowser()) {
135         fail("Problems in starting Netscape6 in path.");
136     }
137     System.out.println("ended test");
138     }
139
140     /**
141        Using: External (Command Line) : Netscape 6.x FullPath
142      **/

143
144     public void testEBCLNetscape6FullPath() {
145     String JavaDoc nsfp = BrowserUtils.getNetscape6FullPath();
146     if(nsfp == null) {
147         fail("Netscape6 not found. See output for details.");
148     }
149     BrowserUtils.setCLBrowser();
150     BrowserUtils.setCLBrowserCommand(nsfp);
151     view();
152     }
153
154     /****
155      End of EBCL section
156      ****/

157     /****
158      External Browser(Unix) section
159      ****/

160
161
162     /**
163        Using: External (Unix) : Netscape in Path
164      **/

165
166     public void testEBUNetscapeInPath() {
167     String JavaDoc ns = BrowserUtils.getNetscapeInPath();
168     if(ns == null) {
169         fail("Netscape not found.");
170     }
171     BrowserUtils.setExternalUnixBrowser();
172     BrowserUtils.setEBUBrowserCommand(ns);
173     view();
174     }
175
176     /**
177        Using: External (Unix) : Netscape FullPath
178      **/

179
180     public void testEBUNetscapeFullPath() {
181     String JavaDoc nsfp = BrowserUtils.getNetscapeFullPath();
182     if(nsfp == null) {
183         fail("Netscape not found. See output for details.");
184     }
185     BrowserUtils.setExternalUnixBrowser();
186     BrowserUtils.setEBUBrowserCommand(nsfp);
187     view();
188     }
189
190    
191     /****
192      End of EBU section
193     ****/

194
195
196     /****
197      External Browser(Windows) section
198      ****/

199
200
201     /**
202        Using: External (Windows) : Netscape
203      **/

204
205     public void testEBWNetscape() {
206     BrowserUtils.setExternalWinBrowser();
207     BrowserUtils.setDDEServerNetscape();
208     view();
209     }
210
211     /**
212        Using: External (Windows) : Netscape6
213      **/

214
215     public void testEBWNetscape6() {
216     BrowserUtils.setExternalWinBrowser();
217     BrowserUtils.setDDEServerNetscape6();
218     view();
219     }
220
221
222     /**
223        Using: External (Windows) : Internet Explorer
224      **/

225
226     public void testEBWExplorer() {
227     BrowserUtils.setExternalWinBrowser();
228     BrowserUtils.setDDEServerExplorer();
229     view();
230     }
231
232
233    
234     /****
235      End of EBU section
236     ****/

237
238
239
240
241     /**must be last test in this suite. See bug #
242        Using: Swing HTML browser
243      **/

244
245     public void testSwingBrowser() {
246     BrowserUtils.setSwingBrowser();
247     view();
248     }
249     
250
251
252     /**
253        Private methods
254      **/

255     public void view() {
256     String JavaDoc menuPath = "View|Web Browser"; //NOI18N
257
new Action(menuPath,null).performMenu();
258     }
259 }
260
261
262
263
264
265
266
267
268
Popular Tags