Author: jjankovi
Date: 2012-01-30 06:35:27 -0500 (Mon, 30 Jan 2012)
New Revision: 38265
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/annotation/
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/views/
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/rest/explorer/RESTfulExplorerTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulSupportTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt
Log:
Fixing the WS bot tests
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 2012-01-30
09:48:41 UTC (rev 38264)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java 2012-01-30
11:35:27 UTC (rev 38265)
@@ -75,7 +75,7 @@
public void cleanup() {
servers.removeAllProjectsFromServer();
}
-
+
protected Slider_Level getLevel() {
return level;
}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerTest.java 2012-01-30
09:48:41 UTC (rev 38264)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulExplorerTest.java 2012-01-30
11:35:27 UTC (rev 38265)
@@ -12,6 +12,7 @@
package org.jboss.tools.ws.ui.bot.test.rest.explorer;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ws.ui.bot.test.rest.RESTFulAnnotations;
import org.jboss.tools.ws.ui.bot.test.rest.RESTfulTestBase;
import org.jboss.tools.ws.ui.bot.test.ti.wizard.RESTFullExplorerWizard;
@@ -27,6 +28,12 @@
private RESTFullExplorerWizard restfulWizard = null;
+ private final String BASIC_WS_RESOURCE_PATH =
"/resources/restful/BasicRestfulWS.java.ws";
+
+ private final String ADVANCED_WS_RESOURCE_PATH =
"/resources/restful/AdvancedRestfulWS.java.ws";
+
+ private final String EMPTY_WS_RESOURCE_PATH =
"/resources/restful/EmptyRestfulWS.java.ws";
+
protected String getWsProjectName() {
return "RestServicesExplorer";
}
@@ -53,26 +60,22 @@
}
}
- @Override
- public void cleanup() {
- if (projectExists(getWsProjectName())) {
- removeRestSupport(getWsProjectName());
- }
- }
-
@Test
public void testAddingSimpleRESTMethods() {
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/BasicRestfulWS.java.ws"),
+ getResourceAsStream(BASIC_WS_RESOURCE_PATH),
false, getWsPackage(), getWsName());
-
+
+ bot.sleep(Timing.time2S());
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
- assertTrue(restServices.length == 4);
- assertTrue(allRestServicesArePresent(restServices));
+ assertTrue(restServices.length + " RESTful services was found instead of 4.",
+ restServices.length == 4);
+ assertTrue("All RESTful services (GET, DELETE, POST, PUT) should be present but
they are not",
+ allRestServicesArePresent(restServices));
for (SWTBotTreeItem restService : restServices) {
assertTrue(restfulWizard.getPathForRestFulService(restService).equals("/rest"));
@@ -86,14 +89,17 @@
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
RESTfulExplorerTest.class.
-
getResourceAsStream("/resources/restful/AdvancedRestfulWS.java.ws"),
+ getResourceAsStream(ADVANCED_WS_RESOURCE_PATH),
false, getWsPackage(), getWsName());
+ bot.sleep(Timing.time2S());
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
- assertTrue(restServices.length == 4);
- assertTrue(allRestServicesArePresent(restServices));
+ assertTrue(restServices.length + " RESTful services was found instead of
4.",
+ restServices.length == 4);
+ assertTrue("All RESTful services (GET, DELETE, POST, PUT) should be present but
they are not",
+ allRestServicesArePresent(restServices));
for (SWTBotTreeItem restService : restServices) {
if
(restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.GET.getLabel()))
{
@@ -125,20 +131,24 @@
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/BasicRestfulWS.java.ws"),
+ getResourceAsStream(BASIC_WS_RESOURCE_PATH),
false, getWsPackage(), getWsName());
+ bot.sleep(Timing.time2S());
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
- assertTrue(allRestServicesArePresent(restServices));
+ assertTrue("All RESTful services (GET, DELETE, POST, PUT) should be present but
they are not",
+ allRestServicesArePresent(restServices));
resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(), "@DELETE",
"@GET");
+ bot.sleep(Timing.time2S());
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
restServices = restfulWizard.getAllRestServices();
- assertFalse(allRestServicesArePresent(restServices));
+ assertFalse("All RESTful services (GET, DELETE, POST, PUT) shouldnt be present but
they are",
+ allRestServicesArePresent(restServices));
for (SWTBotTreeItem restService : restServices) {
if
(restfulWizard.getRestServiceName(restService).equals(RESTFulAnnotations.DELETE.getLabel()))
{
@@ -153,9 +163,10 @@
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/AdvancedRestfulWS.java.ws"),
+ getResourceAsStream(ADVANCED_WS_RESOURCE_PATH),
false, getWsPackage(), getWsName());
+ bot.sleep(Timing.time2S());
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
@@ -170,6 +181,7 @@
resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(), "@DELETE",
"@DELETE" + LINE_SEPARATOR +
"@Produces(\"text/plain\")");
+ bot.sleep(Timing.time2S());
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
restServices = restfulWizard.getAllRestServices();
@@ -186,23 +198,27 @@
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/BasicRestfulWS.java.ws"),
+ getResourceAsStream(BASIC_WS_RESOURCE_PATH),
false, getWsPackage(), getWsName());
+ bot.sleep(Timing.time2S());
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
- assertTrue(restServices.length == 4);
+ assertTrue(restServices.length + " RESTful services was found instead of 4.",
+ restServices.length == 4);
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/EmptyRestfulWS.java.ws"),
+ getResourceAsStream(EMPTY_WS_RESOURCE_PATH),
false, getWsPackage(), getWsName());
+ bot.sleep(Timing.time2S());
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
restServices = restfulWizard.getAllRestServices();
- assertTrue(restServices.length == 0);
+ assertTrue(restServices.length + " RESTful services was found instead of
0.",
+ restServices.length == 0);
}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulSupportTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulSupportTest.java 2012-01-30
09:48:41 UTC (rev 38264)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/RESTfulSupportTest.java 2012-01-30
11:35:27 UTC (rev 38265)
@@ -43,7 +43,7 @@
@Test
- public void testJAXRSExplorerSupport() {
+ public void test_JAXRS_ExplorerSupport() {
addRestSupport(getWsProjectName());
assertTrue(isRestSupportEnabled(getWsProjectName()));
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt 2012-01-30 09:48:41 UTC (rev
38264)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt 2012-01-30 11:35:27 UTC (rev
38265)
@@ -1,3 +1 @@
-* manually add resteasy libs to project with EAP target server (RESTfulTestBase)
-* enable/disable JAX-RS validator (RESTfulTestBase)
-* test operating on JAX-RS completion
\ No newline at end of file
+* manually add resteasy libs to project with EAP target server (RESTfulTestBase)
\ No newline at end of file