JBoss Tools SVN: r41264 - branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site.
by jbosstools-commits@lists.jboss.org
Author: dpalmer
Date: 2012-05-22 17:34:42 -0400 (Tue, 22 May 2012)
New Revision: 41264
Modified:
branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml
Log:
Added zest feature to update site
Modified: branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml
===================================================================
--- branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml 2012-05-22 21:01:43 UTC (rev 41263)
+++ branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml 2012-05-22 21:34:42 UTC (rev 41264)
@@ -40,7 +40,7 @@
<category name="SOATools" />
</feature>
<!-- ESB requires zest -->
- <feature url="features/org.eclipse.zest.feature_0.0.0.jar" id="org.eclise.zest.feature" version="0.0.0"/>
+ <feature url="features/org.eclipse.zest_0.0.0.jar" id="org.eclise.zest" version="0.0.0"/>
<feature url="features/org.jboss.tools.bpel.feature_0.0.0.jar" id="org.jboss.tools.bpel.feature" version="0.0.0">
<category name="SOATools" />
12 years, 7 months
JBoss Tools SVN: r41263 - trunk/build/aggregate/soa-site/site.
by jbosstools-commits@lists.jboss.org
Author: dpalmer
Date: 2012-05-22 17:01:43 -0400 (Tue, 22 May 2012)
New Revision: 41263
Modified:
trunk/build/aggregate/soa-site/site/site.xml
Log:
Added zest feature to update site
Modified: trunk/build/aggregate/soa-site/site/site.xml
===================================================================
--- trunk/build/aggregate/soa-site/site/site.xml 2012-05-22 20:59:14 UTC (rev 41262)
+++ trunk/build/aggregate/soa-site/site/site.xml 2012-05-22 21:01:43 UTC (rev 41263)
@@ -39,6 +39,9 @@
<category name="SOADataServices" />
<category name="SOATools" />
</feature>
+ <!-- ESB requires zest -->
+ <feature url="features/org.eclipse.zest.feature_0.0.0.jar" id="org.eclise.zest.feature" version="0.0.0"/>
+
<feature url="features/org.jboss.tools.bpel.feature_0.0.0.jar" id="org.jboss.tools.bpel.feature" version="0.0.0">
<category name="SOATools" />
</feature>
12 years, 7 months
JBoss Tools SVN: r41262 - branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site.
by jbosstools-commits@lists.jboss.org
Author: dpalmer
Date: 2012-05-22 16:59:14 -0400 (Tue, 22 May 2012)
New Revision: 41262
Modified:
branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml
Log:
Added zest feature to update site
Modified: branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml
===================================================================
--- branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml 2012-05-22 20:56:15 UTC (rev 41261)
+++ branches/soatools-3.3.0.Beta2/build/aggregate/soa-site/site/site.xml 2012-05-22 20:59:14 UTC (rev 41262)
@@ -39,6 +39,9 @@
<category name="SOADataServices" />
<category name="SOATools" />
</feature>
+ <!-- ESB requires zest -->
+ <feature url="features/org.eclipse.zest.feature_0.0.0.jar" id="org.eclise.zest.feature" version="0.0.0"/>
+
<feature url="features/org.jboss.tools.bpel.feature_0.0.0.jar" id="org.jboss.tools.bpel.feature" version="0.0.0">
<category name="SOATools" />
</feature>
12 years, 7 months
JBoss Tools SVN: r41260 - trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-05-22 16:38:22 -0400 (Tue, 22 May 2012)
New Revision: 41260
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectNatureUtils.java
Log:
Fixing error when project is closed: cannot read its description
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectNatureUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectNatureUtils.java 2012-05-22 19:48:29 UTC (rev 41259)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectNatureUtils.java 2012-05-22 20:38:22 UTC (rev 41260)
@@ -45,6 +45,9 @@
* in case of exception
*/
public static boolean isProjectNatureInstalled(final IProject project, final String natureId) throws CoreException {
+ if(!project.isOpen()) {
+ return false;
+ }
String[] natures = project.getDescription().getNatureIds();
for (String nature : natures) {
if (nature.equals(natureId)) {
12 years, 7 months
JBoss Tools SVN: r41259 - trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-05-22 15:48:29 -0400 (Tue, 22 May 2012)
New Revision: 41259
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeViewerDialog.java
Log:
JBIDE-11959 - Order runtimes on Download dialog
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeViewerDialog.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeViewerDialog.java 2012-05-22 19:18:47 UTC (rev 41258)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeViewerDialog.java 2012-05-22 19:48:29 UTC (rev 41259)
@@ -10,6 +10,12 @@
************************************************************************************/
package org.jboss.tools.project.examples.dialog;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
import java.util.Map;
import org.eclipse.jface.dialogs.Dialog;
@@ -125,7 +131,35 @@
@Override
public Object[] getElements(Object inputElement) {
- return downloadRuntimes.values().toArray(new DownloadRuntime[0]);
+ DownloadRuntime[] runtimes = downloadRuntimes.values().toArray(new DownloadRuntime[0]);
+ Arrays.sort(runtimes, new Comparator<DownloadRuntime>() {
+
+ @Override
+ public int compare(DownloadRuntime o1, DownloadRuntime o2) {
+ if (o1 == null && o2 == null) {
+ return 0;
+ }
+ if (o1 == null) {
+ return 1;
+ }
+ if (o2 == null) {
+ return -1;
+ }
+ String s1 = o1.getName();
+ String s2 = o2.getName();
+ if (s1 == null && s2 == null) {
+ return 0;
+ }
+ if (s1 == null) {
+ return 1;
+ }
+ if (s2 == null) {
+ return -1;
+ }
+ return s1.compareTo(s2);
+ }
+ });
+ return runtimes;
}
@Override
12 years, 7 months
JBoss Tools SVN: r41258 - in trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-05-22 15:18:47 -0400 (Tue, 22 May 2012)
New Revision: 41258
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExample.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java
Log:
JBIDE-10962 - Support for 'source-ref' in Project Examples
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExample.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExample.java 2012-05-22 16:59:09 UTC (rev 41257)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExample.java 2012-05-22 19:18:47 UTC (rev 41258)
@@ -53,6 +53,7 @@
private Set<String> tags;
private Set<String> essentialEnterpriseDependencies;
private String iconPath;
+ private String sourceLocation;
public ProjectExample() {
name = ""; //$NON-NLS-1$
@@ -353,4 +354,12 @@
public void setWelcomeFixRequired(boolean welcomeFixRequired) {
this.welcomeFixRequired = welcomeFixRequired;
}
+
+ public String getSourceLocation() {
+ return sourceLocation;
+ }
+
+ public void setSourceLocation(String sourceLocation) {
+ this.sourceLocation = sourceLocation;
+ }
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleUtil.java 2012-05-22 16:59:09 UTC (rev 41257)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleUtil.java 2012-05-22 19:18:47 UTC (rev 41258)
@@ -407,6 +407,8 @@
project.setDescription(getContent(child));
} else if (nodeName.equals(URL)) {
project.setUrl(getContent(child));
+ } else if (nodeName.equals("source-location")) { //$NON-NLS-1$
+ project.setSourceLocation(getContent(child));
} else if (nodeName.equals("perspectiveId")) { //$NON-NLS-1$
project.setPerspectiveId(getContent(child));
} else if (nodeName.equals("importType")) { //$NON-NLS-1$
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java 2012-05-22 16:59:09 UTC (rev 41257)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java 2012-05-22 19:18:47 UTC (rev 41258)
@@ -1,6 +1,7 @@
package org.jboss.tools.project.examples.wizard;
import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -33,6 +34,7 @@
import org.eclipse.mylyn.internal.discovery.core.model.RemoteBundleDiscoveryStrategy;
import org.eclipse.mylyn.internal.discovery.ui.DiscoveryUi;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.GC;
@@ -43,9 +45,12 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
@@ -69,6 +74,7 @@
private ArrayList<ProjectFix> unsatisfiedFixes = new ArrayList<ProjectFix>();
private Image checkboxOn;
private Image checkboxOff;
+ private Link link;
public NewProjectExamplesRequirementsPage(ProjectExample projectExample) {
super(PAGE_NAME);
@@ -144,13 +150,7 @@
gd = new GridData(SWT.FILL, SWT.FILL, true, false);
gd.horizontalSpan = 2;
label.setLayoutData(gd);
-
-// label = new Label(composite, SWT.NONE);
-// gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-// gd.horizontalSpan = 2;
-// label.setLayoutData(gd);
-
-
+
Group fixesGroup = new Group(composite, SWT.NONE);
gd = new GridData(SWT.FILL, SWT.FILL, true, false);
gd.horizontalSpan = 2;
@@ -181,6 +181,12 @@
tableViewer.setContentProvider(new FixContentProvider(fixes));
createButtons(fixesGroup, tableViewer);
+
+ link = new Link(composite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ gd.horizontalSpan=2;
+ link.setLayoutData(gd);
+
setPageComplete(true);
setControl(composite);
if (projectExample != null) {
@@ -373,10 +379,40 @@
return projectExample;
}
- public void setProjectExample(ProjectExample projectExample) {
+ public void setProjectExample(final ProjectExample projectExample) {
this.projectExample = projectExample;
setTitleAndDescription(projectExample);
refreshFixes();
+
+ if (link == null) {
+ return;
+ }
+ if (projectExample != null && projectExample.getSourceLocation() != null && !projectExample.getSourceLocation().isEmpty()) {
+ link.setVisible(true);
+ link.setText("Found a bug? Or have improvements to this example? Help us develop it, source can be found at <a>Project Example Source</a>");
+ link.getParent().pack(true);
+ link.addSelectionListener( new SelectionAdapter( ) {
+
+ public void widgetSelected( SelectionEvent e )
+ {
+ String text = e.text;
+ if ("Project Example Source".equals(text)) {
+ IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
+ .getBrowserSupport();
+ try {
+ URL url = new URL(projectExample.getSourceLocation());
+ support.getExternalBrowser().openURL(url);
+ } catch (Exception e1) {
+ ProjectExamplesActivator.log(e1);
+ }
+ }
+ }
+ } );
+ } else {
+ link.setVisible(false);
+ link.setText(""); //$NON-NLS-1$
+ link.getParent().pack(true);
+ }
}
protected void refreshFixes() {
12 years, 7 months
JBoss Tools SVN: r41257 - trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples.
by jbosstools-commits@lists.jboss.org
Author: ldimaggio
Date: 2012-05-22 12:59:09 -0400 (Tue, 22 May 2012)
New Revision: 41257
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
Log:
Removed commented out/unused code in examples/ESBExampleTest.java
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2012-05-22 15:27:09 UTC (rev 41256)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2012-05-22 16:59:09 UTC (rev 41257)
@@ -97,33 +97,6 @@
eclipse.runTreeItemAsJavaApplication(jmsCall);
bot.sleep(Timing.time5S());
util.waitForNonIgnoredJobs();
-
- // New - the consoles fail to switch....sometimes
- boolean consoleSwitched = false;
- int switchLimit = 30;
- int switchCounter = 0;
- consoleSwitched = console.switchConsole(configuredState.getServer().name);
- while (!consoleSwitched) {
- consoleSwitched = console.switchConsole(configuredState.getServer().name);
- bot.sleep(Timing.time10S());
- log.error("Console did not switch - retrying.");
- if (switchCounter++ > switchLimit) {
- break;
- }
- }
- //console.switchConsole(configuredState.getServer().name);
-
-// //String text2 = console.getConsoleText(TIME_5S, TIME_20S, false);
-// String text2 = console.getConsoleText(TIME_5S, TIME_30S, false); /* https://issues.jboss.org/browse/JBQA-5838 - ldimaggi */
-// log.info("text2 = " + text2);
-// //console.clearConsole();
-//
-// if (text2.length() == 0) {
-// return null;
-// }
-// else {
-// return text2;
-// }
String returnString = consoleWaiting();
return returnString;
}
@@ -152,39 +125,6 @@
protected String executeClientGetServerOutput(String className, String arguments) {
String text = console.getConsoleText();
eclipse.runJavaApplication(getExampleClientProjectName(), className, arguments);
-// console.switchConsole(configuredState.getServer().name);
-// String text2 = console.getConsoleText(TIME_5S, TIME_30S, false);
-// if (text.length()>=text2.length()) {
-// return null;
-// }
-// return text2.substring(text.length());
-
-// // New - the consoles fail to switch....sometimes
-// boolean consoleSwitched = false;
-// int switchLimit = 30;
-// int switchCounter = 0;
-// consoleSwitched = console.switchConsole(configuredState.getServer().name);
-// while (!consoleSwitched) {
-// consoleSwitched = console.switchConsole(configuredState.getServer().name);
-// bot.sleep(Timing.time10S());
-// log.error("Console did not switch - retrying.");
-// if (switchCounter++ > switchLimit) {
-// break;
-// }
-// }
-// //console.switchConsole(configuredState.getServer().name);
-//
-// //String text2 = console.getConsoleText(TIME_5S, TIME_20S, false);
-// String text2 = console.getConsoleText(TIME_5S, TIME_30S, false); /* https://issues.jboss.org/browse/JBQA-5838 - ldimaggi */
-// log.info("text2 = " + text2);
-// //console.clearConsole();
-//
-// if (text2.length() == 0) {
-// return null;
-// }
-// else {
-// return text2;
-// }
String returnString = consoleWaiting();
return returnString;
}
@@ -205,7 +145,6 @@
}
}
//console.switchConsole(configuredState.getServer().name);
-
//String text2 = console.getConsoleText(TIME_5S, TIME_20S, false);
String text2 = console.getConsoleText(TIME_5S, TIME_30S, false); /* https://issues.jboss.org/browse/JBQA-5838 - ldimaggi */
log.info("text2 = " + text2);
12 years, 7 months
JBoss Tools SVN: r41256 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-05-22 11:27:09 -0400 (Tue, 22 May 2012)
New Revision: 41256
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteDomainAction.java
Log:
Fixed issue where 'Delete domain' action was disabled if user has applications, which is now supported
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteDomainAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteDomainAction.java 2012-05-22 14:33:31 UTC (rev 41255)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteDomainAction.java 2012-05-22 15:27:09 UTC (rev 41256)
@@ -51,7 +51,7 @@
try {
IDomain domain = user.getDefaultDomain();
- if (domain != null && user.getApplications().size() == 0) {
+ if (domain != null) {
enable = true;
}
} catch (OpenShiftException e) {
12 years, 7 months
JBoss Tools SVN: r41255 - in trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test: detector and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-05-22 10:33:31 -0400 (Tue, 22 May 2012)
New Revision: 41255
Added:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/ServerWithSeam.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/ServerRuntimesPreferencesDialog.java
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java
Log:
Created test for combinations of adding server and seam runtimes.
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java 2012-05-22 13:30:42 UTC (rev 41254)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java 2012-05-22 14:33:31 UTC (rev 41255)
@@ -1,5 +1,6 @@
package org.jboss.tools.runtime.as.ui.bot.test;
+import org.jboss.tools.runtime.as.ui.bot.test.detector.ServerWithSeam;
import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam22.CheckSeam22;
import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam22.DetectSeam22;
import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam23.CheckSeam23;
@@ -34,6 +35,7 @@
@RunWith(RequirementAwareSuite.class)
@Suite.SuiteClasses({
+ ServerWithSeam.class,
DetectJBoss7.class,
OperateJBoss7.class,
DetectEAP6.class,
Added: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/ServerWithSeam.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/ServerWithSeam.java (rev 0)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/ServerWithSeam.java 2012-05-22 14:33:31 UTC (rev 41255)
@@ -0,0 +1,107 @@
+package org.jboss.tools.runtime.as.ui.bot.test.detector;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import org.jboss.tools.runtime.as.ui.bot.test.RuntimeProperties;
+import org.jboss.tools.runtime.as.ui.bot.test.detector.server.eap5.DetectEAP5;
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.RuntimeDetectionPreferencesDialog;
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SeamPreferencesDialog;
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SearchingForRuntimesDialog;
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.ServerRuntimesPreferencesDialog;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Runtime detection of JBoss server containing also Seam runtime. Checks if the JBoss AS and
+ * Seam can be added independently.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class ServerWithSeam extends SWTTestExt {
+
+ private RuntimeDetectionPreferencesDialog runtimeDetectionPreferences;
+
+ private SearchingForRuntimesDialog searchingForRuntimesDialog;
+
+ private SeamPreferencesDialog seamPreferences = new SeamPreferencesDialog();
+
+ private ServerRuntimesPreferencesDialog serverRuntimesPreferences = new ServerRuntimesPreferencesDialog();
+
+ @Before
+ public void search(){
+ runtimeDetectionPreferences = new RuntimeDetectionPreferencesDialog();
+ runtimeDetectionPreferences.open();
+ runtimeDetectionPreferences.addPath(RuntimeProperties.getInstance().getRuntimePath(DetectEAP5.SERVER_ID));
+ searchingForRuntimesDialog = runtimeDetectionPreferences.search();
+ }
+
+ @Test
+ public void serverFirst(){
+ deselectRuntime("seam");
+
+ assertSeamRuntimesNumber(0);
+ assertServerRuntimesNumber(1);
+
+ addAllDetectedRuntimes();
+
+ assertSeamRuntimesNumber(1);
+ assertServerRuntimesNumber(1);
+ }
+
+ @Test
+ public void seamFirst(){
+ deselectRuntime(DetectEAP5.SERVER_ID);
+
+ assertSeamRuntimesNumber(1);
+ assertServerRuntimesNumber(0);
+
+ addAllDetectedRuntimes();
+
+ assertSeamRuntimesNumber(1);
+ assertServerRuntimesNumber(1);
+ }
+
+ @After
+ public void cleanup(){
+ runtimeDetectionPreferences.open();
+ runtimeDetectionPreferences.removePath(RuntimeProperties.getInstance().getRuntimePath(DetectEAP5.SERVER_ID));
+ runtimeDetectionPreferences.ok();
+
+ seamPreferences.open();
+ seamPreferences.removeAllRuntimes();
+ seamPreferences.ok();
+
+ serverRuntimesPreferences.open();
+ serverRuntimesPreferences.removeAllRuntimes();
+ serverRuntimesPreferences.ok();
+ }
+
+ private void deselectRuntime(String name) {
+ searchingForRuntimesDialog.deselect(name);
+ searchingForRuntimesDialog.ok();
+ runtimeDetectionPreferences.ok();
+ }
+
+ private void assertSeamRuntimesNumber(int expected) {
+ seamPreferences.open();
+ assertThat(seamPreferences.getRuntimes().size(), is(expected));
+ seamPreferences.ok();
+ }
+
+ private void assertServerRuntimesNumber(int expected) {
+ serverRuntimesPreferences.open();
+ assertThat(serverRuntimesPreferences.getRuntimes().size(), is(expected));
+ serverRuntimesPreferences.ok();
+ }
+
+ private void addAllDetectedRuntimes() {
+ runtimeDetectionPreferences.open();
+ searchingForRuntimesDialog = runtimeDetectionPreferences.search();
+ searchingForRuntimesDialog.ok();
+ runtimeDetectionPreferences.ok();
+ }
+}
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java 2012-05-22 13:30:42 UTC (rev 41254)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java 2012-05-22 14:33:31 UTC (rev 41255)
@@ -2,11 +2,15 @@
import java.util.Set;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.jboss.tools.runtime.core.model.RuntimePath;
import org.jboss.tools.runtime.ui.RuntimeUIActivator;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
public class RuntimeDetectionPreferencesDialog extends PreferencesDialog{
@@ -37,6 +41,36 @@
public SearchingForRuntimesDialog search(){
SWTBotFactory.getBot().button("Search...").click();
+ SWTBot bot = SWTBotFactory.getBot().shell("Searching for runtimes...").bot();
+ bot.waitUntil(new RuntimeSearchedFinished(bot), TaskDuration.LONG.getTimeout());
return new SearchingForRuntimesDialog();
}
+
+ private static class RuntimeSearchedFinished implements ICondition {
+
+ private SWTBot bot;
+
+ public RuntimeSearchedFinished(SWTBot bot) {
+ this.bot = bot;
+ }
+
+ @Override
+ public void init(SWTBot bot) {
+ }
+
+ @Override
+ public boolean test() throws Exception {
+ try {
+ bot.label("Searching runtimes is finished.");
+ return true;
+ } catch (WidgetNotFoundException e){
+ return false;
+ }
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return "The runtime search has not finished in the specified amount of time";
+ }
+ }
}
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java 2012-05-22 13:30:42 UTC (rev 41254)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java 2012-05-22 14:33:31 UTC (rev 41255)
@@ -3,26 +3,18 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.runtime.as.ui.bot.test.entity.Runtime;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
-import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
public class SearchingForRuntimesDialog {
public List<Runtime> getRuntimes(){
List<Runtime> runtimes = new ArrayList<Runtime>();
- SWTBot bot = SWTBotFactory.getBot().shell("Searching for runtimes...").bot();
- bot.waitUntil(new RuntimeSearchedFinished(bot), TaskDuration.LONG.getTimeout());
- SWTBotTree tree = bot.tree();
-
- for (SWTBotTreeItem treeItem : SWTEclipseExt.getAllTreeItemsRecursive(SWTBotFactory.getBot(), tree, true)) {
+ for (SWTBotTreeItem treeItem : getRuntimesTreeItems()) {
Runtime runtime = new Runtime();
runtime.setName(treeItem.cell(0));
runtime.setVersion(treeItem.cell(1));
@@ -37,31 +29,16 @@
SWTBotFactory.getBot().button("OK").click();
}
- private static class RuntimeSearchedFinished implements ICondition {
-
- private SWTBot bot;
-
- public RuntimeSearchedFinished(SWTBot bot) {
- this.bot = bot;
- }
-
- @Override
- public void init(SWTBot bot) {
- }
-
- @Override
- public boolean test() throws Exception {
- try {
- bot.label("Searching runtimes is finished.");
- return true;
- } catch (WidgetNotFoundException e){
- return false;
+ public void deselect(String runtimeName){
+ for (SWTBotTreeItem treeItem : getRuntimesTreeItems()) {
+ if (treeItem.cell(0).equals(runtimeName)){
+ treeItem.uncheck();
}
}
-
- @Override
- public String getFailureMessage() {
- return "The runtime search has not finished in the specified amount of time";
- }
}
+
+ private List<SWTBotTreeItem> getRuntimesTreeItems(){
+ SWTBotTree tree = SWTBotFactory.getBot().tree();
+ return SWTEclipseExt.getAllTreeItemsRecursive(SWTBotFactory.getBot(), tree, true);
+ }
}
Added: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/ServerRuntimesPreferencesDialog.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/ServerRuntimesPreferencesDialog.java (rev 0)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/ServerRuntimesPreferencesDialog.java 2012-05-22 14:33:31 UTC (rev 41255)
@@ -0,0 +1,44 @@
+package org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
+import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.jboss.tools.runtime.as.ui.bot.test.entity.Runtime;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+
+public class ServerRuntimesPreferencesDialog extends PreferencesDialog {
+
+ public void open(){
+ open("Server", "Runtime Environments");
+ }
+
+ public List<Runtime> getRuntimes(){
+ List<Runtime> runtimes = new ArrayList<Runtime>();
+
+ SWTBotTable table = SWTBotFactory.getBot().table();
+
+ for (int i = 0; i < table.rowCount(); i++){
+ Runtime runtime = new Runtime();
+ runtime.setName(table.cell(i, 0));
+ runtime.setType(table.cell(i, 1));
+ runtimes.add(runtime);
+ }
+ return runtimes;
+ }
+
+ public void removeAllRuntimes(){
+ SWTBot bot = SWTBotFactory.getBot();
+ SWTBotTable table = bot.table();
+
+ for (int i = 0; i < table.rowCount(); i++){
+ table.click(0, 0);
+ bot.button("Remove").click();
+ KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT, Keystrokes.CR, Keystrokes.LF);
+ bot.shell("Preferences").activate();
+ }
+ }
+}
12 years, 7 months