Author: jjankovi
Date: 2012-05-01 08:38:10 -0400 (Tue, 01 May 2012)
New Revision: 40671
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/DefaultValueParamSupportTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/PathAnnotationSupportTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/QueryParamSupportTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/utils/ResourceHelper.java
Log:
fix compilation error for ambiguous methods
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/DefaultValueParamSupportTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/DefaultValueParamSupportTest.java 2012-05-01
11:07:31 UTC (rev 40670)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/DefaultValueParamSupportTest.java 2012-05-01
12:38:10 UTC (rev 40671)
@@ -45,7 +45,7 @@
/** test showing default DefaultValue in RESTful explorer **/
packageExplorer.openFile(getWsProjectName(), "src",
getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ resourceHelper.copyResourceToClassWithSave(bot.editorByTitle(getWsName() +
".java"),
DefaultValueParamSupportTest.class.getResourceAsStream(DEFAULT_VALUE_RESOURCE),
false, false, getWsPackage(), getWsName(), queryParam, defaultValue,
queryParamType);
bot.sleep(Timing.time2S());
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/PathAnnotationSupportTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/PathAnnotationSupportTest.java 2012-05-01
11:07:31 UTC (rev 40670)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/PathAnnotationSupportTest.java 2012-05-01
12:38:10 UTC (rev 40671)
@@ -41,12 +41,7 @@
@Test
public void testAddingSimpleRESTMethods() {
- packageExplorer.openFile(getWsProjectName(), "src",
- getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- PathAnnotationSupportTest.class.getResourceAsStream(BASIC_WS_RESOURCE),
- false, false, getWsPackage(), getWsName());
- bot.sleep(Timing.time2S());
+ prepareWSResource(BASIC_WS_RESOURCE);
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
@@ -66,12 +61,7 @@
@Test
public void testAddingAdvancedRESTMethods() {
- packageExplorer.openFile(getWsProjectName(), "src",
- getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- PathAnnotationSupportTest.class.getResourceAsStream(ADVANCED_WS_RESOURCE),
- false, false, getWsPackage(), getWsName());
- bot.sleep(Timing.time2S());
+ prepareWSResource(ADVANCED_WS_RESOURCE);
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
@@ -109,11 +99,7 @@
@Test
public void testEditingSimpleRESTMethods() {
- packageExplorer.openFile(getWsProjectName(), "src",
- getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- PathAnnotationSupportTest.class.getResourceAsStream(BASIC_WS_RESOURCE),
- false, false, getWsPackage(), getWsName());
+ prepareWSResource(BASIC_WS_RESOURCE);
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
@@ -142,11 +128,7 @@
@Test
public void testEditingAdvancedRESTMethods() {
- packageExplorer.openFile(getWsProjectName(), "src",
- getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- PathAnnotationSupportTest.class.getResourceAsStream(ADVANCED_WS_RESOURCE),
- false, false, getWsPackage(), getWsName());
+ prepareWSResource(ADVANCED_WS_RESOURCE);
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
@@ -182,11 +164,7 @@
@Test
public void testDeletingRESTMethods() {
- packageExplorer.openFile(getWsProjectName(), "src",
- getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- PathAnnotationSupportTest.class.getResourceAsStream(BASIC_WS_RESOURCE),
- false, false, getWsPackage(), getWsName());
+ prepareWSResource(BASIC_WS_RESOURCE);
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
@@ -196,7 +174,7 @@
packageExplorer.openFile(getWsProjectName(), "src",
getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ resourceHelper.copyResourceToClassWithSave(bot.editorByTitle(getWsName() +
".java"),
PathAnnotationSupportTest.class.
getResourceAsStream(EMPTY_WS_RESOURCE),
false, false, getWsPackage(), getWsName());
@@ -227,4 +205,15 @@
return true;
}
+ private void prepareWSResource(String streamPath) {
+
+ packageExplorer.openFile(getWsProjectName(), "src",
+ getWsPackage(), getWsName() + ".java").toTextEditor();
+ resourceHelper.copyResourceToClassWithSave(bot.editorByTitle(getWsName() +
".java"),
+ PathAnnotationSupportTest.class.getResourceAsStream(streamPath),
+ false, false, getWsPackage(), getWsName());
+ bot.sleep(Timing.time2S());
+
+ }
+
}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/QueryParamSupportTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/QueryParamSupportTest.java 2012-05-01
11:07:31 UTC (rev 40670)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/QueryParamSupportTest.java 2012-05-01
12:38:10 UTC (rev 40671)
@@ -43,14 +43,9 @@
String queryParam2 = "param2";
String queryType = "java.lang.String";
+ prepareWSResource(QUERY_ONE_PARAM_RESOURCE,
+ getWsPackage(), getWsName(), queryParam1, queryType);
- packageExplorer.openFile(getWsProjectName(), "src",
- getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- QueryParamSupportTest.class.getResourceAsStream(QUERY_ONE_PARAM_RESOURCE),
- false, false, getWsPackage(), getWsName(), queryParam1, queryType);
- bot.sleep(Timing.time2S());
-
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
@@ -59,13 +54,8 @@
String path = restfulWizard.getPathForRestFulService(restServices[0]);
assertEquals("/rest?" + queryParam1 + "={" + queryParam1 +
":" + queryType + "}", path);
-
-
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- QueryParamSupportTest.class.getResourceAsStream(QUERY_TWO_PARAM_RESOURCE),
- false, false, getWsPackage(), getWsName(),
+ prepareWSResource(QUERY_TWO_PARAM_RESOURCE, getWsPackage(), getWsName(),
queryParam1, queryType, queryParam2, queryType);
- bot.sleep(Timing.time2S());
restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
restServices = restfulWizard.getAllRestServices();
@@ -87,13 +77,9 @@
String queryParam2New = "newParam2";
String queryType = "java.lang.String";
- packageExplorer.openFile(getWsProjectName(), "src",
- getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- QueryParamSupportTest.class.getResourceAsStream(QUERY_TWO_PARAM_RESOURCE),
- false, false, getWsPackage(), getWsName(),
+ prepareWSResource(QUERY_TWO_PARAM_RESOURCE, getWsPackage(), getWsName(),
queryParam1, queryType, queryParam2, queryType);
- bot.sleep(Timing.time2S());
+
resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(),
queryParam1, queryParam1New, false);
bot.sleep(Timing.time2S());
@@ -133,13 +119,9 @@
String queryType2 = "java.lang.Integer";
String queryTypeNew = "java.lang.Long";
- packageExplorer.openFile(getWsProjectName(), "src",
- getWsPackage(), getWsName() + ".java").toTextEditor();
- resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
- QueryParamSupportTest.class.getResourceAsStream(QUERY_TWO_PARAM_RESOURCE),
- false, false, getWsPackage(), getWsName(),
+ prepareWSResource(QUERY_TWO_PARAM_RESOURCE, getWsPackage(), getWsName(),
queryParam1, queryType1, queryParam2, queryType2);
- bot.sleep(Timing.time2S());
+
resourceHelper.replaceInEditor(bot.activeEditor().toTextEditor(),
queryType1, queryTypeNew, false);
bot.sleep(Timing.time2S());
@@ -169,5 +151,16 @@
queryParam2 + "={" + queryParam2 + ":" + queryTypeNew +
"}", path);
}
+
+ private void prepareWSResource(String streamPath, Object... parameters) {
+
+ packageExplorer.openFile(getWsProjectName(), "src",
+ getWsPackage(), getWsName() + ".java").toTextEditor();
+ resourceHelper.copyResourceToClassWithSave(bot.editorByTitle(getWsName() +
".java"),
+ QueryParamSupportTest.class.getResourceAsStream(streamPath),
+ false, false, parameters);
+ bot.sleep(Timing.time2S());
+
+ }
}
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/utils/ResourceHelper.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/utils/ResourceHelper.java 2012-05-01
11:07:31 UTC (rev 40670)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/utils/ResourceHelper.java 2012-05-01
12:38:10 UTC (rev 40671)
@@ -93,7 +93,7 @@
*/
public void copyResourceToClass(SWTBotEditor classEdit,
InputStream resource, boolean closeEdit, Object... param) {
- copyResourceToClass(classEdit, resource, true, closeEdit, param);
+ copyResourceToClassWithSave(classEdit, resource, true, closeEdit, param);
}
/**
@@ -103,7 +103,7 @@
* @param closeEdit
* @param param
*/
- public void copyResourceToClass(SWTBotEditor classEdit,
+ public void copyResourceToClassWithSave(SWTBotEditor classEdit,
InputStream resource, boolean save, boolean closeEdit, Object... param) {
String s = readStream(resource);
String code = MessageFormat.format(s, param);