1 24 25 package org.netbeans.modules.extbrowser; 26 27 import junit.framework.*; 28 import org.netbeans.junit.*; 29 import java.awt.*; 30 import java.awt.event.*; 31 import java.beans.*; 32 import java.net.*; 33 import javax.swing.*; 34 import java.util.ResourceBundle ; 35 import java.util.StringTokenizer ; 36 import java.util.Timer ; 37 import java.util.TimerTask ; 38 import java.util.Vector ; 39 import org.openide.NotifyDescriptor; 40 import org.openide.ErrorManager; 41 import org.openide.awt.HtmlBrowser; 42 import org.openide.execution.NbProcessDescriptor; 43 import org.openide.options.SystemOption; 44 import org.openide.util.SharedClassObject; 45 import org.openide.util.Utilities; 46 import org.openide.util.NbBundle; 47 48 52 public class NbDdeBrowserImplTest extends NbTestCase { 53 54 public NbDdeBrowserImplTest (java.lang.String testName) { 55 super(testName); 56 } 57 58 public static void main(java.lang.String [] args) { 59 junit.textui.TestRunner.run(suite()); 60 } 61 62 private NbDdeBrowserImpl getDDEBrowserImpl() { 63 return (NbDdeBrowserImpl)((DelegatingWebBrowserImpl)testObject).getImplementation(); 64 } 65 66 67 public void testGetBrowserPath () throws NbBrowserException { 68 if (!org.openide.util.Utilities.isWindows ()) 69 return; 70 getDDEBrowserImpl().getBrowserPath ("IEXPLORE"); 71 } 72 73 74 public void testGetDefaultOpenCommand () throws NbBrowserException { 75 if (!org.openide.util.Utilities.isWindows ()) 76 return; 77 getDDEBrowserImpl().getDefaultOpenCommand (); 78 } 79 80 81 public void testBackward () { 82 if (!org.openide.util.Utilities.isWindows ()) 83 return; 84 85 testObject.backward (); 86 } 87 88 89 public void testForward () { 90 if (!org.openide.util.Utilities.isWindows ()) 91 return; 92 testObject.forward (); 93 } 94 95 96 public void testIsBackward () { 97 if (!org.openide.util.Utilities.isWindows ()) 98 return; 99 testObject.isBackward (); 100 } 101 102 103 public void testIsForward () { 104 if (!org.openide.util.Utilities.isWindows ()) 105 return; 106 testObject.isForward (); 107 } 108 109 110 public void testIsHistory () { 111 if (!org.openide.util.Utilities.isWindows ()) 112 return; 113 if (testObject.isHistory ()) 114 fail ("NbDdeBrowserImpl.isHistory retunred true. It should return false."); 115 } 116 117 118 public void testReloadDocument () { 119 if (!org.openide.util.Utilities.isWindows ()) 120 return; 121 testObject.reloadDocument (); 122 } 123 124 125 public void testSetURL () throws java.net.MalformedURLException { 126 if (!org.openide.util.Utilities.isWindows ()) 127 return; 128 testObject.setURL (new java.net.URL ("http://www.netbeans.org/")); 129 } 130 131 132 public void testShowHistory () { 133 if (!org.openide.util.Utilities.isWindows ()) 134 return; 135 testObject.showHistory (); 136 } 137 138 139 public void testStopLoading () { 140 if (!org.openide.util.Utilities.isWindows ()) 141 return; 142 testObject.stopLoading (); 143 } 144 145 public static Test suite () { 146 TestSuite suite = new NbTestSuite (NbDdeBrowserImplTest.class); 147 148 return suite; 149 } 150 151 protected ExtBrowserImpl testObject; 155 156 protected void setUp () { 157 if (org.openide.util.Utilities.isWindows ()) 158 testObject = (ExtBrowserImpl)new ExtWebBrowser ().createHtmlBrowserImpl (); 159 } 160 161 } 162 | Popular Tags |