Author: yzhishko
Date: 2009-07-28 08:02:10 -0400 (Tue, 28 Jul 2009)
New Revision: 16838
Added:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllTests.java
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/editor/ToggleCommentTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4556Test.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java
Removed:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/CSSDialogJBIDETests.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3890Test.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE3197Test.java
Modified:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java
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/WidgetVariables.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4306Test.java
Log:
SWTBot tests were redesigned. Some new tests were written.
Deleted:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/CSSDialogJBIDETests.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/CSSDialogJBIDETests.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/CSSDialogJBIDETests.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -1,33 +0,0 @@
-package org.jboss.tools.jsf.ui.bot.test;
-
-import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
-import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3148and4441Test;
-import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3577Test;
-import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3579Test;
-import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3890Test;
-import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3920Test;
-import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE4391Test;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-
-/**
- *
- * This is a sample swtbot testcase for an eclipse application.
- *
- */
-public class CSSDialogJBIDETests extends SWTBotTestCase{
- public static Test suite(){
- TestSuite suite = new TestSuite("CSS dialog JBIDE tests");
- suite.addTestSuite(JBIDE3148and4441Test.class);
- suite.addTestSuite(JBIDE4391Test.class);
- suite.addTestSuite(JBIDE3577Test.class);
- suite.addTestSuite(JBIDE3579Test.class);
- suite.addTestSuite(JBIDE3920Test.class);
- suite.addTestSuite(JBIDE3890Test.class);
- return new TestSetup(suite);
- }
-}
\ No newline at end of file
Copied:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllTests.java
(from rev 16678,
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/CSSDialogJBIDETests.java)
===================================================================
---
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllTests.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllTests.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -0,0 +1,30 @@
+package org.jboss.tools.jsf.ui.bot.test;
+
+import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
+import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3148and4441Test;
+import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3577Test;
+import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3579Test;
+import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE3920Test;
+import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE4391Test;
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+
+/**
+ *
+ * This is a sample swtbot testcase for an eclipse application.
+ *
+ */
+public class JSFAllTests extends SWTBotTestCase{
+ public static Test suite(){
+ TestSuite suite = new TestSuite("CSS dialog JBIDE tests");
+ suite.addTestSuite(JBIDE3148and4441Test.class);
+ suite.addTestSuite(JBIDE4391Test.class);
+ suite.addTestSuite(JBIDE3577Test.class);
+ suite.addTestSuite(JBIDE3579Test.class);
+ suite.addTestSuite(JBIDE3920Test.class);
+ return new TestSetup(suite);
+ }
+}
\ No newline at end of file
Modified:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -5,11 +5,15 @@
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-public class JSFAutoTestCase extends VPEAutoTestCase{
+public abstract class JSFAutoTestCase extends VPEAutoTestCase{
@Override
protected String getPathToResources(String testPage) throws IOException{
return
FileLocator.toFileURL(Platform.getBundle(Activator.PLUGIN_ID).getEntry("/")).getFile()+"resources/"+testPage
;
}
+
+ protected abstract void closeUnuseDialogs();
+ protected abstract boolean isUnuseDialogOpened();
+
}
Modified:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -12,7 +12,10 @@
private static String CSS_FILE_NAME = "JBIDE3148";
private static String CSS_CLASS_NAME = "cssclass";
- public void testCreateNewCSSFile(){
+ public void testJBIDE3148and4441() {
+
+ //Test create new CSS file
+
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
@@ -36,17 +39,17 @@
"background-color:green;\r}");
eclipseEditor.save();
eclipseEditor.contextMenu("Open CSS Dialog").click();
- }
-
- public void testEditAttrsOfFirstClass(){
+
+ //Test edit attrs of the first Class
+
bot.shell("CSS Class").activate();
bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
bot.tabItem("Text/Font").activate();
bot.comboBoxWithLabel("Text
Decoration:").setSelection("underline");
bot.comboBoxWithLabel("Font Weight:").setSelection("bold");
- }
-
- public void testEditAttrsOfSecondClass(){
+
+ //Test edit attrs of the second class
+
bot.shell("CSS Class").activate();
bot.comboBoxWithLabel("Style
class:").setSelection(CSS_CLASS_NAME+"(2)");
bot.tabItem("Text/Font").activate();
@@ -54,15 +57,35 @@
bot.comboBoxWithLabel("Font Weight:").setSelection("lighter");
bot.button("Apply").click();
bot.button("OK").click();
- }
-
- public void testValidateCSSFile(){
+
+ //Test check css file content
+
String fileContainer =
bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText();
assertEquals("cssclass{\r\tcolor: red;\r\tbackground-color: green;\r" +
"\tfont-weight: bold;\r\ttext-decoration: underline\r}\rcssclass" +
"{\r\tcolor: green;\r\tbackground-color: red;\r" +
"\tfont-weight: lighter;\r\ttext-decoration: overline\r}", fileContainer);
bot.editorByTitle(CSS_FILE_NAME+".css").close();
+
}
+
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ bot.shell("CSS Class").close();
+ } catch (Exception e) {
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("CSS Class").activate();
+ isOpened = true;
+ } catch (Exception e) {
+ }
+ return isOpened;
+ }
}
Modified:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -12,7 +12,10 @@
private static String CSS_FILE_NAME = "JBIDE3577";
private static String CSS_CLASS_NAME = "cssclass";
- public void testCreateNewCSSFile(){
+ public void testJBIDE3577(){
+
+ //Test create new CSS file
+
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
@@ -34,9 +37,9 @@
"background-color:green;\r}");
eclipseEditor.save();
eclipseEditor.contextMenu("Open CSS Dialog").click();
- }
-
- public void testClearAttrs(){
+
+ //Test Clear all attributes
+
bot.shell("CSS Class").activate();
bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
bot.tabItem("Preview").activate();
@@ -45,6 +48,26 @@
bot.button("OK").click();
assertEquals("cssclass{\r\t\r}",
bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText());
bot.editorByTitle(CSS_FILE_NAME+".css").close();
+
}
+
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ bot.shell("CSS Class").close();
+ } catch (Exception e) {
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("CSS Class").activate();
+ isOpened = true;
+ } catch (Exception e) {
+ }
+ return isOpened;
+ }
}
Modified:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -12,7 +12,10 @@
private static String CSS_FILE_NAME = "JBIDE3579";
private static String CSS_CLASS_NAME = "newCSSclass";
- public void testCreateNewCSSFile(){
+ public void testJBIDE3579(){
+
+ //Test Create new CSS file
+
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
@@ -34,9 +37,9 @@
"background-color:green;\r}");
eclipseEditor.save();
eclipseEditor.contextMenu("Open CSS Dialog").click();
- }
-
- public void testCreateNewCSSClass(){
+
+ //Test Create new CSS class
+
bot.shell("CSS Class").activate();
bot.button("Add CSS Class").click();
bot.shell("Enter New CSS Class Name").activate();
@@ -45,6 +48,26 @@
bot.button("Apply").click();
bot.button("OK").click();
bot.editorByTitle(CSS_FILE_NAME+".css").close();
+
}
+
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ bot.shell("CSS Class").close();
+ } catch (Exception e) {
+ }
+ }
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("CSS Class").activate();
+ isOpened = true;
+ } catch (Exception e) {
+ }
+ return isOpened;
+ }
+
}
Deleted:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3890Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3890Test.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3890Test.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -1,36 +0,0 @@
-package org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide;
-
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
-import org.jboss.tools.ui.bot.test.SWTBotMultiPageEditor;
-import org.jboss.tools.ui.bot.test.WidgetVariables;
-
-public class JBIDE3890Test extends JSFAutoTestCase{
-
- public void testOpenVPE() throws Throwable{
- SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
- SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode("inputUserName.jsp").doubleClick();
- } catch (Exception e) {
- }
- try {
- bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode("hello.jsp").doubleClick();
- } catch (Exception e) {
- }
- SWTBotEclipseEditor editor = bot.editorByTitle("hello.jsp").toTextEditor();
- editor.selectLine(10);
- editor.insertText("<body id=\"bodyId\">");
- waitForJobs();
- editor.save();
- waitForJobs();
- SWTBotMultiPageEditor multiPageEditor =
bot.multiPageEditorByTitle("hello.jsp");
- performContentTest("test.xml", multiPageEditor);
- }
-
-}
Modified:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -12,7 +12,7 @@
private static String CSS_FILE_NAME = "JBIDE3920";
private static String CSS_CLASS_NAME = "cssclass";
- public void testCreateNewCSSClass(){
+ public void testJBIDE3920(){
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
@@ -41,4 +41,23 @@
bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().close();
}
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ bot.shell("CSS Class").close();
+ } catch (Exception e) {
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("CSS Class").activate();
+ isOpened = true;
+ } catch (Exception e) {
+ }
+ return isOpened;
+ }
+
}
Modified:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -12,7 +12,10 @@
private static String CSS_FILE_NAME = "JBIDE4391";
private static String CSS_CLASS_NAME = "cssclass";
- public void testCreateNewCSSFile(){
+ public void testJBIDE4391(){
+
+ //Test Create new CSS file
+
SWTBot innerBot= bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
@@ -34,9 +37,9 @@
"background-color:green;\r}");
eclipseEditor.save();
eclipseEditor.contextMenu("Open CSS Dialog").click();
- }
-
- public void testIncorrectAttr(){
+
+ //Test incorrect attribute
+
bot.shell("CSS Class").activate();
bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
bot.tabItem("Text/Font").activate();
@@ -46,6 +49,26 @@
assertEquals("cssclass{\r\tcolor:red;\r\t" +
"background-color:green;\r}",
bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText());
bot.editorByTitle(CSS_FILE_NAME+".css").close();
+
}
+
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ bot.shell("CSS Class").close();
+ } catch (Exception e) {
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("CSS Class").activate();
+ isOpened = true;
+ } catch (Exception e) {
+ }
+ return isOpened;
+ }
}
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-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -78,7 +78,7 @@
}
openErrorLog();
openPackageExplorer();
- openProgressStatus();
+// openProgressStatus();
deleteLog();
setException(null);
Platform.addLogListener(this);
@@ -87,11 +87,11 @@
@Override
protected void tearDown() throws Exception {
+ Platform.removeLogListener(this);
+ deleteLog();
if (getException() != null) {
throw new Exception(getException());
}
- Platform.removeLogListener(this);
- deleteLog();
}
protected void delay() {
@@ -134,17 +134,17 @@
}
}
- protected void openProgressStatus() {
- try {
- bot.viewByTitle(WidgetVariables.PROGRESS_STATUS);
- } catch (WidgetNotFoundException e) {
- bot.menu("Window").menu("Show
View").menu("Other...").click();
- SWTBotTree viewTree = bot.tree();
- delay();
- viewTree.expandNode("General").expandNode(WidgetVariables.PROGRESS_STATUS).select();
- bot.button("OK").click();
- }
- }
+// protected void openProgressStatus() {
+// try {
+// bot.viewByTitle(WidgetVariables.PROGRESS_STATUS);
+// } catch (WidgetNotFoundException e) {
+// bot.menu("Window").menu("Show
View").menu("Other...").click();
+// SWTBotTree viewTree = bot.tree();
+// delay();
+// viewTree.expandNode("General").expandNode(WidgetVariables.PROGRESS_STATUS).select();
+// bot.button("OK").click();
+// }
+// }
protected void waitForJobs(){
delay();
Modified:
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -6,5 +6,5 @@
public static final String PACKAGE_EXPLORER = "Package Explorer";
public static final String WELCOME = "Welcome";
public static final String PROGRESS_STATUS = "Progress";
-
+ public static final String PALETTE = "JBoss Tools Palette";
}
Added:
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
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -0,0 +1,23 @@
+package org.jboss.tools.vpe.ui.bot.test;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
+import org.jboss.tools.vpe.ui.bot.test.editor.ToggleCommentTest;
+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;
+import org.jboss.tools.vpe.ui.bot.test.palette.ImportTagsFromTLDFileTest;
+
+public class VPEAllTests extends SWTBotTestCase{
+ public static Test suite(){
+ TestSuite suite = new TestSuite("VPE All Tests");
+ suite.addTestSuite(CancelTagLibDefenitionTest.class);
+ suite.addTestSuite(ImportTagsFromTLDFileTest.class);
+ suite.addTestSuite(ToggleCommentTest.class);
+ suite.addTestSuite(JBIDE4306Test.class);
+ suite.addTestSuite(JBIDE4556Test.class);
+ return new TestSetup(suite);
+ }
+}
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -7,6 +7,7 @@
import java.util.Properties;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
@@ -23,6 +24,7 @@
public abstract class VPEAutoTestCase extends JBTSWTBotTestCase{
protected static Properties projectProperties;
+ protected static final String TEST_PAGE = "inputUserName.jsp";
public static String PROJECT_PROPERTIES = "projectProperties.properties";
public static String JBOSS_EAP_HOME;
static {
@@ -40,6 +42,7 @@
protected void setUp() throws Exception {
super.setUp();
+ clearWorkbench();
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
@@ -49,6 +52,12 @@
}
}
+ @Override
+ protected void tearDown() throws Exception {
+ clearWorkbench();
+ super.tearDown();
+ }
+
protected void createJSFProject(String jsfProjectName){
bot.menu("File").menu("New").menu("Other...").click();
bot.tree().expandNode("JBoss Tools
Web").expandNode("JSF").select("JSF Project");
@@ -64,7 +73,7 @@
bot.button("Yes").click();
openErrorLog();
openPackageExplorer();
- openProgressStatus();
+// openProgressStatus();
} catch (Exception e) {
}
} catch (Exception e) {
@@ -80,7 +89,7 @@
bot.button("Yes").click();
openErrorLog();
openPackageExplorer();
- openProgressStatus();
+// openProgressStatus();
} catch (Exception e2) {
}
}
@@ -174,4 +183,34 @@
}
}
+ protected void openPalette(){
+ try {
+ bot.viewByTitle(WidgetVariables.PALETTE);
+ } catch (WidgetNotFoundException e) {
+ bot.menu("Window").menu("Show
View").menu("Other...").click();
+ SWTBotTree viewTree = bot.tree();
+ delay();
+ viewTree.expandNode("JBoss Tools Web").expandNode(
+ WidgetVariables.PALETTE).select();
+ bot.button("OK").click();
+ }
+ }
+
+ protected void clearWorkbench(){
+ while (isUnuseDialogOpened()) {
+ closeUnuseDialogs();
+ }
+ List<? extends SWTBotEditor> editors = bot.editors();
+ try {
+ for (int i = 0; i < editors.size(); i++) {
+ editors.get(i).close();
+ }
+ } catch (WidgetNotFoundException e) {
+ }
+ }
+
+ protected abstract void closeUnuseDialogs();
+
+ protected abstract boolean isUnuseDialogOpened();
+
}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -0,0 +1,138 @@
+package org.jboss.tools.vpe.ui.bot.test.editor;
+
+import java.util.List;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+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 ToggleCommentTest extends VPEAutoTestCase{
+
+ private static String textEditor;
+ private static SWTBotEclipseEditor editor;
+
+ public void testToggleComment() throws Throwable{
+
+ //Test open page
+
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ List<? extends SWTBotEditor> editors = bot.editors();
+ for (int i = 0; i < editors.size(); i++) {
+ editors.get(i).close();
+ }
+
+ } catch (Exception e) {
+ }
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
+ } catch (Exception e) {
+ }
+
+ //Test toggle comment from Source menu
+
+ editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
+ textEditor = editor.getText();
+ editor.navigateTo(22,22);
+ bot.menu("Source").menu("Toggle Comment").click();
+ delay();
+ checkVPE("ToggleCommentTestToggle.xml");
+
+ //Test untoggle comment from Source menu
+
+ editor.navigateTo(22,22);
+ bot.menu("Source").menu("Toggle Comment").click();
+ delay();
+ checkVPE("ToggleCommentTestUntoggle.xml");
+
+ //Test toggle comment with CTRL+SHIFT+C hot keys
+
+ editor.navigateTo(22,22);
+ pressToggleCommentHotKeys();
+ delay();
+ checkVPE("ToggleCommentTestToggle.xml");
+
+ //Test untoggle comment with CTRL+SHIFT hot keys
+
+ editor.navigateTo(22,22);
+ pressToggleCommentHotKeys();
+ delay();
+ checkVPE("ToggleCommentTestUntoggle.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();
+ performContentTest(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
+ }
+
+ private void pressToggleCommentHotKeys(){
+ bot.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ Display display = bot.getDisplay();
+ Event event = new Event();
+ event.type = SWT.KeyDown;
+ event.keyCode = SWT.CTRL;
+ display.post(event);
+ event = new Event();
+ event.type = SWT.KeyDown;
+ event.keyCode = SWT.SHIFT;
+ display.post(event);
+ event = new Event();
+ event.type = SWT.KeyDown;
+ event.character = 'c';
+ display.post(event);
+ event = new Event();
+ event.type = SWT.KeyUp;
+ event.character = 'c';
+ display.post(event);
+ event = new Event();
+ event.type = SWT.KeyUp;
+ event.keyCode = SWT.SHIFT;
+ display.post(event);
+ event = new Event();
+ event.type = SWT.KeyUp;
+ event.keyCode = SWT.CTRL;
+ display.post(event);
+ }
+ });
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+
+ //Restore page state before tests
+
+ 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/jbide/JBIDE3197Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE3197Test.java 2009-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE3197Test.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -1,34 +0,0 @@
-package org.jboss.tools.vpe.ui.bot.test.jbide;
-
-import java.util.List;
-
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-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 JBIDE3197Test extends VPEAutoTestCase {
-
- public void testOpenPage(){
-
- SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
- SWTBotTree tree = innerBot.tree();
- try {
- List<? extends SWTBotEditor> editors = bot.editors();
- for (int i = 0; i < editors.size(); i++) {
- editors.get(i).close();
- }
-
- } catch (Exception e) {
- }
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode("inputUserName.jsp").doubleClick();
- } catch (Exception e) {
- }
-
-
- }
-
-}
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-07-28
09:17:02 UTC (rev 16837)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4306Test.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -8,29 +8,35 @@
public class JBIDE4306Test extends VPEAutoTestCase{
- public void testOpenPageOnVisualSourceTab(){
+ public void testJBIDE4306(){
+
+ //Test open page on visual/source tab
+
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode("inputUserName.jsp").doubleClick();
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
} catch (Exception e) {
}
- }
-
- public void testSetDefaultTabSource(){
+
+ //Test set default source tab
+
bot.toolbarButtonWithTooltip("Preferences").click();
bot.shell("Preferences (Filtered)").activate();
- bot.comboBoxWithLabel("Default Editor
Tab:").setSelection("Source");
+ bot.comboBoxWithLabel("Select the default active editor's tab\nfor files that
haven't been previously\nopened in the VPE:").setSelection("Source");
bot.button("OK").click();
try {
- SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
- SWTBotTree tree = innerBot.tree();
+ innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ tree = innerBot.tree();
bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
tree.expandNode(projectProperties.getProperty("JSFProjectName"))
.expandNode("WebContent").expandNode("pages").getNode("hello.jsp").doubleClick();
} catch (Exception e) {
}
+
+ //Check if the tab changed
+
WidgetNotFoundException exception = null;
try {
bot.toolbarButtonWithTooltip("Preferences").click();
@@ -39,15 +45,34 @@
}
assertNotNull(exception);
bot.editorByTitle("hello.jsp").close();
- }
+ bot.editorByTitle(TEST_PAGE).setFocus();
- public void testSetDefaultTabVisualSource(){
- bot.editorByTitle("inputUserName.jsp").setFocus();
+ //Test set default visual/source tab
+
bot.toolbarButtonWithTooltip("Preferences").click();
bot.shell("Preferences (Filtered)").activate();
- bot.comboBoxWithLabel("Default Editor
Tab:").setSelection("Visual/Source");
+ bot.comboBoxWithLabel("Select the default active editor's tab\nfor files that
haven't been previously\nopened in the
VPE:").setSelection("Visual/Source");
bot.button("OK").click();
- bot.editorByTitle("inputUserName.jsp").close();
+ bot.editorByTitle(TEST_PAGE).close();
}
+
+ @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;
+ }
}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4556Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4556Test.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/JBIDE4556Test.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -0,0 +1,7 @@
+package org.jboss.tools.vpe.ui.bot.test.jbide;
+
+import org.jboss.tools.vpe.ui.bot.test.palette.CancelTagLibDefenitionTest;
+
+public class JBIDE4556Test extends CancelTagLibDefenitionTest{
+
+}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/CancelTagLibDefenitionTest.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -0,0 +1,67 @@
+package org.jboss.tools.vpe.ui.bot.test.palette;
+
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+public class CancelTagLibDefenitionTest extends VPEAutoTestCase{
+
+ @Override
+ protected void createJSFProject(String jsfProjectName) {
+ super.createJSFProject(jsfProjectName);
+ openPalette();
+ }
+
+ public void testCancelTagLibDefenition(){
+
+ //Test open import dialog
+
+ bot.toolbarButtonWithTooltip("Import").click();
+ bot.shell("Import Tags from TLD File").activate();
+
+ //Test open edit TLD dialog
+
+ bot.button("Browse...").click();
+ bot.shell("Edit TLD").activate();
+
+ //Test cancel TLD
+ delay();
+ bot.tree().expandNode(projectProperties.getProperty("JSFProjectName")).expandNode("x-1_0-rt.tld
[x_rt]").select();
+ bot.button("Cancel").click();
+
+ //Test check fields
+
+ bot.shell("Import Tags from TLD File").activate();
+ assertEquals("", bot.textWithLabel("TLD File*").getText());
+ assertEquals("", bot.textWithLabel("Name*").getText());
+ assertEquals("", bot.textWithLabel("Default Prefix").getText());
+ assertEquals("", bot.textWithLabel("Library URI").getText());
+ bot.button("Cancel").click();
+ }
+
+ protected void closeUnuseDialogs(){
+ try {
+ bot.shell("Edit TLD").close();
+ } catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell("Import Tags from TLD File").close();
+ } catch (WidgetNotFoundException e) {
+ }
+ }
+
+ protected boolean isUnuseDialogOpened(){
+ boolean isOpened = false;
+ try {
+ bot.shell("Edit TLD").activate();
+ isOpened = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell("Import Tags from TLD File").activate();
+ isOpened = true;
+ }catch (WidgetNotFoundException e) {
+ }
+ return isOpened;
+ }
+
+}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/palette/ImportTagsFromTLDFileTest.java 2009-07-28
12:02:10 UTC (rev 16838)
@@ -0,0 +1,166 @@
+package org.jboss.tools.vpe.ui.bot.test.palette;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+public class ImportTagsFromTLDFileTest extends VPEAutoTestCase{
+
+ private static final String GROUP_NAME = "NewGroup";
+
+ public void testImportTagsFromTLDFile(){
+
+ //Test clear group
+ bot.toolbarButtonWithTooltip("Palette Editor").click();
+ bot.shell("Palette Editor").activate();
+ try {
+ bot.getDisplay().syncExec(new Runnable() {
+
+ public void run() {
+ SWTBotTree tree = bot.tree();
+ delay();
+ try {
+ tree.expandNode("XStudio").expandNode("Palette").getNode(GROUP_NAME).select();
+ Display display = bot.getDisplay();
+ Event event = new Event();
+ event.type = SWT.KeyDown;
+ event.character = SWT.DEL;
+ display.post(event);
+ delay();
+ event = new Event();
+ event.type = SWT.KeyUp;
+ event.character = SWT.DEL;
+ display.post(event);
+ event = new Event();
+ event.type = SWT.KeyDown;
+ event.character = SWT.DEL;
+ display.post(event);
+ delay();
+ event = new Event();
+ event.type = SWT.KeyUp;
+ event.character = SWT.DEL;
+ display.post(event);
+ } catch (Exception e) {
+ }
+ }
+
+ });
+
+ bot.shell("Confirmation").activate();
+ bot.button("OK").click();
+ } catch (Exception e) {
+ }
+ bot.shell("Palette Editor").activate();
+ bot.button("OK").click();
+
+ //Test open import dialog
+
+ bot.toolbarButtonWithTooltip("Import").click();
+ bot.shell("Import Tags from TLD File").activate();
+
+ //Test set tag lib
+
+ bot.button("Browse...").click();
+ bot.shell("Edit TLD").activate();
+ bot.tree().expandNode(projectProperties.getProperty("JSFProjectName")).expandNode("c.tld
[c]").select();
+ bot.button("OK").click();
+
+ //Test set group
+
+ bot.shell("Import Tags from TLD File").activate();
+ bot.radio(1).click();
+ bot.text(4).setText(GROUP_NAME);
+ bot.button("OK").click();
+
+ //Test if group is created
+
+ bot.toolbarButtonWithTooltip("Palette Editor").click();
+ bot.shell("Palette Editor").activate();
+ try {
+ bot.getDisplay().syncExec(new Runnable() {
+
+ public void run() {
+ SWTBotTree tree = bot.tree();
+ try {
+ tree.expandNode("XStudio").expandNode("Palette").getNode(GROUP_NAME).select();
+ Display display = bot.getDisplay();
+ Event event = new Event();
+ event.type = SWT.KeyDown;
+ event.character = SWT.DEL;
+ display.post(event);
+ delay();
+ event = new Event();
+ event.type = SWT.KeyUp;
+ event.character = SWT.DEL;
+ display.post(event);
+ event = new Event();
+ event.type = SWT.KeyDown;
+ event.character = SWT.DEL;
+ display.post(event);
+ delay();
+ event = new Event();
+ event.type = SWT.KeyUp;
+ event.character = SWT.DEL;
+ display.post(event);
+ } catch (WidgetNotFoundException e) {
+ setException(e);
+ }
+ }
+
+ });
+ bot.shell("Confirmation").activate();
+ bot.button("OK").click();
+ } catch (WidgetNotFoundException e) {
+ }
+ bot.shell("Palette Editor").activate();
+ bot.button("OK").click();
+
+ }
+
+ @Override
+ protected void createJSFProject(String jsfProjectName) {
+ super.createJSFProject(jsfProjectName);
+ openPalette();
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("Edit TLD").activate();
+ isOpened = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell("Import Tags from TLD File").activate();
+ isOpened = true;
+ }catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell("Palette Editor").activate();
+ isOpened = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ return isOpened;
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ bot.shell("Edit TLD").close();
+ } catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell("Import Tags from TLD File").close();
+ }catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell("Palette Editor").close();
+ } catch (WidgetNotFoundException e) {
+ }
+ }
+
+}