1 19 20 package gui.propertyeditors; 21 22 import org.netbeans.jellytools.properties.editors.ServiceTypeCustomEditorOperator; 23 24 import org.netbeans.junit.NbTestSuite; 25 26 31 public class PropertyType_Executor extends PropertyEditorsTest { 32 33 public String propertyName_L; 34 public String propertyValue_L; 35 public String propertyValueExpectation_L; 36 37 public boolean waitDialog = false; 38 39 40 public PropertyType_Executor(String testName) { 41 super(testName); 42 } 43 44 45 public void setUp(){ 46 propertyName_L = "Executor"; 47 super.setUp(); 48 } 49 50 public static NbTestSuite suite() { 51 NbTestSuite suite = new NbTestSuite(); 52 suite.addTest(new PropertyType_Executor("testByCombo")); 53 suite.addTest(new PropertyType_Executor("verifyCustomizer")); 54 suite.addTest(new PropertyType_Executor("testCustomizerOk")); 55 suite.addTest(new PropertyType_Executor("testCustomizerCancel")); 56 return suite; 57 } 58 59 public void testByCombo(){ 60 propertyValue_L = org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.core.execution.beaninfo.editors.Bundle", "LAB_NoExecutor"); propertyValueExpectation_L = propertyValue_L; 62 waitDialog = false; 63 setByCombo(propertyName_L, propertyValue_L, true); 64 } 65 66 public void testCustomizerOk(){ 67 propertyValue_L = org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.core.execution.beaninfo.Bundle", "CTL_ProcessExecutor"); propertyValueExpectation_L = propertyValue_L; 69 waitDialog = false; 70 setByCustomizerOk(propertyName_L, true); 71 } 72 73 public void testCustomizerCancel(){ 74 propertyValue_L = org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.core.execution.beaninfo.Bundle", "CTL_ThreadExecutor"); propertyValueExpectation_L = propertyValue_L; 76 waitDialog = false; 77 setByCustomizerCancel(propertyName_L, false); 78 } 79 80 public void testCustomizerOk_platform(){ 81 propertyValue_L = org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.core.execution.beaninfo.editors.Bundle", "LAB_NoExecutor"); propertyValueExpectation_L = propertyValue_L; 83 waitDialog = false; 84 setByCustomizerOk(propertyName_L, true); 85 } 86 87 public void testCustomizerCancel_platform(){ 88 propertyValue_L = org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.core.execution.beaninfo.editors.Bundle", "LAB_NoExecutor"); propertyValueExpectation_L = propertyValue_L; 90 waitDialog = false; 91 setByCustomizerCancel(propertyName_L, false); 92 } 93 94 public void verifyCustomizer() { 95 verifyCustomizer(propertyName_L); 96 } 97 98 public void setCustomizerValue() { 99 ServiceTypeCustomEditorOperator customizer = new ServiceTypeCustomEditorOperator(propertyCustomizer); 100 customizer.setServiceTypeValue(propertyValue_L); 101 } 102 103 public void verifyPropertyValue(boolean expectation) { 104 verifyExpectationValue(propertyName_L,expectation, propertyValueExpectation_L, propertyValue_L, waitDialog); 105 } 106 107 public void verifyCustomizerLayout() { 108 ServiceTypeCustomEditorOperator customizer = new ServiceTypeCustomEditorOperator(propertyCustomizer); 109 customizer.lstServices(); 110 customizer.propertySheet(); 111 customizer.btOK(); 112 customizer.btCancel(); 113 } 114 115 118 public static void main(String [] args) { 119 junit.textui.TestRunner.run(suite()); 121 } 122 123 } 124 | Popular Tags |