Author: yzhishko
Date: 2009-08-11 04:32:24 -0400 (Tue, 11 Aug 2009)
New Revision: 17042
Modified:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotMultiPageEditor.java
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTagsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4306Test.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java
Log:
I've made a little refractoring. Unnecessary try{}/catch(){} blocks were deleted.
JavaDoc and comments for main methods were created.
Modified:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -16,13 +16,21 @@
ILogListener {
private Throwable exception;
- public static final String swtBotProperties = "SWTBot.properties";
+ public static final String PATH_TO_SWT_BOT_PROPERTIES = "SWTBot.properties";
private static Properties SWT_BOT_PROPERTIES;
protected SWTJBTBot bot = new SWTJBTBot();
-
+ private int sleepTime = 500;
+
+ /* (non-Javadoc)
+ * This static block read properties from
+ * org.jboss.tools.ui.bot.test/resources/SWTBot.properties file
+ * and set up parameters for SWTBot tests. You may change a number of parameters
+ * in static block and their values in property file.
+ */
+
static {
try {
- InputStream swtPreferenceIS =
Platform.getBundle(Activator.PLUGIN_ID).getResource(swtBotProperties)
+ InputStream swtPreferenceIS =
Platform.getBundle(Activator.PLUGIN_ID).getResource(PATH_TO_SWT_BOT_PROPERTIES)
.openStream();
SWT_BOT_PROPERTIES = new Properties();
SWT_BOT_PROPERTIES.load(swtPreferenceIS);
@@ -33,9 +41,9 @@
.getProperty("SWTBotPreferences.TIMEOUT"));
swtPreferenceIS.close();
} catch (IOException e) {
- fail("Can't load properties from " + swtBotProperties + "
file");
+ fail("Can't load properties from " + PATH_TO_SWT_BOT_PROPERTIES + "
file");
} catch (IllegalStateException e) {
- fail("Property file " + swtBotProperties + " was not found");
+ fail("Property file " + PATH_TO_SWT_BOT_PROPERTIES + " was not
found");
}
}
@@ -54,14 +62,36 @@
}
}
+ /**
+ * Getter method for exception that may be thrown during test
+ * execution.<p>
+ * You can call this method from any place of your methods
+ * and verify if any exception was thrown during test executing
+ * including Error Log.
+ * @return exception
+ * @see Throwable
+ */
+
protected Throwable getException() {
return exception;
}
+ /**
+ * Setter method for exception.
+ * If param is not null test will fail and you will see stack trace in JUnit Error Log
+ * @param e - exception, that can be frown during test executing
+ * @see Throwable
+ */
+
protected void setException(Throwable e) {
this.exception = e;
}
+ /**
+ * Delete .log file from junit-workspace .metadata, if it hadn't been deleted
before<p>
+ * So we can catch exceptions and errors, which were thrown during current test.
+ */
+
private void deleteLog() {
try {
Platform.getLogFileLocation().toFile().delete();
@@ -69,6 +99,16 @@
}
}
+ /**
+ * Make a default preconditions before test launch
+ * @see #activePerspective()
+ * @see #openErrorLog()
+ * @see #openPackageExplorer()
+ * @see #setException(Throwable)
+ * @see #deleteLog()
+ * @see #delay()
+ */
+
@Override
protected void setUp() throws Exception {
activePerspective();
@@ -85,6 +125,11 @@
delay();
}
+ /**
+ * Tears down the fixture. Verify Error Log.
+ * @see #getException()
+ */
+
@Override
protected void tearDown() throws Exception {
Platform.removeLogListener(this);
@@ -94,20 +139,23 @@
}
}
+ /**
+ * A little delay between test's steps. Use it where necessary.
+ */
+
protected void delay() {
- bot.sleep(500);
+ bot.sleep(sleepTime);
}
- protected void shortDelay(){
- bot.sleep(3000);
- }
-
- protected void longDelay() {
- bot.sleep(10000);
- }
+ /** Defines which kind of perspective should be activated before tests' run.
+ */
abstract protected void activePerspective ();
+ /**
+ * Open and activate Error Log view if it hadn't been opened before
+ */
+
protected void openErrorLog() {
try {
bot.viewByTitle(WidgetVariables.ERROR_LOG);
@@ -121,6 +169,10 @@
}
}
+ /**
+ * Open and activate Package Explorer view if it hadn't been opened before
+ */
+
protected void openPackageExplorer() {
try {
bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER);
@@ -146,6 +198,10 @@
// }
// }
+ /**
+ * Wait until job manager is currently idle
+ */
+
protected void waitForJobs(){
delay();
while (!Job.getJobManager().isIdle()) {
Modified:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotMultiPageEditor.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotMultiPageEditor.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotMultiPageEditor.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -6,18 +6,44 @@
import org.hamcrest.SelfDescribing;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+/**
+ * This represents Eclipse MultiPageEditor part
+ * @author yzhishko
+ *
+ */
+
public class SWTBotMultiPageEditor extends SWTBotEditor{
+ /**
+ * Constructs an instance for the given editorReference.
+ * @param editorReference - the part reference.
+ * @param bot - the helper bot.
+ * @param description - the description of the editor part.
+ */
+
public SWTBotMultiPageEditor(IEditorReference editorReference,
SWTWorkbenchBot bot, SelfDescribing description) {
super(editorReference, bot, description);
}
+ /**
+ * Constructs an instance for the given editorReference.
+ * @param editorReference - the editor reference
+ * @param bot - the instance of {@link SWTWorkbenchBot} which will be used to drive
operations on behalf of this object.
+ */
+
public SWTBotMultiPageEditor(IEditorReference editorReference,
SWTWorkbenchBot bot) {
super(editorReference, bot);
}
+ /**
+ *
+ * @return <b>null</b> if current MultiPageEditor isn't instance of
{@link JSPMultiPageEditor}, <i>else</i> <p>
+ * An object that has {@link JSPMultiPageEditor} reference type
+ * @see JSPMultiPageEditor
+ */
+
public JSPMultiPageEditor getJSPMultiPageEditor(){
if (partReference.getPart(true) instanceof JSPMultiPageEditor) {
return (JSPMultiPageEditor)partReference.getPart(true);
Modified:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -7,18 +7,43 @@
import org.eclipse.swtbot.eclipse.finder.waits.WaitForEditor;
import org.hamcrest.Matcher;
+/**
+ * SWTWorkbenchBot is a {@link SWTWorkbenchBot} with capabilities for
+ * testing Eclipse workbench item like MultiPageEditor
+ * @author yzhishko
+ *
+ */
+
public class SWTJBTBot extends SWTWorkbenchBot{
+ /**
+ *
+ * @param matcher
+ * @return
+ */
+
public SWTBotMultiPageEditor multiPageEditor(Matcher<?> matcher) {
WaitForEditor waitForEditor = waitForEditor(matcher);
waitUntilWidgetAppears(waitForEditor);
return new SWTBotMultiPageEditor(waitForEditor.get(0), this);
}
+ /**
+ * Get editor by title
+ * @param fileName - the name of editor
+ * @return - object with {@link SWTBotMultiPageEditor} reference type and current name
+ */
+
public SWTBotMultiPageEditor multiPageEditorByTitle (String fileName) {
return multiPageEditor(withPartName(fileName));
}
+ /**
+ * Get editor by id
+ * @param id - id of an editor
+ * @return - object with {@link SWTBotMultiPageEditor} reference type and current id
+ */
+
public SWTBotMultiPageEditor multiPageEditorById(String id){
return multiPageEditor(withPartId(id));
}
Modified:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -1,5 +1,12 @@
package org.jboss.tools.ui.bot.test;
+/**
+ * Class defines constants with editors', shells', views' names.
+ * @author yzhishko
+ *
+ */
+
+
public class WidgetVariables {
public static final String ERROR_LOG = "Error Log";
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -30,7 +30,20 @@
protected static Properties projectProperties;
protected static final String TEST_PAGE = "inputUserName.jsp";
public static String PROJECT_PROPERTIES = "projectProperties.properties";
+
+ /**
+ * Variable defines JBoss EAP 4.3 server location on a file system
+ */
+
public static String JBOSS_EAP_HOME;
+
+ /* (non-Javadoc)
+ * This static block read properties from
+ * org.jboss.tools.vpe.ui.bot.test/resources/projectProperties.properties file
+ * and set up parameters for project which you would like to create. You may change a
number of parameters
+ * in static block and their values in property file.
+ */
+
static {
try {
InputStream is =
Platform.getBundle(Activator.PLUGIN_ID).getResource(PROJECT_PROPERTIES).openStream();
@@ -44,6 +57,11 @@
JBOSS_EAP_HOME =
System.getProperty("jbosstools.test.jboss.home",projectProperties.getProperty("JBossEap4.3"));
}
+ /**
+ * @see #clearWorkbench()
+ * @see #createJSFProject(String)
+ */
+
protected void setUp() throws Exception {
super.setUp();
clearWorkbench();
@@ -56,12 +74,23 @@
}
}
+ /**
+ * Tears down the fixture. Verify Error Log. Close all dialogs which may be not closed
+ * after test executing.
+ * @see #clearWorkbench()
+ */
+
@Override
protected void tearDown() throws Exception {
clearWorkbench();
super.tearDown();
}
+ /**
+ * Create JSF Project with <b>jsfProjectName</b>
+ * @param jsfProjectName - name of created project
+ */
+
protected void createJSFProject(String jsfProjectName){
bot.menu("File").menu("New").menu("Other...").click();
SWTBotTree tree = bot.tree();
@@ -103,6 +132,18 @@
waitForJobs();
}
+ /**
+ * Test content of elements from <b>editor</b> by IDs.<p>
+ * Tested elements from source editor should have id's attributes that
+ * correspond to expected one from <b>expectedVPEContentFile</b>.
+ * @param expectedVPEContentFile - file name, for example,
<i>"ShowNonVisualTags.xml"</i>
+ * with expected VPE DOM Elements and id's attributes correspond to source
<b>editor</b> element
+ * @param editor - {@link JSPMultiPageEditor} that contains source code with tested
elements and current id.
+ * @throws Throwable
+ * @see SWTBotMultiPageEditor
+ * @see Throwable
+ */
+
protected void performContentTestByIDs(String expectedVPEContentFile,
SWTBotMultiPageEditor editor) throws Throwable{
JSPMultiPageEditor multiPageEditor = editor.getJSPMultiPageEditor();
@@ -202,6 +243,13 @@
}
}
+ /**
+ * Close all dialogs and editors, which may be not closed
+ * after test executing.
+ * @see #isUnuseDialogOpened()
+ * @see #closeUnuseDialogs()
+ */
+
protected void clearWorkbench(){
while (isUnuseDialogOpened()) {
closeUnuseDialogs();
@@ -215,6 +263,14 @@
}
}
+ /**
+ * Test content for elements from all VPE DOM that are nested with
<i>BODY</i> descriptor
+ * @param expectedVPEContentFile - file name, for example,
<i>"VerificationOfNameSpaces.xml"</i>
+ * with expected VPE DOM Elements that are nested with <i>BODY</i>
descriptor
+ * @param editor - {@link JSPMultiPageEditor} that contains source code of currently
tested page.
+ * @throws Throwable
+ */
+
protected void performContentTestByDocument(String expectedVPEContentFile,
SWTBotMultiPageEditor editor) throws Throwable{
JSPMultiPageEditor multiPageEditor = editor.getJSPMultiPageEditor();
assertNotNull(multiPageEditor);
@@ -238,7 +294,15 @@
TestDomUtil.compareNodes(visualBodyNode, testBodyNode);
}
+ /**
+ * Try to close all unnecessary dialogs, that could prevent next tests fails
+ */
+
protected abstract void closeUnuseDialogs();
+
+ /**
+ * Verify if any dialog that should be closed is opened
+ */
protected abstract boolean isUnuseDialogOpened();
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -105,17 +105,14 @@
private void openPage(){
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (WidgetNotFoundException e) {
- }
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
}
private void checkIsHide(){
WidgetNotFoundException exception = null;
try {
- bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
+ bot.toolbarButtonWithTooltip("Hide Selection Bar");
} catch (WidgetNotFoundException e) {
exception = e;
}
@@ -123,13 +120,19 @@
}
private void checkIsShow(){
- assertNotNull(bot.toolbarButtonWithTooltip("Hide Selection Bar"));
+ WidgetNotFoundException exception = null;
+ try {
+ bot.toolbarButtonWithTooltip("Hide Selection Bar");
+ } catch (WidgetNotFoundException e) {
+ exception = e;
+ }
+ assertNull(exception);
}
@Override
protected void tearDown() throws Exception {
- //Restore page state before tests
+ //Restore page state after tests
try {
bot.toolbarButtonWithTooltip("Preferences").click();
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -5,7 +5,6 @@
import org.eclipse.swt.widgets.Event;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
@@ -21,11 +20,8 @@
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (WidgetNotFoundException e) {
- }
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
textEditor = editor.getText();
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -19,11 +19,8 @@
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (WidgetNotFoundException e) {
- }
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
textEditor = editor.getText();
@@ -108,7 +105,7 @@
checkBox.click();
}
bot.button("OK").click();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
editor.setFocus();
bot.menu("Edit").menu("Select All").click();
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTagsTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTagsTest.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTagsTest.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -87,11 +87,8 @@
private void openPage(){
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (WidgetNotFoundException e) {
- }
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
}
private void selectShowNonVisual(){
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -19,11 +19,8 @@
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (WidgetNotFoundException e) {
- }
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
textEditor = editor.getText();
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -32,7 +32,6 @@
//Test Hide Selection Bar
selectSelection();
- waitForJobs();
checkIsHide();
//Test Hide selection after reopen
@@ -44,7 +43,6 @@
//Test Show Selection Bar
selectSelection();
- waitForJobs();
checkIsShow();
//Test Show Selection Bar after reopen
@@ -69,7 +67,6 @@
//Test Show Selection Bar from dialog
selectSelection();
- waitForJobs();
checkIsShow();
//Test Show Selection Bar after reopen
@@ -135,17 +132,14 @@
private void openPage(){
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (WidgetNotFoundException e) {
- }
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
}
private void checkIsHide(){
WidgetNotFoundException exception = null;
try {
- bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
+ bot.toolbarButtonWithTooltip("Hide Selection Bar");
} catch (WidgetNotFoundException e) {
exception = e;
}
@@ -153,7 +147,13 @@
}
private void checkIsShow(){
- assertNotNull(bot.toolbarButtonWithTooltip("Hide Selection Bar"));
+ WidgetNotFoundException exception = null;
+ try {
+ bot.toolbarButtonWithTooltip("Hide Selection Bar");
+ } catch (WidgetNotFoundException e) {
+ exception = e;
+ }
+ assertNull(exception);
}
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -5,7 +5,6 @@
import org.eclipse.swt.widgets.Event;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
@@ -21,13 +20,9 @@
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (WidgetNotFoundException e) {
- }
-
-
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
+
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
textEditor = editor.getText();
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -2,7 +2,6 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
@@ -24,11 +23,8 @@
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (WidgetNotFoundException e) {
- }
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
textEditor = editor.getText();
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4306Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4306Test.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4306Test.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -14,11 +14,8 @@
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (Exception e) {
- }
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
//Test set default source tab
@@ -26,20 +23,17 @@
bot.shell("Preferences (Filtered)").activate();
bot.comboBoxWithLabel("Select the default active editor's tab\nfor files that
haven't been previously\nopened in the VPE:").setSelection("Source");
bot.button("OK").click();
- try {
- innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
- tree = innerBot.tree();
- bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode("hello.jsp").doubleClick();
- } catch (Exception e) {
- }
+ innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ tree = innerBot.tree();
+ bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode("hello.jsp").doubleClick();
//Check if the tab changed
WidgetNotFoundException exception = null;
try {
- bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.toolbarButtonWithTooltip("Refresh").click();
} catch (WidgetNotFoundException e) {
exception = e;
}
@@ -60,7 +54,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("Preferences (Filtered)").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -70,7 +64,7 @@
try {
bot.shell("Preferences (Filtered)").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java 2009-08-11
08:07:08 UTC (rev 17041)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java 2009-08-11
08:32:24 UTC (rev 17042)
@@ -43,7 +43,7 @@
event.type = SWT.KeyUp;
event.character = SWT.DEL;
display.post(event);
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -51,7 +51,7 @@
bot.shell("Confirmation").activate();
bot.button("OK").click();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
bot.shell("Palette Editor").activate();
bot.button("OK").click();