Author: jlukas(a)redhat.com
Date: 2010-12-01 10:03:35 -0500 (Wed, 01 Dec 2010)
New Revision: 27059
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WebServiceWizard.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:
reorder tests a bit, added workaround for not yet fixed random issue (JBIDE-6731) and let
the test do ws from wsdl in a package (due to JBIDE-7681)
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WebServiceWizard.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WebServiceWizard.java 2010-12-01
15:02:40 UTC (rev 27058)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/WebServiceWizard.java 2010-12-01
15:03:35 UTC (rev 27059)
@@ -142,6 +142,12 @@
return scale(1).isEnabled();
}
+ //second panel
+ public WebServiceWizard setPackageName(String pkg) {
+ bot().textWithLabel("Package name").typeText(pkg);
+ return this;
+ }
+
private List<SWTBotHyperlinkExt> findLink(String text) {
List<? extends Hyperlink> widgets =
bot().widgets(WidgetMatcherFactory.widgetOfType(Hyperlink.class));
List<SWTBotHyperlinkExt> ret = new ArrayList<SWTBotHyperlinkExt>();
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 2010-12-01
15:02:40 UTC (rev 27058)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/BottomUpWSTest.java 2010-12-01
15:03:35 UTC (rev 27059)
@@ -56,8 +56,8 @@
}
@Test
- public void testDevelopService() {
- setLevel(Slider_Level.DEVELOP);
+ public void testDeployService() {
+ setLevel(Slider_Level.DEPLOY);
bottomUpJbossWebService();
}
@@ -68,8 +68,8 @@
}
@Test
- public void testDeployService() {
- setLevel(Slider_Level.DEPLOY);
+ public void testDevelopService() {
+ setLevel(Slider_Level.DEVELOP);
bottomUpJbossWebService();
}
@@ -94,11 +94,9 @@
private void bottomUpJbossWebService() {
String s =
readStream(BottomUpWSTest.class.getResourceAsStream("/resources/jbossws/ClassA.java.ws"));
String src = MessageFormat.format(s, getWsPackage(), getWsName());
- createService(Service_Type.BOTTOM_UP, getWsPackage() + "." + getWsName(),
getLevel(), src);
-// runProject(getProjectName());
+ createService(Service_Type.BOTTOM_UP, getWsPackage() + "." + getWsName(),
getLevel(), null, src);
switch (getLevel()) {
case DEVELOP:
- return;
case ASSEMBLE:
case DEPLOY:
runProject(getEarProjectName());
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 2010-12-01
15:02:40 UTC (rev 27058)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/TopDownWSTest.java 2010-12-01
15:03:35 UTC (rev 27059)
@@ -56,6 +56,12 @@
*/
@Test
+ public void testDeployService() {
+ setLevel(Slider_Level.DEPLOY);
+ topDownWS();
+ }
+
+ @Test
public void testDevelopService() {
setLevel(Slider_Level.DEVELOP);
topDownWS();
@@ -68,12 +74,6 @@
}
@Test
- public void testDeployService() {
- setLevel(Slider_Level.DEPLOY);
- topDownWS();
- }
-
- @Test
public void testInstallService() {
setLevel(Slider_Level.INSTALL);
topDownWS();
@@ -101,8 +101,15 @@
}
sb.append(tns[0]);
String src = MessageFormat.format(s, sb.toString(), getWsName());
- createService(Service_Type.TOP_DOWN, "/" + getWsProjectName() +
"/src/" + getWsName() + ".wsdl", getLevel(), src);
-// runProject(getProjectName());
+ String pkg = "ws." + getWsName().toLowerCase();
+ createService(Service_Type.TOP_DOWN, "/" + getWsProjectName() +
"/src/" + getWsName() + ".wsdl", getLevel(), pkg, src);
+ switch (getLevel()) {
+ case DEVELOP:
+ case ASSEMBLE:
+ case DEPLOY:
+ runProject(getEarProjectName());
+ break;
+ }
assertServiceDeployed(getWSDLUrl());
// 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 2010-12-01
15:02:40 UTC (rev 27058)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/WSTestBase.java 2010-12-01
15:03:35 UTC (rev 27059)
@@ -24,6 +24,10 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
@@ -142,7 +146,7 @@
}
}
- protected void createService(Service_Type t, String source, Slider_Level level, String
code) {
+ protected void createService(Service_Type t, String source, Slider_Level level, String
pkg, String code) {
//create ws source - java class or wsdl
SWTBotEditor ed = null;
switch (t) {
@@ -159,6 +163,13 @@
st.selectRange(0, 0, st.getText().length());
st.setText(code);
ed.saveAndClose();
+ //refresh workspace - workaround for JBIDE-6731
+ try {
+ ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IWorkspaceRoot.DEPTH_INFINITE,
new NullProgressMonitor());
+ } catch (CoreException e) {
+ L.log(Level.WARNING, e.getMessage(), e);
+ }
+ bot.sleep(500);
//create a web service
new NewFileWizardAction().run().selectTemplate("Web Services", "Web
Service").next();
WebServiceWizard wsw = new WebServiceWizard();
@@ -172,6 +183,10 @@
if (wsw.isClientEnabled()) {
wsw.setClientSlider(Slider_Level.NO_CLIENT);
}
+ if (pkg != null && pkg.trim().length() > 0) {
+ wsw.next();
+ wsw.setPackageName(pkg);
+ }
wsw.finish();
util.waitForNonIgnoredJobs();
bot.sleep(1000);