JBoss Tools SVN: r42869 - trunk/freemarker/tests/org.jboss.tools.freemarker.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-08-07 03:04:02 -0400 (Tue, 07 Aug 2012)
New Revision: 42869
Modified:
trunk/freemarker/tests/org.jboss.tools.freemarker.ui.bot.test/pom.xml
Log:
Freemarker ui.bot.test pom.xml updated, needed configuration is now in parent pom
Modified: trunk/freemarker/tests/org.jboss.tools.freemarker.ui.bot.test/pom.xml
===================================================================
--- trunk/freemarker/tests/org.jboss.tools.freemarker.ui.bot.test/pom.xml 2012-08-07 06:59:27 UTC (rev 42868)
+++ trunk/freemarker/tests/org.jboss.tools.freemarker.ui.bot.test/pom.xml 2012-08-07 07:04:02 UTC (rev 42869)
@@ -26,43 +26,6 @@
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>0.14.1</version>
- <configuration>
- <resolver>p2</resolver>
- <ignoreTychoRepositories>true</ignoreTychoRepositories>
- <environments>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86_64</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86_64</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<useUIThread>false</useUIThread>
13 years, 5 months
JBoss Tools SVN: r42868 - in trunk/as/plugins: org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-07 02:59:27 -0400 (Tue, 07 Aug 2012)
New Revision: 42868
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java
Log:
JBIDE-11982 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java 2012-08-06 16:38:04 UTC (rev 42867)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java 2012-08-07 06:59:27 UTC (rev 42868)
@@ -64,4 +64,21 @@
}
return false;
}
+
+ public boolean serverModulesChanged(ServerEvent event, int state) {
+ int eventKind = event.getKind();
+ if ((eventKind & ServerEvent.MODULE_CHANGE) != 0) {
+ return true;
+ }
+ return false;
+ }
+ public boolean serverPublishStateChanged(ServerEvent event, int state) {
+ int eventKind = event.getKind();
+ if ((eventKind & ServerEvent.PUBLISH_STATE_CHANGE) != 0) {
+ return true;
+ }
+ return false;
+ }
+
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2012-08-06 16:38:04 UTC (rev 42867)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2012-08-07 06:59:27 UTC (rev 42868)
@@ -222,7 +222,9 @@
public static String EditorNoRuntimeSelected;
public static String EditorLocalDeployment;
public static String EditorRefreshViewer;
+ public static String EditorDeploymentPageWarning;
+
public static String ExploreUtils_Action_Text;
public static String ExploreUtils_Description;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2012-08-06 16:38:04 UTC (rev 42867)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2012-08-07 06:59:27 UTC (rev 42868)
@@ -197,7 +197,7 @@
EditorNoRuntimeSelected=No Runtime Selected. Please select a runtime and refresh your deployment options.
EditorLocalDeployment=Local Deployment
EditorRefreshViewer=Refresh Table
-
+EditorDeploymentPageWarning=Settings on this page may only be modified if the server has 0 modules and is fully synchronized.
ExploreUtils_Action_Text=File Browser
ExploreUtils_Description=Explore deploy directory
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2012-08-06 16:38:04 UTC (rev 42867)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2012-08-07 06:59:27 UTC (rev 42868)
@@ -976,4 +976,18 @@
return new Path(folder).append(outputName).toPortableString();
return outputName;
}
+
+ public void setEnabled(boolean enabled) {
+ Control[] c = new Control[] {
+ viewer.getTree(), deployText, tempDeployText,
+ metadataRadio, serverRadio, customRadio, currentSelection,
+ deployButton, tempDeployButton,zipDeployWTPProjects
+ };
+ System.out.println("Setting enablement to " + enabled);
+ for( int i = 0; i < c.length; i++ ) {
+ if( c[i] != null && !c[i].isDisposed()) {
+ c[i].setEnabled(enabled);
+ }
+ }
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java 2012-08-06 16:38:04 UTC (rev 42867)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java 2012-08-07 06:59:27 UTC (rev 42868)
@@ -16,30 +16,38 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerListener;
import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerEvent;
import org.eclipse.wst.server.ui.editor.IServerEditorPartInput;
import org.eclipse.wst.server.ui.editor.ServerEditorPart;
import org.eclipse.wst.server.ui.internal.command.ServerCommand;
import org.eclipse.wst.server.ui.internal.editor.ServerEditorPartInput;
import org.eclipse.wst.server.ui.internal.editor.ServerResourceCommandManager;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentModulePrefs;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentPreferences;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.UIUtil;
public class ModuleDeploymentPage extends ServerEditorPart {
protected ServerResourceCommandManager commandManager;
@@ -47,6 +55,7 @@
protected DeploymentPreferences preferences;
protected ServerAttributeHelper helper;
protected DeploymentModuleOptionCompositeAssistant tab;
+ private IServerListener listener;
public ServerAttributeHelper getHelper() {
if( helper == null ) {
helper = new ServerAttributeHelper(getServer().getOriginal(), getServer());
@@ -80,10 +89,42 @@
server = sepi.getServer();
commandManager = ((ServerEditorPartInput) sepi).getServerCommandManager();
readOnly = sepi.isServerReadOnly();
+ helper = new ServerAttributeHelper(server.getOriginal(), server);
+ listener = new UnitedServerListener() {
+ public void serverChanged(ServerEvent event) {
+ setDeploymentTabEnablement(event.getModule());
+ }
+ };
+ server.getOriginal().addServerListener(listener);
}
- helper = new ServerAttributeHelper(server.getOriginal(), server);
}
+ protected void setDeploymentTabEnablement(IModule[] changed) {
+ // This is a big hack due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=386718
+ // IT seems getting the NEW module list from the event is not possible,
+ // and figuring out if a module was added also does not seem to be possible
+ new Thread() {
+ public void run() {
+ try {
+ Thread.sleep(300);
+ } catch(InterruptedException ie) {}
+
+ IModule[] deployed = server.getOriginal().getModules();
+ final boolean hasNoModules = deployed == null || deployed.length == 0;
+ final boolean enabled = hasNoModules && server.getOriginal().getServerPublishState() == IServer.PUBLISH_STATE_NONE;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ tab.setEnabled(enabled);
+ }
+ });
+ }
+ }.start();
+ }
+
+ public void dispose() {
+ super.dispose();
+ server.getOriginal().removeServerListener(listener);
+ }
public void refreshPossibleModules() {
ArrayList<IModule> possibleChildren = new ArrayList<IModule>();
IModule[] modules2 = org.eclipse.wst.server.core.ServerUtil.getModules(server.getServerType().getRuntimeType().getModuleTypes());
@@ -117,18 +158,19 @@
}
private void addDeploymentLocationControls(Composite parent, Control top) {
+ FormToolkit toolkit = new FormToolkit(parent.getDisplay());
+ Label l1 = toolkit.createLabel(parent, Messages.EditorDeploymentPageWarning);
+ FormData fd = new FormData();
+ fd.left = new FormAttachment(0, 5);
+ fd.top = top == null ? new FormAttachment(0, 5) : new FormAttachment(top, 5);
+ fd.right = new FormAttachment(100, -5);
+ l1.setLayoutData(fd);
+
tab = new DeploymentModuleOptionCompositeAssistant();
tab.setDeploymentPage(this);
tab.setDeploymentPrefs(preferences);
Composite defaultComposite = tab.createDefaultComposite(parent);
- FormData fd = new FormData();
- fd.left = new FormAttachment(0, 5);
- if( top == null )
- fd.top = new FormAttachment(0, 5);
- else
- fd.top = new FormAttachment(top, 5);
- fd.right = new FormAttachment(100, -5);
- defaultComposite.setLayoutData(fd);
+ defaultComposite.setLayoutData(UIUtil.createFormData2(l1, 5, null,0,0,5,100,-5));
Composite viewComposite = tab.createViewerPortion(parent);
fd = new FormData();
13 years, 5 months
JBoss Tools SVN: r42867 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-08-06 12:38:04 -0400 (Mon, 06 Aug 2012)
New Revision: 42867
Modified:
trunk/build/pom.xml
Log:
usage added to xulrunner-bootstrap profile
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2012-08-06 16:01:18 UTC (rev 42866)
+++ trunk/build/pom.xml 2012-08-06 16:38:04 UTC (rev 42867)
@@ -184,6 +184,7 @@
</activation>
<modules>
<module>../xulrunner</module>
+ <module>../usage</module>
</modules>
</profile>
13 years, 5 months
JBoss Tools SVN: r42866 - trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-08-06 12:01:18 -0400 (Mon, 06 Aug 2012)
New Revision: 42866
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java
Log:
Fixes for JBT 3.4
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2012-08-06 15:47:49 UTC (rev 42865)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2012-08-06 16:01:18 UTC (rev 42866)
@@ -195,9 +195,16 @@
IDELabel.Menu.ADD_JSF_CAPABILITIES).click();
} catch (WidgetNotFoundException wnfe){
// From 3.1.0.RC1 version this menu is moved to Configure submenu
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- IDELabel.Menu.PACKAGE_EXPLORER_CONFIGURE, false)).menu(
- IDELabel.Menu.ADD_JSF_CAPABILITIES).click();
+ try{
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
+ IDELabel.Menu.PACKAGE_EXPLORER_CONFIGURE, false)).menu(
+ IDELabel.Menu.ADD_JSF_CAPABILITIES).click();
+ }catch (WidgetNotFoundException wnfex){
+ // sometimes context menu is not created properly after first click
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
+ IDELabel.Menu.PACKAGE_EXPLORER_CONFIGURE, false)).menu(
+ IDELabel.Menu.ADD_JSF_CAPABILITIES).click();
+ }
}
delay();
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java 2012-08-06 15:47:49 UTC (rev 42865)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java 2012-08-06 16:01:18 UTC (rev 42866)
@@ -57,14 +57,13 @@
0,
expectedProposals);
// Check content assist for #{msg. prefix
- expectedProposals.clear();
- expectedProposals.add("name : String - Person");
- ContentAssistHelper.checkContentAssistContent(SWTTestExt.bot,
+ ContentAssistHelper.checkContentAssistAutoProposal(SWTTestExt.bot,
FACELETS_TEST_PAGE,
textForSelection,
16,
0,
- expectedProposals);
+ 0,
+ "name");
}
/**
* Test Code Completion functionality for resource
@@ -138,12 +137,18 @@
0);
String contentAssistToUse = "jsfc";
ContentAssistBot contentAssist = editor.contentAssist();
+ SWTBotShell[] shellsBeforeCA = bot.shells();
contentAssist.checkContentAssist(contentAssistToUse, true);
editor.save();
+ SWTBotShell caShell = contentAssist.getContentAssistShell(shellsBeforeCA, bot.shells());
+ if (caShell != null){
+ caShell.close();
+ }
String expectedInsertedText = "<input " + contentAssistToUse + "=\"\"";
assertTrue("Editor has to contain text '" + expectedInsertedText + "' but it doesn't\n" +
"Editor Text is\n" + editor.getText(),
editor.getText().contains(expectedInsertedText));
+ // hide Code Assist Window automatically opened when typing text
// check jsfc attribute value Content Assist menu Content
ContentAssistHelper.checkContentAssistContent(SWTTestExt.bot,
FACELETS_TEST_PAGE,
@@ -189,29 +194,21 @@
0);
String textToInsert = "<ez:";
compositeComponentContainerEditor.insertText(textToInsert);
- SWTJBTExt.selectTextInSourcePane(SWTTestExt.bot,
+ // Check content assist menu content for "<ez:"
+ String expectedInsertedText = "input action=\"\" value=\"\"></ez:input>";
+ ContentAssistHelper.checkContentAssistAutoProposal(SWTTestExt.bot,
JSF2_TEST_PAGE,
textToInsert,
textToInsert.length(),
0,
- 0);
- // Check content assist menu content for "<ez:"
- contentAssist.checkContentAssist("ez:input", true);
- bot.sleep(Timing.time2S());
+ 0,
+ expectedInsertedText);
compositeComponentContainerEditor.save();
- String currentLineText = compositeComponentContainerEditor.getTextOnCurrentLine();
- String expectedInsertedText = "<ez:input value=\"\" action=\"\"></ez:input>";
- if (!currentLineText.toLowerCase().contains(expectedInsertedText.toLowerCase())){
- expectedInsertedText = "<ez:input action=\"\" value=\"\"></ez:input>";
- assertTrue("Inserted text should be " + expectedInsertedText + " but is not.\n"
- + "Current line text is " + currentLineText,
- currentLineText.toLowerCase().contains(expectedInsertedText.toLowerCase()));
- }
// Check content assist menu content for Composite Components attributes
ContentAssistHelper.checkContentAssistContent(SWTTestExt.bot,
JSF2_TEST_PAGE,
expectedInsertedText,
- 10,
+ 6,
0,
getCompositeComponentsAttributesProposalList());
// Open Composite Component definition file
@@ -240,7 +237,7 @@
contentAssist.checkContentAssist("cc.attrs", true);
bot.sleep(Timing.time2S());
compositeComponentDefEditor.save();
- currentLineText = compositeComponentDefEditor.getTextOnCurrentLine();
+ String currentLineText = compositeComponentDefEditor.getTextOnCurrentLine();
expectedInsertedText = "#{cc.attrs}";
assertTrue("Inserted text should be " + expectedInsertedText + " but is not.\n"
+ "Current line text is " + currentLineText,
13 years, 5 months
JBoss Tools SVN: r42865 - in trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext: parts and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-08-06 11:47:49 -0400 (Mon, 06 Aug 2012)
New Revision: 42865
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContentAssistHelper.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/ContentAssistBot.java
Log:
Added methods needed for JBT 3.4.x Code Assist testing.
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContentAssistHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContentAssistHelper.java 2012-08-06 15:25:39 UTC (rev 42864)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContentAssistHelper.java 2012-08-06 15:47:49 UTC (rev 42865)
@@ -130,4 +130,41 @@
}
+ /**
+ * Checks Content Assist auto proposal. It's case when there is only one
+ * content assist item and that item is automatically inserted into editor
+ * and checks if expectedProposalList is equal to current Proposal List
+ * @param editorTitle
+ * @param textToSelect
+ * @param selectionOffset
+ * @param selectionLength
+ * @param textToSelectIndex
+ * @param expectedInsertedText
+ */
+ public static SWTBotEditor checkContentAssistAutoProposal(SWTBotExt bot,
+ String editorTitle, String textToSelect, int selectionOffset,
+ int selectionLength, int textToSelectIndex, String expectedInsertedText) {
+
+ SWTJBTExt.selectTextInSourcePane(bot,
+ editorTitle, textToSelect, selectionOffset, selectionLength,
+ textToSelectIndex);
+
+ bot.sleep(Timing.time1S());
+
+ SWTBotEditorExt editor = SWTTestExt.bot.swtBotEditorExtByTitle(editorTitle);
+ String editorLineBeforeInsert = editor.getTextOnCurrentLine();
+ int xPos = editor.cursorPosition().column;
+ String expectedEditorLineAfterInsert = editorLineBeforeInsert.substring(0,xPos) +
+ expectedInsertedText +
+ editorLineBeforeInsert.substring(xPos);
+ ContentAssistBot contentAssist = editor.contentAssist();
+ contentAssist.invokeContentAssist();
+ String editorLineAfterInsert = editor.getTextOnCurrentLine();
+ assertTrue("Text on current line should be:\n" +
+ "but is :\n" + editorLineAfterInsert
+ , editorLineAfterInsert.equals(expectedEditorLineAfterInsert));
+
+ return editor;
+
+ }
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/ContentAssistBot.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/ContentAssistBot.java 2012-08-06 15:25:39 UTC (rev 42864)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/ContentAssistBot.java 2012-08-06 15:47:49 UTC (rev 42865)
@@ -132,7 +132,7 @@
/*
* Invokes ContentAssistProposal shell action
*/
- private void invokeContentAssist() {
+ public void invokeContentAssist() {
String actionId = "ContentAssistProposal";
//final IAction action = ((ITextEditor) partReference.getEditor(false)).getAction(actionId);
Object oEditor = editor.getReference().getEditor(false);
@@ -282,7 +282,7 @@
* @param s2
* @return
*/
- private SWTBotShell getContentAssistShell(SWTBotShell[] s1, SWTBotShell[] s2) {
+ public SWTBotShell getContentAssistShell(SWTBotShell[] s1, SWTBotShell[] s2) {
SWTBotShell ccShell = null;
for (SWTBotShell bs2 : s2) {
boolean found = false;
13 years, 5 months
JBoss Tools SVN: r42864 - branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-08-06 11:25:39 -0400 (Mon, 06 Aug 2012)
New Revision: 42864
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
Log:
[JBIDE-12142] committed new client library with fix
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
13 years, 5 months
JBoss Tools SVN: r42863 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-08-06 11:17:58 -0400 (Mon, 06 Aug 2012)
New Revision: 42863
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
Log:
[JBIDE-12142] committed new client library with fix
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
13 years, 5 months
JBoss Tools SVN: r42862 - trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot.
by jbosstools-commits@lists.jboss.org
Author: rhopp
Date: 2012-08-06 09:16:35 -0400 (Mon, 06 Aug 2012)
New Revision: 42862
Removed:
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithoutServerTest.java
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/EmptyTestForHudson.java
Modified:
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/BaseFunctionalityTest.java
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CentralAllBotTests.java
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/DocumentationSectionTest.java
Log:
Cleanup of JBoss Central tests
Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/BaseFunctionalityTest.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/BaseFunctionalityTest.java 2012-08-06 13:13:23 UTC (rev 42861)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/BaseFunctionalityTest.java 2012-08-06 13:16:35 UTC (rev 42862)
@@ -9,7 +9,6 @@
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
-//(a)RunWith(SWTBotJunit4ClassRunner.class)
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({CentralAllBotTests.class})
public class BaseFunctionalityTest extends SWTTestExt {
@@ -19,7 +18,6 @@
*/
@BeforeClass
public static void setup(){
- //jbt.closeReportUsageWindowIfOpened(false);
util.closeAllEditors(false);
util.closeAllViews();
}
@@ -45,6 +43,8 @@
assertTrue("JBoss Central is not active",bot.editorByTitle(IDELabel.JBossCentralEditor.JBOSS_CENTRAL).isActive());
}
+
+ //TODO Refactor search Test
// @Test
// public void testSearch(){
// assertTrue("JBoss Central is not active",bot.editorByTitle("JBoss Central").isActive());
Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CentralAllBotTests.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CentralAllBotTests.java 2012-08-06 13:13:23 UTC (rev 42861)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CentralAllBotTests.java 2012-08-06 13:16:35 UTC (rev 42862)
@@ -8,9 +8,7 @@
@SuiteClasses({
BaseFunctionalityTest.class,
CreateProjectsWithServerTest.class,
-// CreateProjectsWithoutServerTest.class
DocumentationSectionTest.class
-// EmptyTestForHudson.class
// InstallTest.class
})
public class CentralAllBotTests {
Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java 2012-08-06 13:13:23 UTC (rev 42861)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java 2012-08-06 13:16:35 UTC (rev 42862)
@@ -93,13 +93,9 @@
@After
public void teardown(){
servers.removeAllProjectsFromServer("AS-7.0");
- /*SWTBotTreeItem[] items = ProblemsView.getErrorsNode(bot).getItems();
- for (SWTBotTreeItem swtBotTreeItem : items) {
- log.error(swtBotTreeItem.toString());
- }*/
}
-// @Test
+ @Test
public void createProjectsSectionTest(){
//Dynamic web project
bot.hyperlink(IDELabel.JBossCentralEditor.DYNAMIC_WEB_PROJECT).click();
@@ -108,14 +104,11 @@
bot.activeShell().close();
//Openshift app
log.info(bot.activeShell().getText());
-
- //TODO will put back when IDELabel.JBossCentralEditor.OPENSHIFT_APP_WIZARD will be correct
bot.hyperlink(IDELabel.JBossCentralEditor.OPENSHIFT_APP).click();
bot.waitForShell(IDELabel.JBossCentralEditor.OPENSHIFT_APP_WIZARD);
bot.waitWhile(new NonSystemJobRunsCondition());
assertTrue("New OpenShift Express Application window should have appeared", bot.activeShell().getText().equals(IDELabel.JBossCentralEditor.OPENSHIFT_APP_WIZARD));
bot.waitWhile(new NonSystemJobRunsCondition());
- //assertTrue("New OpenShift Express Application window should have appeared", bot.shell(IDELabel.JBossCentralEditor.OPENSHIFT_APP_WIZARD).isActive());
bot.activeShell().close();
bot.waitWhile(new NonSystemJobRunsCondition());
bot.hyperlink(IDELabel.JBossCentralEditor.JAVA_EE_WEB_PROJECT).click();
@@ -150,17 +143,14 @@
public void projectExamplesSectionTest(){
SWTBotTwistie twistieBot = bot.twistieByLabel("JBoss Quickstarts");
int counter = 0;
- while (!twistieBot.isExpanded() && counter>10){
+ while (!twistieBot.isExpanded() && counter<10){
twistieBot.toggle();
counter++;
}
- /*if (!twistieBot.isExpanded()){
- twistieBot.toggle();
- }*/
SWTFormsBotExt formsBot = SWTBotFactory.getFormsBot();
checkExample(formsBot, "Helloworld", true);
checkExample(formsBot, "Numberguess", true);
- checkExample(formsBot, "Login", true, "login.xml"); //Login example ma nejaky divny login.xml cheatsheet
+ checkExample(formsBot, "Login", true, "login.xml"); //Login has some weird login.xml cheatsheet
checkExample(formsBot, "Kitchensink", true);
checkExample(formsBot, "HTML5", true);
canBeDeployedTest();
@@ -291,22 +281,4 @@
bot.clickButton("Finish");
}
}
-
-// private void checkCreateProject(String formText){
-// //formsBot.formTextWithText(formText).click();
-// bot.hyperlink(formText).click();
-// bot.waitForShell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE);
-// SWTBotWizard wizard = new SWTBotWizard(bot.shell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE).widget);
-// wizard.next();
-// wizard.finishWithWait();
-// bot.activeShell().close();
-// if (bot.activeEditor().getTitle().equalsIgnoreCase("cheat sheets")){
-// bot.activeEditor().close();
-// }
-//// assertTrue("Project Example window should have appeared", bot.shell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE).isActive());
-//// bot.button("Start").click();
-//// bot.waitForShell(wizzardShellText);
-//// assertTrue(wizzardShellText+" should have appeared", bot.shell(wizzardShellText).isActive());
-//// bot.activeShell().close();
-// }
}
Deleted: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithoutServerTest.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithoutServerTest.java 2012-08-06 13:13:23 UTC (rev 42861)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithoutServerTest.java 2012-08-06 13:16:35 UTC (rev 42862)
@@ -1,192 +0,0 @@
-package org.jboss.tools.central.test.ui.bot;
-
-import java.io.File;
-
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-import org.jboss.tools.ui.bot.ext.SWTFormsBotExt;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.condition.ShellIsActiveCondition;
-import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.ui.bot.ext.wizards.SWTBotWizard;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class CreateProjectsWithoutServerTest extends SWTTestExt {
-
- private static final String JBOSS_INSTALL_PATH = "/tmp/jbossAS";
-
-
- @BeforeClass
- public static void setup(){
- bot.menu("Help").menu(IDELabel.JBossCentralEditor.JBOSS_CENTRAL).click();
- util.waitForAll();
- }
-
- @AfterClass
- public static void teardown(){
- deleteDirectory(new File(JBOSS_INSTALL_PATH));
- }
-
- @Test
- public void createProjectsSectionTest(){
-// SWTFormsBotExt formsBot = SWTBotFactory.getFormsBot();
- //Dynamic web project
- bot.hyperlink(IDELabel.JBossCentralEditor.DYNAMIC_WEB_PROJECT).click();
- bot.waitForShell(IDELabel.JBossCentralEditor.NEW_DYNAMIC_WEB_PROJECT);
- assertTrue("New Dynamic Web Project should have appeared", bot.shell(IDELabel.JBossCentralEditor.NEW_DYNAMIC_WEB_PROJECT).isActive());
- bot.activeShell().close();
- //Openshift app
- bot.hyperlink(IDELabel.JBossCentralEditor.OPENSHIFT_APP).click();
- bot.waitForShell(IDELabel.JBossCentralEditor.OPENSHIFT_APP_WIZARD);
- bot.activeShell().close();
-
- //check Project example and detection of server
- bot.hyperlink(IDELabel.JBossCentralEditor.JAVA_EE_WEB_PROJECT).click();
- SWTBotShell projectExampleShell = bot.waitForShell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE);
- assertTrue("Project Example window should have appeared", bot.shell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE).isActive());
- try{
- bot.table().select(0);
- bot.clickButton("Install...");
- SWTBotShell shell = bot.waitForShell(IDELabel.Menu.PREFERENCES);
- if (shell == null){
- fail("Preferences shell should have appeared");
- }
- bot.activeShell().close();
- }catch(WidgetNotFoundException wnfex){
- fail("Missing Install button");
- }
- try{
- projectExampleShell.activate();
- bot.clickButton("Download and Install...");
- }catch(WidgetNotFoundException wnfex){
- fail("Missing \"Download and Install\" button");
- }
-
- //create direcotry where will be JBossAS downloaded
- if(!createDirectory(JBOSS_INSTALL_PATH)){
- fail("Unable to create direcory for JBoss - \""+JBOSS_INSTALL_PATH+"\"");
- }
-
- bot.textWithLabel("Install folder:").setText(JBOSS_INSTALL_PATH);
- bot.textWithLabel("Download folder:").setText("/tmp");
- bot.clickButton("OK");
- bot.waitForShell("Progress Information");
- //downloading jboss AS could take really long time, that's why waiting for shell twice.
- try{
- bot.waitUntil(new ShellIsActiveCondition(projectExampleShell), TaskDuration.VERY_LONG.getTimeout());
- }catch(Exception ex){
- //do nothing
- }
- bot.waitUntil(new ShellIsActiveCondition(projectExampleShell), TaskDuration.VERY_LONG.getTimeout());
- projectExampleShell.close();
-
- //server should be added.. check again
- bot.hyperlink(IDELabel.JBossCentralEditor.JAVA_EE_WEB_PROJECT).click();
- projectExampleShell = bot.waitForShell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE);
- assertTrue("Project Example window should have appeared", bot.shell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE).isActive());
- try{
- bot.clickButton("Install");
- fail("Button \"Install\" should not be enabled, because all requirements should have been met");
- }catch(WidgetNotFoundException wnfex){
- //ok
- }
- projectExampleShell.activate();
- assertFalse("Button \"Download and Install...\" should not be enabled, because all requirements should have been met, condition", bot.button("Download and Install...").isEnabled());
- projectExampleShell.close();
-
- //check the rest of project examples
- checkExample(null, IDELabel.JBossCentralEditor.JAVA_EE_WEB_PROJECT, true);
- checkExample(null, IDELabel.JBossCentralEditor.JAVA_EE_PROJECT, true);
- checkExample(null, IDELabel.JBossCentralEditor.HTML5_PROJECT, true);
- checkExample(null, IDELabel.JBossCentralEditor.RICHFACES_PROJECT, true);
- checkExample(null, IDELabel.JBossCentralEditor.SPRING_MVC_PROJECT, false);
-
- bot.toolbarDropDownButtonWithTooltip("New").click();
- bot.waitForShell("New");
- assertTrue("Shell \"New\" should have appeared", bot.shell("New").isActive());
- bot.activeShell().close();
- }
-
-
- /**
- *
- * @param formsBot formBot==null => link is of type HyperLink else it is of type FormText
- * @param formText
- * @param readme true if readme should be shown
- */
-
- private void checkExample(SWTFormsBotExt formsBot, String formText, boolean readme){
- checkExample(formsBot, formText, readme, null);
- }
-
- /**
- * Checks example
- * @param formsBot bot for Forms
- * @param formText text to be clicked at
- * @param readme true if readme is supposed to show, false otherwise
- * @param readmeFileName
- */
-
- private void checkExample(SWTFormsBotExt formsBot, String formText, boolean readme, String readmeFileName){
- if (formsBot==null){
- bot.hyperlink(formText).click();
- }else{
- formsBot.formTextWithText(formText).click();
- }
- bot.waitForShell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE);
- SWTBotWizard wizard = new SWTBotWizard(bot.shell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE).widget);
- wizard.next();
- if (wizard.canNext()) wizard.next();
- wizard.finishWithWait();
- String readmeText = bot.checkBox(1).getText();
- assertFalse("Quick fix should not be enabled (Everything should be fine)", bot.checkBox(0).isEnabled());
- if (readme){
- assertTrue("Show readme checkbox should be enabled", bot.checkBox(1).isEnabled());
- assertTrue("Show readme checkbox should be checked by default", bot.checkBox(1).isChecked());
- if (readmeFileName != null){
- assertTrue(readmeText.toLowerCase().contains(readmeFileName));
- bot.clickButton("Finish");
- assertTrue("Cheat Sheets view should be opened right now", bot.activeView().getTitle().equals("Cheat Sheets"));
- bot.activeView().close();
- }else if (readmeText.contains("cheatsheet.xml")){
- bot.clickButton("Finish");
- assertTrue("Cheat Sheets view should be opened right now", bot.activeView().getTitle().equals("Cheat Sheets"));
- bot.activeView().close();
- }else if (readmeText.toLowerCase().contains("readme.md") || readmeText.toLowerCase().contains("readme.txt")){
- bot.clickButton("Finish");
- //assertTrue("Readme should have opened in Text Editor", bot.activeEditor().getReference().getEditor(false).getClass().getName().contains("org.eclipse.ui.editors.text.TextEditor")); //because readmes are opening in browser now.. It's a bug. Jira is created.
- bot.activeEditor().close();
- }else if (readmeText.toLowerCase().contains("readme.htm")){
- bot.clickButton("Finish");
- assertTrue("Readme should have opened in Internal Browser", bot.activeEditor().getReference().getEditor(false).getClass().getName().contains("org.eclipse.ui.internal.browser.WebBrowserEditor"));
- }
- }else{
- bot.clickButton("Finish");
- }
- }
-
-
- private boolean createDirectory(String path){
- File file = new File(path);
- return file.mkdir();
- }
-
- private static boolean deleteDirectory(File path) {
- if( path.exists() ) {
- File[] files = path.listFiles();
- for(int i=0; i<files.length; i++) {
- if(files[i].isDirectory()) {
- deleteDirectory(files[i]);
- }
- else {
- files[i].delete();
- }
- }
- }
- return( path.delete() );
- }
-}
Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/DocumentationSectionTest.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/DocumentationSectionTest.java 2012-08-06 13:13:23 UTC (rev 42861)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/DocumentationSectionTest.java 2012-08-06 13:16:35 UTC (rev 42862)
@@ -37,7 +37,6 @@
bot.waitUntil(new BrowserIsLoaded(browser), TaskDuration.LONG.getTimeout());
assertFalse("JBoss Central sould not be active editor right now", bot.activeEditor().getTitle().equals("JBoss Central"));
//And also can't be empty page
- //System.out.println(browser.getText());
Pattern pattern = Pattern.compile(".*<body></body>.*", Pattern.DOTALL);
Matcher matcher = pattern.matcher(browser.getText());
assertFalse("Page cannot be empty", matcher.matches());
Deleted: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/EmptyTestForHudson.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/EmptyTestForHudson.java 2012-08-06 13:13:23 UTC (rev 42861)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/EmptyTestForHudson.java 2012-08-06 13:16:35 UTC (rev 42862)
@@ -1,120 +0,0 @@
-package org.jboss.tools.central.test.ui.bot;
-
-import java.io.FileNotFoundException;
-
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-import org.jboss.tools.ui.bot.ext.SWTFormsBotExt;
-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.ServerType;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.ui.bot.ext.wizards.SWTBotWizard;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-
-@Require
-public class EmptyTestForHudson extends SWTTestExt {
-
-
- @BeforeClass
- public static void setup() throws FileNotFoundException{
- util.closeAllEditors(false);
- util.closeAllViews();
- bot.menu("Window").menu("Preferences").click();
- bot.waitForShell("Preferences");
- bot.tree().getTreeItem("Maven").select();
- bot.checkBox("Download repository index updates on startup").deselect();
- bot.clickButton("OK");
- bot.menu("Help").menu(IDELabel.JBossCentralEditor.JBOSS_CENTRAL).click();
- util.waitForAll();
- }
-
- @Test
- public void testTest(){
- checkExample(null, IDELabel.JBossCentralEditor.RICHFACES_PROJECT, true);
- checkExample(null, IDELabel.JBossCentralEditor.SPRING_MVC_PROJECT, true);
- SWTFormsBotExt formsBot = SWTBotFactory.getFormsBot();
- formsBot.formTextWithText("Helloworld").click();
- bot.sleep(TIME_10S);
- }
-
-
-
- /**
- *
- * @param formsBot formBot==null => link is of type HyperLink else it is of type FormText
- * @param formText
- * @param readme true if readme should be shown
- */
-
- private void checkExample(SWTFormsBotExt formsBot, String formText, boolean readme){
- checkExample(formsBot, formText, readme, null);
- }
-
- /**
- * Checks example
- * @param formsBot bot for Forms
- * @param formText text to be clicked at
- * @param readme true if readme is supposed to show, false otherwise
- * @param readmeFileName
- */
-
- private void checkExample(SWTFormsBotExt formsBot, String formText, boolean readme, String readmeFileName){
- problems.show();
- if (formsBot==null){
- bot.hyperlink(formText).click();
- }else{
- try{
- formsBot.formTextWithText(formText).click();
- }catch(WidgetNotFoundException wnfex){
- throw new WidgetNotFoundException("Could not found widget of type Hyperlink and text " +
- formText, wnfex);
- }
- }
- bot.waitForShell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE);
- /*SWTBotWizard wizard = new SWTBotWizard(bot.shell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE).widget);
- wizard.next();
- if (wizard.canNext()){
- bot.comboBox(2).setSelection(1);
- try{
- bot.link();
- fail("There is something wrong with maven repo. Message: \n"+bot.link().getText());
- }catch (WidgetNotFoundException ex){
- //everything fine
- }
- wizard.next();
- }
- wizard.finishWithWait();
- String readmeText = bot.checkBox(1).getText();
- assertFalse("Quick fix should not be enabled (Everything should be fine)", bot.checkBox(0).isEnabled());
- if (readme){
- assertTrue("Show readme checkbox should be enabled", bot.checkBox(1).isEnabled());
- assertTrue("Show readme checkbox should be checked by default", bot.checkBox(1).isChecked());
- if (readmeFileName != null){
- assertTrue(readmeText.toLowerCase().contains(readmeFileName));
- bot.clickButton("Finish");
- assertTrue("Cheat Sheets view should be opened right now", bot.activeView().getTitle().equals("Cheat Sheets"));
- bot.activeView().close();
- }else if (readmeText.contains("cheatsheet.xml")){
- bot.clickButton("Finish");
- assertTrue("Cheat Sheets view should be opened right now", bot.activeView().getTitle().equals("Cheat Sheets"));
- bot.activeView().close();
- }else if (readmeText.toLowerCase().contains("readme.md") || readmeText.toLowerCase().contains("readme.txt")){
- bot.clickButton("Finish");
- assertTrue("Readme should have opened in Text Editor", bot.activeEditor().getReference().getEditor(false).getClass().getName().contains("org.eclipse.ui.editors.text.TextEditor")); //because readmes are opening in browser now.. It's a bug. Jira is created.
- bot.activeEditor().close();
- }else if (readmeText.toLowerCase().contains("readme.htm")){
- bot.clickButton("Finish");
- assertTrue("Readme should have opened in Internal Browser", bot.activeEditor().getReference().getEditor(false).getClass().getName().contains("org.eclipse.ui.internal.browser.WebBrowserEditor"));
- }
- }else{
- bot.clickButton("Finish");
- }*/
- bot.activeShell().close();
- }
-
-}
13 years, 5 months
JBoss Tools SVN: r42861 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts.
by jbosstools-commits@lists.jboss.org
Author: rhopp
Date: 2012-08-06 09:13:23 -0400 (Mon, 06 Aug 2012)
New Revision: 42861
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotFormTextExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotTwistie.java
Log:
Fixed SWTBotFormTextExt.click()
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotFormTextExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotFormTextExt.java 2012-08-06 12:47:32 UTC (rev 42860)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotFormTextExt.java 2012-08-06 13:13:23 UTC (rev 42861)
@@ -5,6 +5,7 @@
import org.eclipse.swtbot.swt.finder.ReferenceBy;
import org.eclipse.swtbot.swt.finder.SWTBotWidget;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.results.BoolResult;
import org.eclipse.swtbot.swt.finder.results.StringResult;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
@@ -35,19 +36,44 @@
}
public AbstractSWTBotControl<FormText> click() {
- syncExec(new VoidResult() {
+ /*syncExec(new VoidResult() {
@Override
public void run() {
click(widget.toDisplay(25,5).x, widget.toDisplay(25,5).y, true); //+20 is there because of icon
}
- });
- /*old version of click
- setFocus();
- keyboard().typeCharacter('\r');*/
+ });*/
+ int timeout = 0;
+ while (!hasFocus() && timeout!=5){
+ //try to set focus
+ setFocus();
+ log.info("Trying to set focus");
+ sleep(1000);
+ timeout++;
+ }
+ if (!hasFocus()){
+ throw new IllegalStateException("Unable to focus widget of type Hyperlink");
+ }
+ keyboard().typeCharacter('\r');
return this;
}
+ /**
+ * Tests whether widget has focus or not. Needed for workaround of issue, where method setFocus() isn't working properly when ececuting test via maven.
+ * @return true if widget has focus. False otherwise.
+ */
+
+ public boolean hasFocus(){
+ return syncExec(new BoolResult() {
+
+ @Override
+ public Boolean run() {
+ return widget.isFocusControl();
+ }
+ });
+ }
+
+
public String selectedLinkText() {
return syncExec(new StringResult() {
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotTwistie.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotTwistie.java 2012-08-06 12:47:32 UTC (rev 42860)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotTwistie.java 2012-08-06 13:13:23 UTC (rev 42861)
@@ -51,15 +51,8 @@
* Toggles twistie (expands its section)
*/
public AbstractSWTBotControl<Twistie> toggle() {
- syncExec(new VoidResult() {
-
- @Override
- public void run() {
- clickXY(widget.getBounds().x+3, widget.getBounds().y+3);
- }
- });
- /*setFocus();
- keyboard().typeCharacter('\r');*/
+ setFocus();
+ keyboard().typeCharacter('\r');
return this;
}
13 years, 5 months
JBoss Tools SVN: r42859 - in trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mmalina
Date: 2012-08-06 08:31:45 -0400 (Mon, 06 Aug 2012)
New Revision: 42859
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml
trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/resources/project_config_files/
trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/resources/project_config_files/eap-6.properties
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/META-INF/MANIFEST.MF
Log:
First attempt at mavenizing our AS bot test.
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/META-INF/MANIFEST.MF 2012-08-06 11:10:30 UTC (rev 42858)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/META-INF/MANIFEST.MF 2012-08-06 12:31:45 UTC (rev 42859)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Bot tests for AS component
Bundle-SymbolicName: org.jboss.ide.eclipse.as.ui.bot.test;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: org.jboss.ide.eclipse.as.ui.bot.test.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Added: trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml 2012-08-06 12:31:45 UTC (rev 42859)
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.as</groupId>
+ <artifactId>tests</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.as.tests</groupId>
+ <artifactId>org.jboss.ide.eclipse.as.ui.bot.test</artifactId>
+
+ <packaging>eclipse-test-plugin</packaging>
+
+ <properties>
+ <jbosstools.test.jboss-as-7.1.home>${requirementsDirectory}/jboss-as-7.1.1.Final</jbosstools.test.jboss-as-7.1.home>
+ <jbosstools.test.jboss-as-7.1.url>http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1...</jbosstools.test.jboss-as-7.1.url>
+ <jbosstools.test.jboss-as-7.1.md5>175c92545454f4e7270821f4b8326c4e</jbosstools.test.jboss-as-7.1.md5>
+ <configurations.dir>resources/project_config_files</configurations.dir>
+ <additionalSystemProperties></additionalSystemProperties>
+ <systemProperties>${additionalSystemProperties} -Djbosstools.test.jboss-as-7.1.home=${jbosstools.test.jboss-as-7.1.home} -Dtest.configurations.dir=${configurations.dir} -Dorg.eclipse.swtbot.screenshots.dir=${project.build.directory}/screenshots</systemProperties>
+ <test.class>org.jboss.ide.eclipse.as.ui.bot.test.AllTestsSuite</test.class>
+
+ </properties>
+
+ <profiles>
+ <profile>
+ <id>debug</id>
+ <properties>
+ <additionalSystemProperties>-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y </additionalSystemProperties>
+ </properties>
+ </profile>
+ <profile>
+ <id>osx</id>
+ <activation>
+ <property>
+ <name>java.vendor.url</name>
+ <value>http://www.apple.com/</value>
+ </property>
+ </activation>
+ <properties>
+ <!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY AUTOFORMATTING -->
+ <platformSystemProperties> -d32 -Dosgi.arch=x86 -XstartOnFirstThread -Dorg.eclipse.swtbot.keyboard.layout=MAC_EN_US</platformSystemProperties>
+ </properties>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>maven-download-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install-as-7.1.1</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${jbosstools.test.jboss-as-7.1.url}</url>
+ <md5>${jbosstools.test.jboss-as-7.1.md5}</md5>
+ <unpack>true</unpack>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <configuration>
+ <useUIThread>false</useUIThread>
+ <surefire.timeout>7200</surefire.timeout>
+ <forkedProcessTimeoutInSeconds>7200</forkedProcessTimeoutInSeconds>
+ <testSuite>org.jboss.ide.eclipse.as.ui.bot.test</testSuite>
+ <testClass>${test.class}</testClass>
+ <skip>${swtbot.test.skip}</skip>
+ <dependencies combine.children="append">
+ <dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.jboss.ide.eclipse.as.feature.feature.group</artifactId>
+ <version>0.0.0</version>
+ </dependency>
+ </dependencies>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <ignoreTychoRepositories>true</ignoreTychoRepositories>
+ <environments>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/resources/project_config_files/eap-6.properties
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/resources/project_config_files/eap-6.properties (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/resources/project_config_files/eap-6.properties 2012-08-06 12:31:45 UTC (rev 42859)
@@ -0,0 +1 @@
+SERVER=EAP,6.0,default,${jbosstools.test.jboss-as-7.1.home}
13 years, 5 months