Author: yzhishko
Date: 2009-08-21 08:02:04 -0400 (Fri, 21 Aug 2009)
New Revision: 17213
Added:
workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/src/log4j.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/
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
Removed:
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/BorderForUnknownTagsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ChangeEditorTabForTheFirstOpenPageTest.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
Modified:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Messages.java
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/src/org/jboss/tools/ui/runtime/bot/test/messages.properties
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4306Test.java
Log:
Fixed NLS messages. Some tests were updated. Create logging for Seam tests.
Added: workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/src/log4j.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/src/log4j.xml
(rev 0)
+++ workspace/yzhishko/org.jboss.tools.seam.ui.bot.test/src/log4j.xml 2009-08-21 12:02:04
UTC (rev 17213)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender"
class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) -
%m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender"
class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) -
%m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender"
class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
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-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -205,6 +205,12 @@
protected void waitForJobs(){
delay();
while (!Job.getJobManager().isIdle()) {
+ Job[] jobs = Job.getJobManager().find(null);
+ for (Job job : jobs) {
+ if ("Updating indexes".equals(job.getName())) {
+ job.cancel();
+ }
+ }
delay();
}
}
Modified:
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Messages.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Messages.java 2009-08-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Messages.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -11,6 +11,7 @@
public static String JBossRuntimeStartup_JBoss_Application_Server_4_0;
public static String JBossRuntimeStartup_JBoss_Application_Server_4_2;
public static String JBossRuntimeStartup_JBoss_Application_Server_5_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_5_1;
public static String JBossRuntimeStartup_JBoss_EAP_Server_4_3;
public static String JBossRuntimeStartup_Runtime;
public static String JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database;
Modified:
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/src/org/jboss/tools/ui/runtime/bot/test/messages.properties
===================================================================
---
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/src/org/jboss/tools/ui/runtime/bot/test/messages.properties 2009-08-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.ui.runtime.bot.test/src/org/jboss/tools/ui/runtime/bot/test/messages.properties 2009-08-21
12:02:04 UTC (rev 17213)
@@ -1,6 +1,6 @@
JBossRuntimeStartup_Cannot_create_new_JBoss_Server=Can''t create new JBoss
Server
-JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile=Can''t create new
DTP Connection Profile for JBoss AS Hypersonic embedded database
-JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver=Can''t create new HSQL DB
Driver.
+JBossRuntimeStartup_Cannot_create_new_DTP_Connection_Profile=Can''t create new
DTP Connection Profile for JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_Cannot_create_new_HSQL_DB_Driver=Can''t create new HSQL DB
Driver.
JBossRuntimeStartup_JBoss_Application_Server_3_2=JBoss Application Server 3.2
JBossRuntimeStartup_JBoss_Application_Server_4_0=JBoss Application Server 4.0
JBossRuntimeStartup_JBoss_Application_Server_4_2=JBoss Application Server 4.2
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java 2009-08-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -4,15 +4,15 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
-import org.jboss.tools.vpe.ui.bot.test.editor.AlwaysHideSelectionBarWithoutPromptTest;
import org.jboss.tools.vpe.ui.bot.test.editor.BlockCommentTest;
-import org.jboss.tools.vpe.ui.bot.test.editor.BorderForUnknownTagsTest;
-import org.jboss.tools.vpe.ui.bot.test.editor.ChangeEditorTabForTheFirstOpenPageTest;
-import org.jboss.tools.vpe.ui.bot.test.editor.ShowNonVisualTagsTest;
-import
org.jboss.tools.vpe.ui.bot.test.editor.ShowResourceBundlesUsageasELexpressionsTest;
-import org.jboss.tools.vpe.ui.bot.test.editor.ShowSelectionTagBarTest;
import org.jboss.tools.vpe.ui.bot.test.editor.ToggleCommentTest;
import org.jboss.tools.vpe.ui.bot.test.editor.VerificationOfNameSpacesTest;
+import
org.jboss.tools.vpe.ui.bot.test.editor.preferences.AlwaysHideSelectionBarWithoutPromptTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.preferences.BorderForUnknownTagsTest;
+import
org.jboss.tools.vpe.ui.bot.test.editor.preferences.ChangeEditorTabForTheFirstOpenPageTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowNonVisualTagsTest;
+import
org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowResourceBundlesUsageasELexpressionsTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowSelectionTagBarTest;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4306Test;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4556Test;
import org.jboss.tools.vpe.ui.bot.test.palette.CancelTagLibDefenitionTest;
Deleted:
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-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -1,168 +0,0 @@
-package org.jboss.tools.vpe.ui.bot.test.editor;
-
-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;
-import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-
-public class AlwaysHideSelectionBarWithoutPromptTest extends VPEAutoTestCase{
-
- 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();
- waitForJobs();
- checkIsHide();
-
- //Test Hide selection after reopen
-
- closePage();
- openPage();
- checkIsHide();
-
- //Test Show Selection Bar
-
- selectSelection();
- waitForJobs();
- checkIsShow();
-
- //Test Show Selection Bar after reopen
-
- closePage();
- openPage();
- checkIsShow();
-
- //Test Hide Selection Bar button without confirm
-
- bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
- checkIsHide();
-
- //Test Hide selection after reopen
-
- closePage();
- openPage();
- checkIsHide();
-
- //Test Show Selection Bar from dialog
-
- selectSelection();
- waitForJobs();
- checkIsShow();
-
- //Test Show Selection Bar after reopen
-
- closePage();
- openPage();
- checkIsShow();
-
- }
-
- @Override
- protected void closeUnuseDialogs() {
- try {
- bot.shell("Preferences (Filtered)").close();
- } catch (WidgetNotFoundException e) {
- }
- }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- boolean isOpened = false;
- try {
- bot.shell("Preferences (Filtered)").activate();
- isOpened = true;
- } catch (WidgetNotFoundException e) {
- }
- return isOpened;
- }
-
- private void closePage(){
- bot.editorByTitle(TEST_PAGE).close();
- }
-
- private void openPage(){
- 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();
- }
-
- private void checkIsHide(){
- WidgetNotFoundException exception = null;
- try {
- bot.toolbarButtonWithTooltip("Hide Selection Bar");
- } catch (WidgetNotFoundException e) {
- exception = e;
- }
- assertNotNull(exception);
- }
-
- private void checkIsShow(){
- 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 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.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.button("OK").click();
- }
-
-}
Deleted:
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-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -1,120 +0,0 @@
-package org.jboss.tools.vpe.ui.bot.test.editor;
-
-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;
-import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-
-public class BorderForUnknownTagsTest extends VPEAutoTestCase{
-
- private static String textEditor;
- private static SWTBotEclipseEditor editor;
-
- 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();
-
- //Test insert unknown tag
-
- editor.navigateTo(12, 52);
- editor.insertText("<tagunknown></tagunknown>");
-
- //Test default Show Border value
-
- 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();
-
- //Test check VPE content
-
- checkVPE("ShowBorderForUnknownTag.xml");
-
- //Test hide border for unknown tag
-
- selectBorder();
- checkVPE("HideBorderForUnknownTag.xml");
-
- //Test restore previous state
-
- selectBorder();
- checkVPE("ShowBorderForUnknownTag.xml");
-
- }
-
- @Override
- protected void closeUnuseDialogs() {
- try {
- bot.shell("Preferences (Filtered)").close();
- } catch (WidgetNotFoundException e) {
- }
- }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- boolean isOpened = false;
- try {
- bot.shell("Preferences (Filtered)").activate();
- isOpened = true;
- } catch (WidgetNotFoundException e) {
- }
- return isOpened;
- }
-
- private void checkVPE(String testPage) throws Throwable{
- editor.selectLine(9);
- if (!"<body
id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
- editor.insertText("<body id=\"bodyId\">");
- }
- editor.save();
- waitForJobs();
- performContentTestByIDs(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
- }
-
- private void selectBorder(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Show Border for Unknown Tags").click();
- bot.button("OK").click();
- }
-
- @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 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();
- editor.setText(textEditor);
- editor.save();
- waitForJobs();
- editor.close();
- super.tearDown();
- }
-
-}
Deleted:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ChangeEditorTabForTheFirstOpenPageTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ChangeEditorTabForTheFirstOpenPageTest.java 2009-08-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ChangeEditorTabForTheFirstOpenPageTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -1,7 +0,0 @@
-package org.jboss.tools.vpe.ui.bot.test.editor;
-
-import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4306Test;
-
-public class ChangeEditorTabForTheFirstOpenPageTest extends JBIDE4306Test{
-
-}
Deleted:
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-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTagsTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -1,101 +0,0 @@
-package org.jboss.tools.vpe.ui.bot.test.editor;
-
-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;
-import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-
-public class ShowNonVisualTagsTest extends VPEAutoTestCase{
-
- 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
-
- selectShowNonVisual();
- closePage();
- openPage();
- checkVPE("ShowNonVisualTags.xml");
-
- //Test Hide Non-Visual Tags
- selectShowNonVisual();
- closePage();
- openPage();
- checkVPE("DumpedTestPage.xml");
-
- }
-
- private void checkVPE(String testPage) throws Throwable{
- waitForJobs();
- performContentTestByDocument(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
- }
-
- @Override
- protected void closeUnuseDialogs() {
- try {
- bot.shell("Preferences (Filtered)").close();
- } catch (WidgetNotFoundException e) {
- }
- }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- boolean isOpened = false;
- try {
- bot.shell("Preferences (Filtered)").activate();
- isOpened = true;
- } catch (WidgetNotFoundException e) {
- }
- return isOpened;
- }
-
- @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 closePage(){
- bot.editorByTitle(TEST_PAGE).close();
- }
-
- private void openPage(){
- 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();
- }
-
- private void selectShowNonVisual(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Show Non-Visual Tags").click();
- bot.button("OK").click();
- }
-
-}
Deleted:
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-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -1,111 +0,0 @@
-package org.jboss.tools.vpe.ui.bot.test.editor;
-
-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;
-import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-
-public class ShowResourceBundlesUsageasELexpressionsTest extends VPEAutoTestCase{
-
- private static String textEditor;
- private static SWTBotEclipseEditor editor;
-
- public void testShowResourceBundlesUsageasELexpressions() 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();
-
- //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
-
- selectELExpressions();
- checkVPE("ShowResourceBundlesUsageasELExpressions.xml");
-
- //Test check VPE content without resource bundles
-
- selectELExpressions();
- checkVPE("HideResourceBundlesUsageasELExpressions.xml");
-
- }
-
- @Override
- protected void closeUnuseDialogs() {
- try {
- bot.shell("Preferences (Filtered)").close();
- } catch (WidgetNotFoundException e) {
- }
- }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- boolean isOpened = false;
- try {
- bot.shell("Preferences (Filtered)").activate();
- isOpened = true;
- } catch (WidgetNotFoundException e) {
- }
- return isOpened;
- }
-
- @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 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();
- editor.setText(textEditor);
- editor.save();
- waitForJobs();
- editor.close();
- super.tearDown();
- }
-
- private void checkVPE(String testPage) throws Throwable{
- editor.selectLine(9);
- if (!"<body
id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
- editor.insertText("<body id=\"bodyId\">");
- }
- editor.save();
- waitForJobs();
- performContentTestByIDs(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
- }
-
- private void selectELExpressions(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Show Resource Bundles Usage as EL Expressions").click();
- bot.button("OK").click();
- }
-
-}
Deleted:
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-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -1,159 +0,0 @@
-package org.jboss.tools.vpe.ui.bot.test.editor;
-
-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;
-import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-
-public class ShowSelectionTagBarTest extends VPEAutoTestCase{
-
- 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();
- checkIsHide();
-
- //Test Hide selection after reopen
-
- closePage();
- openPage();
- checkIsHide();
-
- //Test Show Selection Bar
-
- selectSelection();
- checkIsShow();
-
- //Test Show Selection Bar after reopen
-
- closePage();
- openPage();
- checkIsShow();
-
- //Test Hide Selection Bar button with confirm
-
- bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
- bot.shell("Confirm hide selection bar").activate();
- bot.button("OK").click();
- checkIsHide();
-
- //Test Hide 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 closeUnuseDialogs() {
- try {
- bot.shell("Preferences (Filtered)").close();
- } catch (WidgetNotFoundException e) {
- }
- }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- boolean isOpened = false;
- try {
- bot.shell("Preferences (Filtered)").activate();
- isOpened = true;
- } catch (WidgetNotFoundException e) {
- }
- return isOpened;
- }
-
- @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.button("OK").click();
- }
-
- private void closePage(){
- bot.editorByTitle(TEST_PAGE).close();
- }
-
- private void openPage(){
- 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();
- }
-
- private void checkIsHide(){
- WidgetNotFoundException exception = null;
- try {
- bot.toolbarButtonWithTooltip("Hide Selection Bar");
- } catch (WidgetNotFoundException e) {
- exception = e;
- }
- assertNotNull(exception);
- }
-
- private void checkIsShow(){
- WidgetNotFoundException exception = null;
- try {
- bot.toolbarButtonWithTooltip("Hide Selection Bar");
- } catch (WidgetNotFoundException e) {
- exception = e;
- }
- assertNull(exception);
- }
-
-}
Copied:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
(from rev 17192,
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/preferences/AlwaysHideSelectionBarWithoutPromptTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/AlwaysHideSelectionBarWithoutPromptTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -0,0 +1,134 @@
+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{
+
+ 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();
+ waitForJobs();
+ checkIsHide();
+
+ //Test Hide selection after reopen
+
+ closePage();
+ openPage();
+ checkIsHide();
+
+ //Test Show Selection Bar
+
+ selectSelection();
+ waitForJobs();
+ checkIsShow();
+
+ //Test Show Selection Bar after reopen
+
+ closePage();
+ openPage();
+ checkIsShow();
+
+ //Test Hide Selection Bar button without confirm
+
+ bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
+ checkIsHide();
+
+ //Test Hide selection after reopen
+
+ closePage();
+ openPage();
+ checkIsHide();
+
+ //Test Show Selection Bar from dialog
+
+ selectSelection();
+ waitForJobs();
+ checkIsShow();
+
+ //Test Show Selection Bar after reopen
+
+ closePage();
+ openPage();
+ checkIsShow();
+
+ }
+
+ private void checkIsHide(){
+ WidgetNotFoundException exception = null;
+ try {
+ bot.toolbarButtonWithTooltip("Hide Selection Bar");
+ } catch (WidgetNotFoundException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+ }
+
+ private void checkIsShow(){
+ 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 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.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.button("OK").click();
+ }
+
+}
Copied:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java
(from rev 17192,
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/preferences/BorderForUnknownTagsTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/BorderForUnknownTagsTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -0,0 +1,100 @@
+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{
+
+ private static String textEditor;
+ private static SWTBotEclipseEditor editor;
+
+ 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();
+
+ //Test insert unknown tag
+
+ editor.navigateTo(12, 52);
+ editor.insertText("<tagunknown></tagunknown>");
+
+ //Test default Show Border value
+
+ 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();
+
+ //Test check VPE content
+
+ checkVPE("ShowBorderForUnknownTag.xml");
+
+ //Test hide border for unknown tag
+
+ selectBorder();
+ checkVPE("HideBorderForUnknownTag.xml");
+
+ //Test restore previous state
+
+ selectBorder();
+ checkVPE("ShowBorderForUnknownTag.xml");
+
+ }
+
+ private void checkVPE(String testPage) throws Throwable{
+ editor.selectLine(9);
+ if (!"<body
id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
+ editor.insertText("<body id=\"bodyId\">");
+ }
+ editor.save();
+ waitForJobs();
+ performContentTestByIDs(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
+ }
+
+ private void selectBorder(){
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ bot.checkBox("Show Border for Unknown Tags").click();
+ bot.button("OK").click();
+ }
+
+ @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 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();
+ editor.setText(textEditor);
+ editor.save();
+ waitForJobs();
+ editor.close();
+ super.tearDown();
+ }
+
+}
Copied:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java
(from rev 17192,
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ChangeEditorTabForTheFirstOpenPageTest.java)
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ChangeEditorTabForTheFirstOpenPageTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -0,0 +1,7 @@
+package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
+
+import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4306Test;
+
+public class ChangeEditorTabForTheFirstOpenPageTest extends JBIDE4306Test{
+
+}
Added:
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
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -0,0 +1,41 @@
+package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
+
+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;
+
+public class PreferencesTestCase extends VPEAutoTestCase{
+
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ bot.shell("Preferences (Filtered)").close();
+ } catch (WidgetNotFoundException e) {
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("Preferences (Filtered)").activate();
+ isOpened = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ return isOpened;
+ }
+
+ void closePage(){
+ bot.editorByTitle(TEST_PAGE).close();
+ }
+
+ void openPage(){
+ 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();
+ }
+
+}
Copied:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java
(from rev 17192,
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/preferences/ShowNonVisualTagsTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowNonVisualTagsTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -0,0 +1,67 @@
+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
+
+ selectShowNonVisual();
+ closePage();
+ openPage();
+ checkVPE("ShowNonVisualTags.xml");
+
+ //Test Hide Non-Visual Tags
+ selectShowNonVisual();
+ closePage();
+ openPage();
+ checkVPE("DumpedTestPage.xml");
+
+ }
+
+ private void checkVPE(String testPage) throws Throwable{
+ waitForJobs();
+ 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.button("OK").click();
+ }
+
+}
Copied:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java
(from rev 17192,
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/preferences/ShowResourceBundlesUsageasELexpressionsTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowResourceBundlesUsageasELexpressionsTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -0,0 +1,85 @@
+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{
+
+ private static String textEditor;
+ private static SWTBotEclipseEditor editor;
+
+ 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
+
+ selectELExpressions();
+ checkVPE("ShowResourceBundlesUsageasELExpressions.xml");
+
+ //Test check VPE content without resource bundles
+
+ selectELExpressions();
+ checkVPE("HideResourceBundlesUsageasELExpressions.xml");
+
+ }
+
+ @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 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();
+ editor.setText(textEditor);
+ editor.save();
+ waitForJobs();
+ editor.close();
+ super.tearDown();
+ }
+
+ private void checkVPE(String testPage) throws Throwable{
+ editor.selectLine(9);
+ if (!"<body
id=\"bodyId\">".equals(editor.getTextOnCurrentLine().trim())) {
+ editor.insertText("<body id=\"bodyId\">");
+ }
+ editor.save();
+ waitForJobs();
+ performContentTestByIDs(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
+ }
+
+ private void selectELExpressions(){
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ bot.checkBox("Show Resource Bundles Usage as EL Expressions").click();
+ bot.button("OK").click();
+ }
+
+}
Copied:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java
(from rev 17192,
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/preferences/ShowSelectionTagBarTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/ShowSelectionTagBarTest.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -0,0 +1,125 @@
+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{
+
+ 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();
+ checkIsHide();
+
+ //Test Hide selection after reopen
+
+ closePage();
+ openPage();
+ checkIsHide();
+
+ //Test Show Selection Bar
+
+ selectSelection();
+ checkIsShow();
+
+ //Test Show Selection Bar after reopen
+
+ closePage();
+ openPage();
+ checkIsShow();
+
+ //Test Hide Selection Bar button with confirm
+
+ bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
+ bot.shell("Confirm hide selection bar").activate();
+ bot.button("OK").click();
+ checkIsHide();
+
+ //Test Hide 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.button("OK").click();
+ }
+
+ private void checkIsHide(){
+ WidgetNotFoundException exception = null;
+ try {
+ bot.toolbarButtonWithTooltip("Hide Selection Bar");
+ } catch (WidgetNotFoundException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+ }
+
+ private void checkIsShow(){
+ 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/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-21
10:52:38 UTC (rev 17212)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4306Test.java 2009-08-21
12:02:04 UTC (rev 17213)
@@ -4,9 +4,9 @@
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;
+import org.jboss.tools.vpe.ui.bot.test.editor.preferences.PreferencesTestCase;
-public class JBIDE4306Test extends VPEAutoTestCase{
+public class JBIDE4306Test extends PreferencesTestCase{
public void testJBIDE4306(){
@@ -49,24 +49,5 @@
bot.button("OK").click();
bot.editorByTitle(TEST_PAGE).close();
}
-
- @Override
- protected void closeUnuseDialogs() {
- try {
- bot.shell("Preferences (Filtered)").close();
- } catch (WidgetNotFoundException e) {
- }
- }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- boolean isOpened = false;
- try {
- bot.shell("Preferences (Filtered)").activate();
- isOpened = true;
- } catch (WidgetNotFoundException e) {
- }
- return isOpened;
- }
}