Author: yzhishko
Date: 2010-02-10 05:14:17 -0500 (Wed, 10 Feb 2010)
New Revision: 20214
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/EditedTemplateForUnknownTag.xml
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/SetTemplateForUnknownTag.xml
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/UnknownTemplate.xml
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/CSSStyleDialogVariables.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/UnknownTagDialogVariables.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/templates/
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/templates/SetTemplateForUnknownTagTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/templates/UnknownTemplateTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
SWTBot tests for unknown tags were added.
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/EditedTemplateForUnknownTag.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/EditedTemplateForUnknownTag.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/EditedTemplateForUnknownTag.xml 2010-02-10
10:14:17 UTC (rev 20214)
@@ -0,0 +1,44 @@
+<BODY ID="__content__area__">
+<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>
+<B CLASS="__any__tag__caption" STYLE="border: 1px solid green;
-moz-user-modify: read-only;">
+</B>
+<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:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/SetTemplateForUnknownTag.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/SetTemplateForUnknownTag.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/SetTemplateForUnknownTag.xml 2010-02-10
10:14:17 UTC (rev 20214)
@@ -0,0 +1,46 @@
+<BODY ID="__content__area__">
+<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>
+<B CLASS="__any__tag__caption" STYLE="border: 1px solid green;
font-family: Arial; color: black; -moz-user-modify: read-only;">
+myValue<BR STYLE="font-style: italic; color: green; -moz-user-modify:
read-only;"/>
+
+</B>
+<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:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/UnknownTemplate.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/UnknownTemplate.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/resources/templates/UnknownTemplate.xml 2010-02-10
10:14:17 UTC (rev 20214)
@@ -0,0 +1,46 @@
+<BODY ID="__content__area__">
+<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>
+<DIV CLASS="__any__tag__caption" STYLE="border: 1px solid green;
-moz-user-modify: read-only;">
+h:unknowntag<BR 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>
+</DIV>
+</BODY>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/CSSStyleDialogVariables.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/CSSStyleDialogVariables.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/CSSStyleDialogVariables.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -0,0 +1,17 @@
+package org.jboss.tools.jsf.ui.bot.test;
+
+public class CSSStyleDialogVariables {
+
+ public static final String CSS_STYLE_DIALOG_TITLE = "CSS Style";
//$NON-NLS-1$
+ public static final String TEXT_FONT_TAB = "Text/Font"; //$NON-NLS-1$
+ public static final String BACKGROUND_TAB = "Background"; //$NON-NLS-1$
+ public static final String BOXES_TAB = "Boxes"; //$NON-NLS-1$
+ public static final String PROPERTIES_TAB = "Property Sheet"; //$NON-NLS-1$
+ public static final String EDITED_PROPERTIES = "Edited properties";
//$NON-NLS-1$
+ public static final String FONT_FAMILY_FIELD = "Font Family:"; //$NON-NLS-1$
+ public static final String COLOR_FIELD = "Color:"; //$NON-NLS-1$
+ public static final String FONT_SIZE_FIELD = "Font Size:"; //$NON-NLS-1$
+ public static final String TEXT_DECORATION_FIELD = "Text Decoration:";
//$NON-NLS-1$
+
+
+}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -10,6 +10,8 @@
import org.jboss.tools.jsf.ui.bot.test.cssdialog.jbide.JBIDE4391Test;
import org.jboss.tools.jsf.ui.bot.test.smoke.AddRemoveJSFCapabilitiesTest;
import org.jboss.tools.jsf.ui.bot.test.smoke.CreateNewJSFProjectTest;
+import org.jboss.tools.jsf.ui.bot.test.templates.SetTemplateForUnknownTagTest;
+import org.jboss.tools.jsf.ui.bot.test.templates.UnknownTemplateTest;
/**
*
@@ -26,6 +28,8 @@
suite.addTestSuite(JBIDE3577Test.class);
suite.addTestSuite(JBIDE3579Test.class);
suite.addTestSuite(JBIDE3920Test.class);
+ suite.addTestSuite(UnknownTemplateTest.class);
+ suite.addTestSuite(SetTemplateForUnknownTagTest.class);
return suite;
}
}
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -3,17 +3,74 @@
import java.io.IOException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
+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.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-public abstract class JSFAutoTestCase extends VPEAutoTestCase{
-
+public abstract class JSFAutoTestCase extends VPEAutoTestCase {
+
+ private String editorText;
+ private SWTBotEclipseEditor editor;
+
+ String getEditorText() {
+ return editorText;
+ }
+
+ protected void setEditorText(String textEditor) {
+ this.editorText = textEditor;
+ }
+
+ protected SWTBotEclipseEditor getEditor() {
+ return editor;
+ }
+
+ protected void setEditor(SWTBotEclipseEditor editor) {
+ this.editor = editor;
+ }
+
@Override
- protected String getPathToResources(String testPage) throws IOException{
- return
FileLocator.toFileURL(Platform.getBundle(Activator.PLUGIN_ID).getEntry("/")).getFile()+"resources/"+testPage
; //$NON-NLS-1$ //$NON-NLS-2$
+ protected String getPathToResources(String testPage) throws IOException {
+ return FileLocator
+ .toFileURL(
+ Platform.getBundle(Activator.PLUGIN_ID).getEntry("/")).getFile() +
"resources/" + testPage; //$NON-NLS-1$ //$NON-NLS-2$
}
- protected abstract void closeUnuseDialogs();
-
- protected abstract boolean isUnuseDialogOpened();
-
+ protected void openTestPage() {
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER)
+ .bot();
+ SWTBotTree tree = innerBot.tree();
+ tree.expandNode(JBT_TEST_PROJECT_NAME)
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ protected void checkVPE(String testPage) throws Throwable {
+ waitForBlockingJobsAcomplished(VISUAL_UPDATE);
+ performContentTestByDocument(testPage, bot
+ .multiPageEditorByTitle(TEST_PAGE));
+ }
+ @Override
+ protected void closeUnuseDialogs() {
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+
+ // Restore page state before tests
+ if (editor != null) {
+ editor.setFocus();
+ bot.menu("Edit").menu("Select All").click(); //$NON-NLS-1$
//$NON-NLS-2$
+ bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$
//$NON-NLS-2$
+ editor.setText(editorText);
+ editor.save();
+ }
+ super.tearDown();
+ }
+
}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/UnknownTagDialogVariables.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/UnknownTagDialogVariables.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/UnknownTagDialogVariables.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -0,0 +1,14 @@
+package org.jboss.tools.jsf.ui.bot.test;
+
+public class UnknownTagDialogVariables {
+
+ public static final String DIALOG_TITLE = "Unknown tag template";
//$NON-NLS-1$
+ public static final String TAG_NAME_FIELD = "Tag Name:"; //$NON-NLS-1$
+ public static final String TAG_URI_FIELD = "Tag URI:"; //$NON-NLS-1$
+ public static final String DISPLAY_TAG = "Tag For Display:"; //$NON-NLS-1$
+ public static final String ALLOW_CHILDREN_CHECKBOX = "Allow tag children:";
//$NON-NLS-1$
+ public static final String VALUE_FIELD = "Value:"; //$NON-NLS-1$
+ public static final String TAG_STYLE_FIELD = "Tag style:"; //$NON-NLS-1$
+ public static final String EDIT_TAG_STYLE_TIP = "Edit style"; //$NON-NLS-1$
+
+}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -9,8 +9,8 @@
public class JBIDE3148and4441Test extends JSFAutoTestCase{
- private static String CSS_FILE_NAME = "JBIDE3148";
- private static String CSS_CLASS_NAME = "cssclass";
+ private static String CSS_FILE_NAME = "JBIDE3148"; //$NON-NLS-1$
+ private static String CSS_CLASS_NAME = "cssclass"; //$NON-NLS-1$
public void testJBIDE3148and4441() {
@@ -19,67 +19,67 @@
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName")).
- getNode(CSS_FILE_NAME+".css").doubleClick();
- bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
- bot.menu("Edit").menu("Select All").click();
- bot.menu("Edit").menu("Delete").click();
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
//$NON-NLS-1$
+ getNode(CSS_FILE_NAME+".css").doubleClick(); //$NON-NLS-1$
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus(); //$NON-NLS-1$
+ bot.menu("Edit").menu("Select All").click();
//$NON-NLS-1$//$NON-NLS-2$
+ bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$
//$NON-NLS-2$
} catch (WidgetNotFoundException e) {
- tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
- bot.menu("File").menu("New").menu("CSS File").click();
- bot.shell("New CSS File").activate();
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
- bot.button("Finish").click();
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
//$NON-NLS-1$
+ bot.menu("File").menu("New").menu("CSS File").click();
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ bot.shell("New CSS File").activate(); //$NON-NLS-1$
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.button("Finish").click(); //$NON-NLS-1$
}
- SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
eclipseEditor.setFocus();
- eclipseEditor.insertText("\rcssclass{\r\tcolor:green;\r\t" +
- "background-color:red;\r}");
- eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" +
- "background-color:green;\r}");
+ eclipseEditor.insertText("\rcssclass{\r\tcolor:green;\r\t" + //$NON-NLS-1$
+ "background-color:red;\r}"); //$NON-NLS-1$
+ eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" + //$NON-NLS-1$
+ "background-color:green;\r}"); //$NON-NLS-1$
eclipseEditor.save();
- eclipseEditor.contextMenu("Open CSS Dialog").click();
+ eclipseEditor.contextMenu("Open CSS Dialog").click(); //$NON-NLS-1$
//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");
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
+ bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
//$NON-NLS-1$
+ bot.tabItem("Text/Font").activate(); //$NON-NLS-1$
+ bot.comboBoxWithLabel("Text
Decoration:").setSelection("underline"); //$NON-NLS-1$ //$NON-NLS-2$
+ bot.comboBoxWithLabel("Font Weight:").setSelection("bold");
//$NON-NLS-1$ //$NON-NLS-2$
//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();
- bot.comboBoxWithLabel("Text
Decoration:").setSelection("overline");
- bot.comboBoxWithLabel("Font Weight:").setSelection("lighter");
- bot.button("Apply").click();
- bot.button("OK").click();
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
+ bot.comboBoxWithLabel("Style
class:").setSelection(CSS_CLASS_NAME+"(2)"); //$NON-NLS-1$ //$NON-NLS-2$
+ bot.tabItem("Text/Font").activate(); //$NON-NLS-1$
+ bot.comboBoxWithLabel("Text Decoration:").setSelection("overline");
//$NON-NLS-1$ //$NON-NLS-2$
+ bot.comboBoxWithLabel("Font Weight:").setSelection("lighter");
//$NON-NLS-1$ //$NON-NLS-2$
+ bot.button("Apply").click(); //$NON-NLS-1$
+ bot.button("OK").click(); //$NON-NLS-1$
//Test check CSS file content
- assertTrue("Content of CSS file in Editor is not as expected.\n" +
- "Content: " +
bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText(),
-
JBIDE3148and4441Test.testCssFileEditorContent(bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(),
- "cssclass{",
- "color: red;",
- "background-color: green;",
- "font-weight: bold;",
- "text-decoration: underline",
- "}",
- "cssclass{",
- "color: green;",
- "background-color: red;",
- "font-weight: lighter;",
- "text-decoration: overline",
- "}"));
- bot.editorByTitle(CSS_FILE_NAME+".css").close();
+ assertTrue("Content of CSS file in Editor is not as expected.\n" +
//$NON-NLS-1$
+ "Content: " +
bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText(), //$NON-NLS-1$
//$NON-NLS-2$
+
JBIDE3148and4441Test.testCssFileEditorContent(bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(),
//$NON-NLS-1$
+ "cssclass{", //$NON-NLS-1$
+ "color: red;", //$NON-NLS-1$
+ "background-color: green;", //$NON-NLS-1$
+ "font-weight: bold;", //$NON-NLS-1$
+ "text-decoration: underline", //$NON-NLS-1$
+ "}", //$NON-NLS-1$
+ "cssclass{", //$NON-NLS-1$
+ "color: green;", //$NON-NLS-1$
+ "background-color: red;", //$NON-NLS-1$
+ "font-weight: lighter;", //$NON-NLS-1$
+ "text-decoration: overline", //$NON-NLS-1$
+ "}")); //$NON-NLS-1$
+ bot.editorByTitle(CSS_FILE_NAME+".css").close(); //$NON-NLS-1$
}
@Override
protected void closeUnuseDialogs() {
try {
- bot.shell("CSS Class").close();
+ bot.shell("CSS Class").close(); //$NON-NLS-1$
} catch (WidgetNotFoundException e) {
}
}
@@ -88,7 +88,7 @@
protected boolean isUnuseDialogOpened() {
boolean isOpened = false;
try {
- bot.shell("CSS Class").activate();
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
isOpened = true;
} catch (WidgetNotFoundException e) {
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -9,8 +9,8 @@
public class JBIDE3577Test extends JSFAutoTestCase{
- private static String CSS_FILE_NAME = "JBIDE3577";
- private static String CSS_CLASS_NAME = "cssclass";
+ private static String CSS_FILE_NAME = "JBIDE3577"; //$NON-NLS-1$
+ private static String CSS_CLASS_NAME = "cssclass"; //$NON-NLS-1$
public void testJBIDE3577(){
@@ -19,42 +19,42 @@
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName")).
- getNode(CSS_FILE_NAME+".css").doubleClick();
- bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
- bot.menu("Edit").menu("Select All").click();
- bot.menu("Edit").menu("Delete").click();
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
//$NON-NLS-1$
+ getNode(CSS_FILE_NAME+".css").doubleClick(); //$NON-NLS-1$
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus(); //$NON-NLS-1$
+ bot.menu("Edit").menu("Select All").click(); //$NON-NLS-1$
//$NON-NLS-2$
+ bot.menu("Edit").menu("Delete").click();
//$NON-NLS-1$//$NON-NLS-2$
} catch (WidgetNotFoundException e) {
- tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
- bot.menu("File").menu("New").menu("CSS File").click();
- bot.shell("New CSS File").activate();
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
- bot.button("Finish").click();
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
//$NON-NLS-1$
+ bot.menu("File").menu("New").menu("CSS File").click();
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ bot.shell("New CSS File").activate(); //$NON-NLS-1$
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.button("Finish").click(); //$NON-NLS-1$
}
- SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
eclipseEditor.setFocus();
- eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" +
- "background-color:green;\r}");
+ eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" + //$NON-NLS-1$
+ "background-color:green;\r}"); //$NON-NLS-1$
eclipseEditor.save();
- eclipseEditor.contextMenu("Open CSS Dialog").click();
+ eclipseEditor.contextMenu("Open CSS Dialog").click(); //$NON-NLS-1$
//Test Clear all attributes
- bot.shell("CSS Class").activate();
- bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
- bot.tabItem("Preview").activate();
- bot.button("Clear").click();
- bot.button("Apply").click();
- bot.button("OK").click();
- assertEquals("cssclass{\r\t\r}",
bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText());
- bot.editorByTitle(CSS_FILE_NAME+".css").close();
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
+ bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
//$NON-NLS-1$
+ bot.tabItem("Preview").activate(); //$NON-NLS-1$
+ bot.button("Clear").click(); //$NON-NLS-1$
+ bot.button("Apply").click(); //$NON-NLS-1$
+ bot.button("OK").click(); //$NON-NLS-1$
+ assertEquals("cssclass{\r\t\r}",
bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText()); //$NON-NLS-1$
//$NON-NLS-2$
+ bot.editorByTitle(CSS_FILE_NAME+".css").close(); //$NON-NLS-1$
}
@Override
protected void closeUnuseDialogs() {
try {
- bot.shell("CSS Class").close();
+ bot.shell("CSS Class").close(); //$NON-NLS-1$
} catch (WidgetNotFoundException e) {
}
}
@@ -63,7 +63,7 @@
protected boolean isUnuseDialogOpened() {
boolean isOpened = false;
try {
- bot.shell("CSS Class").activate();
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
isOpened = true;
} catch (WidgetNotFoundException e) {
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -9,8 +9,8 @@
public class JBIDE3579Test extends JSFAutoTestCase{
- private static String CSS_FILE_NAME = "JBIDE3579";
- private static String CSS_CLASS_NAME = "newCSSclass";
+ private static String CSS_FILE_NAME = "JBIDE3579"; //$NON-NLS-1$
+ private static String CSS_CLASS_NAME = "newCSSclass"; //$NON-NLS-1$
public void testJBIDE3579(){
@@ -19,42 +19,42 @@
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName")).
- getNode(CSS_FILE_NAME+".css").doubleClick();
- bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
- bot.menu("Edit").menu("Select All").click();
- bot.menu("Edit").menu("Delete").click();
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
//$NON-NLS-1$
+ getNode(CSS_FILE_NAME+".css").doubleClick(); //$NON-NLS-1$
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus(); //$NON-NLS-1$
+ bot.menu("Edit").menu("Select All").click();
//$NON-NLS-1$//$NON-NLS-2$
+ bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$
//$NON-NLS-2$
} catch (WidgetNotFoundException e) {
- tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
- bot.menu("File").menu("New").menu("CSS File").click();
- bot.shell("New CSS File").activate();
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
- bot.button("Finish").click();
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
//$NON-NLS-1$
+ bot.menu("File").menu("New").menu("CSS File").click();
//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ bot.shell("New CSS File").activate(); //$NON-NLS-1$
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.button("Finish").click(); //$NON-NLS-1$
}
- SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
eclipseEditor.setFocus();
- eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" +
- "background-color:green;\r}");
+ eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" + //$NON-NLS-1$
+ "background-color:green;\r}"); //$NON-NLS-1$
eclipseEditor.save();
- eclipseEditor.contextMenu("Open CSS Dialog").click();
+ eclipseEditor.contextMenu("Open CSS Dialog").click(); //$NON-NLS-1$
//Test Create new CSS class
- bot.shell("CSS Class").activate();
- bot.button("Add CSS Class").click();
- bot.shell("Enter New CSS Class Name").activate();
- bot.textWithLabel("Enter New CSS Class Name").setText(CSS_CLASS_NAME);
- bot.button("OK").click();
- bot.button("Apply").click();
- bot.button("OK").click();
- bot.editorByTitle(CSS_FILE_NAME+".css").close();
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
+ bot.button("Add CSS Class").click(); //$NON-NLS-1$
+ bot.shell("Enter New CSS Class Name").activate(); //$NON-NLS-1$
+ bot.textWithLabel("Enter New CSS Class Name").setText(CSS_CLASS_NAME);
//$NON-NLS-1$
+ bot.button("OK").click(); //$NON-NLS-1$
+ bot.button("Apply").click(); //$NON-NLS-1$
+ bot.button("OK").click(); //$NON-NLS-1$
+ bot.editorByTitle(CSS_FILE_NAME+".css").close(); //$NON-NLS-1$
}
@Override
protected void closeUnuseDialogs() {
try {
- bot.shell("CSS Class").close();
+ bot.shell("CSS Class").close(); //$NON-NLS-1$
} catch (WidgetNotFoundException e) {
}
}
@@ -63,7 +63,7 @@
protected boolean isUnuseDialogOpened() {
boolean isOpened = false;
try {
- bot.shell("CSS Class").activate();
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
isOpened = true;
} catch (WidgetNotFoundException e) {
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -9,42 +9,42 @@
public class JBIDE3920Test extends JSFAutoTestCase{
- private static String CSS_FILE_NAME = "JBIDE3920";
- private static String CSS_CLASS_NAME = "cssclass";
+ private static String CSS_FILE_NAME = "JBIDE3920"; //$NON-NLS-1$
+ private static String CSS_CLASS_NAME = "cssclass"; //$NON-NLS-1$
public void testJBIDE3920(){
SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName")).
- getNode(CSS_FILE_NAME+".css").doubleClick();
- bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
- bot.menu("Edit").menu("Select All").click();
- bot.menu("Edit").menu("Delete").click();
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
//$NON-NLS-1$
+ getNode(CSS_FILE_NAME+".css").doubleClick(); //$NON-NLS-1$
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus(); //$NON-NLS-1$
+ bot.menu("Edit").menu("Select All").click();
//$NON-NLS-1$//$NON-NLS-2$
+ bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$
//$NON-NLS-2$
} catch (WidgetNotFoundException e) {
- tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
- bot.menu("File").menu("New").menu("CSS File").click();
- bot.shell("New CSS File").activate();
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
- bot.button("Finish").click();
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
//$NON-NLS-1$
+ bot.menu("File").menu("New").menu("CSS File").click();
//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ bot.shell("New CSS File").activate(); //$NON-NLS-1$
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.button("Finish").click(); //$NON-NLS-1$
}
- SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
eclipseEditor.setFocus();
- eclipseEditor.insertText(CSS_CLASS_NAME+"{");
+ eclipseEditor.insertText(CSS_CLASS_NAME+"{"); //$NON-NLS-1$
eclipseEditor.save();
- eclipseEditor.contextMenu("Open CSS Dialog").click();
- bot.shell("CSS Class").activate();
- bot.tabItem("Text/Font").activate();
- bot.comboBoxWithLabel("Font Style:").setSelection("italic");
- bot.comboBoxWithLabel("Text
Decoration:").setSelection("underline");
- bot.button("OK").click();
- bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().close();
+ eclipseEditor.contextMenu("Open CSS Dialog").click(); //$NON-NLS-1$
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
+ bot.tabItem("Text/Font").activate(); //$NON-NLS-1$
+ bot.comboBoxWithLabel("Font Style:").setSelection("italic");
//$NON-NLS-1$ //$NON-NLS-2$
+ bot.comboBoxWithLabel("Text
Decoration:").setSelection("underline"); //$NON-NLS-1$ //$NON-NLS-2$
+ bot.button("OK").click(); //$NON-NLS-1$
+ bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().close();
//$NON-NLS-1$
}
@Override
protected void closeUnuseDialogs() {
try {
- bot.shell("CSS Class").close();
+ bot.shell("CSS Class").close(); //$NON-NLS-1$
} catch (WidgetNotFoundException e) {
}
}
@@ -53,7 +53,7 @@
protected boolean isUnuseDialogOpened() {
boolean isOpened = false;
try {
- bot.shell("CSS Class").activate();
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
isOpened = true;
} catch (WidgetNotFoundException e) {
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -9,8 +9,8 @@
public class JBIDE4391Test extends JSFAutoTestCase{
- private static String CSS_FILE_NAME = "JBIDE4391";
- private static String CSS_CLASS_NAME = "cssclass";
+ private static String CSS_FILE_NAME = "JBIDE4391"; //$NON-NLS-1$
+ private static String CSS_CLASS_NAME = "cssclass"; //$NON-NLS-1$
public void testJBIDE4391(){
@@ -19,43 +19,43 @@
SWTBot innerBot= bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
SWTBotTree tree = innerBot.tree();
try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName")).
- getNode(CSS_FILE_NAME+".css").doubleClick();
- bot.editorByTitle(CSS_FILE_NAME+".css").setFocus();
- bot.menu("Edit").menu("Select All").click();
- bot.menu("Edit").menu("Delete").click();
+ tree.expandNode(projectProperties.getProperty("JSFProjectName")).
//$NON-NLS-1$
+ getNode(CSS_FILE_NAME+".css").doubleClick(); //$NON-NLS-1$
+ bot.editorByTitle(CSS_FILE_NAME+".css").setFocus(); //$NON-NLS-1$
+ bot.menu("Edit").menu("Select All").click(); //$NON-NLS-1$
//$NON-NLS-2$
+ bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$
//$NON-NLS-2$
} catch (WidgetNotFoundException e) {
- tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
- bot.menu("File").menu("New").menu("CSS File").click();
- bot.shell("New CSS File").activate();
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME);
- bot.button("Finish").click();
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select();
//$NON-NLS-1$
+ bot.menu("File").menu("New").menu("CSS File").click();
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ bot.shell("New CSS File").activate(); //$NON-NLS-1$
+ bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.button("Finish").click(); //$NON-NLS-1$
}
- SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor();
+ SWTBotEclipseEditor eclipseEditor
= bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
eclipseEditor.setFocus();
- eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" +
- "background-color:green;\r}");
+ eclipseEditor.insertText("cssclass{\r\tcolor:red;\r\t" + //$NON-NLS-1$
+ "background-color:green;\r}"); //$NON-NLS-1$
eclipseEditor.save();
- eclipseEditor.contextMenu("Open CSS Dialog").click();
+ eclipseEditor.contextMenu("Open CSS Dialog").click(); //$NON-NLS-1$
//Test incorrect attribute
- bot.shell("CSS Class").activate();
- bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
- bot.tabItem("Text/Font").activate();
- bot.comboBoxWithLabel("Text Decoration:").setText(";;;;");
- bot.comboBoxWithLabel("Font Weight:").setSelection("bold");
- bot.button("Cancel").click();
- 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();
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
+ bot.comboBoxWithLabel("Style class:").setSelection(CSS_CLASS_NAME);
//$NON-NLS-1$
+ bot.tabItem("Text/Font").activate(); //$NON-NLS-1$
+ bot.comboBoxWithLabel("Text Decoration:").setText(";;;;");
//$NON-NLS-1$ //$NON-NLS-2$
+ bot.comboBoxWithLabel("Font Weight:").setSelection("bold");
//$NON-NLS-1$ //$NON-NLS-2$
+ bot.button("Cancel").click(); //$NON-NLS-1$
+ assertEquals("cssclass{\r\tcolor:red;\r\t" + //$NON-NLS-1$
+ "background-color:green;\r}",
bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText()); //$NON-NLS-1$
//$NON-NLS-2$
+ bot.editorByTitle(CSS_FILE_NAME+".css").close(); //$NON-NLS-1$
}
@Override
protected void closeUnuseDialogs() {
try {
- bot.shell("CSS Class").close();
+ bot.shell("CSS Class").close(); //$NON-NLS-1$
} catch (WidgetNotFoundException e) {
}
}
@@ -64,7 +64,7 @@
protected boolean isUnuseDialogOpened() {
boolean isOpened = false;
try {
- bot.shell("CSS Class").activate();
+ bot.shell("CSS Class").activate(); //$NON-NLS-1$
isOpened = true;
} catch (WidgetNotFoundException e) {
}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/templates/SetTemplateForUnknownTagTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/templates/SetTemplateForUnknownTagTest.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/templates/SetTemplateForUnknownTagTest.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -0,0 +1,137 @@
+package org.jboss.tools.jsf.ui.bot.test.templates;
+
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.jboss.tools.jsf.ui.bot.test.CSSStyleDialogVariables;
+import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.jsf.ui.bot.test.UnknownTagDialogVariables;
+import org.jboss.tools.ui.bot.test.WidgetVariables;
+
+public class SetTemplateForUnknownTagTest extends JSFAutoTestCase {
+
+ private static final String TAG_NAME = "h:unknowntag";//$NON-NLS-1$
+ private static final String TAG_URI =
"http://java.sun.com/jsf/html";//$NON-NLS-1$
+ private static final String DISPALY_TAG = "b";//$NON-NLS-1$
+ private static final String CHILDREN_ALLOWS = "yes";//$NON-NLS-1$
+
+ public void testSetTemplateForUnknownTag() throws Throwable{
+ openTestPage();
+ setEditor(bot.editorByTitle(TEST_PAGE).toTextEditor());
+ setEditorText(getEditor().getText());
+ getEditor().navigateTo(13, 0);
+ getEditor().insertText("<h:unknowntag></h:unknowntag>");//$NON-NLS-1$
+ getEditor().navigateTo(13,5);
+ setUpTemplate();
+ editTemplate();
+ removeTemplate();
+ }
+
+ private void setUpTemplate() throws Throwable{
+ bot.toolbarButtonWithTooltip(WidgetVariables.PREFERENCES).click();
+ bot.shell(WidgetVariables.PREF_FILTER_SHELL_TITLE).activate();
+ bot.tabItem(WidgetVariables.VPE_TEMPLATES_TAB).activate();
+ bot.button(WidgetVariables.ADD_BUTTON).click();
+ bot.shell(UnknownTagDialogVariables.DIALOG_TITLE).activate();
+ bot.textWithLabel(UnknownTagDialogVariables.TAG_NAME_FIELD).setText(TAG_NAME);
+ bot.textWithLabel(UnknownTagDialogVariables.TAG_URI_FIELD).setText(TAG_URI);
+ bot.textWithLabel(UnknownTagDialogVariables.DISPLAY_TAG).setText(DISPALY_TAG);
+ bot.checkBoxWithLabel(UnknownTagDialogVariables.ALLOW_CHILDREN_CHECKBOX).click();
+ bot.textWithLabel(UnknownTagDialogVariables.VALUE_FIELD).setText("myValue");//$NON-NLS-1$
+ bot.textWithLabel(UnknownTagDialogVariables.TAG_STYLE_FIELD).setText("color:red");//$NON-NLS-1$
+ bot.buttonWithTooltip(UnknownTagDialogVariables.EDIT_TAG_STYLE_TIP).click();
+ String returnValue = setStyles();
+ assertEquals("font-family:Arial;color:black;", returnValue);//$NON-NLS-1$
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ bot.shell(WidgetVariables.PREF_FILTER_SHELL_TITLE).activate();
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ checkVPE("templates/SetTemplateForUnknownTag.xml");//$NON-NLS-1$
+ }
+
+ private void editTemplate() throws Throwable{
+ bot.toolbarButtonWithTooltip(WidgetVariables.PREFERENCES).click();
+ bot.shell(WidgetVariables.PREF_FILTER_SHELL_TITLE).activate();
+ bot.tabItem(WidgetVariables.VPE_TEMPLATES_TAB).activate();
+ bot.table().select(0);
+ checkTable(bot.table());
+ bot.button(WidgetVariables.EDIT_BUTTON).click();
+ bot.shell(UnknownTagDialogVariables.DIALOG_TITLE).activate();
+ bot.textWithLabel(UnknownTagDialogVariables.TAG_URI_FIELD).setText("");
//$NON-NLS-1$
+ bot.checkBoxWithLabel(UnknownTagDialogVariables.ALLOW_CHILDREN_CHECKBOX).click();
+ bot.textWithLabel(UnknownTagDialogVariables.VALUE_FIELD).setText("");
//$NON-NLS-1$
+ bot.textWithLabel(UnknownTagDialogVariables.TAG_STYLE_FIELD).setText("");
//$NON-NLS-1$
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ bot.shell(WidgetVariables.PREF_FILTER_SHELL_TITLE).activate();
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ checkVPE("templates/EditedTemplateForUnknownTag.xml"); //$NON-NLS-1$
+ }
+
+ private void removeTemplate() throws Throwable{
+ bot.toolbarButtonWithTooltip(WidgetVariables.PREFERENCES).click();
+ bot.shell(WidgetVariables.PREF_FILTER_SHELL_TITLE).activate();
+ bot.tabItem(WidgetVariables.VPE_TEMPLATES_TAB).activate();
+ bot.table().select(0);
+ bot.button(WidgetVariables.REMOVE_BUTTON).click();
+ bot.shell(WidgetVariables.PREF_FILTER_SHELL_TITLE).activate();
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ checkVPE("templates/UnknownTemplate.xml"); //$NON-NLS-1$
+ }
+
+ private String setStyles(){
+ bot.shell(CSSStyleDialogVariables.CSS_STYLE_DIALOG_TITLE).activate();
+ bot.tabItem(CSSStyleDialogVariables.TEXT_FONT_TAB).activate();
+ bot.textWithLabel(CSSStyleDialogVariables.FONT_FAMILY_FIELD).setText("Arial");
//$NON-NLS-1$
+ String colorText = bot.textWithLabel(CSSStyleDialogVariables.COLOR_FIELD).getText();
+ assertEquals("red", colorText); //$NON-NLS-1$
+ bot.textWithLabel(CSSStyleDialogVariables.COLOR_FIELD).setText("black");
//$NON-NLS-1$
+ bot.textWithLabel(CSSStyleDialogVariables.TEXT_DECORATION_FIELD).setText("underline");
//$NON-NLS-1$
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ bot.shell(UnknownTagDialogVariables.DIALOG_TITLE).activate();
+ String returnValue =
bot.textWithLabel(UnknownTagDialogVariables.TAG_STYLE_FIELD).getText();
+ return returnValue;
+ }
+
+ private void checkTable(SWTBotTable table){
+ assertEquals(TAG_NAME, table.cell(0, 0));
+ assertEquals(DISPALY_TAG, table.cell(0, 1));
+ assertEquals(TAG_URI, table.cell(0, 2));
+ assertEquals(CHILDREN_ALLOWS, table.cell(0, 3));
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell(CSSStyleDialogVariables.CSS_STYLE_DIALOG_TITLE).activate();
+ isOpened = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell(UnknownTagDialogVariables.DIALOG_TITLE).activate();
+ isOpened = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell(WidgetVariables.PREF_FILTER_SHELL_TITLE).activate();
+ isOpened = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ return isOpened;
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ bot.shell(CSSStyleDialogVariables.CSS_STYLE_DIALOG_TITLE).close();
+ } catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell(UnknownTagDialogVariables.DIALOG_TITLE).close();
+ } catch (WidgetNotFoundException e) {
+ }
+ try {
+ bot.shell(WidgetVariables.PREF_FILTER_SHELL_TITLE).close();
+ } catch (WidgetNotFoundException e) {
+ }
+ }
+
+}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/templates/UnknownTemplateTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/templates/UnknownTemplateTest.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/templates/UnknownTemplateTest.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -0,0 +1,22 @@
+package org.jboss.tools.jsf.ui.bot.test.templates;
+
+import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+
+public class UnknownTemplateTest extends JSFAutoTestCase {
+
+ public void testUnknownTemplate() throws Throwable{
+
+ openTestPage();
+
+ setEditor(bot.editorByTitle(TEST_PAGE).toTextEditor());
+ setEditorText(getEditor().getText());
+
+ getEditor().navigateTo(13, 0);
+
+ getEditor().insertText("<h:unknowntag></h:unknowntag>");
//$NON-NLS-1$
+
+ checkVPE("templates/UnknownTemplate.xml"); //$NON-NLS-1$
+
+ }
+
+}
Modified:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -23,4 +23,13 @@
public static final String FINISH_BUTTON = "Finish"; //$NON-NLS-1$
public static final String CONTINUE_BUTTON = "Continue"; //$NON-NLS-1$
public static final String NEW_BUTTON = "New..."; //$NON-NLS-1$
+ public static final String WINDOW_MENU = "Window"; //$NON-NLS-1$
+ public static final String PREFERENCES = "Preferences"; //$NON-NLS-1$
+ public static final String VPE_TEMPLATES_TAB = "Templates"; //$NON-NLS-1$
+ public static final String PREF_FILTER_SHELL_TITLE = "Preferences
(Filtered)"; //$NON-NLS-1$
+ public static final String ADD_BUTTON = "Add"; //$NON-NLS-1$
+ public static final String EDIT_BUTTON = "Edit"; //$NON-NLS-1$
+ public static final String REMOVE_BUTTON = "Remove"; //$NON-NLS-1$
+ public static final String CSS_STYLE_DIALOG_TITLE = "CSS Style";
//$NON-NLS-1$
+
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -239,7 +239,7 @@
*/
Button button = new Button(composite, SWT.PUSH);
button.setLayoutData(new GridData(SWT.LEFT, SWT.NONE, false, false, 1, 1));
- button.setToolTipText(VpeUIMessages.BACKGROUND_COLOR_TIP);
+ button.setToolTipText(VpeUIMessages.EDIT_STYLE_TIP);
ImageDescriptor colorDesc = JspEditorPlugin
.getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
Image im = colorDesc.createImage();
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-02-10
10:14:17 UTC (rev 20214)
@@ -99,7 +99,7 @@
public static String MAX_SOURCE_PANE;
public static String MAX_VISUAL_PANE;
public static String RESTORE_PREVIOUS_LOCATION;
- public static String BACKGROUND_COLOR_TIP;
+ public static String EDIT_STYLE_TIP;
public static String BaseActionManager_InsertAfter;
public static String BaseActionManager_InsertAround;
public static String BaseActionManager_InsertBefore;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-02-10
08:49:50 UTC (rev 20213)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-02-10
10:14:17 UTC (rev 20214)
@@ -81,7 +81,7 @@
MAX_SOURCE_PANE=Maximize Source Pane
MAX_VISUAL_PANE=Maximize Visual Pane
RESTORE_PREVIOUS_LOCATION=Restore Previous Location
-BACKGROUND_COLOR_TIP=Choose background color
+EDIT_STYLE_TIP=Edit style
BaseActionManager_InsertAfter=Insert After
BaseActionManager_InsertAround=Insert Around
BaseActionManager_InsertBefore=Insert Before