JBoss Tools SVN: r16941 - in workspace/yzhishko: org.jboss.tools.vpe.ui.bot.test/resources and 2 other directories.
by jbosstools-commits@lists.jboss.org
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/DumpedTestPage.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowNonVisualTags.xml
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/ShowNonVisualTags.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.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java
Log:
I rewrote some tests from manual to auto and increased time executing by decreasing delay time.
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-03 09:46:40 UTC (rev 16940)
+++ workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/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/DumpedTestPage.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/DumpedTestPage.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/DumpedTestPage.xml 2009-08-03 12:18:12 UTC (rev 16941)
@@ -0,0 +1,43 @@
+<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;">
+Input User Name Page
+</H1>
+</DIV>
+<DIV>
+<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>
+</DIV>
+</BODY>
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowNonVisualTags.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowNonVisualTags.xml (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/resources/ShowNonVisualTags.xml 2009-08-03 12:18:12 UTC (rev 16941)
@@ -0,0 +1,80 @@
+<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
+</SPAN><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
+
+</SPAN>
+<SPAN>
+<SPAN STYLE="border: 1px dashed GREY; color: GREY; font-size: 12px;">
+jsp:directive.taglib
+</SPAN><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
+
+</SPAN>
+<SPAN>
+<SPAN STYLE="border: 1px dashed GREY; color: GREY; font-size: 12px;">
+f:loadBundle
+</SPAN><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
+
+</SPAN>
+<DIV STYLE="-moz-user-modify: read-write;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<SPAN>
+<H1 STYLE="-moz-user-modify: read-write;">
+Input User Name Page
+</H1>
+<SPAN CLASS="vpe-text">
+Input User Name Page
+</SPAN>
+</SPAN>
+</DIV>
+<DIV>
+<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>
+<SPAN>
+<UL STYLE="color: red; -moz-user-modify: read-only;">
+<LI>
+Error Messages
+</LI>
+</UL><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
+
+</SPAN>
+<FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+<SPAN CLASS="vpe-text">
+Name:
+</SPAN>
+<SPAN>
+<SPAN CLASS="vpe-text">
+<SPAN CLASS="vpe-text">
+</SPAN>
+<INPUT VALUE="#{user.name}"/>
+
+</SPAN>
+<SPAN>
+<SPAN STYLE="border: 1px dashed GREY; color: GREY; font-size: 12px;">
+f:validateLength
+</SPAN><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
+
+</SPAN>
+</SPAN>
+<SPAN>
+<INPUT TYPE="button" VALUE="Say Hello!" STYLE="-moz-user-modify: read-only;"/>
+<BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
+
+</SPAN>
+</FORM>
+</DIV>
+</TD>
+</TR>
+</TABLE>
+</DIV>
+</DIV>
+</BODY>
\ 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-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.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.ShowNonVisualTags;
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.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/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 (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 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 (Exception e) {
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("Preferences (Filtered)").activate();
+ isOpened = true;
+ } catch (Exception 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();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
+ } catch (Exception e) {
+ }
+ }
+
+ private void checkIsHide(){
+ WidgetNotFoundException exception = null;
+ try {
+ bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
+ } catch (WidgetNotFoundException e) {
+ exception = 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 = 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 (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/tools/vpe/ui/bot/test/editor/ShowNonVisualTags.java
===================================================================
--- 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 = 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 (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 {
+ 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 (Exception 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();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
+ } 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/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 (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 = 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();
+ 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 = 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 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 (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 = 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) {
+ }
+ }
+
+ private void checkIsHide(){
+ WidgetNotFoundException exception = null;
+ try {
+ bot.toolbarButtonWithTooltip("Hide Selection Bar").click();
+ } catch (WidgetNotFoundException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+ }
+
+ private void checkIsShow(){
+ assertNotNull(bot.toolbarButtonWithTooltip("Hide Selection Bar"));
+ }
+
+}
15 years, 7 months
JBoss Tools SVN: r16940 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4/io and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-08-03 05:46:40 -0400 (Mon, 03 Aug 2009)
New Revision: 16940
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/io/ExclusiveGatewayDeserializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/io/ExclusiveGatewaySerializer.java
Log:
GPD-356: Designer creates duplicate handler nodes under decision nodes
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF 2009-07-31 23:24:37 UTC (rev 16939)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF 2009-08-03 09:46:40 UTC (rev 16940)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.jboss.tools.flow.jpdl4;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Vendor: %Bundle-Vendor.0
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.jboss.tools.flow.common;bundle-version="1.0.0",
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/io/ExclusiveGatewayDeserializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/io/ExclusiveGatewayDeserializer.java 2009-07-31 23:24:37 UTC (rev 16939)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/io/ExclusiveGatewayDeserializer.java 2009-08-03 09:46:40 UTC (rev 16940)
@@ -3,12 +3,17 @@
*/
package org.jboss.tools.flow.jpdl4.io;
+import java.util.ArrayList;
+import java.util.List;
+
import org.jboss.tools.flow.common.wrapper.Wrapper;
import org.jboss.tools.flow.jpdl4.model.ExclusiveGateway;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
class ExclusiveGatewayDeserializer extends NodeDeserializer {
+
public void deserializeAttributes(Wrapper wrapper, Element element) {
super.deserializeAttributes(wrapper, element);
if (!(wrapper.getElement() instanceof ExclusiveGateway)) return;
@@ -16,15 +21,28 @@
exclusiveGateWay.setExpr(element.getAttribute("expr"));
exclusiveGateWay.setLang(element.getAttribute("lang"));
}
- public Wrapper deserializeChildNode(Wrapper parent, Node node) {
- Wrapper result = null;
- ExclusiveGateway exclusiveGateway = (ExclusiveGateway)parent.getElement();
- if (node instanceof Element && "handler".equals(node.getNodeName())) {
- String className = ((Element)node).getAttribute("class");
- exclusiveGateway.setHandler("".equals(className) ? null : className);
- } else {
- result = super.deserializeChildNode(parent, node);
+
+ public void deserializeChildNodes(Wrapper wrapper,
+ Element element) {
+ if (wrapper == null) return;
+ NodeList nodeList = element.getChildNodes();
+ ArrayList<Node> unknownNodeList = new ArrayList<Node>();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+ if ("handler".equals(node.getNodeName())) {
+ deserializeHandler(wrapper, node, unknownNodeList);
+ } else {
+ deserializeChildNode(wrapper, node, unknownNodeList);
+ }
}
- return result;
+ wrapper.getElement().setMetaData("trailingNodes", unknownNodeList);
}
+
+ private void deserializeHandler(Wrapper parent, Node node, List<Node> unknownNodeList) {
+ parent.setMetaData("beforeHandlerNodes", new ArrayList<Node>(unknownNodeList));
+ unknownNodeList.clear();
+ String className = ((Element)node).getAttribute("class");
+ parent.setPropertyValue(ExclusiveGateway.HANDLER, "".equals(className) ? null : className);
+ }
+
}
\ No newline at end of file
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/io/ExclusiveGatewaySerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/io/ExclusiveGatewaySerializer.java 2009-07-31 23:24:37 UTC (rev 16939)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/io/ExclusiveGatewaySerializer.java 2009-08-03 09:46:40 UTC (rev 16940)
@@ -9,20 +9,26 @@
import org.jboss.tools.flow.jpdl4.model.ExclusiveGateway;
class ExclusiveGatewaySerializer extends ProcessNodeSerializer {
+
protected List<String> getAttributesToSave() {
List<String> result = super.getAttributesToSave();
result.add("expr");
result.add("lang");
return result;
}
+
public void appendBody(StringBuffer buffer, Wrapper wrapper, int level) {
ExclusiveGateway exclusiveGateway = (ExclusiveGateway)wrapper.getElement();
String handler = exclusiveGateway.getHandler();
if (handler != null && !"".equals(handler)) {
- buffer.append("\n");
- appendPadding(buffer, level + 1);
- buffer.append("<handler class=\"" + handler + "\" />");
+ appendHandler(buffer, wrapper, handler, level);
}
super.appendBody(buffer, wrapper, level);
}
+
+ private void appendHandler(StringBuffer buffer, Wrapper wrapper, String handler, int level) {
+ appendUnknownNodes("beforeHandlerNodes", buffer, wrapper, level);
+ buffer.append("<handler class=\"").append(handler).append("\" />");
+ }
+
}
\ No newline at end of file
15 years, 7 months