1 19 20 25 26 package org.netbeans.test.gui.javadoc; 27 28 import java.io.File ; 29 30 import org.netbeans.jellytools.*; 31 32 import org.netbeans.jellytools.actions.Action; 33 import org.netbeans.jellytools.actions.ActionNoBlock; 34 import org.netbeans.jellytools.actions.PropertiesAction; 35 36 import org.netbeans.jellytools.nodes.Node; 37 38 import org.netbeans.jellytools.properties.Property; 39 import org.netbeans.jellytools.properties.PropertySheetOperator; 40 41 import org.netbeans.jemmy.EventTool; 42 import org.netbeans.jemmy.JemmyProperties; 43 44 import org.netbeans.jemmy.operators.JTextFieldOperator; 45 import org.netbeans.jemmy.operators.JTreeOperator; 46 47 52 public class TestGenerateJavadoc extends JavadocTestCase { 53 54 public static final String sep = File.separator; 55 56 59 public TestGenerateJavadoc(String testName) { 60 super(testName); 61 } 62 63 protected void setUp() { 64 new PropertiesAction().perform(); 65 } 66 67 69 147 148 private void verifyCommonJdocFiles(String base, String folder) { 149 assertTrue("index.html doesn't exist!", new File (base + sep + folder + sep + "index.html").exists()); assertTrue("index-all.html doesn't exist!", new File (base + sep + folder + sep + "index-all.html").exists()); assertTrue("allclasses-frame.html doesn't exist!", new File (base + sep + folder + sep + "allclasses-frame.html").exists()); assertTrue("allclasses-noframe.html doesn't exist!", new File (base + sep + folder + sep + "allclasses-noframe.html").exists()); assertTrue("packages.html doesn't exist!", new File (base + sep + folder + sep + "packages.html").exists()); assertTrue("stylesheet.css doesn't exist!", new File (base + sep + folder + sep + "stylesheet.css").exists()); assertTrue("package-list doesn't exist!", new File (base + sep + folder + sep + "package-list").exists()); assertTrue("help-doc.html doesn't exist!", new File (base + sep + folder + sep + "help-doc.html").exists()); assertTrue("overview-tree.html doesn't exist!", new File (base + sep + folder + sep + "overview-tree.html").exists()); } 159 160 private void verifyCommonJdocFilesInFolder(String base, String folder) { 161 assertTrue("package-frame.html doesn't exist!", new File (base + sep + folder + sep + "package-frame.html").exists()); assertTrue("package-summary.html doesn't exist!", new File (base + sep + folder + sep + "package-summary.html").exists()); assertTrue("package-tree.html doesn't exist!", new File (base + sep + folder + sep + "package-tree.html").exists()); } 165 166 211 212 public void testCreateDoclet() { 213 214 String [] docletSettings = new String [] {"Author", "Bottom", "Charset", "Doc Title", "Footer", "Group", 215 "Header", "Help File", "Link", "Linkoffline", "No Deprecated", "No Deprecated List", "No Help", "No Index", 216 "No Navbar", "No Tree", "Split Index", "Style Sheet File", "Use", "Version", "Window Title"}; 217 String [] docletValues = new String [] {"false", "", "", "", "", "", "", "", "", "", "false", "false", "false", 218 "false", "false", "false", "false", "", "false", "false", ""}; 219 220 OptionsOperator optionsOper = OptionsOperator.invoke(); 222 JTreeOperator optionsTreeOper = optionsOper.treeTable().tree(); 223 Node node = new Node(optionsTreeOper, "Code Documentation|Doclets"); 224 ActionNoBlock newAction = new ActionNoBlock(null, "New|Standard Doclet"); 225 newAction.perform(node); 226 WizardOperator newWizard = new WizardOperator("New Wizard - Standard Doclet"); 227 JTextFieldOperator nameOper = new JTextFieldOperator(newWizard); 228 nameOper.typeText("TestDoclet"); 229 newWizard.finish(); 230 231 optionsOper.selectOption("Code Documentation|Doclets|TestDoclet"); 233 PropertySheetOperator propertiesTab = new PropertySheetOperator(optionsOper); 234 for (int i = 0; i < docletSettings.length; i++) { 235 Property docletProp = new Property(propertiesTab, docletSettings[i]); 236 assertTrue("Default value of " + docletSettings[i] + " is not " + docletValues[i], 237 docletProp.getValue().indexOf(docletValues[i]) != -1); 238 } 239 240 optionsOper.close(); 241 242 } 243 public void testCreateExecutor() { 245 246 String [] execSettings = new String [] {"1.1 style", "Enable JDK 1.4 source", "Encoding", 248 "Extdirs", "External Process", "Locale", "Members", "Overview", "Recursive", "Verbose"}; 249 String [] execValues = new String [] {"false", "false", "", "", "External Javadoc Executor", 250 "", "protected", "", "true", "false"}; 251 252 OptionsOperator optionsOper = OptionsOperator.invoke(); 253 JTreeOperator optionsTreeOper = optionsOper.treeTable().tree(); 254 Node node = new Node(optionsTreeOper, "Code Documentation|Javadoc Executors"); 255 ActionNoBlock newAction = new ActionNoBlock(null, "New|External Javadoc"); 256 newAction.perform(node); 257 WizardOperator newWizard = new WizardOperator("New Wizard - External Javadoc"); 258 JTextFieldOperator nameOper = new JTextFieldOperator(newWizard); 259 nameOper.typeText("TestExecutor"); 260 newWizard.finish(); 261 262 optionsOper.selectOption("Code Documentation|Javadoc Executors|TestExecutor"); 264 PropertySheetOperator propertiesTab = new PropertySheetOperator(optionsOper); 265 for (int i = 0; i < execSettings.length; i++) { 266 Property execProp = new Property(propertiesTab, execSettings[i]); 267 assertTrue("Default value of " + execSettings[i] + " is not " + execValues[i], 268 execProp.getValue().indexOf(execValues[i]) != -1); 269 } 270 271 optionsOper.close(); 272 } 273 274 279 } 280 | Popular Tags |