KickJava   Java API By Example, From Geeks To Geeks.

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


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  * SimpleExtBrowserTest.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 java.io.IOException JavaDoc;
31 import java.net.URL JavaDoc;
32 import org.openide.ErrorManager;
33 import org.openide.NotifyDescriptor;
34 import org.openide.awt.HtmlBrowser;
35 import org.openide.execution.NbProcessDescriptor;
36 import org.openide.util.HelpCtx;
37 import org.openide.util.NbBundle;
38 import org.openide.util.Utilities;
39          
40 /**
41  *
42  * @author rk109395
43  */

44 public class SimpleExtBrowserTest extends NbTestCase {
45
46     public SimpleExtBrowserTest (java.lang.String JavaDoc testName) {
47         super(testName);
48     }
49         
50     public static void main(java.lang.String JavaDoc[] args) {
51         junit.textui.TestRunner.run(suite());
52     }
53     
54     /** Test of getName method, of class org.netbeans.modules.extbrowser.SimpleExtBrowser. */
55     public void testGetName () {
56         if (testObject.getName () == null)
57             fail ("SimpleExtBrowser.getName () returns <null>.");
58     }
59     
60     /** Test of setNamemethod, of class org.netbeans.modules.extbrowser.SimpleExtBrowser. */
61     public void testSetName () {
62         testObject.setName ("Dummy");
63     }
64     
65     /** Test of createHtmlBrowserImpl method, of class org.netbeans.modules.extbrowser.SimpleExtBrowser. */
66     public void testCreateHtmlBrowserImpl () {
67         if (testObject.createHtmlBrowserImpl () == null)
68             fail ("SimpleExtBrowser.createHtmlBrowserImpl () returns <null>.");
69     }
70     
71     /** Test of getBrowserExecutable method, of class org.netbeans.modules.extbrowser.SimpleExtBrowser. */
72     public void testGetBrowserExecutable () {
73         if (testObject.getBrowserExecutable () == null)
74             fail ("SimpleExtBrowser.getBrowserExecutable () returns <null>.");
75     }
76     
77     /** Test of setBrowserExecutable method, of class org.netbeans.modules.extbrowser.SimpleExtBrowser. */
78     public void testSetBrowserExecutable () {
79         testObject.setBrowserExecutable (new NbProcessDescriptor ("netscape", ""));
80     }
81     
82     /** Test of addPropertyChangeListener method, of class org.netbeans.modules.extbrowser.SimpleExtBrowser. */
83     public void testAddPropertyChangeListener () {
84         testObject.addPropertyChangeListener (new PropertyChangeListener () {
85             public void propertyChange (PropertyChangeEvent evt) {}
86         });
87     }
88     
89     /** Test of removePropertyChangeListener method, of class org.netbeans.modules.extbrowser.SimpleExtBrowser. */
90     public void testRemovePropertyChangeListener () {
91         testObject.removePropertyChangeListener (new PropertyChangeListener () {
92             public void propertyChange (PropertyChangeEvent evt) {}
93         });
94     }
95     
96     public static Test suite () {
97         TestSuite suite = new NbTestSuite (SimpleExtBrowserTest.class);
98         
99         return suite;
100     }
101     
102     // Add test methods here, they have to start with 'test' name.
103
// for example:
104
// public void testHello() {}
105
protected SimpleExtBrowser testObject;
106     
107     protected void setUp () {
108         testObject = new SimpleExtBrowser ();
109     }
110
111 }
112
Popular Tags