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