1 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 ; 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 43 public class UnixBrowserImplTest extends NbTestCase { 44 45 public UnixBrowserImplTest (java.lang.String testName) { 46 super(testName); 47 } 48 49 public static void main(java.lang.String [] args) { 50 junit.textui.TestRunner.run(suite()); 51 } 52 53 54 public void testBackward () { 55 if (!org.openide.util.Utilities.isUnix ()) 56 return; 57 testObject.backward (); 58 } 59 60 61 public void testForward () { 62 if (!org.openide.util.Utilities.isUnix ()) 63 return; 64 testObject.forward (); 65 } 66 67 68 public void testIsBackward () { 69 if (!org.openide.util.Utilities.isUnix ()) 70 return; 71 testObject.isBackward (); 72 } 73 74 75 public void testIsForward () { 76 if (!org.openide.util.Utilities.isUnix ()) 77 return; 78 testObject.isForward (); 79 } 80 81 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 90 public void testReloadDocument () { 91 if (!org.openide.util.Utilities.isUnix ()) 92 return; 93 testObject.reloadDocument (); 94 } 95 96 97 public void testSetURL () throws java.net.MalformedURLException { 98 if (!org.openide.util.Utilities.isUnix ()) 99 return; 100 testObject.setURL (new java.net.URL ("http://www.netbeans.org/")); 101 } 102 103 104 public void testShowHistory () { 105 if (!org.openide.util.Utilities.isUnix ()) 106 return; 107 testObject.showHistory (); 108 } 109 110 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 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 |