Author: yzhishko
Date: 2009-07-31 08:35:28 -0400 (Fri, 31 Jul 2009)
New Revision: 16927
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/HideBorderForUnknownTag.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/HideResourceBundlesUsageasELExpressions.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowBorderForUnknownTag.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowResourceBundlesUsageasELExpressions.xml
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/ShowResourceBundlesUsageasELexpressionsTest.java
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java
Log:
Some tests were written for preference dialog of VPE
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/HideBorderForUnknownTag.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/HideBorderForUnknownTag.xml
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/HideBorderForUnknownTag.xml 2009-07-31
12:35:28 UTC (rev 16927)
@@ -0,0 +1,41 @@
+<tests>
+ <test id="bodyId">
+ <DIV ID="bodyId">
+<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width:
100%;">
+<TR>
+<TD>
+<DIV>
+<H1 STYLE="-moz-user-modify: read-write;">
+<SPAN CLASS="vpe-text">
+Hello Demo Application
+</SPAN>
+</H1>
+<DIV CLASS="__any__tag__caption" STYLE="-moz-user-modify:
read-only;">
+tagunknown<BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic;
color: green; -moz-user-modify: read-only;"/>
+
+</DIV>
+<UL STYLE="color: red; -moz-user-modify: read-only;">
+<LI>
+Error Messages
+</LI>
+</UL>
+<FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+<SPAN CLASS="vpe-text">
+Name:
+</SPAN>
+<SPAN CLASS="vpe-text">
+<SPAN CLASS="vpe-text">
+</SPAN>
+<INPUT VALUE="#{user.name}"/>
+
+</SPAN>
+<INPUT TYPE="button" VALUE="Say Hello!"
STYLE="-moz-user-modify: read-only;"/>
+
+</FORM>
+</DIV>
+</TD>
+</TR>
+</TABLE>
+</DIV>
+ </test>
+</tests>
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/HideResourceBundlesUsageasELExpressions.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/HideResourceBundlesUsageasELExpressions.xml
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/HideResourceBundlesUsageasELExpressions.xml 2009-07-31
12:35:28 UTC (rev 16927)
@@ -0,0 +1,37 @@
+<tests>
+ <test id="bodyId">
+ <DIV ID="bodyId">
+<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width:
100%;">
+<TR>
+<TD>
+<DIV>
+<H1 STYLE="-moz-user-modify: read-write;">
+<SPAN CLASS="vpe-text">
+Hello Demo Application
+</SPAN>
+</H1>
+<UL STYLE="color: red; -moz-user-modify: read-only;">
+<LI>
+Error Messages
+</LI>
+</UL>
+<FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+<SPAN CLASS="vpe-text">
+Name:
+</SPAN>
+<SPAN CLASS="vpe-text">
+<SPAN CLASS="vpe-text">
+</SPAN>
+<INPUT VALUE="#{user.name}"/>
+
+</SPAN>
+<INPUT TYPE="button" VALUE="Say Hello!"
STYLE="-moz-user-modify: read-only;"/>
+
+</FORM>
+</DIV>
+</TD>
+</TR>
+</TABLE>
+</DIV>
+ </test>
+</tests>
\ No newline at end of file
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowBorderForUnknownTag.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowBorderForUnknownTag.xml
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowBorderForUnknownTag.xml 2009-07-31
12:35:28 UTC (rev 16927)
@@ -0,0 +1,41 @@
+<tests>
+ <test id="bodyId">
+ <DIV ID="bodyId">
+<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width:
100%;">
+<TR>
+<TD>
+<DIV>
+<H1 STYLE="-moz-user-modify: read-write;">
+<SPAN CLASS="vpe-text">
+Hello Demo Application
+</SPAN>
+</H1>
+<DIV CLASS="__any__tag__caption" STYLE="border: 1px solid green;
-moz-user-modify: read-only;">
+tagunknown<BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic;
color: green; -moz-user-modify: read-only;"/>
+
+</DIV>
+<UL STYLE="color: red; -moz-user-modify: read-only;">
+<LI>
+Error Messages
+</LI>
+</UL>
+<FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+<SPAN CLASS="vpe-text">
+Name:
+</SPAN>
+<SPAN CLASS="vpe-text">
+<SPAN CLASS="vpe-text">
+</SPAN>
+<INPUT VALUE="#{user.name}"/>
+
+</SPAN>
+<INPUT TYPE="button" VALUE="Say Hello!"
STYLE="-moz-user-modify: read-only;"/>
+
+</FORM>
+</DIV>
+</TD>
+</TR>
+</TABLE>
+</DIV>
+ </test>
+</tests>
\ No newline at end of file
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowResourceBundlesUsageasELExpressions.xml
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowResourceBundlesUsageasELExpressions.xml
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowResourceBundlesUsageasELExpressions.xml 2009-07-31
12:35:28 UTC (rev 16927)
@@ -0,0 +1,37 @@
+<tests>
+ <test id="bodyId">
+ <DIV ID="bodyId">
+<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width:
100%;">
+<TR>
+<TD>
+<DIV>
+<H1 STYLE="-moz-user-modify: read-write;">
+<SPAN CLASS="vpe-text">
+#{Message.header}
+</SPAN>
+</H1>
+<UL STYLE="color: red; -moz-user-modify: read-only;">
+<LI>
+Error Messages
+</LI>
+</UL>
+<FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+<SPAN CLASS="vpe-text">
+#{Message.prompt_message}
+</SPAN>
+<SPAN CLASS="vpe-text">
+<SPAN CLASS="vpe-text">
+</SPAN>
+<INPUT VALUE="#{user.name}"/>
+
+</SPAN>
+<INPUT TYPE="button" VALUE="Say Hello!"
STYLE="-moz-user-modify: read-only;"/>
+
+</FORM>
+</DIV>
+</TD>
+</TR>
+</TABLE>
+</DIV>
+ </test>
+</tests>
\ No newline at end of file
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-07-31
07:52:50 UTC (rev 16926)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java 2009-07-31
12:35:28 UTC (rev 16927)
@@ -5,7 +5,11 @@
import junit.framework.TestSuite;
import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
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.ShowResourceBundlesUsageasELexpressionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.ToggleCommentTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.VerificationOfNameSpaces;
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;
@@ -20,6 +24,10 @@
suite.addTestSuite(BlockCommentTest.class);
suite.addTestSuite(JBIDE4306Test.class);
suite.addTestSuite(JBIDE4556Test.class);
+ suite.addTestSuite(ChangeEditorTabForTheFirstOpenPageTest.class);
+ suite.addTestSuite(VerificationOfNameSpaces.class);
+ suite.addTestSuite(BorderForUnknownTagsTest.class);
+ suite.addTestSuite(ShowResourceBundlesUsageasELexpressionsTest.class);
return new TestSetup(suite);
}
}
Added:
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
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java 2009-07-31
12:35:28 UTC (rev 16927)
@@ -0,0 +1,122 @@
+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.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();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
+ } catch (Exception e) {
+ }
+
+ 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 (Exception e) {
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("Preferences (Filtered)").activate();
+ isOpened = true;
+ } catch (Exception 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 (Exception 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();
+ }
+
+}
Added:
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
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ChangeEditorTabForTheFirstOpenPageTest.java 2009-07-31
12:35:28 UTC (rev 16927)
@@ -0,0 +1,7 @@
+package org.jboss.tools.vpe.ui.bot.test.editor;
+
+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/ShowResourceBundlesUsageasELexpressionsTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java 2009-07-31
12:35:28 UTC (rev 16927)
@@ -0,0 +1,113 @@
+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.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();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
+ } catch (Exception e) {
+ }
+
+ 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 (Exception e) {
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("Preferences (Filtered)").activate();
+ isOpened = true;
+ } catch (Exception 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 (Exception 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();
+ }
+
+}
Show replies by date