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 SystemSettings extends JellyTestCase { 45 private static String fSep = System.getProperty("file.separator"); 46 private static String iSep = "|"; 47 48 49 public SystemSettings(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(SystemSettings.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 ideConfiguration = Bundle.getString("org.netbeans.core.Bundle", "UI/Services/IDEConfiguration"); 90 String sys = Bundle.getString("org.netbeans.core.Bundle", "UI/Services/IDEConfiguration/System"); 91 String sett = Bundle.getString("org.netbeans.core.Bundle","Services/org-netbeans-core-IDESettings.settings"); 92 oo.selectOption(ideConfiguration + iSep + sys + iSep + sett); 93 PropertySheetOperator pso = PropertySheetOperator.invoke(); 94 PropertySheetTabOperator psto = new PropertySheetTabOperator(pso); 95 String pnameWebBrowser = Bundle.getString("org.netbeans.modules.web.core.Bundle" ,"PROP_WWWBrowser"); 96 ComboBoxProperty pr = new ComboBoxProperty(psto, pnameWebBrowser); 97 pr.setValue(newVal); 98 if (!pr.getValue().equals(newVal)) { 99 fail("Web Browser is not changed"); 100 } 101 oo.close(); 102 oo = OptionsOperator.invoke(); 103 oo.selectOption(ideConfiguration + iSep + sys + iSep + sett); 104 pso = PropertySheetOperator.invoke(); 105 psto = new PropertySheetTabOperator(pso); 106 pr = new ComboBoxProperty(psto, pnameWebBrowser); 107 if (!pr.getValue().equals(newVal)) { 108 fail("Web Browser property not saved"); 109 } 110 } 111 } 112 113 114 115 116 117 118 119 120 | Popular Tags |