KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > extbrowser > ExtWebBrowserTest


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  * ExtWebBrowserTest.java
20  * NetBeans JUnit based test
21  *
22  * Created on November 2, 2001, 10:42 AM
23  */

24
25 package org.netbeans.modules.extbrowser;
26
27 import junit.framework.*;
28 import org.netbeans.junit.*;
29 import java.beans.*;
30 import org.openide.ErrorManager;
31 import org.openide.execution.NbProcessDescriptor;
32 import org.openide.util.NbBundle;
33 import org.openide.awt.HtmlBrowser;
34
35 /**
36  *
37  * @author rk109395
38  */

39 public class ExtWebBrowserTest extends NbTestCase {
40
41     public ExtWebBrowserTest (java.lang.String JavaDoc testName) {
42         super(testName);
43     }
44         
45     public static void main(java.lang.String JavaDoc[] args) {
46         junit.textui.TestRunner.run(suite());
47     }
48     
49     /** Test of getDescription method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
50 /* public void testGetName () {
51         if (testObject.getName () == null)
52             fail ("ExtWebBrowser.getName () returns <null>.");
53     }
54  */

55     
56     /** Test of getBrowserExecutable method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
57     public void testGetBrowserExecutable () {
58         if (testObject.getBrowserExecutable () == null)
59             fail ("ExtWebBrowser.getBrowserExecutable () returns <null>.");
60     }
61     
62     /** Test of setBrowserExecutable method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
63     public void testSetBrowserExecutable () {
64         testObject.setBrowserExecutable (new NbProcessDescriptor ("netscape", ""));
65     }
66     
67     /** Test of isStartWhenNotRunning method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
68     /*public void testIsStartWhenNotRunning () {
69         testObject.isStartWhenNotRunning ();
70     } */

71     
72     /** Test of setStartWhenNotRunning method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
73     /*public void testSetStartWhenNotRunning () {
74         testObject.setStartWhenNotRunning (true);
75     } */

76     
77     /** Test of defaultBrowserExecutable method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
78     public void testDefaultBrowserExecutable () {
79         if (testObject.defaultBrowserExecutable () == null)
80             fail ("ExtWebBrowser.defaultBrowserExecutable () failed.");
81     }
82     
83     /** Test of createHtmlBrowserImpl method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
84     public void testCreateHtmlBrowserImpl () {
85         testObject.createHtmlBrowserImpl ();
86     }
87     
88     /** Test of addPropertyChangeListener method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
89     public void testAddPropertyChangeListener () {
90         testObject.addPropertyChangeListener (new PropertyChangeListener () {
91             public void propertyChange (PropertyChangeEvent evt) {}
92         });
93     }
94     
95     /** Test of removePropertyChangeListener method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
96     public void testRemovePropertyChangeListener () {
97         testObject.removePropertyChangeListener (new PropertyChangeListener () {
98             public void propertyChange (PropertyChangeEvent evt) {}
99         });
100     }
101     
102     /** Test of getDDEServer method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
103     public void testGetDDEServer () {
104         testObject.getDDEServer ();
105     }
106     
107     /** Test of setDDEServer method, of class org.netbeans.modules.extbrowser.ExtWebBrowser. */
108     public void testSetDDEServer () {
109         testObject.setDDEServer ("NETSCAPE");
110     }
111     
112     public static Test suite () {
113         TestSuite suite = new NbTestSuite (ExtWebBrowserTest.class);
114         
115         return suite;
116     }
117     
118     // Add test methods here, they have to start with 'test' name.
119
// for example:
120
// public void testHello() {}
121
protected ExtWebBrowser testObject;
122     
123     protected void setUp () {
124         testObject = new ExtWebBrowser ();
125     }
126     
127 }
128
Popular Tags