Author: jjankovi
Date: 2012-06-05 06:51:01 -0400 (Tue, 05 Jun 2012)
New Revision: 41714
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/DefaultValueAnnotationSupportTest.java
Log:
default test now test Path param and Matrix param as well as Query param
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/DefaultValueAnnotationSupportTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/DefaultValueAnnotationSupportTest.java 2012-06-05
10:50:07 UTC (rev 41713)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/DefaultValueAnnotationSupportTest.java 2012-06-05
10:51:01 UTC (rev 41714)
@@ -17,12 +17,9 @@
public class DefaultValueAnnotationSupportTest extends RESTfulTestBase {
- private String projectName = "default1";
-
- @Override
- protected String getWsProjectName() {
- return projectName;
- }
+ private String queryParam = "param";
+ private String defaultValue = "abc";
+ private String queryParamType = "java.lang.String";
@Override
public void cleanup() {
@@ -32,15 +29,11 @@
@Test
public void testQueryParamDefaultValue() {
- String queryParam = "param";
- String defaultValue = "abc";
- String queryParamType = "java.lang.String";
-
/* prepare project */
- importRestWSProject(getWsProjectName());
+ importRestWSProject("default1");
/* get JAX-RS REST explorer for the project */
- restfulWizard = new RESTFullExplorerWizard(getWsProjectName());
+ restfulWizard = new RESTFullExplorerWizard("default1");
SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
/* test JAX-RS REST explorer */
@@ -52,13 +45,38 @@
}
@Test
- public void testPathParamDefaultValue() {
+ public void testMatrixParamDefaultValue() {
+ /* prepare project */
+ importRestWSProject("default2");
+
+ /* get JAX-RS REST explorer for the project */
+ restfulWizard = new RESTFullExplorerWizard("default2");
+ SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
+
+ /* test JAX-RS REST explorer */
+ assertCountOfRESTServices(restServices, 1);
+ assertExpectedPathOfService(restServices[0],
+ "/rest:" + queryParam + "={" + queryParam + ":" +
+ queryParamType + "=" + defaultValue + "}");
}
@Test
- public void testMatrixParamDefaultValue() {
+ public void testPathParamDefaultValue() {
+
+ /* prepare project */
+ importRestWSProject("default3");
+ /* get JAX-RS REST explorer for the project */
+ restfulWizard = new RESTFullExplorerWizard("default3");
+ SWTBotTreeItem[] restServices = restfulWizard.getAllRestServices();
+
+ /* test JAX-RS REST explorer */
+ assertCountOfRESTServices(restServices, 1);
+ assertExpectedPathOfService(restServices[0],
+ "/rest/{" + queryParam + ":" +
+ queryParamType + "=" + defaultValue + "}");
+
}
}