Author: jlukas(a)redhat.com
Date: 2011-03-28 05:45:46 -0400 (Mon, 28 Mar 2011)
New Revision: 30060
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/.classpath
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/WsTesterView.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/BottomUpWSTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/TopDownWSTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/WSTestBase.java
Log:
minor test update
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/.classpath 2011-03-28 08:43:10 UTC (rev
30059)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/.classpath 2011-03-28 09:45:46 UTC (rev
30060)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="resources"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="src" path="resources/"/>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/WsTesterView.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/WsTesterView.java 2011-03-28
08:43:10 UTC (rev 30059)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/WsTesterView.java 2011-03-28
09:45:46 UTC (rev 30060)
@@ -14,10 +14,12 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.logging.Logger;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.results.BoolResult;
@@ -25,6 +27,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotLabel;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.internal.WorkbenchMessages;
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
@@ -37,6 +40,7 @@
public class WsTesterView extends ViewBase {
private static final Bundle WSUI_BUNDLE =
Platform.getBundle("org.jboss.tools.ws.ui");
+ private static boolean max = false;
public enum Request_Type {
@@ -80,6 +84,7 @@
public WsTesterView() {
super();
+ max = false;
viewObject = new IView() {
public String getName() {
@@ -98,8 +103,11 @@
public SWTBotView show() {
SWTBotView b = super.show();
// maximize tester view
- bot.menu(IDEWorkbenchMessages.Workbench_window).menu(
+ if (!max) {
+ bot.menu(IDEWorkbenchMessages.Workbench_window).menu(
WorkbenchMessages.MaximizePartAction_text).click();
+ max = true;
+ }
return b;
}
@@ -172,7 +180,7 @@
String oldName, String oldValue, String newName, String newValue) {
bot().list(type.ordinal()).select(oldName + "=" + oldValue);
bot().button("Edit", type.ordinal()).click();
- SWTBot sh = bot().activeShell().bot();
+ SWTBot sh = bot().shell("Edit Value").bot();
sh.text(0).typeText(newName + "=" + newValue);
sh.button(IDialogConstants.OK_LABEL).click();
}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/BottomUpWSTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/BottomUpWSTest.java 2011-03-28
08:43:10 UTC (rev 30059)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/BottomUpWSTest.java 2011-03-28
09:45:46 UTC (rev 30060)
@@ -102,7 +102,7 @@
runProject(getEarProjectName());
break;
}
- assertServiceDeployed(getWSDLUrl());
+ assertServiceDeployed(getWSDLUrl(), 10000);
// checkService(getWSDLUrl(svcName.substring(svcName.lastIndexOf(".") + 1)),
QName service, QName port, String msg, String rsp)
// servers.removeAllProjectsFromServer(configuredState.getServer().name);
}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/TopDownWSTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/TopDownWSTest.java 2011-03-28
08:43:10 UTC (rev 30059)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/TopDownWSTest.java 2011-03-28
09:45:46 UTC (rev 30060)
@@ -110,7 +110,7 @@
runProject(getEarProjectName());
break;
}
- assertServiceDeployed(getWSDLUrl());
+ assertServiceDeployed(getWSDLUrl(), 10000);
// servers.removeAllProjectsFromServer(configuredState.getServer().name);
}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/WSTestBase.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/WSTestBase.java 2011-03-28
08:43:10 UTC (rev 30059)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/WSTestBase.java 2011-03-28
09:45:46 UTC (rev 30060)
@@ -24,6 +24,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import javax.net.ssl.HttpsURLConnection;
+
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -263,21 +265,41 @@
}
protected void assertServiceDeployed(String wsdlURL) {
- HttpURLConnection connection = null;
- try {
- URL u = new URL(wsdlURL);
- connection = (HttpURLConnection) u.openConnection();
- assertEquals("Service was not sucessfully deployed, WSDL '" + wsdlURL +
"' was not found",
- HttpURLConnection.HTTP_OK, connection.getResponseCode());
- } catch (MalformedURLException e1) {
- throw new RuntimeException(e1);
- } catch (IOException e) {
- throw new RuntimeException(e);
- } finally {
- if (connection != null) {
- connection.disconnect();
+ assertServiceDeployed(wsdlURL, 5000);
+ }
+
+ protected void assertServiceDeployed(String wsdlURL, long timeout) {
+ long t = System.currentTimeMillis();
+ int rsp = -1;
+ while (t + timeout > System.currentTimeMillis()) {
+ HttpURLConnection connection = null;
+ try {
+ URL u = new URL(wsdlURL);
+ connection = (HttpURLConnection) u.openConnection();
+ rsp = connection.getResponseCode();
+ if (rsp == HttpsURLConnection.HTTP_OK) {
+ break;
+ } else {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ //ignore
+ }
+ L.info("retrying...");
+ }
+ } catch (MalformedURLException e1) {
+ throw new RuntimeException(e1);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } finally {
+ if (connection != null) {
+ connection.disconnect();
+ }
}
}
+ L.info("done after: " + (System.currentTimeMillis() - t) + "ms.");
+ assertEquals("Service was not sucessfully deployed, WSDL '" + wsdlURL +
"' was not found",
+ HttpURLConnection.HTTP_OK, rsp);
}
protected void assertServiceNotDeployed(String wsdlURL) {
@@ -362,7 +384,6 @@
protected void runProject(String project) {
open.viewOpen(ActionItem.View.ServerServers.LABEL);
projectExplorer.runOnServer(project);
- bot.sleep(5000);
}
Show replies by date