1 19 20 package org.netbeans.test.web; 21 22 import java.io.File ; 23 import java.io.IOException ; 24 import org.netbeans.jellytools.*; 25 import org.netbeans.jellytools.actions.NewProjectAction; 26 import org.netbeans.jellytools.nodes.Node; 27 import org.netbeans.jemmy.QueueTool; 28 import org.netbeans.jemmy.Timeouts; 29 import org.netbeans.junit.NbTestSuite; 30 import org.netbeans.junit.ide.ProjectSupport; 31 32 36 public class WebProjectValidation13 extends WebProjectValidation { 37 static { 38 PROJECT_NAME = "SampleProject13"; PROJECT_FOLDER = PROJECT_LOCATION+File.separator+PROJECT_NAME; 40 } 41 42 43 public WebProjectValidation13(String name) { 44 super(name); 45 } 46 47 48 public static void main(java.lang.String [] args) { 49 junit.textui.TestRunner.run(suite()); 51 } 54 55 public static NbTestSuite suite() { 56 NbTestSuite suite = new NbTestSuite(); 57 suite.addTest(new WebProjectValidation13("testNewWebProject")); 58 suite.addTest(new WebProjectValidation13("testNewJSP")); 59 suite.addTest(new WebProjectValidation13("testNewJSP2")); 60 suite.addTest(new WebProjectValidation13("testNewServlet")); 61 suite.addTest(new WebProjectValidation13("testNewServlet2")); 62 suite.addTest(new WebProjectValidation13("testBuildProject")); 63 suite.addTest(new WebProjectValidation13("testCompileAllJSP")); 64 suite.addTest(new WebProjectValidation13("testCompileJSP")); 65 suite.addTest(new WebProjectValidation13("testCleanProject")); 66 suite.addTest(new WebProjectValidation13("testRunProject")); 67 suite.addTest(new WebProjectValidation13("testRunJSP")); 68 suite.addTest(new WebProjectValidation13("testRunServlet")); 69 suite.addTest(new WebProjectValidation13("testCreateTLD")); 70 suite.addTest(new WebProjectValidation13("testCreateTagHandler")); 71 suite.addTest(new WebProjectValidation13("testRunTag")); 72 suite.addTest(new WebProjectValidation13("testNewHTML")); 73 suite.addTest(new WebProjectValidation13("testRunHTML")); 74 suite.addTest(new WebProjectValidation13("testNewSegment")); 75 suite.addTest(new WebProjectValidation13("testNewDocument")); 76 suite.addTest(new WebProjectValidation13("testStopTomcat")); 77 suite.addTest(new WebProjectValidation13("testStartTomcat")); 78 suite.addTest(new WebProjectValidation13("testFinish")); 79 80 return suite; 81 } 82 83 91 public void testNewWebProject() throws IOException { 92 installJemmyQueue(); 93 new NewProjectAction().perform(); 94 NewProjectWizardOperator projectWizard = new NewProjectWizardOperator(); 95 String sWeb = Bundle.getStringTrimmed( 96 "org.netbeans.modules.web.core.Bundle", 97 "Templates/JSP_Servlet"); 98 projectWizard.selectCategory(sWeb); 99 String sWeb_Application = Bundle.getStringTrimmed( 100 "org.netbeans.modules.web.project.ui.wizards.Bundle", 101 "Templates/Project/Web/emptyWeb.xml"); 102 projectWizard.selectProject(sWeb_Application); 103 projectWizard.next(); 104 NewWebProjectNameLocationStepOperator nameStep = 105 new NewWebProjectNameLocationStepOperator(); 106 nameStep.txtProjectName().setText(""); 107 nameStep.txtProjectName().typeText(PROJECT_NAME); 108 nameStep.txtProjectLocation().setText(""); 109 nameStep.txtProjectLocation().typeText(PROJECT_LOCATION); 110 String sJ2EE_1_3 = Bundle.getStringTrimmed( 111 "org.netbeans.modules.web.project.ui.wizards.Bundle", 112 "J2EESpecLevel_13"); 113 nameStep.selectJ2EEVersion(sJ2EE_1_3); 114 nameStep.finish(); 115 Timeouts timeouts = nameStep.getTimeouts().cloneThis(); 116 nameStep.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 60000); 117 nameStep.waitClosed(); 118 nameStep.setTimeouts(timeouts); 119 sleep(5000); 121 ProjectSupport.waitScanFinished(); 122 new EditorWindowOperator().getEditor("index.jsp"); Node webPages = new Node(new ProjectsTabOperator(). 126 getProjectRootNode(PROJECT_NAME),"Web Pages"); 127 new Node(webPages,"index.jsp"); new Node(webPages,"WEB-INF|web.xml"); new Node(webPages,"META-INF|context.xml"); ref(Util.dumpProjectView(PROJECT_NAME)); 131 compareReferenceFiles(); 132 } 133 134 protected String getTagHandlerCode() { 135 return "try { JspWriter out = pageContext.getOut(); " + 136 "out.print(\"TagOutput\");} catch (IOException e) {} \n"; 137 } 138 } 139 | Popular Tags |