Author: jjankovi
Date: 2011-12-19 11:45:49 -0500 (Mon, 19 Dec 2011)
New Revision: 37434
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapTestBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleRESTWebServiceTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleSoapWebServiceTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleRESTWebServiceTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleSoapWebServiceTest.java
Removed:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/jbossws/Rest.java.ws
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTWebServiceTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapWebServiceTest.java
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleWSBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSampleWSWizardAction.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/SampleWSWizard.java
Log:
SimpleRESTWebServiceTest and SimpleSoapWebServiceTest added
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/jbossws/Rest.java.ws
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/jbossws/Rest.java.ws 2011-12-19
16:39:59 UTC (rev 37433)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/jbossws/Rest.java.ws 2011-12-19
16:45:49 UTC (rev 37434)
@@ -1,49 +0,0 @@
-package rest.sample;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-@Path("/RESTSample")
-public class Sample {
-
- @GET()
- @Produces("text/plain")
- public String method1() {
- return "Hello World!";
- }
-
-
-
- @GET()
- @Path("{name}")
- @Produces("text/plain")
- public String method2(@PathParam("name")String name) {
- return "Hello " + name;
- }
-
- @POST()
- @Path("PostMethod")
- @Produces("text/plain")
- public void method3() {
-
- }
-
- @PUT()
- @Path("PutMethod")
- public void method4() {
-
- }
-
-
- @DELETE()
- @Path("DeleteMethod")
- public void method5() {
-
- }
-
-}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2011-12-19
16:39:59 UTC (rev 37433)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -11,8 +11,10 @@
package org.jboss.tools.ws.ui.bot.test;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ws.ui.bot.test.sample.SampleRESTWebServiceTest;
-import org.jboss.tools.ws.ui.bot.test.sample.SampleSoapWebServiceTest;
+import org.jboss.tools.ws.ui.bot.test.sample.test.SampleRESTWebServiceTest;
+import org.jboss.tools.ws.ui.bot.test.sample.test.SampleSoapWebServiceTest;
+import org.jboss.tools.ws.ui.bot.test.sample.test.SimpleRESTWebServiceTest;
+import org.jboss.tools.ws.ui.bot.test.sample.test.SimpleSoapWebServiceTest;
import org.jboss.tools.ws.ui.bot.test.webservice.BottomUpWSTest;
import org.jboss.tools.ws.ui.bot.test.webservice.TopDownWSTest;
import org.jboss.tools.ws.ui.bot.test.webservice.eap.EAPFromJavaTest;
@@ -45,6 +47,8 @@
@SuiteClasses({
SampleSoapWebServiceTest.class,
SampleRESTWebServiceTest.class,
+ SimpleSoapWebServiceTest.class,
+ SimpleRESTWebServiceTest.class,
BottomUpWSTest.class,
TopDownWSTest.class,
WsClientTest.class,
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java 2011-12-19
16:39:59 UTC (rev 37433)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -69,12 +69,6 @@
servers.removeAllProjectsFromServer();
}
- @AfterClass
- public static void cleanAll() {
- LOGGER.info("cleanAll");
- projectExplorer.deleteAllProjects();
- }
-
protected Slider_Level getLevel() {
return level;
}
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.ui.bot.test.sample;
+
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SampleRESTTestBase extends SampleWSBase {
+
+ protected void createSampleRESTWS(String project, String name, String pkg,
+ String cls, String appCls) {
+ createSampleService(Type.REST, project, name, pkg, cls, appCls);
+ }
+
+ protected void createSimpleRESTWS(String project, String name, String pkg,
+ String cls, String appCls) {
+ createSimpleService(Type.REST, project, name, pkg, cls, appCls);
+ }
+
+ protected void checkRESTService(String project, String svcName,
+ String svcPkg, String svcClass, String msgContent, String appCls) {
+ checkService(Type.REST, project, svcName, svcPkg, svcClass, msgContent, appCls);
+ }
+
+}
Deleted:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTWebServiceTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTWebServiceTest.java 2011-12-19
16:39:59 UTC (rev 37433)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTWebServiceTest.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ws.ui.bot.test.sample;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ws.ui.bot.test.uiutils.actions.TreeItemAction;
-import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard.Type;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- *
- * @author jjankovi
- *
- */
-public class SampleRESTWebServiceTest extends SampleWSBase {
-
- private final String REST_WS_NODE = "JAX-RS REST Web Services";
- private final String REST_SUPPORT = "Add JAX-RS 1.1 support...";
- private final String CONFIGURE_CONTEXT = "Configure";
-
- @Override
- protected String getWsProjectName() {
- return "SampleRESTWS";
- }
-
- @Test
- public void testSampleRestWS() {
- if ("JBOSS_AS".equals(configuredState.getServer().type)) {
- fail("This test requires RESTEasy jars in the server");
- }
- IFile dd = getDD(getWsProjectName());
- if (!dd.exists()) {
- createDD(getWsProjectName());
- }
- assertTrue(dd.exists());
- createSampleRESTWS(getWsProjectName(), "RESTSample",
"rest.sample", "Sample", "RESTApp");
- checkRESTService(getWsProjectName(), "RESTSample",
"rest.sample", "Sample", "Hello World!",
"RESTApp");
- }
- @Ignore //not implemented yet
- @Test
- public void testSimpleRestWS() {
-
- }
-
- private int numberOfService(ArrayList<String> services, String serviceType) {
- int count = 0;
- for (String service: services) {
- if (service.contains(serviceType)) {
- count++;
- }
- }
- return count;
- }
-
- private void checkRESTService(String project, String svcName, String svcPkg, String
svcClass, String msgContent, String appCls) {
- checkService(Type.REST, project, svcName, svcPkg, svcClass, msgContent, appCls);
- checkRestSupport(project,svcName);
- }
-
- private void createSampleRESTWS(String project, String name, String pkg, String cls,
String appCls) {
- SWTBotEditor ed = createSampleService(Type.REST, project, name, pkg, cls, appCls);
- resourceHelper.copyResourceToClass(ed, SampleRESTWebServiceTest.class.
- getResourceAsStream("/resources/jbossws/Rest.java.ws"),false);
- }
-
- private void checkRestSupport(String project, String servName) {
- addRestSupport(project);
- testRestSupport(project, servName);
- }
-
- private void addRestSupport(String project) {
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem ti = tree.expandNode(project);
- new TreeItemAction(ti, CONFIGURE_CONTEXT, REST_SUPPORT).run();
- bot.sleep(Timing.time500MS());
- util.waitForNonIgnoredJobs();
- try {
- ti.getNode(REST_WS_NODE);
- }catch (WidgetNotFoundException exc) {
- fail("REST support was not configured properly");
- }
- }
-
- private void testRestSupport(String project, String servName) {
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem ti = tree.expandNode(project, REST_WS_NODE);
- ArrayList<String> nodes = (ArrayList<String>)ti.getNodes();
-
-
- assertTrue("Should be 2 GET services instead of " +
- numberOfService(nodes,"GET"), numberOfService(nodes,"GET") ==
2);
- assertTrue("Should be 1 DELETE service instead of " +
- numberOfService(nodes,"DELETE"), numberOfService(nodes,"DELETE")
== 1);
- assertTrue("Should be 1 POST service instead of " +
- numberOfService(nodes,"POST"), numberOfService(nodes,"POST") ==
1);
- assertTrue("Should be 1 PUT service instead of " +
- numberOfService(nodes,"PUT"), numberOfService(nodes,"PUT") ==
1);
-
-
- assertTrue("Node's form should be {GET /RESTSample} instead of {" +
- nodes.get(0) + "}",nodes.get(0).equals("GET /" + servName));
- assertTrue("Node's form should be {DELETE /RESTSample/DeleteMethod} instead
of {" +
- nodes.get(1) + "}",nodes.get(1).equals("DELETE /" + servName +
"/DeleteMethod"));
- assertTrue("Node's form should be {POST /RESTSample/PostMethod} instead of
{" +
- nodes.get(2) + "}",nodes.get(2).equals("POST /" + servName +
"/PostMethod"));
- assertTrue("Node's form should be {PUT /RESTSample/PutMethod} instead of
{" +
- nodes.get(3) + "}",nodes.get(3).equals("PUT /" + servName +
"/PutMethod"));
- assertTrue("Node's form should be {GET /RESTSample/{name}} instead of
{" +
- nodes.get(4) + "}",nodes.get(4).equals("GET /" + servName +
"/{name}"));
-
- }
-
-}
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapTestBase.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapTestBase.java
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapTestBase.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.ui.bot.test.sample;
+
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SampleSoapTestBase extends SampleWSBase {
+
+ protected void createSampleSOAPWS(String project, String name, String pkg, String cls)
{
+ createSampleService(Type.SOAP, project, name, pkg, cls, null);
+ }
+
+ protected void createSimpleSOAPWS(String project, String name, String pkg, String cls)
{
+ createSimpleService(Type.SOAP, project, name, pkg, cls, null);
+ }
+
+ protected void checkSOAPService(String project, String svcName, String svcPkg, String
svcClass, String msgContent) {
+ checkService(Type.SOAP, project, svcName, svcPkg, svcClass, msgContent, null);
+ }
+
+}
Deleted:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapWebServiceTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapWebServiceTest.java 2011-12-19
16:39:59 UTC (rev 37433)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapWebServiceTest.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ws.ui.bot.test.sample;
-
-import org.eclipse.core.resources.IFile;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- *
- * @author jjankovi
- *
- */
-public class SampleSoapWebServiceTest extends SampleWSBase {
-
- @Override
- protected String getWsProjectName() {
- return "SampleSOAPWS";
- }
-
- @Test
- public void testSampleSoapWS() {
- IFile dd = getDD(getWsProjectName());
- if (!dd.exists()) {
- createDD(getWsProjectName());
- }
- assertTrue(dd.exists());
- createSampleSOAPWS(getWsProjectName(), "HelloService",
"sample", "SampleService");
- checkSOAPService(getWsProjectName(), "HelloService",
"sample", "SampleService", "You");
-
- createSampleSOAPWS(getWsProjectName(), "GreetService",
"greeter", "Greeter");
- checkSOAPService(getWsProjectName(), "GreetService",
"greeter", "Greeter", "Tester");
- }
- @Ignore //not implemented yet
- @Test
- public void testSimpleSoapWS() {
-
- }
-}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleWSBase.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleWSBase.java 2011-12-19
16:39:59 UTC (rev 37433)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleWSBase.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -27,11 +27,12 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.ws.ui.bot.test.WSTestBase;
import org.jboss.tools.ws.ui.bot.test.uiutils.actions.NewSampleWSWizardAction;
+import org.jboss.tools.ws.ui.bot.test.uiutils.actions.NewSimpleWSWizardAction;
import org.jboss.tools.ws.ui.bot.test.uiutils.actions.TreeItemAction;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard;
-import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard.Type;
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SimpleWSWizard;
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
import org.jboss.tools.ws.ui.bot.test.wsclient.WSClient;
-import org.junit.AfterClass;
/**
*
@@ -42,11 +43,6 @@
protected static final String SOAP_REQUEST = getSoapRequest("<ns1:sayHello
xmlns:ns1=\"http://{0}/\"><arg0>{1}</arg0></ns1:sayHello>");
protected static final String SERVER_URL = "localhost:8080";
-
- @AfterClass
- public static void clean() {
- servers.removeAllProjectsFromServer();
- }
protected void createDD(String project) {
SWTBotTree tree = projectExplorer.bot().tree();
@@ -58,22 +54,35 @@
util.waitForNonIgnoredJobs();
bot.sleep(1500);
}
-
- protected void createSampleSOAPWS(String project, String name, String pkg, String
cls) {
- createSampleService(Type.SOAP, project, name, pkg, cls, null);
+
+ protected IProject getProject(String project) {
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(project);
+ }
+
+ protected IFile getDD(String project) {
+ return getProject(project).getFile("WebContent/WEB-INF/web.xml");
+ }
+
+ protected SWTBotEditor createSampleService(Type type, String project, String name,
String pkg, String cls, String appCls) {
+ SampleWSWizard w = new NewSampleWSWizardAction(type).run();
+ w.setProjectName(project).setServiceName(name);
+ w.setPackageName(pkg).setClassName(cls);
+ if (type == Type.REST) {
+ w.setApplicationClassName(appCls);
+ w.addRESTEasyLibraryFromRuntime();
+ }
+ w.finish();
+ util.waitForNonIgnoredJobs();
+ return bot.editorByTitle(cls + ".java");
}
-
- protected void checkSOAPService(String project, String svcName, String svcPkg, String
svcClass, String msgContent) {
- checkService(Type.SOAP, project, svcName, svcPkg, svcClass, msgContent, null);
- }
-
- protected SWTBotEditor createSampleService(Type type, String project, String name,
String pkg, String cls, String appCls) {
- SampleWSWizard w = new NewSampleWSWizardAction(type).run();
+
+ protected SWTBotEditor createSimpleService(Type type, String project, String name,
String pkg, String cls, String appCls) {
+ SimpleWSWizard w = new NewSimpleWSWizardAction(type).run();
w.setProjectName(project).setServiceName(name);
w.setPackageName(pkg).setClassName(cls);
if (type == Type.REST) {
- w.setApplicationClassName(appCls);
- w.addRESTEasyLibraryFromRuntime();
+ w.addRESTEasyLibraryFromRuntime();
+ w.setApplicationClassName(appCls);
}
w.finish();
util.waitForNonIgnoredJobs();
@@ -81,8 +90,8 @@
}
protected void checkService(Type type, String project, String svcName, String svcPkg,
String svcClass, String msgContent, String appCls) {
- SWTBotEditor ed = bot.activeEditor();
- assertEquals(svcClass + ".java", ed.getTitle());
+ SWTBotEditor ed = bot.editorByTitle(svcClass + ".java");
+ ed.show();
String code = ed.toTextEditor().getText();
assertContains("package " + svcPkg + ";", code);
String dd = resourceHelper.readFile(getDD(project));
@@ -124,13 +133,4 @@
}
}
- protected IProject getProject(String project) {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(project);
- }
-
- protected IFile getDD(String project) {
- return getProject(project).getFile("WebContent/WEB-INF/web.xml");
- }
-
-
}
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleRESTWebServiceTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleRESTWebServiceTest.java
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleRESTWebServiceTest.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.bot.test.sample.test;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.ws.ui.bot.test.sample.SampleRESTTestBase;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SampleRESTWebServiceTest extends SampleRESTTestBase {
+
+ @Override
+ protected String getWsProjectName() {
+ return "SampleRESTWS";
+ }
+
+ @Test
+ public void testSampleRestWS() {
+ IFile dd = getDD(getWsProjectName());
+ if (!dd.exists()) {
+ createDD(getWsProjectName());
+ }
+ assertTrue(dd.exists());
+ createSampleRESTWS(getWsProjectName(), "RESTSample",
"rest.sample", "Sample", "RESTApp");
+ checkRESTService(getWsProjectName(), "RESTSample",
"rest.sample", "Sample", "Hello World!",
"RESTApp");
+ }
+
+}
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleSoapWebServiceTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleSoapWebServiceTest.java
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleSoapWebServiceTest.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.bot.test.sample.test;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.ws.ui.bot.test.sample.SampleSoapTestBase;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SampleSoapWebServiceTest extends SampleSoapTestBase {
+
+ @Override
+ protected String getWsProjectName() {
+ return "SampleSOAPWS";
+ }
+
+ @Test
+ public void testSampleSoapWS() {
+ IFile dd = getDD(getWsProjectName());
+ if (!dd.exists()) {
+ createDD(getWsProjectName());
+ }
+ assertTrue(dd.exists());
+ createSampleSOAPWS(getWsProjectName(), "HelloService",
"sample", "SampleService");
+ checkSOAPService(getWsProjectName(), "HelloService",
"sample", "SampleService", "You");
+
+ createSampleSOAPWS(getWsProjectName(), "GreetService",
"greeter", "Greeter");
+ checkSOAPService(getWsProjectName(), "GreetService",
"greeter", "Greeter", "Tester");
+ }
+
+}
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleRESTWebServiceTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleRESTWebServiceTest.java
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleRESTWebServiceTest.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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.ws.ui.bot.test.sample.test;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.ws.ui.bot.test.sample.SampleRESTTestBase;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SimpleRESTWebServiceTest extends SampleRESTTestBase {
+
+ @Override
+ protected String getWsProjectName() {
+ return "SimpleRESTWS";
+ }
+
+ @Test
+ public void testSimpleRestWS() {
+ IFile dd = getDD(getWsProjectName());
+ if (!dd.exists()) {
+ createDD(getWsProjectName());
+ }
+ assertTrue(dd.exists());
+ createSimpleRESTWS(getWsProjectName(), "RESTSample", "rest.sample",
"Sample", "RESTApp");
+ checkRESTService(getWsProjectName(), "RESTSample", "rest.sample",
"Sample", "Hello World!", "RESTApp");
+ }
+
+}
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleSoapWebServiceTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleSoapWebServiceTest.java
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleSoapWebServiceTest.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.ui.bot.test.sample.test;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.ws.ui.bot.test.sample.SampleSoapTestBase;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SimpleSoapWebServiceTest extends SampleSoapTestBase {
+
+ @Override
+ protected String getWsProjectName() {
+ return "SimpleSOAPWS";
+ }
+
+ @Test
+ public void testSimpleSoapWS() {
+ IFile dd = getDD(getWsProjectName());
+ if (!dd.exists()) {
+ createDD(getWsProjectName());
+ }
+ assertTrue(dd.exists());
+ createSimpleSOAPWS(getWsProjectName(), "HelloService",
"sample", "SampleService");
+ checkSOAPService(getWsProjectName(), "HelloService",
"sample", "SampleService", "You");
+
+ createSimpleSOAPWS(getWsProjectName(), "GreetService",
"greeter", "Greeter");
+ checkSOAPService(getWsProjectName(), "GreetService",
"greeter", "Greeter", "Tester");
+ }
+
+}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSampleWSWizardAction.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSampleWSWizardAction.java 2011-12-19
16:39:59 UTC (rev 37433)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSampleWSWizardAction.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -11,7 +11,7 @@
package org.jboss.tools.ws.ui.bot.test.uiutils.actions;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard;
-import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard.Type;
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Wizard;
public class NewSampleWSWizardAction extends NewFileWizardAction {
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/SampleWSWizard.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/SampleWSWizard.java 2011-12-19
16:39:59 UTC (rev 37433)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/SampleWSWizard.java 2011-12-19
16:45:49 UTC (rev 37434)
@@ -10,32 +10,13 @@
******************************************************************************/
package org.jboss.tools.ws.ui.bot.test.uiutils.wizards;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
-import org.osgi.framework.Bundle;
public class SampleWSWizard extends Wizard {
- private static final Bundle WSUI_BUNDLE =
Platform.getBundle("org.jboss.tools.ws.ui");
-
- public enum Type {
- SOAP, REST;
-
- public String getLabel() {
- switch (this) {
- case SOAP:
- return getStringFromBundle("%JBOSSWS_GENERATEACTION_LABEL");
- case REST:
- return getStringFromBundle("%restful.wizard.name");
- default:
- throw new IllegalArgumentException("Unknown type: " + this);
- }
- }
- }
-
private Type type;
public SampleWSWizard(Type type) throws WidgetNotFoundException {
@@ -79,7 +60,4 @@
return this;
}
- private static String getStringFromBundle(String key) {
- return Platform.getResourceString(WSUI_BUNDLE, key);
- }
}