KickJava   Java API By Example, From Geeks To Geeks.

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


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
21 package org.netbeans.modules.extbrowser;
22
23 import junit.framework.*;
24 import org.netbeans.junit.*;
25 import java.awt.*;
26 import java.beans.*;
27 import java.io.*;
28 import java.net.*;
29 import java.util.ResourceBundle JavaDoc;
30 import javax.swing.*;
31 import org.openide.*;
32 import org.openide.awt.HtmlBrowser;
33 import org.openide.execution.NbProcessDescriptor;
34 import org.openide.util.NbBundle;
35 import org.openide.util.Utilities;
36 import org.openide.options.SystemOption;
37 import org.openide.util.RequestProcessor;
38
39 /**
40  *
41  * @author rk109395
42  */

43 public class UnixBrowserImplTest extends NbTestCase {
44
45     public UnixBrowserImplTest (java.lang.String JavaDoc testName) {
46         super(testName);
47     }
48         
49     public static void main(java.lang.String JavaDoc[] args) {
50         junit.textui.TestRunner.run(suite());
51     }
52     
53     /** Test of backward method, of class org.netbeans.modules.extbrowser.UnixBrowserImpl. */
54     public void testBackward () {
55         if (!org.openide.util.Utilities.isUnix ())
56             return;
57         testObject.backward ();
58     }
59     
60     /** Test of forward method, of class org.netbeans.modules.extbrowser.UnixBrowserImpl. */
61     public void testForward () {
62         if (!org.openide.util.Utilities.isUnix ())
63             return;
64         testObject.forward ();
65     }
66     
67     /** Test of isBackward method, of class org.netbeans.modules.extbrowser.UnixBrowserImpl. */
68     public void testIsBackward () {
69         if (!org.openide.util.Utilities.isUnix ())
70             return;
71         testObject.isBackward ();
72     }
73     
74     /** Test of isForward method, of class org.netbeans.modules.extbrowser.UnixBrowserImpl. */
75     public void testIsForward () {
76         if (!org.openide.util.Utilities.isUnix ())
77             return;
78         testObject.isForward ();
79     }
80     
81     /** Test of isHistory method, of class org.netbeans.modules.extbrowser.UnixBrowserImpl. */
82     public void testIsHistory () {
83         if (!org.openide.util.Utilities.isUnix ())
84             return;
85         if (testObject.isHistory ())
86             fail ("NbDdeBrowserImpl.isHistory retunred true. It should return false.");
87     }
88     
89     /** Test of reloadDocument method, of class org.netbeans.modules.extbrowser.UnixBrowserImpl. */
90     public void testReloadDocument () {
91         if (!org.openide.util.Utilities.isUnix ())
92             return;
93         testObject.reloadDocument ();
94     }
95     
96     /** Test of setURL method, of class org.netbeans.modules.extbrowser.UnixBrowserImpl. */
97     public void testSetURL () throws java.net.MalformedURLException JavaDoc {
98         if (!org.openide.util.Utilities.isUnix ())
99             return;
100         testObject.setURL (new java.net.URL JavaDoc ("http://www.netbeans.org/"));
101     }
102     
103     /** Test of showHistory method, of class org.netbeans.modules.extbrowser.UnixBrowserImpl. */
104     public void testShowHistory () {
105         if (!org.openide.util.Utilities.isUnix ())
106             return;
107         testObject.showHistory ();
108     }
109     
110     /** Test of stopLoading method, of class org.netbeans.modules.extbrowser.UnixBrowserImpl. */
111     public void testStopLoading () {
112         if (!org.openide.util.Utilities.isUnix ())
113             return;
114         testObject.stopLoading ();
115     }
116     
117     public static Test suite () {
118         TestSuite suite = new NbTestSuite (UnixBrowserImplTest.class);
119         
120         return suite;
121     }
122     
123     // Add test methods here, they have to start with 'test' name.
124
// for example:
125
// public void testHello() {}
126
protected HtmlBrowser.Impl testObject;
127     
128     protected void setUp () {
129         if (org.openide.util.Utilities.isUnix ())
130             testObject = new ExtWebBrowser ().createHtmlBrowserImpl ();
131     }
132
133 }
134
Popular Tags