Author: yzhishko
Date: 2009-10-02 07:35:15 -0400 (Fri, 02 Oct 2009)
New Revision: 17868
Added:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java
Modified:
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/jbossEAPRuntime.properties
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam12Settings.properties
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam21Settings.properties
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam2fpSettings.properties
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/resources/runtimePaths.properties
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestLinesToggle.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestToggle.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/CommentTestUntoggle.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/ToggleCommentTestToggle.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/VerificationOfNameSpaces.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionHelloPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionTestPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionHelloPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionTestPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/DumpedTestPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideBorderForUnknownTag.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideResourceBundlesUsageasELExpressions.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowBorderForUnknownTag.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowNonVisualTags.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowResourceBundlesUsageasELExpressions.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/projectProperties.properties
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/ToggleCommentTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java
Log:
Test were changed and redesign according to last changes in UI of VPE and preferences
store. Now they could be run on hudson.
https://jira.jboss.org/jira/browse/JBIDE-4453
Modified:
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/jbossEAPRuntime.properties
===================================================================
---
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/jbossEAPRuntime.properties 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/jbossEAPRuntime.properties 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,5 @@
runtimeGroup=JBoss Enterprise Middleware
runtimeItem=JBoss Enterprise Application Platform 4.3
runtimeName=jboss-eap Runtime
-runtimePath=D\:\\EclipseJBDS\\jboss-eap\\jboss-as
+runtimePath=C\:/jbdevstudioRelease/jboss-eap/jboss-as
serverName=jboss-eap
\ No newline at end of file
Modified:
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam12Settings.properties
===================================================================
---
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam12Settings.properties 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam12Settings.properties 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,4 +1,4 @@
seamRuntimeName=Seam 1.2.AP
-seamRuntimePath=D\:\\EclipseJBDS\\jboss-eap\\seam
+seamRuntimePath=C\:/jbdevstudioRelease/jboss-eap/seam
testProjectName=seamTest12
configName=Dynamic Web Project with Seam 1.2
Modified:
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam21Settings.properties
===================================================================
---
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam21Settings.properties 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam21Settings.properties 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,4 +1,4 @@
seamRuntimeName=Seam 2.1.1.GA
-seamRuntimePath=D\:\\EclipseJBDS\\jboss-seam-2.1.1.GA
+seamRuntimePath=C\:/jbdevstudioRelease/jboss-eap/jboss-seam-2.1.1.GA
testProjectName=seamTest21
configName=Dynamic Web Project with Seam 2.1 (technology preview)
Modified:
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam2fpSettings.properties
===================================================================
---
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam2fpSettings.properties 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/resources/seam2fpSettings.properties 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,4 +1,4 @@
seamRuntimeName=Seam 2FP
-seamRuntimePath=D\:\\EclipseJBDS\\jboss-eap\\seamfp
+seamRuntimePath=C\:/jbdevstudioRelease/jboss-eap/seamfp
testProjectName=seamTest2fp
configName=Dynamic Web Project with Seam 2.0
Added:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -0,0 +1,103 @@
+package org.jboss.tools.ui.bot.test;
+
+import java.lang.reflect.Field;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.ui.IEditorReference;
+import org.hamcrest.SelfDescribing;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart;
+
+/**
+ * This represents Eclipse JSPMultiPageEditor part
+ * @author yzhishko
+ *
+ */
+
+public class SWTBotJSPMultiPageEditor 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.
+ */
+
+ private JSPMultiPageEditor jspMultiPageEditor;
+ private SWTWorkbenchBot bot;
+
+
+ public SWTBotJSPMultiPageEditor(IEditorReference editorReference,
+ SWTWorkbenchBot bot, SelfDescribing description) {
+ super(editorReference, bot, description);
+ this.bot = bot;
+ if (partReference.getPart(true) instanceof JSPMultiPageEditor) {
+ jspMultiPageEditor = (JSPMultiPageEditor)partReference.getPart(true);
+ }
+ }
+
+ /**
+ * 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 SWTBotJSPMultiPageEditor(IEditorReference editorReference,
+ SWTWorkbenchBot bot) {
+ super(editorReference, bot);
+ this.bot = bot;
+ if (partReference.getPart(true) instanceof JSPMultiPageEditor) {
+ jspMultiPageEditor = (JSPMultiPageEditor)partReference.getPart(true);
+ }
+ }
+
+
+ /**
+ *
+ * @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() {
+ return jspMultiPageEditor;
+ }
+
+ public void selectTab(final String tabLabel) throws WidgetNotFoundException{
+ bot.getDisplay().syncExec(new Runnable() {
+
+ public void run() {
+ Class<? extends JSPMultiPageEditorPart> cls = JSPMultiPageEditorPart.class;
+ try {
+ Field field = cls.getDeclaredField("container");
+ field.setAccessible(true);
+ CTabFolder tabFolder = (CTabFolder) field.get(jspMultiPageEditor);
+ CTabItem[] tabItems = tabFolder.getItems();
+ int pageIndex = 0;
+ boolean isHasItem = false;
+ for (int i = 0; i < tabItems.length; i++) {
+ if (tabLabel.equals(tabItems[i].getText())) {
+ pageIndex = i;
+ isHasItem = true;
+ }
+ }
+ if (!isHasItem) {
+ throw new WidgetNotFoundException("Can't find a tab item with "+
tabLabel + " label");
+ }
+ tabFolder.setSelection(tabItems[pageIndex]);
+ jspMultiPageEditor.pageChange(pageIndex);
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ }
+ catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ });
+ }
+
+}
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-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -22,29 +22,29 @@
* @return
*/
- public SWTBotMultiPageEditor multiPageEditor(Matcher<?> matcher) {
+ public SWTBotJSPMultiPageEditor multiPageEditor(Matcher<?> matcher) {
WaitForEditor waitForEditor = waitForEditor(matcher);
waitUntilWidgetAppears(waitForEditor);
- return new SWTBotMultiPageEditor(waitForEditor.get(0), this);
+ return new SWTBotJSPMultiPageEditor(waitForEditor.get(0), this);
}
/**
* Get editor by title
* @param fileName - the name of editor
- * @return - object with {@link SWTBotMultiPageEditor} reference type and current name
+ * @return - object with {@link SWTBotJSPMultiPageEditor} reference type and current
name
*/
- public SWTBotMultiPageEditor multiPageEditorByTitle (String fileName) {
+ public SWTBotJSPMultiPageEditor 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
+ * @return - object with {@link SWTBotJSPMultiPageEditor} reference type and current id
*/
- public SWTBotMultiPageEditor multiPageEditorById(String id){
+ public SWTBotJSPMultiPageEditor multiPageEditorById(String id){
return multiPageEditor(withPartId(id));
}
Modified:
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/resources/runtimePaths.properties
===================================================================
---
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/resources/runtimePaths.properties 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/resources/runtimePaths.properties 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1 +1 @@
-JBossEap4.3=C\:/jbdevstudioRelease/jboss-eap/jboss-as
\ No newline at end of file
+JBossEap4.3=C\:/jbdevstudio0609/jboss-eap/jboss-as
\ No newline at end of file
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestLinesToggle.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestLinesToggle.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestLinesToggle.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestToggle.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestToggle.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/BlockCommentTestToggle.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/CommentTestUntoggle.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/CommentTestUntoggle.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/CommentTestUntoggle.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/ToggleCommentTestToggle.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/ToggleCommentTestToggle.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/ToggleCommentTestToggle.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/VerificationOfNameSpaces.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/VerificationOfNameSpaces.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/editor/VerificationOfNameSpaces.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<SPAN CLASS="vpe-text">
...
</SPAN><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic;
color: green; -moz-user-modify: read-only;"/>
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionHelloPage.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionHelloPage.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionHelloPage.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionTestPage.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionTestPage.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/AddSubstitutedELExpressionTestPage.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionHelloPage.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionHelloPage.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionHelloPage.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionTestPage.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionTestPage.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/pagedesign/RemoveSubstitutedELExpressionTestPage.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/DumpedTestPage.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/DumpedTestPage.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/DumpedTestPage.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideBorderForUnknownTag.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideBorderForUnknownTag.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideBorderForUnknownTag.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideResourceBundlesUsageasELExpressions.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideResourceBundlesUsageasELExpressions.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/HideResourceBundlesUsageasELExpressions.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowBorderForUnknownTag.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowBorderForUnknownTag.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowBorderForUnknownTag.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowNonVisualTags.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowNonVisualTags.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowNonVisualTags.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<SPAN>
<SPAN STYLE="border: 1px dashed GREY; color: GREY; font-size: 12px;">
jsp:directive.taglib
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowResourceBundlesUsageasELExpressions.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowResourceBundlesUsageasELExpressions.xml 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/preferences/ShowResourceBundlesUsageasELExpressions.xml 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,5 +1,4 @@
<BODY ID="__content__area__">
-<!--This comment is of JBIDE-3396 -->
<DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<H1 STYLE="-moz-user-modify: read-write;">
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/projectProperties.properties
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/projectProperties.properties 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/projectProperties.properties 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,3 +1,3 @@
JSFProjectName=JBIDETestProject
Apachev6.0=D\:/Java/apache-tomcat-6.0.18
-JBossEap4.3=C\:/jbdevstudio200ga/jboss-eap/jboss-as
\ No newline at end of file
+JBossEap4.3=C\:/jbdevstudio0609/jboss-eap/jboss-as
\ No newline at end of file
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-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -13,7 +13,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.ui.bot.test.JBTSWTBotTestCase;
-import org.jboss.tools.ui.bot.test.SWTBotMultiPageEditor;
+import org.jboss.tools.ui.bot.test.SWTBotJSPMultiPageEditor;
import org.jboss.tools.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.VpeEditorPart;
@@ -147,13 +147,13 @@
* 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 SWTBotJSPMultiPageEditor
* @see Throwable
*/
@Deprecated
- protected void performContentTestByIDs(String expectedVPEContentFile,
SWTBotMultiPageEditor editor) throws Throwable{
+ protected void performContentTestByIDs(String expectedVPEContentFile,
SWTBotJSPMultiPageEditor editor) throws Throwable{
- JSPMultiPageEditor multiPageEditor = editor.getJSPMultiPageEditor();
+ JSPMultiPageEditor multiPageEditor = editor.getJspMultiPageEditor();
assertNotNull(multiPageEditor);
VpeController controller = TestUtil.getVpeController(multiPageEditor);
@@ -267,11 +267,10 @@
closeUnuseDialogs();
}
List<? extends SWTBotEditor> editors = bot.editors();
- try {
+ if (editors != null) {
for (int i = 0; i < editors.size(); i++) {
editors.get(i).close();
}
- } catch (WidgetNotFoundException e) {
}
}
@@ -283,8 +282,8 @@
* @throws Throwable
*/
- protected void performContentTestByDocument(String expectedVPEContentFile,
SWTBotMultiPageEditor editor) throws Throwable{
- JSPMultiPageEditor multiPageEditor = editor.getJSPMultiPageEditor();
+ protected void performContentTestByDocument(String expectedVPEContentFile,
SWTBotJSPMultiPageEditor editor) throws Throwable{
+ JSPMultiPageEditor multiPageEditor = editor.getJspMultiPageEditor();
assertNotNull(multiPageEditor);
nsIDOMDocument visualDocument =
((VpeEditorPart)multiPageEditor.getVisualEditor()).getVisualEditor().getDomDocument();
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-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -19,28 +19,24 @@
getEditor().navigateTo(22,22);
bot.menu("Source").menu("Toggle Comment").click();
- checkSelectionBar("#comment");
checkVPE("ToggleCommentTestToggle.xml");
//Test untoggle comment from Source menu
getEditor().navigateTo(22,22);
bot.menu("Source").menu("Toggle Comment").click();
- checkSelectionBar("h:commandButton");
checkVPE("CommentTestUntoggle.xml");
//Test toggle comment with CTRL+SHIFT+C hot keys
getEditor().navigateTo(22,22);
pressToggleCommentHotKeys();
- checkSelectionBar("#comment");
checkVPE("ToggleCommentTestToggle.xml");
//Test untoggle comment with CTRL+SHIFT hot keys
getEditor().navigateTo(22,22);
pressToggleCommentHotKeys();
- checkSelectionBar("h:commandButton");
checkVPE("CommentTestUntoggle.xml");
}
@@ -77,10 +73,4 @@
});
}
- private void checkSelectionBar (String... args){
- for (int i = 0; i < args.length; i++) {
- bot.toolbarButton(args[i]).click();
- }
- }
-
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -81,7 +81,6 @@
waitForBlockingJobsAcomplished("Save");
} catch (InterruptedException e) {
}
- editor.close();
super.tearDown();
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,34 +1,16 @@
package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
public class AlwaysHideSelectionBarWithoutPromptTest extends PreferencesTestCase{
+ private static final String HID_SEL_BAR = "Hide selection bar";
+
public void testAlwaysHideSelectionBarWithoutPrompt(){
- //Test open page
-
- openPage();
-
- //Test default Selection values
-
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Selection Tag Bar");
- if (!checkBox.isChecked()) {
- checkBox.click();
- }
- checkBox = bot.checkBox("Always Hide Selection Bar Without Prompt");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
-
//Test Hide Selection Bar
selectSelection();
- selectPrompt();
checkIsHide();
//Test Hide selection after reopen
@@ -49,34 +31,25 @@
checkIsShow();
//Test Hide Selection Bar button without confirm
-
- bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
+
+ selectSelection();
+ selectPrompt();
+ bot.toolbarButtonWithTooltip(HID_SEL_BAR).click();
checkIsHide();
- //Test Hide selection after reopen
+ //Test Show selection after reopen
closePage();
openPage();
- checkIsHide();
-
- //Test Show Selection Bar from dialog
-
- selectSelection();
checkIsShow();
-
- //Test Show Selection Bar after reopen
-
- closePage();
- openPage();
- checkIsShow();
}
private void checkIsHide(){
- WidgetNotFoundException exception = null;
+ IndexOutOfBoundsException exception = null;
try {
- bot.toolbarButtonWithTooltip("Hide Selection Bar");
- } catch (WidgetNotFoundException e) {
+ bot.toolbarButtonWithTooltip(HID_SEL_BAR,1);
+ } catch (IndexOutOfBoundsException e) {
exception = e;
}
assertNotNull(exception);
@@ -85,46 +58,24 @@
private void checkIsShow(){
WidgetNotFoundException exception = null;
try {
- bot.toolbarButtonWithTooltip("Hide Selection Bar");
+ bot.toolbarButtonWithTooltip(HID_SEL_BAR);
} catch (WidgetNotFoundException e) {
exception = e;
}
assertNull(exception);
}
- @Override
- protected void tearDown() throws Exception {
-
- //Restore page state after tests
-
- try {
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Selection Tag Bar");
- if (!checkBox.isChecked()) {
- checkBox.click();
- }
- checkBox = bot.checkBox("Always Hide Selection Bar Without Prompt");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
- } catch (WidgetNotFoundException e) {
- }
- super.tearDown();
- }
-
private void selectSelection(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Show Selection Tag Bar").click();
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ bot.checkBox(SHOW_SELECTION_TAG_BAR).click();
bot.button("OK").click();
}
private void selectPrompt(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Always Hide Selection Bar Without Prompt").click();
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ bot.checkBox(ASK_FOR_CONFIRM).click();
bot.button("OK").click();
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,11 +1,7 @@
package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
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.SWTBotCheckBox;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.jboss.tools.ui.bot.test.WidgetVariables;
public class BorderForUnknownTagsTest extends PreferencesTestCase{
@@ -15,12 +11,6 @@
public void testBorderForUnknownTags() throws Throwable{
//Test open page
-
- SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
- SWTBotTree tree = innerBot.tree();
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
-
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
textEditor = editor.getText();
@@ -31,9 +21,9 @@
//Test default Show Border value
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Border for Unknown Tags");
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ SWTBotCheckBox checkBox = bot.checkBox(SHOW_BORDER_FOR_UNKNOWN_TAGS);
if (!checkBox.isChecked()) {
checkBox.click();
}
@@ -64,9 +54,9 @@
}
private void selectBorder(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Show Border for Unknown Tags").click();
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ bot.checkBox(SHOW_BORDER_FOR_UNKNOWN_TAGS).click();
bot.button("OK").click();
}
@@ -75,16 +65,6 @@
//Restore page state before tests
- try {
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Border for Unknown Tags");
- if (!checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
- } catch (WidgetNotFoundException e) {
- }
editor.setFocus();
bot.menu("Edit").menu("Select All").click();
bot.menu("Edit").menu("Delete").click();
@@ -94,7 +74,6 @@
waitForBlockingJobsAcomplished("Save");
} catch (InterruptedException e) {
}
- editor.close();
super.tearDown();
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -8,15 +8,11 @@
public void testChangeEditorTabForTheFirstOpenPage(){
- //Test open page on visual/source tab
-
- openPage();
-
//Test set default source tab
- bot.toolbarButtonWithTooltip("Preferences").click();
- 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.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ bot.comboBoxWithLabel(SELECT_DEFAULT_TAB).setSelection("Source");
bot.button("OK").click();
//Create and open new page
@@ -30,11 +26,9 @@
bot.shell("New File JSP").activate();
bot.textWithLabel("Name*").setText("testPage");
bot.button("Finish").click();
- delay();
bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
//Check if the tab changed
-
WidgetNotFoundException exception = null;
try {
bot.toolbarButtonWithTooltip("Refresh").click();
@@ -42,39 +36,19 @@
exception = e;
}
assertNotNull(exception);
- bot.editorByTitle("testPage.jsp").close();
- bot.editorByTitle(TEST_PAGE).setFocus();
-
- //Test set default visual/source tab
-
- bot.toolbarButtonWithTooltip("Preferences").click();
- 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("Visual/Source");
- bot.button("OK").click();
}
@Override
protected void tearDown() throws Exception {
//Delete test page if it has been created
- try {
- SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
- innerBot.tree().expandNode(JBT_TEST_PROJECT_NAME).expandNode("WebContent")
- .expandNode("pages").getNode("testPage.jsp").select();
- bot.menu("Edit").menu("Delete").click();
- bot.shell("Confirm Delete").activate();
- bot.button("OK").click();
- } catch (WidgetNotFoundException e) {
- }
- //Set default pref value
- try{
- bot.toolbarButtonWithTooltip("Preferences").click();
- 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("Visual/Source");
- bot.button("OK").click();
- }catch (WidgetNotFoundException e) {
- }
- delay();
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ innerBot.tree().expandNode(JBT_TEST_PROJECT_NAME).expandNode("WebContent")
+ .expandNode("pages").getNode("testPage.jsp").select();
+ bot.menu("Edit").menu("Delete").click();
+ bot.shell("Confirm Delete").activate();
+ bot.button("OK").click();
+ bot.multiPageEditorByTitle(TEST_PAGE).selectTab("Visual/Source");
super.tearDown();
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -6,6 +6,8 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.ui.bot.test.Activator;
@@ -13,6 +15,19 @@
public abstract class PreferencesTestCase extends VPEAutoTestCase{
+ protected static final String SHOW_SELECTION_TAG_BAR = "Show selection tag
bar";
+ protected static final String SHOW_NON_VISUAL_TAGS = "Show non-visual tags";
+ protected static final String SHOW_BORDER_FOR_UNKNOWN_TAGS = "Show border for
unknown tags";
+ protected static final String SHOW_RESOURCE_BUNDLES = "Show resource bundles usage
as EL expressions";
+ protected static final String ASK_FOR_ATTRIBUTES = "Ask for tag attributes during
tag insert";
+ protected static final String ASK_FOR_CONFIRM = "Ask for confirmation when closing
Selection Bar";
+ protected static final String SELECT_DEFAULT_TAB = "Select the default active
editor's tab for files that haven't been previously opened in the VPE";
+ protected static final String EDITOR_SPLITTING = "Visual/Source editors
splitting";
+ protected static final String SHOW_TEXY_FORMAT = "Show text formatting bar";
+ protected static final String PREF_TOOLTIP = "Preferences";
+ protected static final String PREF_FILTER_SHELL_TITLE = "Preferences
(Filtered)";
+
+
@Override
protected void closeUnuseDialogs() {
try {
@@ -53,4 +68,59 @@
return filePath;
}
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ openPage();
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ setPreferencesToDefault();
+ bot.button("OK").click();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ openPage();
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ setPreferencesToDefault();
+ bot.button("OK").click();
+ super.tearDown();
+ }
+
+ void setPreferencesToDefault() throws WidgetNotFoundException{
+ SWTBotCheckBox checkBox = bot.checkBox(SHOW_BORDER_FOR_UNKNOWN_TAGS);
+ if (checkBox.isChecked()) {
+ checkBox.click();
+ }
+ checkBox = bot.checkBox(SHOW_NON_VISUAL_TAGS);
+ if (checkBox.isChecked()) {
+ checkBox.click();
+ }
+ checkBox = bot.checkBox(SHOW_SELECTION_TAG_BAR);
+ if (!checkBox.isChecked()) {
+ checkBox.click();
+ }
+ checkBox = bot.checkBox(SHOW_RESOURCE_BUNDLES);
+ if (checkBox.isChecked()) {
+ checkBox.click();
+ }
+ checkBox = bot.checkBox(ASK_FOR_ATTRIBUTES);
+ if (!checkBox.isChecked()) {
+ checkBox.click();
+ }
+ checkBox = bot.checkBox(ASK_FOR_CONFIRM);
+ if (!checkBox.isChecked()) {
+ checkBox.click();
+ }
+ checkBox = bot.checkBox(SHOW_TEXY_FORMAT);
+ if (!checkBox.isChecked()) {
+ checkBox.click();
+ }
+ SWTBotCombo combo = bot.comboBoxWithLabel("Select the default active editor's
tab for files that haven't been previously opened in the VPE");
+ combo.setSelection("Visual/Source");
+ combo = bot.comboBoxWithLabel("Visual/Source editors splitting");
+ combo.setSelection("Vertical splitting with Source Editor on the top");
+ }
+
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,25 +1,9 @@
package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
-
public class ShowNonVisualTagsTest extends PreferencesTestCase{
public void testShowNonVisualTags() throws Throwable{
- //Test open page
-
- openPage();
-
- //Test set default Show Tag value
-
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Non-Visual Tags");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
checkVPE("DumpedTestPage.xml");
//Test Show Non-Visual Tags
@@ -45,25 +29,10 @@
performContentTestByDocument(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
}
- @Override
- protected void tearDown() throws Exception {
- try {
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Non-Visual Tags");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
- } catch (WidgetNotFoundException e) {
- }
- super.tearDown();
- }
-
private void selectShowNonVisual(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Show Non-Visual Tags").click();
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ bot.checkBox(SHOW_NON_VISUAL_TAGS).click();
bot.button("OK").click();
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,8 +1,6 @@
package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
public class ShowResourceBundlesUsageasELexpressionsTest extends PreferencesTestCase{
@@ -11,22 +9,8 @@
public void testShowResourceBundlesUsageasELexpressions() throws Throwable{
- //Test open page
-
- openPage();
-
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
textEditor = editor.getText();
-
- //Test default Show Border value
-
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Resource Bundles Usage as EL
Expressions");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
//Test check VPE content with resource bundles
@@ -45,16 +29,6 @@
//Restore page state before tests
- try {
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Resource Bundles Usage as EL
Expressions");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
- } catch (WidgetNotFoundException e) {
- }
editor.setFocus();
bot.menu("Edit").menu("Select All").click();
bot.menu("Edit").menu("Delete").click();
@@ -64,7 +38,6 @@
waitForBlockingJobsAcomplished("Save");
} catch (InterruptedException e) {
}
- editor.close();
super.tearDown();
}
@@ -77,9 +50,9 @@
}
private void selectELExpressions(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Show Resource Bundles Usage as EL Expressions").click();
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ bot.checkBox(SHOW_RESOURCE_BUNDLES).click();
bot.button("OK").click();
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -1,30 +1,13 @@
package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
public class ShowSelectionTagBarTest extends PreferencesTestCase{
+ private static final String HID_SEL_BAR = "Hide selection bar";
+
public void testShowSelectionTagBar(){
- //Test open page
-
- openPage();
-
- //Test default Selection values
-
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Selection Tag Bar");
- if (!checkBox.isChecked()) {
- checkBox.click();
- }
- checkBox = bot.checkBox("Always Hide Selection Bar Without Prompt");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
-
//Test Hide Selection Bar
selectSelection();
@@ -49,64 +32,32 @@
//Test Hide Selection Bar button with confirm
- bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
+ bot.toolbarButtonWithTooltip(HID_SEL_BAR).click();
bot.shell("Confirm hide selection bar").activate();
bot.button("OK").click();
+ checkIsShow();
checkIsHide();
- //Test Hide selection after reopen
+ //Test Show selection after reopen
closePage();
openPage();
- checkIsHide();
-
- //Test Show Selection Bar from dialog
-
- selectSelection();
checkIsShow();
-
- //Test Show Selection Bar after reopen
-
- closePage();
- openPage();
- checkIsShow();
}
-
- @Override
- protected void tearDown() throws Exception {
- //Restore page state before tests
-
- try {
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Selection Tag Bar");
- if (!checkBox.isChecked()) {
- checkBox.click();
- }
- checkBox = bot.checkBox("Always Hide Selection Bar Without Prompt");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
- } catch (WidgetNotFoundException e) {
- }
- super.tearDown();
- }
-
private void selectSelection(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Show Selection Tag Bar").click();
+ bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click();
+ bot.shell(PREF_FILTER_SHELL_TITLE).activate();
+ bot.checkBox(SHOW_SELECTION_TAG_BAR).click();
bot.button("OK").click();
}
private void checkIsHide(){
- WidgetNotFoundException exception = null;
+ IndexOutOfBoundsException exception = null;
try {
- bot.toolbarButtonWithTooltip("Hide Selection Bar");
- } catch (WidgetNotFoundException e) {
+ bot.toolbarButtonWithTooltip(HID_SEL_BAR,1);
+ } catch (IndexOutOfBoundsException e) {
exception = e;
}
assertNotNull(exception);
@@ -115,7 +66,7 @@
private void checkIsShow(){
WidgetNotFoundException exception = null;
try {
- bot.toolbarButtonWithTooltip("Hide Selection Bar");
+ bot.toolbarButtonWithTooltip(HID_SEL_BAR);
} catch (WidgetNotFoundException e) {
exception = e;
}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java 2009-10-02
11:03:04 UTC (rev 17867)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java 2009-10-02
11:35:15 UTC (rev 17868)
@@ -16,6 +16,7 @@
//Test open import dialog
+ bot.viewByTitle("JBoss Tools Palette").setFocus();
bot.toolbarButtonWithTooltip("Import").click();
bot.shell("Import Tags from TLD File").activate();