1 19 20 package gui.propertyeditors; 21 22 import gui.propertyeditors.utilities.CoreSupport; 23 24 import org.netbeans.jellytools.properties.editors.ProcessDescriptorCustomEditorOperator; 25 26 import org.netbeans.junit.NbTestSuite; 27 28 33 public class PropertyType_NbProcessDescriptor extends PropertyEditorsTest { 34 35 public String propertyName_L; 36 public String propertyValue_L; 37 public String propertyValueExpectation_L; 38 39 public boolean waitDialog = false; 40 41 private String DELIM = ";"; 42 43 private static String FS_Data_path; 44 45 46 public PropertyType_NbProcessDescriptor(String testName) { 47 super(testName); 48 } 49 50 51 public void setUp(){ 52 propertyName_L = "NbProcessDescriptor"; 53 super.setUp(); 54 } 55 56 public static NbTestSuite suite() { 57 58 String path = ""; 61 62 FS_Data_path = path.substring(0,path.lastIndexOf(System.getProperty("file.separator"))); 63 64 NbTestSuite suite = new NbTestSuite(); 65 suite.addTest(new PropertyType_NbProcessDescriptor("testByInPlace")); 66 suite.addTest(new PropertyType_NbProcessDescriptor("verifyCustomizer")); 67 suite.addTest(new PropertyType_NbProcessDescriptor("testCustomizerCancel")); 68 suite.addTest(new PropertyType_NbProcessDescriptor("testCustomizerOk")); 69 return suite; 70 } 71 72 73 public void testCustomizerOk() { 74 propertyValue_L = FS_Data_path + DELIM + "okArgument"; 75 propertyValueExpectation_L = FS_Data_path + " okArgument"; 76 waitDialog = false; 77 setByCustomizerOk(propertyName_L, true); 78 } 79 80 public void testCustomizerCancel(){ 81 propertyValue_L = "cancel" + DELIM + "cancel_argument"; 82 propertyValueExpectation_L = propertyValue_L; 83 waitDialog = false; 84 setByCustomizerCancel(propertyName_L, false); 85 } 86 87 public void testByInPlace(){ 88 propertyValue_L = "process argument"; 89 propertyValueExpectation_L = propertyValue_L; 90 waitDialog = false; 91 setByInPlace(propertyName_L, propertyValue_L, true); 92 } 93 94 public void verifyCustomizer() { 95 verifyCustomizer(propertyName_L); 96 } 97 98 public void setCustomizerValue() { 99 ProcessDescriptorCustomEditorOperator customizer = new ProcessDescriptorCustomEditorOperator(propertyCustomizer); 100 101 int index = propertyValue_L.indexOf(DELIM); 102 String process = propertyValue_L.substring(0,index); 103 String argument = propertyValue_L.substring(index + DELIM.length()); 104 105 customizer.setProcess(process); 106 customizer.setArguments(argument); 107 108 } 109 110 public void verifyPropertyValue(boolean expectation) { 111 verifyExpectationValue(propertyName_L,expectation, propertyValueExpectation_L, propertyValue_L, waitDialog); 112 } 113 114 public void verifyCustomizerLayout() { 115 ProcessDescriptorCustomEditorOperator customizer = new ProcessDescriptorCustomEditorOperator(propertyCustomizer); 116 customizer.verify(); 117 customizer.btOK(); 118 customizer.btCancel(); 119 } 120 121 124 public static void main(String [] args) { 125 junit.textui.TestRunner.run(suite()); 127 } 128 129 } 130 | Popular Tags |