From jbosstools-commits at lists.jboss.org Mon Aug 3 08:18:13 2009 Content-Type: multipart/mixed; boundary="===============1463223139454372141==" MIME-Version: 1.0 From: jbosstools-commits at lists.jboss.org To: jbosstools-commits at lists.jboss.org Subject: [jbosstools-commits] JBoss Tools SVN: r16941 - in workspace/yzhishko: org.jboss.tools.vpe.ui.bot.test/resources and 2 other directories. Date: Mon, 03 Aug 2009 08:18:13 -0400 Message-ID: <200908031218.n73CIDvS032109@svn01.web.mwc.hst.phx2.redhat.com> --===============1463223139454372141== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: yzhishko Date: 2009-08-03 08:18:12 -0400 (Mon, 03 Aug 2009) New Revision: 16941 Added: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/DumpedTestP= age.xml workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowNonVisu= alTags.xml workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/v= pe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/v= pe/ui/bot/test/editor/ShowNonVisualTags.java workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/v= pe/ui/bot/test/editor/ShowSelectionTagBarTest.java Modified: workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bo= t/test/JBTSWTBotTestCase.java workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/v= pe/ui/bot/test/VPEAllTests.java Log: I rewrote some tests from manual to auto and increased time executing by de= creasing delay time. Modified: workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tool= s/ui/bot/test/JBTSWTBotTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/b= ot/test/JBTSWTBotTestCase.java 2009-08-03 09:46:40 UTC (rev 16940) +++ workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/b= ot/test/JBTSWTBotTestCase.java 2009-08-03 12:18:12 UTC (rev 16941) @@ -95,7 +95,7 @@ } = protected void delay() { - bot.sleep(1000); + bot.sleep(500); } = protected void shortDelay(){ @@ -147,7 +147,6 @@ // } = protected void waitForJobs(){ - delay(); while (!Job.getJobManager().isIdle()) { delay(); } Added: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/DumpedT= estPage.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/DumpedTest= Page.xml (rev 0) +++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/DumpedTest= Page.xml 2009-08-03 12:18:12 UTC (rev 16941) @@ -0,0 +1,43 @@ + + +
+
+

+Input User Name Page +

+
+
+ + + + +
+
+

+ +Hello Demo Application + +

+
    +
  • +Error Messages +
  • +
+
+ +Name: + + + + + + + + + +
+
+
+
+
+ \ No newline at end of file Added: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowNon= VisualTags.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowNonVis= ualTags.xml (rev 0) +++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowNonVis= ualTags.xml 2009-08-03 12:18:12 UTC (rev 16941) @@ -0,0 +1,80 @@ + + + + +jsp:directive.taglib +
+ +
+ + +jsp:directive.taglib +
+ +
+ + +f:loadBundle +
+ +
+
+
+ +

+Input User Name Page +

+ +Input User Name Page + +
+
+
+ + + + +
+
+

+ +Hello Demo Application + +

+ +
    +
  • +Error Messages +
  • +

+ +
+
+ +Name: + + + + + + + + + + +f:validateLength +
+ +
+
+ + +
+ +
+
+
+
+
+
+ \ 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/= vpe/ui/bot/test/VPEAllTests.java 2009-08-03 09:46:40 UTC (rev 16940) +++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/= vpe/ui/bot/test/VPEAllTests.java 2009-08-03 12:18:12 UTC (rev 16941) @@ -4,10 +4,13 @@ import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.swtbot.swt.finder.SWTBotTestCase; +import org.jboss.tools.vpe.ui.bot.test.editor.AlwaysHideSelectionBarWithou= tPromptTest; 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.ChangeEditorTabForTheFirstOp= enPageTest; +import org.jboss.tools.vpe.ui.bot.test.editor.ShowNonVisualTags; import org.jboss.tools.vpe.ui.bot.test.editor.ShowResourceBundlesUsageasEL= expressionsTest; +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.VerificationOfNameSpaces; import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4306Test; @@ -28,6 +31,9 @@ suite.addTestSuite(VerificationOfNameSpaces.class); suite.addTestSuite(BorderForUnknownTagsTest.class); suite.addTestSuite(ShowResourceBundlesUsageasELexpressionsTest.class); + suite.addTestSuite(ShowSelectionTagBarTest.class); + suite.addTestSuite(AlwaysHideSelectionBarWithoutPromptTest.class); + suite.addTestSuite(ShowNonVisualTags.class); return new TestSetup(suite); } } Added: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/too= ls/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/= vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java = (rev 0) +++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/= vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java 2009-08= -03 12:18:12 UTC (rev 16941) @@ -0,0 +1,165 @@ +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 VPEAutoTestCa= se{ + = + public void testAlwaysHideSelectionBarWithoutPrompt(){ + = + //Test open page + = + openPage(); + = + //Test default Selection values + = + bot.toolbarButtonWithTooltip("Preferences").click(); + bot.shell("Preferences (Filtered)").activate(); + SWTBotCheckBox checkBox =3D bot.checkBox("Show Selection Tag Bar"); + if (!checkBox.isChecked()) { + checkBox.click(); + } + checkBox =3D 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 (Exception e) { + } + } + + @Override + protected boolean isUnuseDialogOpened() { + boolean isOpened =3D false; + try { + bot.shell("Preferences (Filtered)").activate(); + isOpened =3D true; + } catch (Exception e) { + } + return isOpened; + } + = + private void closePage(){ + bot.editorByTitle(TEST_PAGE).close(); + } + = + private void openPage(){ + SWTBot innerBot =3D bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bo= t(); + SWTBotTree tree =3D innerBot.tree(); + try { + tree.expandNode(projectProperties.getProperty("JSFProjectName")) + .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).double= Click(); + } catch (Exception e) { + } + } + = + private void checkIsHide(){ + WidgetNotFoundException exception =3D null; + try { + bot.toolbarButtonWithTooltip("Hide Selection Bar").click(); + } catch (WidgetNotFoundException e) { + exception =3D e; + } + assertNotNull(exception); + } + = + private void checkIsShow(){ + assertNotNull(bot.toolbarButtonWithTooltip("Hide Selection Bar")); + } + + @Override + protected void tearDown() throws Exception { + + //Restore page state before tests + = + try { + bot.toolbarButtonWithTooltip("Preferences").click(); + bot.shell("Preferences (Filtered)").activate(); + SWTBotCheckBox checkBox =3D bot.checkBox("Show Selection Tag Bar"); + if (!checkBox.isChecked()) { + checkBox.click(); + } + checkBox =3D bot.checkBox("Always Hide Selection Bar Without Prompt"); + if (checkBox.isChecked()) { + checkBox.click(); + } + bot.button("OK").click(); + } catch (Exception 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(); + } + = +} Added: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/too= ls/vpe/ui/bot/test/editor/ShowNonVisualTags.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/= vpe/ui/bot/test/editor/ShowNonVisualTags.java (rev = 0) +++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/= vpe/ui/bot/test/editor/ShowNonVisualTags.java 2009-08-03 12:18:12 UTC (rev = 16941) @@ -0,0 +1,103 @@ +package org.jboss.tools.vpe.ui.bot.test.editor; + +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 ShowNonVisualTags 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 =3D 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_P= AGE)); + } + + @Override + protected void closeUnuseDialogs() { + try { + bot.shell("Preferences (Filtered)").close(); + } catch (Exception e) { + } + } + + @Override + protected boolean isUnuseDialogOpened() { + boolean isOpened =3D false; + try { + bot.shell("Preferences (Filtered)").activate(); + isOpened =3D true; + } catch (Exception e) { + } + return isOpened; + } + = + @Override + protected void tearDown() throws Exception { + try { + bot.toolbarButtonWithTooltip("Preferences").click(); + bot.shell("Preferences (Filtered)").activate(); + SWTBotCheckBox checkBox =3D bot.checkBox("Show Non-Visual Tags"); + if (checkBox.isChecked()) { + checkBox.click(); + } + bot.button("OK").click(); + } catch (Exception e) { + } + super.tearDown(); + } + + private void closePage(){ + bot.editorByTitle(TEST_PAGE).close(); + } + = + private void openPage(){ + SWTBot innerBot =3D bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bo= t(); + SWTBotTree tree =3D innerBot.tree(); + try { + tree.expandNode(projectProperties.getProperty("JSFProjectName")) + .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).double= Click(); + } catch (Exception e) { + } + } + = + private void selectShowNonVisual(){ + bot.toolbarButtonWithTooltip("Preferences").click(); + bot.shell("Preferences (Filtered)").activate(); + bot.checkBox("Show Non-Visual Tags").click(); + bot.button("OK").click(); + } + +} Added: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/too= ls/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/= vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java = (rev 0) +++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/= vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java 2009-08-03 12:18:12 UTC= (rev 16941) @@ -0,0 +1,159 @@ +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 =3D bot.checkBox("Show Selection Tag Bar"); + if (!checkBox.isChecked()) { + checkBox.click(); + } + checkBox =3D bot.checkBox("Always Hide Selection Bar Without Prompt"); + if (checkBox.isChecked()) { + checkBox.click(); + } + bot.button("OK").click(); + = + //Test Hide Selection Bar + = + selectSelection(); + 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 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(); + waitForJobs(); + checkIsShow(); + = + //Test Show Selection Bar after reopen + = + closePage(); + openPage(); + checkIsShow(); + = + } + = + @Override + protected void closeUnuseDialogs() { + try { + bot.shell("Preferences (Filtered)").close(); + } catch (Exception e) { + } + } + + @Override + protected boolean isUnuseDialogOpened() { + boolean isOpened =3D false; + try { + bot.shell("Preferences (Filtered)").activate(); + isOpened =3D 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 =3D bot.checkBox("Show Selection Tag Bar"); + if (!checkBox.isChecked()) { + checkBox.click(); + } + checkBox =3D bot.checkBox("Always Hide Selection Bar Without Prompt"); + if (checkBox.isChecked()) { + checkBox.click(); + } + bot.button("OK").click(); + } catch (Exception 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 =3D bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bo= t(); + SWTBotTree tree =3D innerBot.tree(); + try { + tree.expandNode(projectProperties.getProperty("JSFProjectName")) + .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).double= Click(); + } catch (Exception e) { + } + } + = + private void checkIsHide(){ + WidgetNotFoundException exception =3D null; + try { + bot.toolbarButtonWithTooltip("Hide Selection Bar").click(); + } catch (WidgetNotFoundException e) { + exception =3D e; + } + assertNotNull(exception); + } + = + private void checkIsShow(){ + assertNotNull(bot.toolbarButtonWithTooltip("Hide Selection Bar")); + } + = +} --===============1463223139454372141==--