JBoss Tools SVN: r38175 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/completion.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-01-25 11:46:54 -0500 (Wed, 25 Jan 2012)
New Revision: 38175
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/completion/RESTfulCompletionTest.java
Log:
RESTfulCompletionTest completed
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/completion/RESTfulCompletionTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/completion/RESTfulCompletionTest.java 2012-01-25 16:45:57 UTC (rev 38174)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/completion/RESTfulCompletionTest.java 2012-01-25 16:46:54 UTC (rev 38175)
@@ -11,7 +11,12 @@
package org.jboss.tools.ws.ui.bot.test.rest.completion;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.tools.ui.bot.ext.helper.ContentAssistHelper;
import org.jboss.tools.ws.ui.bot.test.rest.RESTfulTestBase;
+import org.jboss.tools.ws.ui.bot.test.rest.explorer.RESTfulExplorerTest;
import org.junit.Test;
/**
@@ -21,6 +26,22 @@
*/
public class RESTfulCompletionTest extends RESTfulTestBase{
+ private final String SIMPLE_REST_WS_RESOURCE = "/resources/restful/SimpleRestWS.java.ws";
+
+ private final String GET_METHOD_PATH = "/{userId}";
+
+ private final String EMPTY_PATH_PARAM = "";
+
+ private final String CORRECT_PATH_PARAM = "userId";
+
+ private final String INCORRECT_PATH_PARAM = "someId";
+
+ private final String PATH_PARAM_NAVIGATION = "@PathParam(";
+
+ private final List<String> EXP_NON_EMPTY_COMPLETION_RESULT = Arrays.asList("userId - JAX-RS Mapping");
+
+ private final List<String> EXP_EMPTY_COMPLETION_RESULT = Arrays.asList("No Default Proposals");
+
protected String getWsProjectName() {
return "RestServicesCompletion";
}
@@ -48,31 +69,81 @@
@Test
public void testWithEmptyPrefix() {
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
+ false, getWsPackage(), getWsName(), GET_METHOD_PATH, EMPTY_PATH_PARAM);
+
+ ContentAssistHelper.checkContentAssistContent(bot,
+ getWsName() + ".java", PATH_PARAM_NAVIGATION, PATH_PARAM_NAVIGATION.length() + 1,
+ 0, EXP_NON_EMPTY_COMPLETION_RESULT);
+
}
@Test
public void testWithValidPrefixAtTheEnd() {
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
+ false, getWsPackage(), getWsName(), GET_METHOD_PATH, CORRECT_PATH_PARAM);
+
+ ContentAssistHelper.checkContentAssistContent(bot,
+ getWsName() + ".java", PATH_PARAM_NAVIGATION, PATH_PARAM_NAVIGATION.length() +
+ CORRECT_PATH_PARAM.length() + 1,
+ 0, EXP_NON_EMPTY_COMPLETION_RESULT);
+
}
@Test
public void testWithValidPrefixInTheBeginning() {
+
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
+ false, getWsPackage(), getWsName(), GET_METHOD_PATH, CORRECT_PATH_PARAM);
+ ContentAssistHelper.checkContentAssistContent(bot,
+ getWsName() + ".java", PATH_PARAM_NAVIGATION, PATH_PARAM_NAVIGATION.length() + 1,
+ 0, EXP_NON_EMPTY_COMPLETION_RESULT);
+
}
@Test
public void testWithInvalidPrefixAtTheEnd() {
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
+ false, getWsPackage(), getWsName(), GET_METHOD_PATH, INCORRECT_PATH_PARAM);
+
+ ContentAssistHelper.checkContentAssistContent(bot,
+ getWsName() + ".java", PATH_PARAM_NAVIGATION, PATH_PARAM_NAVIGATION.length() +
+ INCORRECT_PATH_PARAM.length() + 1,
+ 0, EXP_EMPTY_COMPLETION_RESULT);
+
}
-
+
@Test
public void testWithInvalidPrefixInTheBeginning() {
+
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
+ false, getWsPackage(), getWsName(), GET_METHOD_PATH, INCORRECT_PATH_PARAM);
+ ContentAssistHelper.checkContentAssistContent(bot,
+ getWsName() + ".java", PATH_PARAM_NAVIGATION, PATH_PARAM_NAVIGATION.length() + 1,
+ 0, EXP_NON_EMPTY_COMPLETION_RESULT);
+
}
@Test
public void testWithAllInvalidParamSelection() {
+ resourceHelper.copyResourceToClass(bot.editorByTitle(getWsName() + ".java"),
+ RESTfulExplorerTest.class.getResourceAsStream(SIMPLE_REST_WS_RESOURCE),
+ false, getWsPackage(), getWsName(), GET_METHOD_PATH, INCORRECT_PATH_PARAM);
+
+ ContentAssistHelper.checkContentAssistContent(bot,
+ getWsName() + ".java", PATH_PARAM_NAVIGATION, PATH_PARAM_NAVIGATION.length() + 1,
+ INCORRECT_PATH_PARAM.length(), EXP_NON_EMPTY_COMPLETION_RESULT);
+
}
}
12 years, 11 months
JBoss Tools SVN: r38174 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/validation.
by jbosstools-commits@lists.jboss.org
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,
12 years, 11 months
JBoss Tools SVN: r38173 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-01-25 11:44:33 -0500 (Wed, 25 Jan 2012)
New Revision: 38173
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/SimpleRestWS.java.ws
Removed:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/BadRestWS.java.ws
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/CorrectRestWS.java.ws
Log:
Two resource files merged into one
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/BadRestWS.java.ws
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/BadRestWS.java.ws 2012-01-25 16:29:14 UTC (rev 38172)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/BadRestWS.java.ws 2012-01-25 16:44:33 UTC (rev 38173)
@@ -1,17 +0,0 @@
-package {0};
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-
-@Path("/rest")
-public class {1} '{'
-
- @GET
- @Path("{2}")
- public String getMessage(@PathParam("{3}") int id) '{'
- return null;
- '}'
-
-'}'
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/CorrectRestWS.java.ws
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/CorrectRestWS.java.ws 2012-01-25 16:29:14 UTC (rev 38172)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/CorrectRestWS.java.ws 2012-01-25 16:44:33 UTC (rev 38173)
@@ -1,17 +0,0 @@
-package {0};
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-
-@Path("/rest")
-public class {1} '{'
-
- @GET
- @Path("{2}")
- public String getMessage(@PathParam("{3}") int id) '{'
- return null;
- '}'
-
-'}'
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/SimpleRestWS.java.ws
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/SimpleRestWS.java.ws (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/restful/SimpleRestWS.java.ws 2012-01-25 16:44:33 UTC (rev 38173)
@@ -0,0 +1,17 @@
+package {0};
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+
+
+@Path("/rest")
+public class {1} '{'
+
+ @GET
+ @Path("{2}")
+ public String getMessage(@PathParam("{3}") int id) '{'
+ return null;
+ '}'
+
+'}'
12 years, 11 months
JBoss Tools SVN: r38172 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-01-25 11:29:14 -0500 (Wed, 25 Jan 2012)
New Revision: 38172
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/
Log:
ignoring resources
Property changes on: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test
___________________________________________________________________
Modified: svn:ignore
- build
bin
target
buildlog.latest.txt
+ build
bin
target
buildlog.latest.txt
db
screenshots
12 years, 11 months
JBoss Tools SVN: r38171 - trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke.
by jbosstools-commits@lists.jboss.org
Author: jgargula
Date: 2012-01-25 10:45:07 -0500 (Wed, 25 Jan 2012)
New Revision: 38171
Modified:
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsViewsTest.java
Log:
Added test of Audit view
Modified: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsViewsTest.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsViewsTest.java 2012-01-25 15:43:20 UTC (rev 38170)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsViewsTest.java 2012-01-25 15:45:07 UTC (rev 38171)
@@ -15,10 +15,10 @@
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.gen.IView;
+import org.jboss.tools.ui.bot.ext.helper.DragAndDropHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -36,6 +36,7 @@
private static final String SAMPLE_TREE_NODE = "com.sample";
private static final String GLOBAL_VARIABLE_NAME = "globalString";
private static final String GLOBAL_VARIABLE_VALUE = "abcd";
+ private static final String LOG_FILE = "test.log";
private static boolean isFirstTimeRun = true;
/**
@@ -44,17 +45,17 @@
@Before
public void setUp() {
if (isFirstTimeRun) {
+ eclipse.closeAllEditors();
manageProject();
setUpOnce();
}
SWTBotTreeItem javaTreeItem = packageExplorer.selectTreeItem(JAVA_FILE, new String[] {PROJECT_NAME, JAVA_FILE_PATH, SAMPLE_TREE_NODE});
eclipse.debugTreeItemAsDroolsApplication(javaTreeItem);
- while (bot.waitForShell(IDELabel.Shell.PROGRESS_INFORMATION, 1) != null) {
- // nothing to do, waiting time is included in waitForShell method
+ while (bot.waitForShell(IDELabel.Shell.PROGRESS_INFORMATION, 0) != null) {
+ bot.sleep(Timing.time2S());
}
if (isFirstTimeRun) {
- bot.waitForShell(IDELabel.Shell.CONFIRM_PERSPECTIVE_SWITCH).activate();
eclipse.closeConfirmPerspectiveSwitchShellIfOpened(false, true);
}
@@ -136,7 +137,6 @@
/**
* Tests refreshing of Agenda view.
*/
- @Ignore
@Test
public void refreshAgendaTest() {
openView(IDELabel.View.AGENDA);
@@ -158,6 +158,26 @@
}
/**
+ * Test of Audit view.
+ */
+ @Test
+ public void auditTest() {
+ eclipse.finishDebug();
+ openView(IDELabel.View.AUDIT);
+ SWTBotView auditView = bot.viewByTitle(IDELabel.View.AUDIT);
+ assertEquals("Tree in Audit view should be empty, but it has " + auditView.bot().tree().getAllItems().length
+ + " items.", 0, auditView.bot().tree().getAllItems().length);
+ packageExplorer.selectTreeItem(PROJECT_NAME, null).contextMenu(IDELabel.Menu.REFRESH).click();
+ assertTrue("Log file '" + LOG_FILE + "' was not created.", packageExplorer.existsResource(PROJECT_NAME, LOG_FILE));
+ SWTBotTreeItem treeItem = packageExplorer.selectTreeItem(LOG_FILE, new String[] {PROJECT_NAME});
+ DragAndDropHelper.dragAndDropOnTo(treeItem.widget, auditView.getWidget());
+ assertTrue("Tree in Audit view should not be empty, but it was.", auditView.bot().tree().getAllItems().length > 0);
+ assertFalse("Log file '" + LOG_FILE + "' was not loaded properly into Audit view.",
+ "The selected audit log is empty.".equals(auditView.bot().tree().getAllItems()[0].getText()));
+ fail("Error with Audit was probably resolved. This should be completed now.");
+ }
+
+ /**
* Adds some pieces of code to DroolsTest.java
*/
private void adjustDroolsTestFile() {
12 years, 11 months
JBoss Tools SVN: r38170 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: jgargula
Date: 2012-01-25 10:43:20 -0500 (Wed, 25 Jan 2012)
New Revision: 38170
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
Log:
Added method which return all checkBoxes
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2012-01-25 14:55:19 UTC (rev 38169)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2012-01-25 15:43:20 UTC (rev 38170)
@@ -12,13 +12,17 @@
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf;
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withStyle;
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withText;
import static org.junit.Assert.fail;
+import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Scale;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
@@ -26,12 +30,14 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.Section;
+import org.hamcrest.Matcher;
import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
import org.jboss.tools.ui.bot.ext.parts.SWTBotHyperlinkExt;
@@ -240,4 +246,23 @@
return null;
}
+
+ /**
+ * Returns current displayed checkboxes.
+ * There are included disabled checkboxes as well
+ * therefore it is necessary to check their states before use of them.
+ *
+ * @return List of current displayed checkboxes.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public List<SWTBotCheckBox> checkBoxes() {
+ List<SWTBotCheckBox> checkBoxes = new ArrayList<SWTBotCheckBox>();
+ Matcher matcher = allOf(widgetOfType(Button.class), withStyle(SWT.CHECK, "SWT.CHECK"));
+ for (Object widget : widgets(matcher)) {
+ if (widget != null) {
+ checkBoxes.add(new SWTBotCheckBox((Button) widget));
+ }
+ }
+ return checkBoxes;
+ }
}
12 years, 11 months
JBoss Tools SVN: r38169 - trunk/vpe/tests/org.jboss.tools.vpe.browsersim.browser.test/src/org/jboss/tools/vpe/browsersim/browser/test.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-01-25 09:55:19 -0500 (Wed, 25 Jan 2012)
New Revision: 38169
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.browsersim.browser.test/src/org/jboss/tools/vpe/browsersim/browser/test/WebKitTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10706 : BrowserSim: compilation error in WebKitTests.java
Modified: trunk/vpe/tests/org.jboss.tools.vpe.browsersim.browser.test/src/org/jboss/tools/vpe/browsersim/browser/test/WebKitTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.browsersim.browser.test/src/org/jboss/tools/vpe/browsersim/browser/test/WebKitTests.java 2012-01-25 14:22:42 UTC (rev 38168)
+++ trunk/vpe/tests/org.jboss.tools.vpe.browsersim.browser.test/src/org/jboss/tools/vpe/browsersim/browser/test/WebKitTests.java 2012-01-25 14:55:19 UTC (rev 38169)
@@ -36,7 +36,7 @@
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
- final AbstractWebKitBrowser webKitBrowser = WebKitBrowserFactory.createWebKitBrowser(shell, SWT.NONE);
+ final AbstractWebKitBrowser webKitBrowser = new WebKitBrowserFactory().createBrowser(shell, SWT.NONE);
assertNotNull(webKitBrowser);
ExpressionsEvaluator expressionsEvaluator = new ExpressionsEvaluator(webKitBrowser);
12 years, 11 months
JBoss Tools SVN: r38168 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-01-25 09:22:42 -0500 (Wed, 25 Jan 2012)
New Revision: 38168
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeValue.java
Log:
https://issues.jboss.org/browse/JBIDE-8651 :
Revert workaround for wrong implementation of WTP's ElementImpl.getAttribute(String)
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeValue.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeValue.java 2012-01-25 11:23:33 UTC (rev 38167)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeValue.java 2012-01-25 14:22:42 UTC (rev 38168)
@@ -29,13 +29,6 @@
}
public VpeValue(String value) {
- /* yradtsevich: workaround for JBIDE-8649: WTP ElementImpl
- * may return null for getAttribute method.
- */
- if (value == null) {
- value = ""; //$NON-NLS-1$
- }
-
stringValue = value;
type = STRING_VALUE;
}
12 years, 11 months
JBoss Tools SVN: r38167 - trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-01-25 06:23:33 -0500 (Wed, 25 Jan 2012)
New Revision: 38167
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsLabelProvider.java
Log:
Trying to fix a refresh issue: saving quickly the web.xml does not *always* end up with JAX-RS nodes labels being updated in the Project explorer view...
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java 2012-01-25 11:09:37 UTC (rev 38166)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java 2012-01-25 11:23:33 UTC (rev 38167)
@@ -158,8 +158,8 @@
public void run() {
if (viewer != null) {
TreePath[] treePaths = viewer.getExpandedTreePaths();
- Logger.debug("*** Refreshing the viewer... ***");
- viewer.refresh(target, true);
+ Logger.debug("*** Refreshing the viewer at target level: {} (viewer busy: {}) ***", target, viewer.isBusy());
+ viewer.refresh(target);
viewer.setExpandedTreePaths(treePaths);
Logger.debug("*** Refreshing the viewer... done ***");
} else {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsLabelProvider.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsLabelProvider.java 2012-01-25 11:09:37 UTC (rev 38166)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsLabelProvider.java 2012-01-25 11:23:33 UTC (rev 38167)
@@ -22,6 +22,7 @@
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsEndpoint;
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsResourceMethod;
import org.jboss.tools.ws.jaxrs.ui.JBossJaxrsUIPlugin;
+import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
/** @author xcoulon */
public class UriMappingsLabelProvider implements IStyledLabelProvider, ILabelProvider {
@@ -125,6 +126,7 @@
sb.append(uriTemplate);
StyledString styledString = new StyledString(sb.toString());
styledString.setStyle(0, httpVerb.length(), StyledString.QUALIFIER_STYLER);
+ Logger.debug("URI Path Template: {}", styledString.getString());
return styledString;
}
12 years, 11 months
JBoss Tools SVN: r38166 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-01-25 06:09:37 -0500 (Wed, 25 Jan 2012)
New Revision: 38166
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/RESTfulTestBase.java
Log:
Adding and fixing some features in RESTFulTestBase
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/RESTfulTestBase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/RESTfulTestBase.java 2012-01-25 11:08:49 UTC (rev 38165)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/rest/RESTfulTestBase.java 2012-01-25 11:09:37 UTC (rev 38166)
@@ -28,102 +28,127 @@
/**
* Test base for bot tests using RESTFul support
+ *
* @author jjankovi
- *
+ *
*/
-@Require(server=@Server(), perspective="Java EE")
+@Require(server = @Server(), perspective = "Java EE")
public class RESTfulTestBase extends WSTestBase {
protected final String PATH_PARAM_VALID_ERROR = "Invalid @PathParam value";
protected final String VALIDATION_PREFERENCE = "Validation";
+ protected final String ENABLE_ALL = "Enable All";
protected final String JAX_RS_VALIDATOR = "JAX-RS Metamodel Validator";
protected final String CONFIGURE_MENU_LABEL = "Configure";
protected final String REST_SUPPORT_MENU_LABEL_ADD = "Add JAX-RS 1.1 support...";
protected final String REST_SUPPORT_MENU_LABEL_REMOVE = "Remove JAX-RS 1.1 support...";
protected final String REST_EXPLORER_LABEL = "JAX-RS REST Web Services";
protected final String REST_EXPLORER_LABEL_BUILD = "Building RESTful Web Services...";
+ protected final String VALIDATION_SETTINGS_CHANGED = "Validation Settings Changed";
+
private enum ConfigureOption {
ADD, REMOVE;
}
-
- protected SWTBotTreeItem[] getRESTValidationErrorsAfterCleanBuild(String wsProjectName) {
- eclipse.cleanAllProjects();
- return getRESTValidationErrors(wsProjectName);
- }
-
+
protected SWTBotTreeItem[] getRESTValidationErrors(String wsProjectName) {
- return ProblemsView.getFilteredErrorsTreeItems(bot, PATH_PARAM_VALID_ERROR, "/"
- + wsProjectName, null, null);
+ return ProblemsView.getFilteredErrorsTreeItems(bot,
+ PATH_PARAM_VALID_ERROR, "/" + wsProjectName, null, null);
}
-
+
protected void enableRESTValidation() {
- SWTBotTable validatorTable = preferenceDialog(VALIDATION_PREFERENCE, new ArrayList<String>()).table();
- int restValidationRow = -1;
- for (int row = 0; row < validatorTable.rowCount(); row++) {
- if (validatorTable.getTableItem(row).getText().equals(JAX_RS_VALIDATOR)) {
- restValidationRow = row;
- break;
- }
- }
- assertTrue(restValidationRow >= 0);
-
+ modifyRESTValidation(ConfigureOption.ADD);
}
-
+
protected void disableRESTValidation() {
-
+ modifyRESTValidation(ConfigureOption.REMOVE);
}
+
- protected SWTBot preferenceDialog(final String name, final List<String> path) {
- return open.preferenceOpen(new IPreference() {
+ /**
+ * DO IT BETTER!!!!!!!!!!!!!!!!!!
+ */
+ protected void modifyRESTValidation(ConfigureOption option) {
+
+ SWTBot validationBot = openValidationPreference(VALIDATION_PREFERENCE, new ArrayList<String>());
+
+ validationBot.button(ENABLE_ALL).click();
+
+ if (option == ConfigureOption.REMOVE) {
- @Override
- public String getName() {
- return name;
+ SWTBotTable validatorTable = validationBot.table();
+ int restValidationRow = -1;
+ for (int row = 0; row < validatorTable.rowCount(); row++) {
+ if (validatorTable.getTableItem(row).getText()
+ .equals(JAX_RS_VALIDATOR)) {
+ restValidationRow = row;
+ break;
+ }
}
- @Override
- public List<String> getGroupPath() {
- return path;
- }
- });
+ assertTrue(restValidationRow >= 0);
+
+ validatorTable.click(restValidationRow, 1);
+ validatorTable.click(restValidationRow, 2);
+ }
+
+ validationBot.button("OK").click();
+ if (bot.activeShell().getText().equals(VALIDATION_SETTINGS_CHANGED)) {
+ bot.activeShell().bot().button("Yes").click();
+ }
+
+ bot.sleep(Timing.time3S());
+ util.waitForNonIgnoredJobs();
+
}
-
+
protected void addRestSupport(String wsProjectName) {
configureRestSupport(wsProjectName, ConfigureOption.ADD);
}
-
+
protected void removeRestSupport(String wsProjectName) {
configureRestSupport(wsProjectName, ConfigureOption.REMOVE);
}
+
- private void configureRestSupport(String wsProjectName, ConfigureOption option) {
+ protected boolean isRestSupportEnabled(String wsProjectName) {
+ return (projectExplorer.isFilePresent(wsProjectName,
+ RESTFulAnnotations.REST_EXPLORER_LABEL.getLabel()) || projectExplorer
+ .isFilePresent(wsProjectName,
+ RESTFulAnnotations.REST_EXPLORER_LABEL_BUILD.getLabel()));
+ }
+
+ protected static void addRestEasyLibs(String wsProjectName) {
+ assertTrue(configuredState.getServer().type.equals("EAP"));
+ }
+
+
+ private void configureRestSupport(String wsProjectName,
+ ConfigureOption option) {
projectExplorer.selectProject(wsProjectName);
SWTBotTree tree = projectExplorer.bot().tree();
SWTBotTreeItem item = tree.getTreeItem(wsProjectName);
item.expand();
- NodeContextUtil.nodeContextMenu(tree, item, RESTFulAnnotations.CONFIGURE_MENU_LABEL.getLabel(),
- option==ConfigureOption.ADD?
- RESTFulAnnotations.REST_SUPPORT_MENU_LABEL_ADD.getLabel():
- RESTFulAnnotations.REST_SUPPORT_MENU_LABEL_REMOVE.getLabel()).click();
- bot.sleep(Timing.time2S());
+ NodeContextUtil.nodeContextMenu(tree, item,
+ RESTFulAnnotations.CONFIGURE_MENU_LABEL.getLabel(),
+ option == ConfigureOption.ADD ? RESTFulAnnotations.REST_SUPPORT_MENU_LABEL_ADD
+ .getLabel() : RESTFulAnnotations.REST_SUPPORT_MENU_LABEL_REMOVE.getLabel()).click();
+ bot.sleep(Timing.time2S());
util.waitForNonIgnoredJobs();
}
- /**
- *
- * @param wsProjectName
- * @return
- */
- protected boolean isRestSupportEnabled(String wsProjectName) {
- return (projectExplorer.isFilePresent(wsProjectName,
- RESTFulAnnotations.REST_EXPLORER_LABEL.getLabel()) ||
- projectExplorer.isFilePresent(wsProjectName,
- RESTFulAnnotations.REST_EXPLORER_LABEL_BUILD.getLabel()));
+ private SWTBot openValidationPreference(final String name, final List<String> groupPath) {
+ return open.preferenceOpen(new IPreference() {
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public List<String> getGroupPath() {
+ return groupPath;
+ }
+ });
}
-
-
- protected static void addRestEasyLibs(String wsProjectName) {
- assertTrue(configuredState.getServer().type.equals("EAP"));
- }
-
+
}
12 years, 11 months