1 19 20 package gui.propertyeditors; 21 22 import gui.propertyeditors.utilities.CoreSupport; 23 import org.netbeans.jellytools.properties.editors.FileCustomEditorOperator; 24 25 import org.netbeans.jemmy.EventTool; 26 27 import org.netbeans.junit.NbTestSuite; 28 29 30 35 public class PropertyType_File extends PropertyEditorsTest { 36 37 public String propertyName_L; 38 public String propertyValue_L; 39 public String propertyValueExpectation_L; 40 41 public boolean waitDialog = false; 42 43 44 public PropertyType_File(String testName) { 45 super(testName); 46 } 47 48 public void setUp(){ 49 propertyName_L = "File"; 50 propertyValue_L = new java.io.File (CoreSupport.getSampleProjectPath(this),"build.xml").getPath(); 51 log("=========== File to be set {"+propertyValue_L+"}"); 52 super.setUp(); 53 } 54 55 public static NbTestSuite suite() { 56 NbTestSuite suite = new NbTestSuite(); 57 suite.addTest(new PropertyType_File("verifyCustomizer")); 58 suite.addTest(new PropertyType_File("testByInPlace")); 59 suite.addTest(new PropertyType_File("testCustomizerCancel")); 60 suite.addTest(new PropertyType_File("testCustomizerOk")); 61 return suite; 62 } 63 64 public void testCustomizerOk() { 65 propertyValueExpectation_L = propertyValue_L; 66 waitDialog = false; 67 setByCustomizerOk(propertyName_L, true); 68 } 69 70 public void testCustomizerCancel(){ 71 propertyValueExpectation_L = propertyValue_L; 72 waitDialog = false; 73 setByCustomizerCancel(propertyName_L, false); 74 } 75 76 public void testByInPlace(){ 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 FileCustomEditorOperator customizer = new FileCustomEditorOperator(propertyCustomizer); 88 new EventTool().waitNoEvent(1000); 89 customizer.setFileValue(propertyValue_L); 90 } 91 92 public void verifyPropertyValue(boolean expectation) { 93 verifyExpectationValue(propertyName_L,expectation, propertyValueExpectation_L, propertyValue_L, waitDialog); 94 } 95 96 public void verifyCustomizerLayout() { 97 FileCustomEditorOperator customizer = new FileCustomEditorOperator(propertyCustomizer); 98 customizer.verify(); 99 customizer.btOK(); 100 customizer.btCancel(); 101 } 102 103 106 public static void main(String [] args) { 107 junit.textui.TestRunner.run(suite()); 109 } 110 } 111 | Popular Tags |