Author: vpakan(a)redhat.com
Date: 2011-05-03 06:11:56 -0400 (Tue, 03 May 2011)
New Revision: 31025
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotRadioExt.java
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/AbstractSeamTestBase.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/DeleteSeamProjects.java
Log:
Fixes for JBDS 4.1.0.M1
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/AbstractSeamTestBase.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/AbstractSeamTestBase.java 2011-05-03
09:28:57 UTC (rev 31024)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/AbstractSeamTestBase.java 2011-05-03
10:11:56 UTC (rev 31025)
@@ -1,21 +1,13 @@
package org.jboss.tools.seam.ui.bot.test;
-import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCLabel;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotLabel;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
-import org.jboss.tools.ui.bot.test.JBTSWTBotTestCase;
-import org.jboss.tools.ui.bot.test.SWTJBTBot;
-import org.junit.BeforeClass;
public abstract class AbstractSeamTestBase extends SWTTestExt {
@@ -53,7 +45,7 @@
SWTBot viewBot = bot.activeView().bot();
- SWTBotTreeItem suiteItem = projectExplorer.selectTreeItem("Seam" + unitType +
"Test.java", new String[] {
+ projectExplorer.selectTreeItem("Seam" + unitType + "Test.java", new
String[] {
testProjectName + type + "-test",
"test-src",
getTestPackageName(type)
@@ -61,11 +53,10 @@
ContextMenuHelper.clickContextMenu(viewBot.tree(), "Run As", "2 TestNG
Test");
SWTTestExt.util.waitForNonIgnoredJobs(120000);
-
- SWTBotView ngView = bot.viewByTitle("Results of running test class");
+ SWTBotView ngView = bot.viewByTitle("Results of running class Seam" +
unitType + "Test");
+ bot.sleep(Timing.time20S());
SWTBot ngBot = ngView.bot();
int k = 0;
- util.displayAllBotWidgets(ngBot);
SWTBotCLabel l = ngBot.clabel(k);
int passed = -1;
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java 2011-05-03
09:28:57 UTC (rev 31024)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java 2011-05-03
10:11:56 UTC (rev 31025)
@@ -25,6 +25,7 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotRadioExt;
import org.jboss.tools.ui.bot.ext.view.ProblemsView;
import org.jboss.tools.ui.bot.test.SWTJBTBot;
import org.junit.Test;
@@ -87,7 +88,7 @@
bot.button("Next >").click();
bot.button("Next >").click();
bot.comboBoxWithLabel("Seam
Runtime:").setSelection(SWTTestExt.configuredState.getSeam().name);
- bot.radio(type).click();
+ new SWTBotRadioExt(bot.radio(type).widget).clickWithoutDeselectionEvent();
bot.comboBoxWithLabel("Connection profile:").setSelection(CONN_PROFILE);
SWTBotShell seamPrjShell = bot.activeShell();
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/DeleteSeamProjects.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/DeleteSeamProjects.java 2011-05-03
09:28:57 UTC (rev 31024)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/DeleteSeamProjects.java 2011-05-03
10:11:56 UTC (rev 31025)
@@ -1,14 +1,10 @@
package org.jboss.tools.seam.ui.bot.test.create;
-import java.util.Properties;
-
import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
import org.jboss.tools.seam.ui.bot.test.EARTests;
import org.jboss.tools.seam.ui.bot.test.TestControl;
import org.jboss.tools.seam.ui.bot.test.WARTests;
import org.jboss.tools.ui.bot.ext.SWTJBTExt;
-import org.jboss.tools.ui.bot.ext.SWTUtilExt;
-import org.jboss.tools.ui.bot.test.SWTJBTBot;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotRadioExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotRadioExt.java
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotRadioExt.java 2011-05-03
10:11:56 UTC (rev 31025)
@@ -0,0 +1,89 @@
+ /*******************************************************************************
+ * Copyright (c) 2007-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ui.bot.ext.parts;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.results.BoolResult;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.utils.MessageFormat;
+import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio;
+/**
+ * SWTBot Radio Button component
+ * @author vpakan
+ *
+ */
+public class SWTBotRadioExt extends AbstractSWTBotControl<Button> {
+
+ private SWTBotRadio botRadio = null;
+
+ public SWTBotRadioExt(Button radioButton) throws WidgetNotFoundException {
+ super(radioButton);
+ this.botRadio = new SWTBotRadio(radioButton);
+ }
+
+ /**
+ * Return the current value of the slider.
+ *
+ * @return the current selection in the slider.
+ */
+ public boolean getSelection() {
+ return syncExec(new BoolResult() {
+ public Boolean run() {
+ return widget.getSelection();
+ }
+ });
+ }
+
+ /**
+ * Set the selection to the specified value.
+ *
+ * @param value the value to set into the slider.
+ */
+ public void setSelection(final boolean value) {
+ log.debug(MessageFormat.format("Setting selection on {0} to {1}", this,
value)); //$NON-NLS-1$
+ waitForEnabled();
+ asyncExec(new VoidResult() {
+ public void run() {
+ widget.setSelection(value);
+ }
+ });
+ notify(SWT.Selection);
+ log.debug(MessageFormat.format("Set selection on {0} to {1}", this, value));
//$NON-NLS-1$
+ }
+
+ /**
+ * Clicks on the radio button without firing deselection event for previously selected
radio button.
+ */
+ public SWTBotRadio clickWithoutDeselectionEvent() {
+ if (botRadio.isSelected()) {
+ log.debug(MessageFormat.format("Widget {0} is already selected, not clicking
again.", this)); //$NON-NLS-1$
+ return botRadio;
+ }
+ waitForEnabled();
+
+ log.debug(MessageFormat.format("Clicking on {0}", this)); //$NON-NLS-1$
+
+ notify(SWT.Activate);
+ notify(SWT.MouseDown, createMouseEvent(0, 0, 1, 0, 1));
+ notify(SWT.MouseUp, createMouseEvent(0, 0, 1, SWT.BUTTON1, 1));
+ asyncExec(new VoidResult() {
+ public void run() {
+ widget.setSelection(true);
+ }
+ });
+ notify(SWT.Selection);
+ log.debug(MessageFormat.format("Clicked on {0}", this)); //$NON-NLS-1$
+ return botRadio;
+ }
+}
Property changes on:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotRadioExt.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain