1 19 20 package gui.propertyeditors; 21 22 import org.netbeans.jellytools.properties.editors.StringCustomEditorOperator; 23 24 import org.netbeans.jemmy.operators.JEditorPaneOperator; 25 26 import org.netbeans.junit.NbTestSuite; 27 28 33 public class PropertyType_Properties extends PropertyEditorsTest { 34 35 public String propertyName_L; 36 public String propertyValue_L; 37 public String propertyValueExpectation_L; 38 39 40 public boolean waitDialog = false; 41 42 43 public PropertyType_Properties(String testName) { 44 super(testName); 45 } 46 47 48 public void setUp(){ 49 propertyName_L = "property_Properties"; 50 super.setUp(); 51 } 52 53 public static NbTestSuite suite() { 54 NbTestSuite suite = new NbTestSuite(); 55 suite.addTest(new PropertyType_Properties("testByInPlace")); 56 suite.addTest(new PropertyType_Properties("verifyCustomizer")); 57 suite.addTest(new PropertyType_Properties("testCustomizerOk")); 58 suite.addTest(new PropertyType_Properties("testCustomizerCancel")); 59 return suite; 60 } 61 62 public void testCustomizerOk() { 63 propertyValue_L = "propertyName1=propertyValue1"; 64 propertyValueExpectation_L = propertyValue_L; 65 waitDialog = false; 66 setByCustomizerOk(propertyName_L, true); 67 } 68 69 public void testCustomizerCancel(){ 70 propertyValue_L = "pp=xx"; 71 waitDialog = false; 72 setByCustomizerCancel(propertyName_L, false); 73 } 74 75 public void testByInPlace(){ 76 propertyValue_L = "propertyName=propertyValue"; 77 propertyValueExpectation_L = propertyValue_L; 78 waitDialog = false; 79 setByInPlace(propertyName_L, propertyValue_L, true); 80 } 81 82 public void verifyCustomizer() { 83 verifyCustomizer(propertyName_L); 84 } 85 86 public void setCustomizerValue() { 87 StringCustomEditorOperator customizer = new StringCustomEditorOperator(propertyCustomizer); 88 new JEditorPaneOperator(customizer).setText(propertyValue_L); 91 } 92 93 public void verifyPropertyValue(boolean expectation) { 94 verifyExpectationValue(propertyName_L,expectation, propertyValueExpectation_L, propertyValue_L, waitDialog); 95 } 96 97 public void verifyCustomizerLayout() { 98 StringCustomEditorOperator customizer = new StringCustomEditorOperator(propertyCustomizer); 99 new JEditorPaneOperator(customizer); 100 customizer.btOK(); 101 customizer.btCancel(); 102 } 103 104 107 public static void main(String [] args) { 108 junit.textui.TestRunner.run(suite()); 110 } 111 112 } 113 | Popular Tags |