1 19 20 package org.netbeans.test.gui.web.extbrowser.settings; 21 22 import org.netbeans.jellytools.JellyTestCase; 23 import org.netbeans.jellytools.Bundle; 24 import org.netbeans.jellytools.ExplorerOperator; 25 import org.netbeans.jellytools.OptionsOperator; 26 import org.netbeans.jellytools.NbDialogOperator; 27 28 import org.netbeans.jellytools.properties.ComboBoxProperty; 29 import org.netbeans.jellytools.properties.PropertySheetTabOperator; 30 import org.netbeans.jellytools.properties.PropertySheetOperator; 31 import org.netbeans.jellytools.properties.editors.FileCustomEditorOperator; 32 33 34 35 36 import org.netbeans.test.gui.web.util.BrowserUtils; 37 38 import org.netbeans.jemmy.operators.JButtonOperator; 39 import org.netbeans.jemmy.operators.JTextFieldOperator; 40 import org.netbeans.jemmy.operators.JTextComponentOperator; 41 import org.netbeans.junit.NbTestSuite; 42 import java.io.File ; 43 44 public class JspAndServletSettings extends JellyTestCase { 45 private static String fSep = System.getProperty("file.separator"); 46 private static String iSep = "|"; 47 48 49 public JspAndServletSettings(java.lang.String testName) { 50 super(testName); 51 } 52 53 public static void main(java.lang.String [] args) { 54 junit.textui.TestRunner.run(suite()); 55 } 56 57 public static junit.framework.Test suite() { 59 return new NbTestSuite(JspAndServletSettings.class); 60 } 61 62 65 public void testEBU() { 66 String newVal = Bundle.getString("org.netbeans.modules.extbrowser.Bundle" ,"Services/Browsers/UnixWebBrowser.settings"); 67 testSystemValue(newVal); 68 } 69 70 73 public void testEBCL() { 74 String newVal = Bundle.getString("org.netbeans.modules.extbrowser.Bundle" ,"Services/Browsers/SimpleExtBrowser.settings"); 75 testSystemValue(newVal); 76 } 77 78 81 public void testSwing() { 82 String newVal = Bundle.getString("org.netbeans.core.ui.Bundle" ,"Services/Browsers/SwingBrowser.ser"); 83 testSystemValue(newVal); 84 } 85 86 87 private void testSystemValue(String newVal) { 88 OptionsOperator oo = OptionsOperator.invoke(); 89 String dae = Bundle.getString("org.netbeans.core.Bundle", "UI/Services/DebuggingAndExecuting"); 90 String sett = Bundle.getString("org.netbeans.modules.web.core.Bundle","Services/JSP_Servlet/org-netbeans-modules-web-core-ServletSettings.settings"); 91 oo.selectOption(dae + iSep + sett); 92 PropertySheetOperator pso = PropertySheetOperator.invoke(); 93 PropertySheetTabOperator psto = new PropertySheetTabOperator(pso); 94 String pnameWebBrowser = Bundle.getString("org.netbeans.modules.web.core.Bundle" ,"PROP_WWWBrowser"); 95 ComboBoxProperty pr = new ComboBoxProperty(psto, pnameWebBrowser); 96 pr.setValue(newVal); 97 if (!pr.getValue().equals(newVal)) { 98 fail("Web Browser is not changed"); 99 } 100 oo.close(); 101 oo = OptionsOperator.invoke(); 102 oo.selectOption(dae + iSep + sett); 103 pso = PropertySheetOperator.invoke(); 104 psto = new PropertySheetTabOperator(pso); 105 pr = new ComboBoxProperty(psto, pnameWebBrowser); 106 if (!pr.getValue().equals(newVal)) { 107 fail("Web Browser property not saved"); 108 } 109 } 110 } 111 112 113 114 115 116 117 118 119 120 121 | Popular Tags |