Author: jjankovi
Date: 2012-06-25 10:59:12 -0400 (Mon, 25 Jun 2012)
New Revision: 42200
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/integration/JAXRSToolingIntegrationTest.java
Log:
new test JAXRSToolingIntegrationTest has been implemented
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/integration/JAXRSToolingIntegrationTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/integration/JAXRSToolingIntegrationTest.java 2012-06-25
14:58:41 UTC (rev 42199)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/integration/JAXRSToolingIntegrationTest.java 2012-06-25
14:59:12 UTC (rev 42200)
@@ -17,6 +17,7 @@
import org.jboss.tools.ws.ui.bot.test.uiutils.RESTFullExplorer;
import org.jboss.tools.ws.ui.bot.test.widgets.WsTesterView;
import org.jboss.tools.ws.ui.bot.test.widgets.WsTesterView.Request_Type;
+import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -31,12 +32,21 @@
private static String projectName = "integration1";
private String localhostUrl = "http://localhost:8080/";
private String serviceUrl = localhostUrl + projectName + "/rest/";
+ private WsTesterView wsTesterView = new WsTesterView();
@BeforeClass
public static void prepareWS() {
importRestWSProject(projectName);
+ servers.addProjectToServer(
+ projectName, configuredState.getServer().name);
}
+ @After
+ public void minimizeTester() {
+ /* minimize web service tester */
+ wsTesterView.minimize();
+ }
+
@Test
public void testGetMethod() {
/* get JAX-RS REST Web Services */
@@ -47,15 +57,12 @@
assertWebServiceTesterIsActive();
/* test generated url and response after invoking */
- WsTesterView wsTesterView = showWSTester();
+ wsTesterView = showWSTester();
assertEquals(serviceUrl + "get", wsTesterView.getServiceURL());
invokeMethodInWSTester(wsTesterView, Request_Type.GET);
assertEquals("GET method", wsTesterView.getResponseBody());
assertEquals("[HTTP/1.1 200 OK]", wsTesterView.getResponseHeaders()[0]);
-
- /* minimize web service tester */
- wsTesterView.minimize();
}
@Test
@@ -68,15 +75,12 @@
assertWebServiceTesterIsActive();
/* test generated url and response after invoking */
- WsTesterView wsTesterView = showWSTester();
+ wsTesterView = showWSTester();
assertEquals(serviceUrl + "post", wsTesterView.getServiceURL());
invokeMethodInWSTester(wsTesterView, Request_Type.POST);
assertEquals("POST method", wsTesterView.getResponseBody());
assertEquals("[HTTP/1.1 200 OK]", wsTesterView.getResponseHeaders()[0]);
-
- /* minimize web service tester */
- wsTesterView.minimize();
}
@Test
@@ -89,15 +93,12 @@
assertWebServiceTesterIsActive();
/* test generated url and response after invoking */
- WsTesterView wsTesterView = showWSTester();
+ wsTesterView = showWSTester();
assertEquals(serviceUrl + "put", wsTesterView.getServiceURL());
invokeMethodInWSTester(wsTesterView, Request_Type.PUT);
assertEquals("PUT method", wsTesterView.getResponseBody());
assertEquals("[HTTP/1.1 200 OK]", wsTesterView.getResponseHeaders()[0]);
-
- /* minimize web service tester */
- wsTesterView.minimize();
}
@Test
@@ -110,15 +111,12 @@
assertWebServiceTesterIsActive();
/* test generated url and response after invoking */
- WsTesterView wsTesterView = showWSTester();
- assertEquals(serviceUrl + "get", wsTesterView.getServiceURL());
+ wsTesterView = showWSTester();
+ assertEquals(serviceUrl + "delete", wsTesterView.getServiceURL());
invokeMethodInWSTester(wsTesterView, Request_Type.DELETE);
assertEquals("DELETE method", wsTesterView.getResponseBody());
assertEquals("[HTTP/1.1 200 OK]", wsTesterView.getResponseHeaders()[0]);
-
- /* minimize web service tester */
- wsTesterView.minimize();
}
@Test
@@ -131,20 +129,16 @@
assertWebServiceTesterIsActive();
/* test generated url and response after invoking */
- WsTesterView wsTesterView = showWSTester();
+ wsTesterView = showWSTester();
assertEquals(serviceUrl + "get", wsTesterView.getServiceURL());
invokeMethodInWSTester(wsTesterView, Request_Type.POST);
assertFalse(wsTesterView.getResponseBody().equals("GET method"));
assertEquals("[HTTP/1.1 405 Method Not Allowed]",
wsTesterView.getResponseHeaders()[0]);
-
- /* minimize web service tester */
- wsTesterView.minimize();
}
private WsTesterView showWSTester() {
- WsTesterView wsTesterView = new WsTesterView();
- wsTesterView.show();
+ wsTesterView.show();
return wsTesterView;
}
Show replies by date