Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 1089 invoked from network); 3 Nov 2008 19:30:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Nov 2008 19:30:16 -0000 Received: (qmail 64440 invoked by uid 500); 3 Nov 2008 19:30:22 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 64387 invoked by uid 500); 3 Nov 2008 19:30:22 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 64378 invoked by uid 99); 3 Nov 2008 19:30:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 11:30:22 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 19:29:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 159EA23889B7; Mon, 3 Nov 2008 11:29:45 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710138 - in /geronimo/devtools/eclipse-plugin/branches/2.1.4: eclipse/ testsuite/eclipse/ testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ Date: Mon, 03 Nov 2008 19:29:44 -0000 To: scm@geronimo.apache.org From: mcconne@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081103192945.159EA23889B7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mcconne Date: Mon Nov 3 11:29:44 2008 New Revision: 710138 URL: http://svn.apache.org/viewvc?rev=710138&view=rev Log: GERONIMODEVTOOLS-527 Upgrade testsuite to use Ganymede SR1 Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/eclipse/build.xml geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/eclipse/build.xml geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ProjectTasks.java geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/eclipse/build.xml URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/eclipse/build.xml?rev=710138&r1=710137&r2=710138&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/branches/2.1.4/eclipse/build.xml (original) +++ geronimo/devtools/eclipse-plugin/branches/2.1.4/eclipse/build.xml Mon Nov 3 11:29:44 2008 @@ -26,10 +26,10 @@ - - - - + + + + Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/eclipse/build.xml URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/eclipse/build.xml?rev=710138&r1=710137&r2=710138&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/eclipse/build.xml (original) +++ geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/eclipse/build.xml Mon Nov 3 11:29:44 2008 @@ -29,10 +29,10 @@ - - - - + + + + Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ProjectTasks.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ProjectTasks.java?rev=710138&r1=710137&r2=710138&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ProjectTasks.java (original) +++ geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ProjectTasks.java Mon Nov 3 11:29:44 2008 @@ -1,171 +1,172 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.geronimo.testsuite.common.ui; - -import java.io.FileInputStream; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.widgets.Shell; - -import abbot.swt.finder.generic.MultipleFoundException; -import abbot.swt.finder.generic.NotFoundException; - -public class ProjectTasks { - Shell workbenchShell; - AbbotHelper aHelper; - String serverVersion; - - public ProjectTasks (Shell shell, AbbotHelper helper, String serverVersion) { - workbenchShell = shell; - aHelper = helper; - this.serverVersion = serverVersion; - } - - public void createProjects() throws Exception { - createEARProject (); - createEJBProject (); - createWARProject (); - copyCode (); - } - - private void createEARProject() throws MultipleFoundException, NotFoundException { - Shell wizardShell = aHelper.clickMenuItem (workbenchShell, - new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, - "New"); - - aHelper.clickTreeItem (wizardShell, - new String[] {"Java EE", "Enterprise Application Project"}); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "", "SampleEAR"); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.clickButton (wizardShell, "Generate Deployment Descriptor"); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "default", "sampleear"); - aHelper.setTextField(wizardShell, "", "sample-ear"); - aHelper.setTextField(wizardShell, "car", "ear"); - aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); - - aHelper.waitForDialogDisposal (wizardShell); - } - - private void createEJBProject() throws MultipleFoundException, NotFoundException { - Shell wizardShell = aHelper.clickMenuItem (workbenchShell, - new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, - "New"); - - aHelper.clickTreeItem (wizardShell, - new String[] {"EJB", "EJB Project"}); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "", "SampleEJB"); - aHelper.clickButton (wizardShell, "Add project to an EAR"); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.clickButton (wizardShell, "Create an EJB Client JAR module to hold the client interfaces and classes."); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "default", "sampleear"); - aHelper.setTextField(wizardShell, "", "sample-ejb"); - aHelper.setTextField(wizardShell, "car", "ejb"); - aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); - - aHelper.waitForDialogDisposal (wizardShell); - - aHelper.doubleClickItem(workbenchShell, "ejbModule"); - aHelper.doubleClickItem(workbenchShell, "META-INF"); - Shell questionShell = aHelper.rightClickItem(workbenchShell, "openejb-jar.xml", - new String[] {"&Delete"}, "Delete Resources"); - aHelper.clickButton (questionShell, IDialogConstants.OK_LABEL); - aHelper.waitForDialogDisposal (questionShell); - } - - private void createWARProject() throws MultipleFoundException, NotFoundException { - Shell wizardShell = aHelper.clickMenuItem (workbenchShell, - new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, - "New"); - - aHelper.clickTreeItem (wizardShell, - new String[] {"Web", "Dynamic Web Project"}); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "", "SampleWAR"); - aHelper.clickButton (wizardShell, "Add project to an EAR"); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "default", "sampleear"); - aHelper.setTextField(wizardShell, "", "sample-war"); - aHelper.setTextField(wizardShell, "car", "war"); - aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); - - aHelper.waitForDialogDisposal (wizardShell); - } - - private void copyCode () throws Exception { - aHelper.clickItem (workbenchShell, "SampleWAR"); - Shell propShell = aHelper.clickMenuItem (workbenchShell, - new String[] {"&Project", "&Properties"}, - "Properties for SampleWAR"); - aHelper.clickItem (propShell, "Java EE Module Dependencies"); - aHelper.clickButton (propShell, "Select &All"); - aHelper.clickButton (propShell, "&Apply"); - aHelper.clickButton (propShell, IDialogConstants.OK_LABEL); - - IWorkspaceRoot aWSRoot = ResourcesPlugin.getWorkspace().getRoot(); - IProject aProject = aWSRoot.getProject ("SampleEJB"); - IFolder aFolder = aProject.getFolder("ejbModule/sampleear"); - aFolder.create (false, true, null); - String fileDir = aWSRoot.getLocation().toOSString() + "/src/main/resources/ui-tutorial"; - IFile aFile = aProject.getFile("ejbModule/sampleear/RemoteBusinessInterface.java"); - aFile.create(new FileInputStream (fileDir + "/RemoteBusinessInterface.java"), true, null); - aFile = aProject.getFile("ejbModule/sampleear/MyStatelessSessionBean.java"); - aFile.create(new FileInputStream (fileDir + "/MyStatelessSessionBean.java"), true, null); - - aProject = aWSRoot.getProject ("SampleWAR"); - aFolder = aProject.getFolder("src/sampleear"); - aFolder.create (false, true, null); - aFile = aProject.getFile("WebContent/index.jsp"); - aFile.create(new FileInputStream (fileDir + "/index.jsp"), true, null); - // have to go through Servlet Creation dialog to make the web.xml correct - Shell servletShell = aHelper.rightClickItem(workbenchShell, "SampleWAR", - new String [] {"&New", "Servlet"}, "Create Servlet"); - aHelper.setCursorText("MyServlet"); - aHelper.setTextField(servletShell, "", "sampleear"); - aHelper.clickButton (servletShell, IDialogConstants.NEXT_LABEL); - aHelper.clickItem(servletShell, "/MyServlet"); - Shell urlShell = aHelper.clickEnabledButton (servletShell, "Edit...", "URL Mappings"); - aHelper.setTextField(urlShell, "/MyServlet", "/sayHello"); - aHelper.clickButton (urlShell, IDialogConstants.OK_LABEL); - aHelper.clickButton (servletShell, IDialogConstants.FINISH_LABEL); - - // copy over the correct contents - aFile = aProject.getFile("src/sampleear/MyServlet.java"); - aFile.setContents(new FileInputStream (fileDir + "/MyServlet.java"), true, true, null); - } - - public void deleteProject (String projectName) throws MultipleFoundException, NotFoundException { - Shell questionShell = aHelper.rightClickItem (workbenchShell, projectName, - new String[] {"&Delete"}, "Delete Resources"); - - // use .* to signify use of a wildcard - aHelper.clickButton (questionShell, "&Delete project contents.*"); - aHelper.clickButton (questionShell, IDialogConstants.OK_LABEL); - aHelper.waitForDialogDisposal (questionShell); - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.testsuite.common.ui; + +import java.io.FileInputStream; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.swt.widgets.Shell; + +import abbot.swt.finder.generic.MultipleFoundException; +import abbot.swt.finder.generic.NotFoundException; + +public class ProjectTasks { + Shell workbenchShell; + AbbotHelper aHelper; + String serverVersion; + + public ProjectTasks (Shell shell, AbbotHelper helper, String serverVersion) { + workbenchShell = shell; + aHelper = helper; + this.serverVersion = serverVersion; + } + + public void createProjects() throws Exception { + createEARProject (); + createEJBProject (); + createWARProject (); + copyCode (); + } + + private void createEARProject() throws MultipleFoundException, NotFoundException { + Shell wizardShell = aHelper.clickMenuItem (workbenchShell, + new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, + "New"); + + aHelper.clickTreeItem (wizardShell, + new String[] {"Java EE", "Enterprise Application Project"}); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "", "SampleEAR"); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.clickButton (wizardShell, "Generate Deployment Descriptor"); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "default", "sampleear"); + aHelper.setTextField(wizardShell, "", "sample-ear"); + aHelper.setTextField(wizardShell, "car", "ear"); + aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); + + aHelper.waitForDialogDisposal (wizardShell); + } + + private void createEJBProject() throws MultipleFoundException, NotFoundException { + Shell wizardShell = aHelper.clickMenuItem (workbenchShell, + new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, + "New"); + + aHelper.clickTreeItem (wizardShell, + new String[] {"EJB", "EJB Project"}); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "", "SampleEJB"); + aHelper.clickButton (wizardShell, "Add &project to an EAR"); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.clickButton (wizardShell, "Create an EJB Client JAR module to hold the client interfaces and classes."); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "default", "sampleear"); + aHelper.setTextField(wizardShell, "", "sample-ejb"); + aHelper.setTextField(wizardShell, "car", "ejb"); + aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); + + aHelper.waitForDialogDisposal (wizardShell); + + aHelper.doubleClickItem(workbenchShell, "SampleEJB"); + aHelper.doubleClickItem(workbenchShell, "ejbModule"); + aHelper.doubleClickItem(workbenchShell, "META-INF"); + Shell questionShell = aHelper.rightClickItem(workbenchShell, "openejb-jar.xml", + new String[] {"&Delete"}, "Delete Resources"); + aHelper.clickButton (questionShell, IDialogConstants.OK_LABEL); + aHelper.waitForDialogDisposal (questionShell); + } + + private void createWARProject() throws MultipleFoundException, NotFoundException { + Shell wizardShell = aHelper.clickMenuItem (workbenchShell, + new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, + "New"); + + aHelper.clickTreeItem (wizardShell, + new String[] {"Web", "Dynamic Web Project"}); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "", "SampleWAR"); + aHelper.clickButton (wizardShell, "Add &project to an EAR"); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "default", "sampleear"); + aHelper.setTextField(wizardShell, "", "sample-war"); + aHelper.setTextField(wizardShell, "car", "war"); + aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); + + aHelper.waitForDialogDisposal (wizardShell); + } + + private void copyCode () throws Exception { + aHelper.clickItem (workbenchShell, "SampleWAR"); + Shell propShell = aHelper.clickMenuItem (workbenchShell, + new String[] {"&Project", "&Properties"}, + "Properties for SampleWAR"); + aHelper.clickItem (propShell, "Java EE Module Dependencies"); + aHelper.clickButton (propShell, "Select &All"); + aHelper.clickButton (propShell, "&Apply"); + aHelper.clickButton (propShell, IDialogConstants.OK_LABEL); + + IWorkspaceRoot aWSRoot = ResourcesPlugin.getWorkspace().getRoot(); + IProject aProject = aWSRoot.getProject ("SampleEJB"); + IFolder aFolder = aProject.getFolder("ejbModule/sampleear"); + aFolder.create (false, true, null); + String fileDir = aWSRoot.getLocation().toOSString() + "/src/main/resources/ui-tutorial"; + IFile aFile = aProject.getFile("ejbModule/sampleear/RemoteBusinessInterface.java"); + aFile.create(new FileInputStream (fileDir + "/RemoteBusinessInterface.java"), true, null); + aFile = aProject.getFile("ejbModule/sampleear/MyStatelessSessionBean.java"); + aFile.create(new FileInputStream (fileDir + "/MyStatelessSessionBean.java"), true, null); + + aProject = aWSRoot.getProject ("SampleWAR"); + aFolder = aProject.getFolder("src/sampleear"); + aFolder.create (false, true, null); + aFile = aProject.getFile("WebContent/index.jsp"); + aFile.create(new FileInputStream (fileDir + "/index.jsp"), true, null); + // have to go through Servlet Creation dialog to make the web.xml correct + Shell servletShell = aHelper.rightClickItem(workbenchShell, "SampleWAR", + new String [] {"&New", "Servlet"}, "Create Servlet"); + aHelper.setCursorText("MyServlet"); + aHelper.setTextField(servletShell, "", "sampleear"); + aHelper.clickButton (servletShell, IDialogConstants.NEXT_LABEL); + aHelper.clickItem(servletShell, "/MyServlet"); + Shell urlShell = aHelper.clickEnabledButton (servletShell, "Edit...", "URL Mappings"); + aHelper.setTextField(urlShell, "/MyServlet", "/sayHello"); + aHelper.clickButton (urlShell, IDialogConstants.OK_LABEL); + aHelper.clickButton (servletShell, IDialogConstants.FINISH_LABEL); + + // copy over the correct contents + aFile = aProject.getFile("src/sampleear/MyServlet.java"); + aFile.setContents(new FileInputStream (fileDir + "/MyServlet.java"), true, true, null); + } + + public void deleteProject (String projectName) throws MultipleFoundException, NotFoundException { + Shell questionShell = aHelper.rightClickItem (workbenchShell, projectName, + new String[] {"&Delete"}, "Delete Resources"); + + // use .* to signify use of a wildcard + aHelper.clickButton (questionShell, "&Delete project contents.*"); + aHelper.clickButton (questionShell, IDialogConstants.OK_LABEL); + aHelper.waitForDialogDisposal (questionShell); + } + +} Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java?rev=710138&r1=710137&r2=710138&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java (original) +++ geronimo/devtools/eclipse-plugin/branches/2.1.4/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java Mon Nov 3 11:29:44 2008 @@ -1,188 +1,189 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.geronimo.testsuite.common.ui; - -import java.io.FileInputStream; - -import org.apache.geronimo.testsuite.common.AssertUtil; -import org.apache.geronimo.testsuite.common.selenium.EclipseSelenium; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.widgets.Shell; - -import abbot.swt.finder.generic.MultipleFoundException; -import abbot.swt.finder.generic.NotFoundException; - -/** - * Tutorial5Minute - * - * @version $Rev: 679174 $ $Date: 2008-07-23 12:52:55 -0700 (Wed, 23 Jul 2008) $ - */ -public class Tutorial5Minute { - - Shell workbenchShell; - AbbotHelper aHelper; - - public Tutorial5Minute (Shell shell, AbbotHelper helper) { - workbenchShell = shell; - aHelper = helper; - } - - public void createProjects() throws Exception { - createEARProject (); - createEJBProject (); - createWARProject (); - copyCode (); - } - - private void createEARProject() throws MultipleFoundException, NotFoundException { - Shell wizardShell = aHelper.clickMenuItem (workbenchShell, - new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, - "New"); - - aHelper.clickTreeItem (wizardShell, - new String[] {"Java EE", "Enterprise Application Project"}); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "", "SampleEAR"); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.clickButton (wizardShell, "Generate Deployment Descriptor"); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "default", "sampleear"); - aHelper.setTextField(wizardShell, "", "sample-ear"); - aHelper.setTextField(wizardShell, "car", "ear"); - aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); - - aHelper.waitForDialogDisposal (wizardShell); - } - - private void createEJBProject() throws MultipleFoundException, NotFoundException { - Shell wizardShell = aHelper.clickMenuItem (workbenchShell, - new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, - "New"); - - aHelper.clickTreeItem (wizardShell, - new String[] {"EJB", "EJB Project"}); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "", "SampleEJB"); - aHelper.clickButton (wizardShell, "Add project to an EAR"); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.clickButton (wizardShell, "Create an EJB Client JAR module to hold the client interfaces and classes."); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "default", "sampleear"); - aHelper.setTextField(wizardShell, "", "sample-ejb"); - aHelper.setTextField(wizardShell, "car", "ejb"); - aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); - - aHelper.waitForDialogDisposal (wizardShell); - - aHelper.doubleClickItem(workbenchShell, "ejbModule"); - aHelper.doubleClickItem(workbenchShell, "META-INF"); - Shell questionShell = aHelper.rightClickItem(workbenchShell, "openejb-jar.xml", - new String[] {"&Delete"}, "Delete Resources"); - aHelper.clickButton (questionShell, IDialogConstants.OK_LABEL); - aHelper.waitForDialogDisposal (questionShell); - } - - private void createWARProject() throws MultipleFoundException, NotFoundException { - Shell wizardShell = aHelper.clickMenuItem (workbenchShell, - new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, - "New"); - - aHelper.clickTreeItem (wizardShell, - new String[] {"Web", "Dynamic Web Project"}); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "", "SampleWAR"); - aHelper.clickButton (wizardShell, "Add project to an EAR"); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); - aHelper.setTextField(wizardShell, "default", "sampleear"); - aHelper.setTextField(wizardShell, "", "sample-war"); - aHelper.setTextField(wizardShell, "car", "war"); - aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); - - aHelper.waitForDialogDisposal (wizardShell); - } - - private void copyCode () throws Exception { - aHelper.clickItem (workbenchShell, "SampleWAR"); - Shell propShell = aHelper.clickMenuItem (workbenchShell, - new String[] {"&Project", "&Properties"}, - "Properties for SampleWAR"); - aHelper.clickItem (propShell, "Java EE Module Dependencies"); - aHelper.clickButton (propShell, "Select &All"); - aHelper.clickButton (propShell, "&Apply"); - aHelper.clickButton (propShell, IDialogConstants.OK_LABEL); - - IWorkspaceRoot aWSRoot = ResourcesPlugin.getWorkspace().getRoot(); - IProject aProject = aWSRoot.getProject ("SampleEJB"); - IFolder aFolder = aProject.getFolder("ejbModule/sampleear"); - aFolder.create (false, true, null); - String fileDir = aWSRoot.getLocation().toOSString() + "/src/main/resources/ui-tutorial"; - IFile aFile = aProject.getFile("ejbModule/sampleear/RemoteBusinessInterface.java"); - aFile.create(new FileInputStream (fileDir + "/RemoteBusinessInterface.java"), true, null); - aFile = aProject.getFile("ejbModule/sampleear/MyStatelessSessionBean.java"); - aFile.create(new FileInputStream (fileDir + "/MyStatelessSessionBean.java"), true, null); - - aProject = aWSRoot.getProject ("SampleWAR"); - aFolder = aProject.getFolder("src/sampleear"); - aFolder.create (false, true, null); - aFile = aProject.getFile("WebContent/index.jsp"); - aFile.create(new FileInputStream (fileDir + "/index.jsp"), true, null); - // have to go through Servlet Creation dialog to make the web.xml correct - Shell servletShell = aHelper.rightClickItem(workbenchShell, "SampleWAR", - new String [] {"&New", "Servlet"}, "Create Servlet"); - aHelper.setCursorText("MyServlet"); - aHelper.setTextField(servletShell, "", "sampleear"); - aHelper.clickButton (servletShell, IDialogConstants.NEXT_LABEL); - aHelper.clickItem(servletShell, "/MyServlet"); - Shell urlShell = aHelper.clickEnabledButton (servletShell, "Edit...", "URL Mappings"); - aHelper.setTextField(urlShell, "/MyServlet", "/sayHello"); - aHelper.clickButton (urlShell, IDialogConstants.OK_LABEL); - aHelper.clickButton (servletShell, IDialogConstants.FINISH_LABEL); - - // copy over the correct contents - aFile = aProject.getFile("src/sampleear/MyServlet.java"); - aFile.setContents(new FileInputStream (fileDir + "/MyServlet.java"), true, true, null); - - // close the open file - aHelper.clickMenuItem (workbenchShell, - new String[] {"&File", "&Close"}); - } - - - public void webTesting () throws Exception { - EclipseSelenium selenium = new EclipseSelenium(); - selenium.start(); - selenium.open( "http://localhost:8080/SampleWAR/"); - selenium.type("name", "Tom"); - selenium.click("submit"); - selenium.waitForPageToLoad( "3000" ); - AssertUtil.assertTrue(selenium.getHtmlSource().indexOf( "says hello to" ) > 0); - - // TODO fill in a name and click the Process button - // This is a problem, HTML objects are not the same as SWT objects and - // Abbot cannot find these - //aHelper.setTextField(workbenchShell, "", "MyName"); - //aHelper.clickButton (workbenchShell, "Press me!"); - selenium.stop(); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.geronimo.testsuite.common.ui; + +import java.io.FileInputStream; + +import org.apache.geronimo.testsuite.common.AssertUtil; +import org.apache.geronimo.testsuite.common.selenium.EclipseSelenium; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.swt.widgets.Shell; + +import abbot.swt.finder.generic.MultipleFoundException; +import abbot.swt.finder.generic.NotFoundException; + +/** + * Tutorial5Minute + * + * @version $Rev: 679174 $ $Date: 2008-07-23 12:52:55 -0700 (Wed, 23 Jul 2008) $ + */ +public class Tutorial5Minute { + + Shell workbenchShell; + AbbotHelper aHelper; + + public Tutorial5Minute (Shell shell, AbbotHelper helper) { + workbenchShell = shell; + aHelper = helper; + } + + public void createProjects() throws Exception { + createEARProject (); + createEJBProject (); + createWARProject (); + copyCode (); + } + + private void createEARProject() throws MultipleFoundException, NotFoundException { + Shell wizardShell = aHelper.clickMenuItem (workbenchShell, + new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, + "New"); + + aHelper.clickTreeItem (wizardShell, + new String[] {"Java EE", "Enterprise Application Project"}); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "", "SampleEAR"); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.clickButton (wizardShell, "Generate Deployment Descriptor"); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "default", "sampleear"); + aHelper.setTextField(wizardShell, "", "sample-ear"); + aHelper.setTextField(wizardShell, "car", "ear"); + aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); + + aHelper.waitForDialogDisposal (wizardShell); + } + + private void createEJBProject() throws MultipleFoundException, NotFoundException { + Shell wizardShell = aHelper.clickMenuItem (workbenchShell, + new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, + "New"); + + aHelper.clickTreeItem (wizardShell, + new String[] {"EJB", "EJB Project"}); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "", "SampleEJB"); + aHelper.clickButton (wizardShell, "Add &project to an EAR"); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.clickButton (wizardShell, "Create an EJB Client JAR module to hold the client interfaces and classes."); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "default", "sampleear"); + aHelper.setTextField(wizardShell, "", "sample-ejb"); + aHelper.setTextField(wizardShell, "car", "ejb"); + aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); + + aHelper.waitForDialogDisposal (wizardShell); + + aHelper.doubleClickItem(workbenchShell, "SampleEJB"); + aHelper.doubleClickItem(workbenchShell, "ejbModule"); + aHelper.doubleClickItem(workbenchShell, "META-INF"); + Shell questionShell = aHelper.rightClickItem(workbenchShell, "openejb-jar.xml", + new String[] {"&Delete"}, "Delete Resources"); + aHelper.clickButton (questionShell, IDialogConstants.OK_LABEL); + aHelper.waitForDialogDisposal (questionShell); + } + + private void createWARProject() throws MultipleFoundException, NotFoundException { + Shell wizardShell = aHelper.clickMenuItem (workbenchShell, + new String[] {"&File", "&New\tAlt+Shift+N", "&Other..."}, + "New"); + + aHelper.clickTreeItem (wizardShell, + new String[] {"Web", "Dynamic Web Project"}); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "", "SampleWAR"); + aHelper.clickButton (wizardShell, "Add &project to an EAR"); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL); + aHelper.setTextField(wizardShell, "default", "sampleear"); + aHelper.setTextField(wizardShell, "", "sample-war"); + aHelper.setTextField(wizardShell, "car", "war"); + aHelper.clickButton (wizardShell, IDialogConstants.FINISH_LABEL); + + aHelper.waitForDialogDisposal (wizardShell); + } + + private void copyCode () throws Exception { + aHelper.clickItem (workbenchShell, "SampleWAR"); + Shell propShell = aHelper.clickMenuItem (workbenchShell, + new String[] {"&Project", "&Properties"}, + "Properties for SampleWAR"); + aHelper.clickItem (propShell, "Java EE Module Dependencies"); + aHelper.clickButton (propShell, "Select &All"); + aHelper.clickButton (propShell, "&Apply"); + aHelper.clickButton (propShell, IDialogConstants.OK_LABEL); + + IWorkspaceRoot aWSRoot = ResourcesPlugin.getWorkspace().getRoot(); + IProject aProject = aWSRoot.getProject ("SampleEJB"); + IFolder aFolder = aProject.getFolder("ejbModule/sampleear"); + aFolder.create (false, true, null); + String fileDir = aWSRoot.getLocation().toOSString() + "/src/main/resources/ui-tutorial"; + IFile aFile = aProject.getFile("ejbModule/sampleear/RemoteBusinessInterface.java"); + aFile.create(new FileInputStream (fileDir + "/RemoteBusinessInterface.java"), true, null); + aFile = aProject.getFile("ejbModule/sampleear/MyStatelessSessionBean.java"); + aFile.create(new FileInputStream (fileDir + "/MyStatelessSessionBean.java"), true, null); + + aProject = aWSRoot.getProject ("SampleWAR"); + aFolder = aProject.getFolder("src/sampleear"); + aFolder.create (false, true, null); + aFile = aProject.getFile("WebContent/index.jsp"); + aFile.create(new FileInputStream (fileDir + "/index.jsp"), true, null); + // have to go through Servlet Creation dialog to make the web.xml correct + Shell servletShell = aHelper.rightClickItem(workbenchShell, "SampleWAR", + new String [] {"&New", "Servlet"}, "Create Servlet"); + aHelper.setCursorText("MyServlet"); + aHelper.setTextField(servletShell, "", "sampleear"); + aHelper.clickButton (servletShell, IDialogConstants.NEXT_LABEL); + aHelper.clickItem(servletShell, "/MyServlet"); + Shell urlShell = aHelper.clickEnabledButton (servletShell, "Edit...", "URL Mappings"); + aHelper.setTextField(urlShell, "/MyServlet", "/sayHello"); + aHelper.clickButton (urlShell, IDialogConstants.OK_LABEL); + aHelper.clickButton (servletShell, IDialogConstants.FINISH_LABEL); + + // copy over the correct contents + aFile = aProject.getFile("src/sampleear/MyServlet.java"); + aFile.setContents(new FileInputStream (fileDir + "/MyServlet.java"), true, true, null); + + // close the open file + aHelper.clickMenuItem (workbenchShell, + new String[] {"&File", "&Close"}); + } + + + public void webTesting () throws Exception { + EclipseSelenium selenium = new EclipseSelenium(); + selenium.start(); + selenium.open( "http://localhost:8080/SampleWAR/"); + selenium.type("name", "Tom"); + selenium.click("submit"); + selenium.waitForPageToLoad( "3000" ); + AssertUtil.assertTrue(selenium.getHtmlSource().indexOf( "says hello to" ) > 0); + + // TODO fill in a name and click the Process button + // This is a problem, HTML objects are not the same as SWT objects and + // Abbot cannot find these + //aHelper.setTextField(workbenchShell, "", "MyName"); + //aHelper.clickButton (workbenchShell, "Press me!"); + selenium.stop(); + } +}