Author: jjankovi
Date: 2012-01-25 11:45:57 -0500 (Wed, 25 Jan 2012)
New Revision: 38174
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/validation/RESTfulValidationTest.java
Log:
RESTfulValidationTest edited to use merged resource file
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/validation/RESTfulValidationTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/validation/RESTfulValidationTest.java 2012-01-25
16:44:33 UTC (rev 38173)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/validation/RESTfulValidationTest.java 2012-01-25
16:45:57 UTC (rev 38174)
@@ -25,6 +25,7 @@
private final String GET_METHOD_PATH = "/{id}";
private final String CORRECT_PATH_PARAM = "id";
private final String BAD_PATH_PARAM = "customerId";
+ private final String SIMPLE_REST_WS_RESOURCE =
"/resources/restful/SimpleRestWS.java.ws";
protected String getWsProjectName() {
return "RestServicesValidation";
@@ -54,8 +55,7 @@
public void testCorrectValueValidation() {
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/CorrectRestWS.java.ws"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
false, getWsPackage(), getWsName(), GET_METHOD_PATH, CORRECT_PATH_PARAM);
assertTrue(getRESTValidationErrors(getWsProjectName()).length == 0);
@@ -63,9 +63,9 @@
@Test
public void testBadValueValidation() {
+
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/BadRestWS.java.ws"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
false, getWsPackage(), getWsName(), GET_METHOD_PATH, BAD_PATH_PARAM);
assertTrue("" + getRESTValidationErrors(getWsProjectName()).length,
@@ -74,14 +74,13 @@
@Test
public void testCorrectToBadValueValidation() {
+
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/CorrectRestWS.java.ws"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
false, getWsPackage(), getWsName(), GET_METHOD_PATH, CORRECT_PATH_PARAM);
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/BadRestWS.java.ws"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
false, getWsPackage(), getWsName(), GET_METHOD_PATH, BAD_PATH_PARAM);
assertTrue("" + getRESTValidationErrors(getWsProjectName()).length,
@@ -91,13 +90,11 @@
@Test
public void testBadToCorrectValueValidation() {
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/BadRestWS.java.ws"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
false, getWsPackage(), getWsName(), GET_METHOD_PATH, BAD_PATH_PARAM);
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/CorrectRestWS.java.ws"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
false, getWsPackage(), getWsName(), GET_METHOD_PATH, CORRECT_PATH_PARAM);
assertTrue("" + getRESTValidationErrors(getWsProjectName()).length,
@@ -110,8 +107,7 @@
disableRESTValidation();
resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- RESTfulExplorerTest.class.
- getResourceAsStream("/resources/restful/BadRestWS.java.ws"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
false, getWsPackage(), getWsName(), GET_METHOD_PATH, BAD_PATH_PARAM);
assertTrue("" + getRESTValidationErrors(getWsProjectName()).length,