Author: jjankovi
Date: 2011-12-20 04:23:49 -0500 (Tue, 20 Dec 2011)
New Revision: 37452
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/test/
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/test/RESTfulExplorerValidationTest.java
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java
Log:
RestfulExplorerValidationTest added
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2011-12-20
09:23:16 UTC (rev 37451)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2011-12-20
09:23:49 UTC (rev 37452)
@@ -11,6 +11,7 @@
package org.jboss.tools.ws.ui.bot.test;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ws.ui.bot.test.rest.explorer.test.RESTfulExplorerValidationTest;
import org.jboss.tools.ws.ui.bot.test.sample.test.SampleRESTWebServiceTest;
import org.jboss.tools.ws.ui.bot.test.sample.test.SampleSoapWebServiceTest;
import org.jboss.tools.ws.ui.bot.test.sample.test.SimpleRESTWebServiceTest;
@@ -49,6 +50,7 @@
SampleRESTWebServiceTest.class,
SimpleSoapWebServiceTest.class,
SimpleRESTWebServiceTest.class,
+ RESTfulExplorerValidationTest.class,
BottomUpWSTest.class,
TopDownWSTest.class,
WsClientTest.class,
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 2011-12-20
09:23:16 UTC (rev 37451)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java 2011-12-20
09:23:49 UTC (rev 37452)
@@ -45,10 +45,10 @@
protected static final Logger LOGGER = Logger
.getLogger(WSTestBase.class.getName());
- protected static ResourceHelper resourceHelper = new ResourceHelper();
- protected static ProjectHelper projectHelper = new ProjectHelper();
- protected static DeploymentHelper deploymentHelper = new DeploymentHelper();
- protected static WebServiceClientHelper clientHelper = new WebServiceClientHelper();
+ protected static final ResourceHelper resourceHelper = new ResourceHelper();
+ protected static final ProjectHelper projectHelper = new ProjectHelper();
+ protected static final DeploymentHelper deploymentHelper = new DeploymentHelper();
+ protected static final WebServiceClientHelper clientHelper = new
WebServiceClientHelper();
@Before
public void setup() {
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/test/RESTfulExplorerValidationTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/test/RESTfulExplorerValidationTest.java
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/explorer/test/RESTfulExplorerValidationTest.java 2011-12-20
09:23:49 UTC (rev 37452)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.ui.bot.test.rest.explorer.test;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ws.ui.bot.test.WSTestBase;
+import org.jboss.tools.ws.ui.bot.test.utils.NodeContextUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class RESTfulExplorerValidationTest extends WSTestBase {
+
+ private static final String CONFIGURE_MENU_LABEL = "Configure";
+ private static final String REST_SUPPORT_MENU_LABEL_ADD = "Add JAX-RS 1.1
support...";
+ private static final String REST_SUPPORT_MENU_LABEL_REMOVE = "Remove JAX-RS 1.1
support...";
+ private static final String REST_EXPLORER_LABEL = "JAX-RS REST Web Services";
+
+ protected String getWsProjectName() {
+ return "RestExplorerTest";
+ }
+
+ protected String getWsPackage() {
+ return "org.rest.explorer.validation.test";
+ }
+
+ protected String getWsName() {
+ return "RestService";
+ }
+
+ @Before
+ public void setup() {
+ if (!projectExists(getWsProjectName())) {
+ projectHelper.createProject(getWsProjectName());
+ }
+ }
+
+
+ @Test
+ public void testSupportJAX_RS1_1_Explorer() {
+
+ addRestSupport(getWsProjectName());
+
+ projectExplorer.selectProject(getWsProjectName());
+ SWTBotTree tree = projectExplorer.bot().tree();
+ SWTBotTreeItem item = tree.getTreeItem(getWsProjectName());
+ assertTrue(NodeContextUtil.nodeContextMenu(tree, item, CONFIGURE_MENU_LABEL,
+ REST_SUPPORT_MENU_LABEL_REMOVE).isVisible());
+ assertTrue(projectExplorer.isFilePresent(getWsProjectName(), REST_EXPLORER_LABEL));
+
+ }
+
+ private void addRestSupport(String wsProjectName) {
+ projectExplorer.selectProject(wsProjectName);
+ SWTBotTree tree = projectExplorer.bot().tree();
+ SWTBotTreeItem item = tree.getTreeItem(wsProjectName);
+ item.expand();
+ NodeContextUtil.nodeContextMenu(tree, item, CONFIGURE_MENU_LABEL,
+ REST_SUPPORT_MENU_LABEL_ADD).click();
+ bot.sleep(Timing.time2S());
+ util.waitForNonIgnoredJobs();
+ }
+
+}