JBoss Tools SVN: r36479 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-21 07:35:30 -0500 (Mon, 21 Nov 2011)
New Revision: 36479
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
Log:
exported internal packages to x-friends
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF 2011-11-21 11:57:50 UTC (rev 36478)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/META-INF/MANIFEST.MF 2011-11-21 12:35:30 UTC (rev 36479)
@@ -10,5 +10,12 @@
org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
Export-Package: org.jboss.tools.openshift.express.client,
org.jboss.tools.openshift.express.client.configuration,
- org.jboss.tools.openshift.express.client.utils
+ org.jboss.tools.openshift.express.client.utils,
+ org.jboss.tools.openshift.express.internal.client;x-friends:="org.jboss.tools.openshift.express.ui",
+ org.jboss.tools.openshift.express.internal.client.httpclient;x-friends:="org.jboss.tools.openshift.express.ui",
+ org.jboss.tools.openshift.express.internal.client.request;x-friends:="org.jboss.tools.openshift.express.ui",
+ org.jboss.tools.openshift.express.internal.client.request.marshalling;x-friends:="org.jboss.tools.openshift.express.ui",
+ org.jboss.tools.openshift.express.internal.client.response;x-friends:="org.jboss.tools.openshift.express.ui",
+ org.jboss.tools.openshift.express.internal.client.response.unmarshalling;x-friends:="org.jboss.tools.openshift.express.ui",
+ org.jboss.tools.openshift.express.internal.client.utils;x-friends:="org.jboss.tools.openshift.express.ui"
Require-Bundle: com.jcraft.jsch;bundle-version="0.1.44"
13 years, 1 month
JBoss Tools SVN: r36477 - workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-11-21 06:55:09 -0500 (Mon, 21 Nov 2011)
New Revision: 36477
Modified:
workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/_maven.repositories
workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/jboss-javaee6-html5-mobile-archetype-7.0.2-SNAPSHOT-sources.jar
workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/jboss-javaee6-html5-mobile-archetype-7.0.2-SNAPSHOT.jar
workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/maven-metadata-local.xml
Log:
Update html5 archetype
Modified: workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/_maven.repositories
===================================================================
--- workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/_maven.repositories 2011-11-21 11:38:32 UTC (rev 36476)
+++ workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/_maven.repositories 2011-11-21 11:55:09 UTC (rev 36477)
@@ -1,5 +1,5 @@
#NOTE: This is an internal implementation file, its format can be changed without prior notice.
-#Tue Nov 15 20:44:34 CET 2011
+#Mon Nov 21 12:52:51 CET 2011
jboss-javaee6-html5-mobile-archetype-7.0.2-SNAPSHOT-sources.jar>=
jboss-javaee6-html5-mobile-archetype-7.0.2-SNAPSHOT.jar>=
jboss-javaee6-html5-mobile-archetype-7.0.2-SNAPSHOT.pom>=
Modified: workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/jboss-javaee6-html5-mobile-archetype-7.0.2-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)
Modified: workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/jboss-javaee6-html5-mobile-archetype-7.0.2-SNAPSHOT.jar
===================================================================
(Binary files differ)
Modified: workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/maven-metadata-local.xml
===================================================================
--- workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/maven-metadata-local.xml 2011-11-21 11:38:32 UTC (rev 36476)
+++ workspace/fred/repositories/snapshot/org/jboss/spec/archetypes/jboss-javaee6-html5-mobile-archetype/7.0.2-SNAPSHOT/maven-metadata-local.xml 2011-11-21 11:55:09 UTC (rev 36477)
@@ -7,23 +7,23 @@
<snapshot>
<localCopy>true</localCopy>
</snapshot>
- <lastUpdated>20111115194434</lastUpdated>
+ <lastUpdated>20111121115251</lastUpdated>
<snapshotVersions>
<snapshotVersion>
<classifier>sources</classifier>
<extension>jar</extension>
<value>7.0.2-SNAPSHOT</value>
- <updated>20111115194434</updated>
+ <updated>20111121115251</updated>
</snapshotVersion>
<snapshotVersion>
<extension>jar</extension>
<value>7.0.2-SNAPSHOT</value>
- <updated>20111115194434</updated>
+ <updated>20111121115251</updated>
</snapshotVersion>
<snapshotVersion>
<extension>pom</extension>
<value>7.0.2-SNAPSHOT</value>
- <updated>20111115194434</updated>
+ <updated>20111121115251</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>
13 years, 1 month
JBoss Tools SVN: r36476 - trunk/maven/plugins/org.jboss.tools.maven.ui.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-11-21 06:38:32 -0500 (Mon, 21 Nov 2011)
New Revision: 36476
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
Log:
JBIDE-10146: tests should work better if I commit the actual code modifications
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2011-11-21 11:25:33 UTC (rev 36475)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2011-11-21 11:38:32 UTC (rev 36476)
@@ -213,5 +213,12 @@
</navigatorContent>
</extension>
-->
-
+ <extension point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.jboss.tools.common.ui.JBossPerspective">
+ <newWizardShortcut
+ id="org.eclipse.m2e.core.wizards.Maven2ProjectWizard">
+ </newWizardShortcut>
+ </perspectiveExtension>
+ </extension>
</plugin>
13 years, 1 month
JBoss Tools SVN: r36475 - trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-11-21 06:25:33 -0500 (Mon, 21 Nov 2011)
New Revision: 36475
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
Log:
Remove debug traces
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-11-21 11:20:58 UTC (rev 36474)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-11-21 11:25:33 UTC (rev 36475)
@@ -196,7 +196,7 @@
private Artifact downloadArchetype(String groupId, String artifactId,
String version, ArtifactRepository archetypeRepository,
List<ArtifactRepository> repositories) throws CoreException {
- long start = System.currentTimeMillis();
+ //long start = System.currentTimeMillis();
IMaven maven = MavenPlugin.getMaven();
ArrayList<ArtifactRepository> repos = new ArrayList<ArtifactRepository>();
if (archetypeRepository != null) {
@@ -206,8 +206,8 @@
IProgressMonitor nullProgressMonitor = new NullProgressMonitor();
maven.resolve(groupId, artifactId, version, "pom", null, repos, nullProgressMonitor); //$NON-NLS-1$
Artifact a = maven.resolve(groupId, artifactId, version, "jar", null, repos, nullProgressMonitor); //$NON-NLS-1$
- long stop = System.currentTimeMillis();
- System.err.println("download took " + (stop-start) + " ms");
+ //long stop = System.currentTimeMillis();
+ //System.err.println("download took " + (stop-start) + " ms");
return a;
}
13 years, 1 month
JBoss Tools SVN: r36474 - in trunk: maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-11-21 06:20:58 -0500 (Mon, 21 Nov 2011)
New Revision: 36474
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenProjectExample.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
Log:
JBIDE-10200: Add default maven profiles configuration to project examples
https://issues.jboss.org/browse/JBIDE-10200
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2011-11-21 10:52:56 UTC (rev 36473)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2011-11-21 11:20:58 UTC (rev 36474)
@@ -16,8 +16,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
/**
@@ -46,6 +44,7 @@
private ArchetypeModel archetypeModel = new ArchetypeModel();
private File file;
private IProjectExampleSite site;
+ private String defaultProfiles ="";
public Project() {
name=""; //$NON-NLS-1$
@@ -253,4 +252,13 @@
public void setFile(File file) {
this.file = file;
}
+
+ public String getDefaultProfiles() {
+ return defaultProfiles;
+ }
+
+ public void setDefaultProfiles(String defaultProfiles) {
+ this.defaultProfiles = defaultProfiles;
+ }
+
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2011-11-21 10:52:56 UTC (rev 36473)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2011-11-21 11:20:58 UTC (rev 36474)
@@ -264,7 +264,7 @@
parseFixes(project, child);
}
- if (nodeName.equals("category")) { //$NON-NLS-1$
+ else if (nodeName.equals("category")) { //$NON-NLS-1$
String value = getContent(child);
boolean found = false;
for (Category cat : list) {
@@ -281,29 +281,29 @@
}
project.setCategory(category);
}
- if (nodeName.equals(NAME)) {
+ else if (nodeName.equals(NAME)) {
project.setName(getContent(child));
}
- if (nodeName.equals("shortDescription")) { //$NON-NLS-1$
+ else if (nodeName.equals("shortDescription")) { //$NON-NLS-1$
project
.setShortDescription(getContent(child));
}
- if (nodeName.equals("description")) { //$NON-NLS-1$
+ else if (nodeName.equals("description")) { //$NON-NLS-1$
project.setDescription(getContent(child));
}
- if (nodeName.equals(URL)) {
+ else if (nodeName.equals(URL)) {
project.setUrl(getContent(child));
}
- if (nodeName.equals("perspectiveId")) { //$NON-NLS-1$
+ else if (nodeName.equals("perspectiveId")) { //$NON-NLS-1$
project.setPerspectiveId(getContent(child));
}
- if (nodeName.equals("importType")) { //$NON-NLS-1$
+ else if (nodeName.equals("importType")) { //$NON-NLS-1$
project.setImportType(getContent(child));
}
- if (nodeName.equals("importTypeDescription")) { //$NON-NLS-1$
+ else if (nodeName.equals("importTypeDescription")) { //$NON-NLS-1$
project.setImportTypeDescription(getContent(child));
}
- if (nodeName.equals("size")) { //$NON-NLS-1$
+ else if (nodeName.equals("size")) { //$NON-NLS-1$
long size = 0;
try {
size = new Long(getContent(child));
@@ -311,7 +311,7 @@
}
project.setSize(size);
}
- if (nodeName.equals("included-projects")) { //$NON-NLS-1$
+ else if (nodeName.equals("included-projects")) { //$NON-NLS-1$
String includedProjects = getContent(child);
if (includedProjects != null) {
includedProjects = includedProjects
@@ -325,7 +325,10 @@
project.setIncludedProjects(projectList);
}
}
- if (nodeName.equals("welcome")) { //$NON-NLS-1$
+ else if (nodeName.equals("defaultMavenProfiles")) { //$NON-NLS-1$
+ project.setDefaultProfiles(getContent(child));
+ }
+ else if (nodeName.equals("welcome")) { //$NON-NLS-1$
project.setWelcome(true);
String attribute = child.getAttribute("type"); //$NON-NLS-1$
if (attribute != null && CHEATSHEETS.equals(attribute.trim())) {
@@ -341,7 +344,7 @@
project.setWelcomeURL(attribute.trim());
}
}
- if (nodeName.equals("mavenArchetype")) { //$NON-NLS-1$
+ else if (nodeName.equals("mavenArchetype")) { //$NON-NLS-1$
parseMavenArchetype(project, child);
}
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenProjectExample.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenProjectExample.java 2011-11-21 10:52:56 UTC (rev 36473)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenProjectExample.java 2011-11-21 11:20:58 UTC (rev 36474)
@@ -124,11 +124,11 @@
return projects;
}
- importMavenProjects(destination);
+ importMavenProjects(destination, projectDescription);
return projects;
}
- private void importMavenProjects(final File destination) {
+ private void importMavenProjects(final File destination, final Project projectDescription) {
Job job = new ProjectExamplesJob("Importing Maven projects") {
public IStatus runInWorkspace(IProgressMonitor monitor) {
setProperty(IProgressConstants.ACTION_PROPERTY,
@@ -144,7 +144,11 @@
addMavenProjects(infos, mavenProjects);
final List<IProject> existingProjects = new ArrayList<IProject>();
ProjectImportConfiguration importConfiguration = new ProjectImportConfiguration();
- for(MavenProjectInfo info:infos) {
+ String profiles = projectDescription.getDefaultProfiles();
+ if (profiles != null && profiles.trim().length() > 0) {
+ importConfiguration.getResolverConfiguration().setActiveProfiles(profiles);
+ }
+ for(MavenProjectInfo info:infos) {
String projectName = getProjectName(info, importConfiguration);
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (project != null && project.exists()) {
@@ -175,7 +179,7 @@
return Status.CANCEL_STATUS;
}
}
- plugin.getProjectConfigurationManager().importProjects(
+ MavenPlugin.getProjectConfigurationManager().importProjects(
infos, importConfiguration, monitor);
} catch (CoreException ex) {
MavenProjectExamplesActivator.log(ex, "Projects imported with errors");
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java 2011-11-21 10:52:56 UTC (rev 36473)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java 2011-11-21 11:20:58 UTC (rev 36474)
@@ -99,6 +99,7 @@
} catch (InterruptedException e) {
return false;
} catch (InvocationTargetException e) {
+
return false;
}
@@ -109,6 +110,10 @@
public void addPages() {
configuration = new ProjectImportConfiguration();
+ String profiles = projectDescription.getDefaultProfiles();
+ if (profiles != null && profiles.trim().length() > 0) {
+ configuration.getResolverConfiguration().setActiveProfiles(profiles);
+ }
wizardPage = new ArchetypeExamplesWizardPage(configuration, projectDescription);
addPage(wizardPage);
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-11-21 10:52:56 UTC (rev 36473)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-11-21 11:20:58 UTC (rev 36474)
@@ -63,6 +63,7 @@
@Override
public void createControl(Composite parent) {
+ long start = System.currentTimeMillis();
super.createControl(parent);
Archetype archetype = new Archetype();
ArchetypeModel archetypeModel = projectDescription.getArchetypeModel();
@@ -113,6 +114,9 @@
groupIdCombo.setText(groupId);
versionCombo.setText(version);
packageCombo.setText(javaPackage);
+
+ long stop = System.currentTimeMillis();
+ System.err.println("Create controls took " + (stop-start) + " ms");
}
public Archetype getArchetype() {
@@ -160,10 +164,12 @@
}
} catch(UnknownArchetype e) {
MavenProjectExamplesActivator.log(e);
- //TODO don't swallow exceptions
+ e.printStackTrace();
+ //TODO don't swallow exceptions
} catch(CoreException ex) {
//TODO don't swallow exceptions
MavenProjectExamplesActivator.log(ex);
+ ex.printStackTrace();
} finally {
monitor.done();
}
@@ -190,7 +196,7 @@
private Artifact downloadArchetype(String groupId, String artifactId,
String version, ArtifactRepository archetypeRepository,
List<ArtifactRepository> repositories) throws CoreException {
-
+ long start = System.currentTimeMillis();
IMaven maven = MavenPlugin.getMaven();
ArrayList<ArtifactRepository> repos = new ArrayList<ArtifactRepository>();
if (archetypeRepository != null) {
@@ -199,7 +205,10 @@
repos.addAll(maven.getArtifactRepositories()); // see org.apache.maven.archetype.downloader.DefaultDownloader#download
IProgressMonitor nullProgressMonitor = new NullProgressMonitor();
maven.resolve(groupId, artifactId, version, "pom", null, repos, nullProgressMonitor); //$NON-NLS-1$
- return maven.resolve(groupId, artifactId, version, "jar", null, repos, nullProgressMonitor); //$NON-NLS-1$
+ Artifact a = maven.resolve(groupId, artifactId, version, "jar", null, repos, nullProgressMonitor); //$NON-NLS-1$
+ long stop = System.currentTimeMillis();
+ System.err.println("download took " + (stop-start) + " ms");
+ return a;
}
}
13 years, 1 month
JBoss Tools SVN: r36473 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-21 05:52:56 -0500 (Mon, 21 Nov 2011)
New Revision: 36473
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java
Log:
Removed unnecessary import
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java 2011-11-21 10:51:32 UTC (rev 36472)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java 2011-11-21 10:52:56 UTC (rev 36473)
@@ -2,7 +2,6 @@
import static org.junit.Assert.assertThat;
-import org.eclipse.jface.viewers.deferred.SetModel;
import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
import org.jboss.tools.portlet.ui.bot.test.task.SWTBotAware;
import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
13 years, 1 month
JBoss Tools SVN: r36472 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-21 05:51:32 -0500 (Mon, 21 Nov 2011)
New Revision: 36472
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF
Log:
removed unnecessary dependency
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF 2011-11-21 10:11:54 UTC (rev 36471)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF 2011-11-21 10:51:32 UTC (rev 36472)
@@ -9,7 +9,6 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.jboss.tools.jst.ui.bot.test;bundle-version="1.0.0",
org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
13 years, 1 month
JBoss Tools SVN: r36471 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test: META-INF and 21 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-21 05:11:54 -0500 (Mon, 21 Nov 2011)
New Revision: 36471
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/.classpath
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/.project
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/build.properties
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/aaa
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/log4j.xml
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/screenshots/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/screenshots/Default - testcreate(org.jboss.tools.portlet.ui.bot.test.create.CreateJavaPortlet).jpeg
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/screenshots/screenshot-CreateJavaPortlet.testcreate.jpeg
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/Activator.java
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/RequirementAwareUsageWindowClosingSuite.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortletProject.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/AbstractSWTMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/SWTMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/NumberOfErrorsMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/ProblemViewMatchersFactory.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingFileMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingProjectMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ProjectFacetsMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/AbstractSWTTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/CompositeSWTTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTBotAware.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/AssociatedPerspectiveDialogClosingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogCloseTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogOpenTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/AbstractFacetTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/FacetDefinition.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/FacetsSelectionTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardOpeningTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageDefaultsFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectCreationTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectWizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/jboss/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/jboss/JBossPortletCapabilitiesWizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java
Log:
Initial import.
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/.classpath
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/.classpath (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/.classpath 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/.project
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/.project (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/.project 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.portlet.ui.bot.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Portal Tests
+Bundle-SymbolicName: org.jboss.tools.portlet.ui.bot.test;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor:
+ JBoss by Red Hat
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.jst.ui.bot.test;bundle-version="1.0.0",
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.apache.log4j;bundle-version="1.2.13",
+ org.junit4;bundle-version="4.8.1",
+ org.eclipse.datatools.connectivity;bundle-version="1.1.2",
+ org.jboss.tools.ui.bot.ext;bundle-version="1.0.0",
+ org.hamcrest;bundle-version="1.1.0"
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/build.properties
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/build.properties (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/build.properties 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,6 @@
+source.. = src/,\
+ resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ resources/
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/aaa
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/aaa (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/aaa 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1 @@
+SERVER=EPP,5.1.0,default,/home/ljelinko/programs/jboss/jboss-epp-5.1/jboss-as
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/log4j.xml
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/log4j.xml (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/log4j.xml 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/screenshots/Default - testcreate(org.jboss.tools.portlet.ui.bot.test.create.CreateJavaPortlet).jpeg
===================================================================
(Binary files differ)
Property changes on: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/screenshots/Default - testcreate(org.jboss.tools.portlet.ui.bot.test.create.CreateJavaPortlet).jpeg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/screenshots/screenshot-CreateJavaPortlet.testcreate.jpeg
===================================================================
(Binary files differ)
Property changes on: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/screenshots/screenshot-CreateJavaPortlet.testcreate.jpeg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/Activator.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/Activator.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/Activator.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,50 @@
+package org.jboss.tools.portlet.ui.bot.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.portlet.ui.bot.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,13 @@
+package org.jboss.tools.portlet.ui.bot.test;
+
+import org.jboss.tools.portlet.ui.bot.test.create.CreateJavaPortletProject;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+(a)RunWith(RequirementAwareUsageWindowClosingSuite.class)
+(a)Suite.SuiteClasses({
+ CreateJavaPortletProject.class
+ })
+public class AllTestsSuite {
+
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/RequirementAwareUsageWindowClosingSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/RequirementAwareUsageWindowClosingSuite.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/RequirementAwareUsageWindowClosingSuite.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,27 @@
+package org.jboss.tools.portlet.ui.bot.test;
+
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.junit.runners.model.Statement;
+
+/**
+ * Normal {@link RequirementAwareSuite} with the special added functionality of
+ * closing the usage window.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class RequirementAwareUsageWindowClosingSuite extends
+ RequirementAwareSuite {
+
+ public RequirementAwareUsageWindowClosingSuite(Class<?> klass)
+ throws Throwable {
+ super(klass);
+ }
+
+ @Override
+ protected Statement withBeforeClasses(Statement statement) {
+ SWTBotFactory.getJbt().closeReportUsageWindowIfOpened(false);
+ return super.withBeforeClasses(statement);
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortletProject.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortletProject.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortletProject.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,65 @@
+package org.jboss.tools.portlet.ui.bot.test.create;
+
+import static org.jboss.tools.portlet.ui.bot.test.matcher.problems.ProblemViewMatchersFactory.isNumberOfErrors;
+import static org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.existsInProject;
+import static org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.hasFacets;
+import static org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.isExistingProject;
+
+import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.test.task.facet.FacetDefinition;
+import org.jboss.tools.portlet.ui.bot.test.task.facet.FacetsSelectionTask;
+import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageDefaultsFillingTask;
+import org.jboss.tools.portlet.ui.bot.test.task.wizard.web.DynamicWebProjectCreationTask;
+import org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss.JBossPortletCapabilitiesWizardPageFillingTask;
+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.Require;
+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;
+import org.junit.Test;
+
+/**
+ * Creates a new Dynamic Web Project with the specific JBoss Core Portlet facet.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+@Require(server=@Server(required=true, state=ServerState.Present, type=ServerType.EPP))
+public class CreateJavaPortletProject extends SWTTaskBasedTestCase{
+
+ private static final String PROJECT_NAME = "java-portlet";
+
+ private static final String FACET_CATEGORY = "JBoss Portlets";
+
+ private static final String FACET_NAME = "JBoss Core Portlet";
+
+ @Test
+ public void testcreate(){
+ doPerform(getCreateDynamicWebProjectTask());
+
+ doAssertThat(0, isNumberOfErrors());
+ doAssertThat(PROJECT_NAME, isExistingProject());
+ doAssertThat("WebContent/WEB-INF/portlet.xml", existsInProject(PROJECT_NAME));
+ doAssertThat("JBoss Portlet Libraries", existsInProject(PROJECT_NAME));
+ doAssertThat(PROJECT_NAME, hasFacets(new FacetDefinition(FACET_NAME, FACET_CATEGORY)));
+ }
+
+ private AbstractSWTTask getCreateDynamicWebProjectTask() {
+ DynamicWebProjectCreationTask task = new DynamicWebProjectCreationTask();
+ task.setProjectName(PROJECT_NAME);
+ task.setWebModuleVersion("2.5");
+ task.setServerName(SWTTestExt.configuredState.getServer().name);
+ task.setSelectFacetsTask(getSelectFacetsTask());
+ task.addWizardPage(new WizardPageDefaultsFillingTask());
+ task.addWizardPage(new WizardPageDefaultsFillingTask());
+ task.addWizardPage(new JBossPortletCapabilitiesWizardPageFillingTask(JBossPortletCapabilitiesWizardPageFillingTask.Type.RUNTIME_PROVIDER));
+ return task;
+ }
+
+ private FacetsSelectionTask getSelectFacetsTask() {
+ FacetsSelectionTask task = new FacetsSelectionTask();
+ task.addFacet(new FacetDefinition(FACET_NAME, FACET_CATEGORY));
+ return task;
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/AbstractSWTMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/AbstractSWTMatcher.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/AbstractSWTMatcher.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,33 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.hamcrest.TypeSafeMatcher;
+import org.jboss.tools.portlet.ui.bot.test.task.SWTBotAware;
+import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
+
+/**
+ * Common ancestor of all SWT based matchers.
+ *
+ * @author Lucia Jelinkova
+ *
+ * @param <T>
+ */
+public abstract class AbstractSWTMatcher<T> extends TypeSafeMatcher<T> implements SWTMatcher<T>, SWTBotAware {
+
+ private SWTBot bot;
+
+ protected void performInnerTask(SWTTask task){
+ if (task instanceof SWTBotAware){
+ ((SWTBotAware) task).setBot(getBot());
+ }
+ task.perform();
+ }
+
+ public SWTBot getBot() {
+ return bot;
+ }
+
+ public void setBot(SWTBot bot) {
+ this.bot = bot;
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/SWTMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/SWTMatcher.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/SWTMatcher.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,14 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher;
+
+import org.hamcrest.Matcher;
+
+/**
+ * Matcher for SWT based tests.
+ *
+ * @author Lucia Jelinkova
+ *
+ * @param <T>
+ */
+public interface SWTMatcher<T> extends Matcher<T> {
+
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/NumberOfErrorsMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/NumberOfErrorsMatcher.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/NumberOfErrorsMatcher.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,42 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.problems;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.test.matcher.AbstractSWTMatcher;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
+
+/**
+ * Checks the number of Errors on the Problems view.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class NumberOfErrorsMatcher extends AbstractSWTMatcher<Integer> {
+
+ private int numberOfErrors;
+
+ @Override
+ public boolean matchesSafely(Integer expectedNumber) {
+ SWTBotFactory.getOpen().perspective(ActionItem.Perspective.JAVA.LABEL);
+ SWTBotTreeItem errorItem = ProblemsView.getErrorsNode(SWTBotFactory.getBot());
+
+ if (errorItem == null){
+ if (expectedNumber.equals(0)){
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ numberOfErrors = errorItem.getNodes().size();
+
+ return expectedNumber.equals(numberOfErrors);
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendText(numberOfErrors + " errors");
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/ProblemViewMatchersFactory.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/ProblemViewMatchersFactory.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/ProblemViewMatchersFactory.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,20 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.problems;
+
+import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
+
+/**
+ * Factory of matchers for Problems View.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class ProblemViewMatchersFactory {
+
+ public ProblemViewMatchersFactory() {
+ // not to be instantiated
+ }
+
+ public static SWTMatcher<Integer> isNumberOfErrors(){
+ return new NumberOfErrorsMatcher();
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingFileMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingFileMatcher.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingFileMatcher.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,40 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.workspace;
+
+import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.test.matcher.AbstractSWTMatcher;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+
+/**
+ * Checks if the file exists in the project.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class ExistingFileMatcher extends AbstractSWTMatcher<String> {
+
+ private static final String FILE_SEPARATOR = "/";
+
+ private String project;
+
+ public ExistingFileMatcher(String project) {
+ this.project = project;
+ }
+
+ @Override
+ public boolean matchesSafely(String path) {
+ SWTBotFactory.getOpen().perspective(ActionItem.Perspective.JAVA.LABEL);
+ try {
+ SWTEclipseExt.openFile(SWTBotFactory.getBot(), project, path.split(FILE_SEPARATOR));
+ return true;
+ } catch (Exception e){
+ return false;
+ }
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendValue("existing file");
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingProjectMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingProjectMatcher.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingProjectMatcher.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,28 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.workspace;
+
+import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.test.matcher.AbstractSWTMatcher;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+
+/**
+ * Checks if the project exists in the workspace.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class ExistingProjectMatcher extends AbstractSWTMatcher<String> {
+
+ @Override
+ public boolean matchesSafely(String project) {
+ SWTBotFactory.getOpen().perspective(ActionItem.Perspective.JAVA.LABEL);
+ return SWTBotFactory.getEclipse().isProjectInPackageExplorer(project);
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendValue("existing project");
+ }
+}
+
+
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ProjectFacetsMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ProjectFacetsMatcher.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ProjectFacetsMatcher.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,65 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.workspace;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.test.matcher.AbstractSWTMatcher;
+import org.jboss.tools.portlet.ui.bot.test.task.dialog.ProjectPropertyDialogCloseTask;
+import org.jboss.tools.portlet.ui.bot.test.task.dialog.ProjectPropertyDialogOpenTask;
+import org.jboss.tools.portlet.ui.bot.test.task.facet.AbstractFacetTask;
+import org.jboss.tools.portlet.ui.bot.test.task.facet.FacetDefinition;
+
+/**
+ * Checks if the project has the specified facets.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class ProjectFacetsMatcher extends AbstractSWTMatcher<String> {
+
+ private List<FacetDefinition> facets;
+
+ public ProjectFacetsMatcher(FacetDefinition... facets) {
+ this.facets = Arrays.asList(facets);
+ }
+
+ @Override
+ public boolean matchesSafely(String project) {
+ showPropertyDialog(project);
+ return checkFacets();
+ }
+
+ private void showPropertyDialog(String project) {
+ ProjectPropertyDialogOpenTask openTask = new ProjectPropertyDialogOpenTask();
+ openTask.setProject(project);
+ openTask.setPropertyPage("Project Facets");
+ performInnerTask(openTask);
+ }
+
+ private boolean checkFacets() {
+ ValueCheckedTask task = new ValueCheckedTask();
+ for (FacetDefinition facet : facets){
+ task.addFacet(facet);
+ }
+ performInnerTask(task);
+
+ performInnerTask(new ProjectPropertyDialogCloseTask());
+ return task.allChecked;
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendValue("file containing facet");
+ }
+
+ class ValueCheckedTask extends AbstractFacetTask {
+ private boolean allChecked = true;
+
+ @Override
+ protected void processFacet(SWTBotTreeItem facetItem) {
+ allChecked = allChecked && facetItem.isChecked();
+ }
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,29 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.workspace;
+
+import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
+import org.jboss.tools.portlet.ui.bot.test.task.facet.FacetDefinition;
+
+/**
+ * Factory for workspace specific matchers (projects, files..)
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class WorkspaceMatchersFactory {
+
+ private WorkspaceMatchersFactory(){
+ // not to be instantiated
+ }
+
+ public static SWTMatcher<String> isExistingProject(){
+ return new ExistingProjectMatcher();
+ }
+
+ public static SWTMatcher<String> existsInProject(String project){
+ return new ExistingFileMatcher(project);
+ }
+
+ public static SWTMatcher<String> hasFacets(FacetDefinition... facets){
+ return new ProjectFacetsMatcher(facets);
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/AbstractSWTTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/AbstractSWTTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/AbstractSWTTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,29 @@
+package org.jboss.tools.portlet.ui.bot.test.task;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+
+/**
+ * Common ancestor of all UI tasks.
+ *
+ * @author ljelinko
+ *
+ */
+public abstract class AbstractSWTTask implements SWTTask, SWTBotAware {
+
+ private SWTBot bot;
+
+ protected void performInnerTask(SWTTask task){
+ if (task instanceof SWTBotAware){
+ ((SWTBotAware) task).setBot(getBot());
+ }
+ task.perform();
+ }
+
+ public SWTBot getBot() {
+ return bot;
+ }
+
+ public void setBot(SWTBot bot) {
+ this.bot = bot;
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/CompositeSWTTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/CompositeSWTTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/CompositeSWTTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,46 @@
+package org.jboss.tools.portlet.ui.bot.test.task;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Performs a set of tasks and enables subclasses to define actions before and after
+ * each of the tasks is performed.
+ *
+ * @author ljelinko
+ *
+ */
+public class CompositeSWTTask<T extends SWTTask> extends AbstractSWTTask {
+
+ private List<T> tasks;
+
+ public CompositeSWTTask() {
+ super();
+ tasks = new ArrayList<T>();
+ }
+
+ @Override
+ public void perform() {
+ for (T task : tasks){
+ beforeTask(task);
+ performInnerTask(task);
+ afterTask(task);
+ }
+ }
+
+ protected void beforeTask(T task) {
+ // hook up method
+ }
+
+ protected void afterTask(T task) {
+ // hook up method
+ }
+
+ public void addTask(T task){
+ tasks.add(task);
+ }
+
+ public List<T> getTasks() {
+ return tasks;
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTBotAware.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTBotAware.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTBotAware.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,14 @@
+package org.jboss.tools.portlet.ui.bot.test.task;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+
+/**
+ * Marking that the class should be aware of SWT bot.
+ *
+ * @author ljelinko
+ *
+ */
+public interface SWTBotAware {
+
+ void setBot(SWTBot bot);
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,13 @@
+package org.jboss.tools.portlet.ui.bot.test.task;
+
+/**
+ * Encapsulates all the information needed to perform a task on the UI.
+ *
+ * @author ljelinko
+ *
+ */
+public interface SWTTask {
+
+ void perform();
+
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/AssociatedPerspectiveDialogClosingTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/AssociatedPerspectiveDialogClosingTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/AssociatedPerspectiveDialogClosingTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,41 @@
+package org.jboss.tools.portlet.ui.bot.test.task.dialog;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+
+/**
+ * Checks if there is a dialog asking if the associated perspective
+ * should be open and if so, clicks Yes or No button depending on the
+ * constructor argument.
+ *
+ * @author ljelinko
+ *
+ */
+public class AssociatedPerspectiveDialogClosingTask extends AbstractSWTTask {
+
+ private boolean open;
+
+ public AssociatedPerspectiveDialogClosingTask(boolean open) {
+ this.open = open;
+ }
+
+ @Override
+ public void perform() {
+
+ SWTBot bot;
+
+ try {
+ bot = getBot().shell("Open Associated Perspective?").activate().bot();
+ } catch (WidgetNotFoundException e) {
+ // dialog is not open, skip the rest
+ return;
+ }
+
+ if (open){
+ bot.button("Yes").click();
+ } else {
+ bot.button("No").click();
+ }
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogCloseTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogCloseTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogCloseTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,11 @@
+package org.jboss.tools.portlet.ui.bot.test.task.dialog;
+
+import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+
+public class ProjectPropertyDialogCloseTask extends AbstractSWTTask {
+
+ @Override
+ public void perform() {
+ getBot().button("OK").click();
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogOpenTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogOpenTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogOpenTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,36 @@
+package org.jboss.tools.portlet.ui.bot.test.task.dialog;
+
+import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
+
+public class ProjectPropertyDialogOpenTask extends AbstractSWTTask{
+
+ private String project;
+
+ private String propertyPage;
+
+ @Override
+ public void perform() {
+ SWTBotFactory.getOpen().viewOpen(ActionItem.View.JavaPackageExplorer.LABEL);
+
+ PackageExplorer projectExplorer = SWTBotFactory.getPackageexplorer();
+ projectExplorer.selectProject(project);
+
+ ContextMenuHelper.clickContextMenu(projectExplorer.bot().tree(),
+ "Properties");
+
+ SWTBotFactory.getEclipse().waitForShell("Properties for " + project);
+ getBot().tree().expandNode(propertyPage).select();
+ }
+
+ public void setProject(String project) {
+ this.project = project;
+ }
+
+ public void setPropertyPage(String propertyPage) {
+ this.propertyPage = propertyPage;
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/AbstractFacetTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/AbstractFacetTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/AbstractFacetTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,86 @@
+package org.jboss.tools.portlet.ui.bot.test.task.facet;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+
+/**
+ * Common ancestor for facet handling tasks that can locate the facet node
+ * in the tree (it can be simple facet of facet with category).
+ *
+ * It lets the subclasses to define the action upon the facet.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public abstract class AbstractFacetTask extends AbstractSWTTask {
+
+ private List<FacetDefinition> facets;
+
+ public AbstractFacetTask() {
+ facets = new ArrayList<FacetDefinition>();
+ }
+
+ protected abstract void processFacet(SWTBotTreeItem facetItem);
+
+ @Override
+ public void perform() {
+ SWTBotTree tree = getTree();
+ for (FacetDefinition facet : facets){
+ processFacet(getTreeItem(tree, facet));
+ }
+ }
+
+ protected SWTBotTree getTree(){
+ Tree tree = getBot().widget(new ProjectFacetsTableMatcher());
+ return new SWTBotTree(tree);
+ }
+
+ /**
+ *
+ * @param tree
+ * @param facet
+ * @return The facet node (single or located within category)
+ */
+ protected SWTBotTreeItem getTreeItem(SWTBotTree tree, FacetDefinition facet){
+ if (facet.getCategory() == null){
+ return tree.getTreeItem(facet.getName());
+ } else {
+ tree.expandNode(facet.getCategory());
+ return tree.getTreeItem(facet.getCategory()).getNode(facet.getName());
+ }
+ }
+
+ public void addFacet(FacetDefinition facet){
+ facets.add(facet);
+ }
+
+ /**
+ * Matcher for locating the facet selection tree on the screen.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+ private static class ProjectFacetsTableMatcher extends BaseMatcher<Tree> {
+
+ @Override
+ public boolean matches(Object item) {
+ if (!(item instanceof Tree)){
+ return false;
+ }
+ Tree tree = (Tree) item;
+
+ return tree.getColumnCount() > 0 && "Project Facet".equals(tree.getColumn(0).getText());
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ }
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/FacetDefinition.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/FacetDefinition.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/FacetDefinition.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,35 @@
+package org.jboss.tools.portlet.ui.bot.test.task.facet;
+
+public class FacetDefinition {
+
+ private String category;
+
+ private String name;
+
+ public FacetDefinition(String name) {
+ super();
+ this.name = name;
+ }
+
+ public FacetDefinition(String name, String category) {
+ super();
+ this.category = category;
+ this.name = name;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/FacetsSelectionTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/FacetsSelectionTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/FacetsSelectionTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,17 @@
+package org.jboss.tools.portlet.ui.bot.test.task.facet;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+
+/**
+ * Selects the given facets in the Project facetss tree.
+ *
+ * @author ljelinko
+ *
+ */
+public class FacetsSelectionTask extends AbstractFacetTask {
+
+ @Override
+ protected void processFacet(SWTBotTreeItem facetItem) {
+ facetItem.check();
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardFillingTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardFillingTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardFillingTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,31 @@
+package org.jboss.tools.portlet.ui.bot.test.task.wizard;
+
+import org.jboss.tools.portlet.ui.bot.test.task.CompositeSWTTask;
+
+/**
+ *
+ * Provides the functionality of navigating between wizard pages. The data
+ * should fill every wizard page itself.
+ *
+ * @author ljelinko
+ *
+ */
+public class WizardFillingTask extends CompositeSWTTask<WizardPageFillingTask>{
+
+ @Override
+ public void perform() {
+ super.perform();
+ getBot().button("Finish").click();
+ }
+
+ @Override
+ protected void beforeTask(WizardPageFillingTask task) {
+ if (!isFirst(task)){
+ getBot().button("Next >").click();
+ }
+ }
+
+ private boolean isFirst(WizardPageFillingTask task){
+ return getTasks().indexOf(task) == 0;
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardOpeningTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardOpeningTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardOpeningTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,47 @@
+package org.jboss.tools.portlet.ui.bot.test.task.wizard;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+
+/**
+ * Opens a specified wizard.
+ *
+ * @author ljelinko
+ *
+ */
+public class WizardOpeningTask extends AbstractSWTTask {
+
+ private String category;
+
+ private String name;
+
+ public WizardOpeningTask(String name) {
+ super();
+ this.name = name;
+ }
+
+ public WizardOpeningTask(String name, String category) {
+ this(name);
+ this.category = category;
+ }
+
+ @Override
+ public void perform() {
+ getBot().menu("File").menu("New").menu("Other...").click();
+
+ SWTBotTree tree = getBot().tree();
+ getTreeItem(tree).select();
+
+ getBot().button("Next >").click();
+ }
+
+ private SWTBotTreeItem getTreeItem(SWTBotTree tree){
+ if (category == null){
+ return tree.getTreeItem(name);
+ } else {
+ tree.expandNode(category);
+ return tree.getTreeItem(category).getNode(name);
+ }
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageDefaultsFillingTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageDefaultsFillingTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageDefaultsFillingTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,18 @@
+package org.jboss.tools.portlet.ui.bot.test.task.wizard;
+
+import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+
+/**
+ * Leaves the defaults on the wizard page.
+ *
+ * @author ljelinko
+ *
+ */
+public class WizardPageDefaultsFillingTask extends AbstractSWTTask implements
+ WizardPageFillingTask {
+
+ @Override
+ public void perform() {
+ // leave defaults
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageFillingTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageFillingTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageFillingTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,14 @@
+package org.jboss.tools.portlet.ui.bot.test.task.wizard;
+
+import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
+
+/**
+ * Common ancestor for tasks filling in information into the wizard page.
+ * Currently just the marking interface.
+ *
+ * @author ljelinko
+ *
+ */
+public interface WizardPageFillingTask extends SWTTask {
+
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectCreationTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectCreationTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectCreationTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,54 @@
+package org.jboss.tools.portlet.ui.bot.test.task.wizard.web;
+
+import org.jboss.tools.portlet.ui.bot.test.task.dialog.AssociatedPerspectiveDialogClosingTask;
+import org.jboss.tools.portlet.ui.bot.test.task.facet.FacetsSelectionTask;
+import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardFillingTask;
+import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardOpeningTask;
+import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageFillingTask;
+
+/**
+ * Creates a new dynamic web project using the wizard.
+ *
+ * @author ljelinko
+ *
+ */
+public class DynamicWebProjectCreationTask extends WizardFillingTask {
+
+ private DynamicWebProjectWizardPageFillingTask firstPage;
+
+ private WizardFillingTask wizardFillingTask;
+
+ public DynamicWebProjectCreationTask() {
+ super();
+ firstPage = new DynamicWebProjectWizardPageFillingTask();
+ wizardFillingTask = new WizardFillingTask();
+ wizardFillingTask.addTask(firstPage);
+ }
+
+ @Override
+ public void perform() {
+ performInnerTask(new WizardOpeningTask("Dynamic Web Project", "Web"));
+ performInnerTask(wizardFillingTask);
+ performInnerTask(new AssociatedPerspectiveDialogClosingTask(false));
+ }
+
+ public void addWizardPage(WizardPageFillingTask page){
+ wizardFillingTask.addTask(page);
+ }
+
+ public void setProjectName(String projectName) {
+ firstPage.setProjectName(projectName);
+ }
+
+ public void setWebModuleVersion(String webModuleVersion) {
+ firstPage.setWebModuleVersion(webModuleVersion);
+ }
+
+ public void setServerName(String serverName) {
+ firstPage.setServerName(serverName);
+ }
+
+ public void setSelectFacetsTask(FacetsSelectionTask selectFacetsTask) {
+ firstPage.setSelectFacetsTask(selectFacetsTask);
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectWizardPageFillingTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectWizardPageFillingTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectWizardPageFillingTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,57 @@
+package org.jboss.tools.portlet.ui.bot.test.task.wizard.web;
+
+import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.test.task.facet.FacetsSelectionTask;
+import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageFillingTask;
+
+/**
+ * Fills in the information of the first page of Dynamic Web Project Wizard.
+ * @author ljelinko
+ *
+ */
+public class DynamicWebProjectWizardPageFillingTask extends AbstractSWTTask
+ implements WizardPageFillingTask {
+
+ private String projectName;
+
+ private String webModuleVersion;
+
+ private String serverName;
+
+ private FacetsSelectionTask selectFacetsTask;
+
+ @Override
+ public void perform() {
+ getBot().textWithLabel("Project name:").typeText(projectName);
+
+ if (webModuleVersion != null){
+ getBot().comboBoxInGroup("Dynamic web module version").setSelection(webModuleVersion);
+ }
+
+ if (serverName != null){
+ getBot().comboBoxInGroup("Target runtime").setSelection(serverName);
+ }
+
+ if (selectFacetsTask != null){
+ getBot().button("Modify...").click();
+ performInnerTask(selectFacetsTask);
+ getBot().button("OK").click();
+ }
+ }
+
+ public void setProjectName(String projectName) {
+ this.projectName = projectName;
+ }
+
+ public void setWebModuleVersion(String webModuleVersion) {
+ this.webModuleVersion = webModuleVersion;
+ }
+
+ public void setServerName(String serverName) {
+ this.serverName = serverName;
+ }
+
+ public void setSelectFacetsTask(FacetsSelectionTask selectFacetsTask) {
+ this.selectFacetsTask = selectFacetsTask;
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/jboss/JBossPortletCapabilitiesWizardPageFillingTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/jboss/JBossPortletCapabilitiesWizardPageFillingTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/jboss/JBossPortletCapabilitiesWizardPageFillingTask.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,44 @@
+package org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss;
+
+import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageFillingTask;
+
+/**
+ * Fills the JBoss portlet specific wizard page (for selection of
+ * how the portlet libraries should be configured)
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class JBossPortletCapabilitiesWizardPageFillingTask extends
+ AbstractSWTTask implements WizardPageFillingTask {
+
+ public enum Type {
+ DISABLED("Disable Library Configuration"),
+ USER("User library"),
+ RUNTIME_PROVIDER("Portlet Target Runtime Provider");
+
+ private String desc;
+
+ private Type(String s) {
+ desc = s;
+ }
+
+ @Override
+ public String toString() {
+ return desc;
+ }
+ }
+
+ private Type type;
+
+ public JBossPortletCapabilitiesWizardPageFillingTask(Type type) {
+ super();
+ this.type = type;
+ }
+
+ @Override
+ public void perform() {
+ getBot().comboBoxWithLabel("Type:").setSelection(type.toString());
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java 2011-11-21 10:11:54 UTC (rev 36471)
@@ -0,0 +1,33 @@
+package org.jboss.tools.portlet.ui.bot.test.testcase;
+
+import static org.junit.Assert.assertThat;
+
+import org.eclipse.jface.viewers.deferred.SetModel;
+import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
+import org.jboss.tools.portlet.ui.bot.test.task.SWTBotAware;
+import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+
+/**
+ * Common ancestor for SWT tests that wish to use {@link SWTTask} and {@link SWTMatcher}
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class SWTTaskBasedTestCase extends SWTTestExt {
+
+ protected void doPerform(SWTTask task){
+ if (task instanceof SWTBotAware){
+ ((SWTBotAware) task).setBot(bot);
+ }
+ task.perform();
+ }
+
+ protected <T> void doAssertThat(T actual, SWTMatcher<T> matcher){
+ if (matcher instanceof SWTBotAware){
+ ((SWTBotAware) matcher).setBot(bot);
+ }
+ assertThat(actual, matcher);
+ }
+
+}
13 years, 1 month
JBoss Tools SVN: r36470 - trunk/portlet/tests.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-21 05:09:30 -0500 (Mon, 21 Nov 2011)
New Revision: 36470
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/
Log:
Initial import.
13 years, 1 month