1 19 20 package org.netbeans.qa.form.options; 21 22 import org.netbeans.qa.form.*; 23 import org.netbeans.qa.form.visualDevelopment.*; 24 import org.netbeans.jellytools.modules.form.ComponentInspectorOperator; 25 import org.netbeans.jellytools.modules.form.FormDesignerOperator; 26 import org.netbeans.jellytools.properties.Property; 27 import org.netbeans.junit.NbTestSuite; 28 import org.netbeans.jellytools.actions.*; 29 import org.netbeans.jellytools.*; 30 import org.netbeans.jellytools.nodes.Node; 31 import org.netbeans.jellytools.properties.Property; 32 import org.netbeans.qa.form.ExtJellyTestCase; 33 import java.util.*; 34 35 40 public class GeneratedComponentsDestionationTest extends ExtJellyTestCase { 41 42 43 public GeneratedComponentsDestionationTest(String testName) { 44 super(testName); 45 } 46 47 48 public static void main(java.lang.String [] args) { 49 junit.textui.TestRunner.run(suite()); 50 } 51 52 53 public static NbTestSuite suite() { 54 NbTestSuite suite = new NbTestSuite(); 55 56 suite.addTest(new GeneratedComponentsDestionationTest("testGeneratedComponentsDestionationLocal")); suite.addTest(new GeneratedComponentsDestionationTest("testGeneratedComponentsDestionationClassField")); 59 return suite; 60 } 61 62 65 public void testGeneratedComponentsDestionationLocal() { 66 testGeneratedComponentsDestionation(true); 67 } 68 69 72 public void testGeneratedComponentsDestionationClassField() { 73 testGeneratedComponentsDestionation(false); 74 } 75 76 81 private void testGeneratedComponentsDestionation(Boolean local) { 82 OptionsOperator.invoke(); 83 OptionsOperator options = new OptionsOperator(); 84 options.switchToClassicView(); 85 waitAMoment(); 86 87 options.selectOption("Editing|GUI Builder"); waitAMoment(); 89 90 Property property = new Property(options.getPropertySheet("Editing|GUI Builder"), "Variables Modifier"); property.setValue("private"); 93 property = new Property(options.getPropertySheet("Editing|GUI Builder"), "Local Variables"); property.setValue(String.valueOf(local)); 95 options.close(); 96 waitAMoment(); 97 98 String name = createJFrameFile(); 99 waitAMoment(); 100 101 FormDesignerOperator designer = new FormDesignerOperator(name); 102 ComponentInspectorOperator inspector = new ComponentInspectorOperator(); 103 Node node = new Node(inspector.treeComponents(), "JFrame"); 105 runPopupOverNode("Add From Palette|Swing Controls|Label", node); waitAMoment(); 107 108 String code = "private javax.swing.JLabel jLabel1"; if (local) 110 missInCode(code, designer); 111 else 112 findInCode(code, designer); 113 114 waitAMoment(); 115 removeFile(name); 116 } 117 } | Popular Tags |