Author: ljelinko
Date: 2011-11-28 11:20:45 -0500 (Mon, 28 Nov 2011)
New Revision: 36704
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/seam/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/seam/Seam2FacetWizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/SeamPortletTestSuite.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/CreateSeamPortletProject.java
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/aaa
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java
Log:
Created new test for Seam project portlet
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/aaa
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/aaa 2011-11-28
16:20:04 UTC (rev 36703)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/aaa 2011-11-28
16:20:45 UTC (rev 36704)
@@ -1 +1,3 @@
SERVER=EPP,5.1.0,default,/home/ljelinko/programs/jboss/jboss-epp-5.1/jboss-as
+SEAM=2.2,/home/ljelinko/programs/jboss/jboss-epp-5.1/seam
+DB=hsqldb18,internal, , , , ,
\ No newline at end of file
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/seam/Seam2FacetWizardPageFillingTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/seam/Seam2FacetWizardPageFillingTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/seam/Seam2FacetWizardPageFillingTask.java 2011-11-28
16:20:45 UTC (rev 36704)
@@ -0,0 +1,47 @@
+package org.jboss.tools.portlet.ui.bot.task.wizard.web.seam;
+
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
+
+/**
+ * Fills in the Seam configuration on the Seam Facet wizard page.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class Seam2FacetWizardPageFillingTask extends AbstractSWTTask
+ implements WizardPageFillingTask {
+
+ private String runtime;
+
+ private String databaseType;
+
+ private String connectionProfile;
+
+ @Override
+ public void perform() {
+ if (runtime != null){
+ getBot().comboBoxWithLabel("Seam 2 Runtime:").setSelection(runtime);
+ }
+
+ if (databaseType != null){
+ getBot().comboBoxWithLabel("Database Type:").setSelection(databaseType);
+ }
+
+ if (connectionProfile != null){
+ getBot().comboBoxWithLabel("Connection
profile:").setSelection(connectionProfile);
+ }
+ }
+
+ public void setRuntime(String runtime) {
+ this.runtime = runtime;
+ }
+
+ public void setDatabaseType(String databaseType) {
+ this.databaseType = databaseType;
+ }
+
+ public void setConnectionProfile(String connectionProfile) {
+ this.connectionProfile = connectionProfile;
+ }
+}
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java 2011-11-28
16:20:04 UTC (rev 36703)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java 2011-11-28
16:20:45 UTC (rev 36704)
@@ -6,6 +6,7 @@
import org.jboss.tools.portlet.ui.bot.test.jsf.CreateJSFPortlet;
import org.jboss.tools.portlet.ui.bot.test.jsf.CreateJSFPortletProject;
import org.jboss.tools.portlet.ui.bot.test.jsf.RunJSFPortletOnServer;
+import org.jboss.tools.portlet.ui.bot.test.seam.CreateSeamPortletProject;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -16,7 +17,8 @@
RunJavaPortletOnServer.class,
CreateJSFPortletProject.class,
CreateJSFPortlet.class,
- RunJSFPortletOnServer.class
+ RunJSFPortletOnServer.class,
+ CreateSeamPortletProject.class
})
public class AllTestsSuite {
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/SeamPortletTestSuite.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/SeamPortletTestSuite.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/SeamPortletTestSuite.java 2011-11-28
16:20:45 UTC (rev 36704)
@@ -0,0 +1,13 @@
+package org.jboss.tools.portlet.ui.bot.test;
+
+import org.jboss.tools.portlet.ui.bot.test.seam.CreateSeamPortletProject;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+(a)RunWith(RequirementAwareUsageWindowClosingSuite.class)
+(a)Suite.SuiteClasses({
+ CreateSeamPortletProject.class,
+ })
+public class SeamPortletTestSuite {
+
+}
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java 2011-11-28
16:20:04 UTC (rev 36703)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java 2011-11-28
16:20:45 UTC (rev 36704)
@@ -22,14 +22,6 @@
public static final String PROJECT_NAME = "jsf-portlet";
- protected static final FacetDefinition JSF_PORTLET_FACET = new
FacetDefinition("JBoss JSF Portlet", JBOSS_FACET_CATEGORY);
-
- protected static final FacetDefinition JSF_FACET = new FacetDefinition("JavaServer
Faces");
-
- protected static final String FACES_CONFIG_XML =
"WebContent/WEB-INF/faces-config.xml";
-
- protected static final String WEB_APP_LIBRARIES = "Web App Libraries";
-
@Override
public String getProjectName() {
return PROJECT_NAME;
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/CreateSeamPortletProject.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/CreateSeamPortletProject.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/CreateSeamPortletProject.java 2011-11-28
16:20:45 UTC (rev 36704)
@@ -0,0 +1,75 @@
+package org.jboss.tools.portlet.ui.bot.test.seam;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.tools.portlet.ui.bot.entity.FacetDefinition;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
+import
org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossJSFPortletCapabilitiesWizardPageFillingTask;
+import
org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossPortletCapabilitiesWizardPageFillingTask;
+import
org.jboss.tools.portlet.ui.bot.task.wizard.web.seam.Seam2FacetWizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.test.template.CreatePortletProjectTemplate;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+
+
+/**
+ * Creates a new Dynamic Web Project with the specific JBoss Seam Portlet facet.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class CreateSeamPortletProject extends CreatePortletProjectTemplate{
+
+ public static final String PROJECT_NAME = "seam-portlet";
+
+ @Override
+ public String getProjectName() {
+ return PROJECT_NAME;
+ }
+
+ @Override
+ public List<FacetDefinition> getRequiredFacets() {
+ List<FacetDefinition> facets = new ArrayList<FacetDefinition>();
+ facets.add(JAVA_FACET);
+ facets.add(JSF_FACET);
+ facets.add(SEAM_2_FACET);
+ facets.add(CORE_PORTLET_FACET);
+ facets.add(JSF_PORTLET_FACET);
+ facets.add(SEAM_PORTLET_FACET);
+ return facets;
+ }
+
+ @Override
+ public List<WizardPageFillingTask> getAdditionalWizardPages() {
+ List<WizardPageFillingTask> tasks = new
ArrayList<WizardPageFillingTask>();
+ tasks.add(new WizardPageDefaultsFillingTask());
+ tasks.add(new WizardPageDefaultsFillingTask());
+ tasks.add(new
JBossPortletCapabilitiesWizardPageFillingTask(JBossPortletCapabilitiesWizardPageFillingTask.Type.RUNTIME_PROVIDER));
+ tasks.add(new WizardPageDefaultsFillingTask());
+ tasks.add(getSeamFacetPageFillingTask());
+ tasks.add(new
JBossJSFPortletCapabilitiesWizardPageFillingTask(JBossJSFPortletCapabilitiesWizardPageFillingTask.Type.RUNTIME_PROVIDER));
+ return tasks;
+ }
+
+ private WizardPageFillingTask getSeamFacetPageFillingTask() {
+ Seam2FacetWizardPageFillingTask task = new Seam2FacetWizardPageFillingTask();
+ task.setDatabaseType("HSQL");
+ task.setConnectionProfile(SWTTestExt.configuredState.getDB().name);
+ return task;
+ }
+
+ @Override
+ public List<String> getExpectedFiles() {
+ return Arrays.asList(
+ WEB_XML,
+ PORTLET_XML,
+ PORTLET_LIBRARIES,
+ FACES_CONFIG_XML,
+ WEB_APP_LIBRARIES,
+ PAGES_XML,
+ COMPONENTS_XML,
+ JBOSS_WEB_XML);
+ }
+}
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java 2011-11-28
16:20:04 UTC (rev 36703)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java 2011-11-28
16:20:45 UTC (rev 36704)
@@ -16,7 +16,9 @@
import org.jboss.tools.portlet.ui.bot.task.wizard.web.DynamicWebProjectCreationTask;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Seam;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
@@ -29,39 +31,59 @@
* @author Lucia Jelinkova
*
*/
-@Require(server=@Server(required=true, state=ServerState.Present, type=ServerType.EPP))
+@Require(db=@DB(required=true), seam=(a)Seam(version="2.2"),
server=@Server(required=true, state=ServerState.Present, type=ServerType.EPP))
public abstract class CreatePortletProjectTemplate extends SWTTaskBasedTestCase {
+ protected static final FacetDefinition JAVA_FACET = new
FacetDefinition("Java", null, "1.6");
+
+ protected static final FacetDefinition JSF_FACET = new FacetDefinition("JavaServer
Faces");
+
+ public static final FacetDefinition SEAM_2_FACET = new FacetDefinition("Seam
2");
+
protected static final String JBOSS_FACET_CATEGORY = "JBoss Portlets";
-
+
protected static final FacetDefinition CORE_PORTLET_FACET = new
FacetDefinition("JBoss Core Portlet", JBOSS_FACET_CATEGORY);
+
+ protected static final FacetDefinition JSF_PORTLET_FACET = new
FacetDefinition("JBoss JSF Portlet", JBOSS_FACET_CATEGORY);
- protected static final FacetDefinition JAVA_FACET = new
FacetDefinition("Java", null, "1.6");
+ public static final FacetDefinition SEAM_PORTLET_FACET = new FacetDefinition("JBoss
Seam Portlet", JBOSS_FACET_CATEGORY);
- protected static final String WEB_XML = "WebContent/WEB-INF/web.xml";
+ protected static final String WEB_INF = "WebContent/WEB-INF/";
- protected static final String PORTLET_XML = "WebContent/WEB-INF/portlet.xml";
+ protected static final String FACES_CONFIG_XML = WEB_INF +
"faces-config.xml";
+
+ protected static final String WEB_XML = WEB_INF + "web.xml";
+
+ protected static final String PORTLET_XML = WEB_INF + "portlet.xml";
+ protected static final String COMPONENTS_XML = WEB_INF + "components.xml";
+
+ protected static final String PAGES_XML = WEB_INF + "pages.xml";
+
+ protected static final String JBOSS_WEB_XML = WEB_INF + "jboss-web.xml";
+
protected static final String PORTLET_LIBRARIES = "JBoss Portlet Libraries";
+ protected static final String WEB_APP_LIBRARIES = "Web App Libraries";
+
public abstract String getProjectName();
-
+
public abstract List<FacetDefinition> getRequiredFacets();
-
+
public abstract List<WizardPageFillingTask> getAdditionalWizardPages();
-
+
public abstract List<String> getExpectedFiles();
-
+
@Test
public void testcreate(){
doPerform(getCreateDynamicWebProjectTask());
-
+
doAssertThat(0, isNumberOfErrors());
doAssertThat(getProjectName(), isExistingProject());
doAssertThat(getProjectName(), hasFacets(getRequiredFacets()));
doAssertThat(getExpectedWorkspaceFiles(), exist());
}
-
+
protected AbstractSWTTask getCreateDynamicWebProjectTask() {
DynamicWebProjectCreationTask task = new DynamicWebProjectCreationTask();
task.setProjectName(getProjectName());
@@ -71,20 +93,20 @@
task.addAllWizardPages(getAdditionalWizardPages());
return task;
}
-
+
protected FacetsSelectionTask getSelectFacetsTask() {
FacetsSelectionTask task = new FacetsSelectionTask();
task.addAllFacets(getRequiredFacets());
return task;
}
-
+
private List<WorkspaceFile> getExpectedWorkspaceFiles(){
List<WorkspaceFile> expectedWorkspaceFiles = new
ArrayList<WorkspaceFile>();
-
+
for (String file : getExpectedFiles()){
expectedWorkspaceFiles.add(new WorkspaceFile(getProjectName(), file));
}
-
+
return expectedWorkspaceFiles;
}
}