Author: vpakan(a)redhat.com
Date: 2010-12-16 12:39:44 -0500 (Thu, 16 Dec 2010)
New Revision: 27556
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/GlobalELVariablesTest.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
Added GlobalELVariablesTest.
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-12-16
16:22:49 UTC (rev 27555)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-12-16
17:39:44 UTC (rev 27556)
@@ -319,7 +319,7 @@
public static final class NewXHTMLFileDialog {
- public static final String NAME = "Name*";
+ public static final String FILE_NAME = "Name*";
public static final String TEMPLATE = "Template";
public static final String TEMPLATE_FACELET_FORM_XHTML =
"FaceletForm.xhtml";
public static final String TEMPLATE_FACELET_FORM_XHTML_NAME = "Form Facelet
Page";
@@ -380,6 +380,7 @@
public static final String JBOSS_TOOLS_WEB_EDITORS = "Editors";
public static final String JBOSS_TOOLS_WEB_EDITORS_VPE = "Visual Page
Editor";
public static final String JBOSS_TOOLS_WEB_EDITORS_VPE_VISUAL_TEMPLATES =
"Visual Templates";
+ public static final String JBOSS_TOOLS_EL_VARIABLES = "El Variables";
}
public static class JBossServerRuntimeDialog {
@@ -646,4 +647,11 @@
public static final String FILE_NAME = "File name:";
}
+ public static class AddELReferenceDialog{
+
+ public static final String EL_NAME = "El Name*";
+ public static final String VALUE = "Value";
+
+ }
+
}
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-12-16
16:22:49 UTC (rev 27555)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-12-16
17:39:44 UTC (rev 27556)
@@ -24,6 +24,7 @@
import
org.jboss.tools.vpe.ui.bot.test.editor.preferences.AlwaysHideSelectionBarWithoutPromptTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.BorderForUnknownTagsTest;
import
org.jboss.tools.vpe.ui.bot.test.editor.preferences.ChangeEditorTabForTheFirstOpenPageTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.preferences.GlobalELVariablesTest;
import
org.jboss.tools.vpe.ui.bot.test.editor.preferences.PromptForTagAttributesDuringTagInsertTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowNonVisualTagsTest;
import
org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowResourceBundlesUsageasELexpressionsTest;
@@ -88,6 +89,7 @@
suite.addTestSuite(ManipulatingELValueTest.class);
suite.addTestSuite(SelectionBarTest.class);
suite.addTestSuite(IncludedCssFilesTest.class);
+ suite.addTestSuite(GlobalELVariablesTest.class);
return new TestSetup(suite);
}
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/GlobalELVariablesTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/GlobalELVariablesTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/GlobalELVariablesTest.java 2010-12-16
17:39:44 UTC (rev 27556)
@@ -0,0 +1,106 @@
+package org.jboss.tools.vpe.ui.bot.test.editor.preferences;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotTableExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.JobName;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+import org.jboss.tools.vpe.ui.bot.test.editor.VPEEditorTestCase;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+/**
+ * Tests Global EL Variables Definition
+ * @author vpakan
+ *
+ */
+public class GlobalELVariablesTest extends VPEEditorTestCase{
+
+ private static final String elName = "user.name";
+ private static final String elValue = "!!TestELValue!!";
+ private static String FACELET_PROJECT_XHTML_FILE_NAME =
"globalELVariablesTest.xhtml";
+ private SWTBotExt botExt = null;
+
+ public GlobalELVariablesTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+
+ public void testGlobalELVariables() throws Throwable{
+ bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
+ SWTBotTree preferenceTree = this.bot.tree();
+ preferenceTree
+ .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS)
+ .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB)
+ .select(IDELabel.PreferencesDialog.JBOSS_TOOLS_EL_VARIABLES);
+ bot.button(IDELabel.Button.ADD_WITHOUT_DOTS).click();
+ bot.shell(IDELabel.Shell.ADD_EL_REFERENCE).activate();
+
bot.textWithLabel(IDELabel.AddELReferenceDialog.EL_NAME).setText(GlobalELVariablesTest.elName);
+
bot.textWithLabel(IDELabel.AddELReferenceDialog.VALUE).setText(GlobalELVariablesTest.elValue);
+ bot.button(IDELabel.Button.FINISH).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
+ bot.button(IDELabel.Button.OK).click();
+ openPage(VPEAutoTestCase.TEST_PAGE);
+ // Create XHTML File in Facelet Project
+ SWTBotTree tree = packageExplorer.show().bot().tree();
+ tree.expandNode(VPEAutoTestCase.FACELETS_TEST_PROJECT_NAME)
+ .expandNode("WebContent")
+ .getNode("pages")
+ .select();
+ // add JSP
+ open.newObject(ActionItem.NewObject.JBossToolsWebXHTMLFile.LABEL);
+ bot.shell(IDELabel.Shell.NEW_XHTML_FILE).activate(); //$NON-NLS-1$
+ bot.textWithLabel(ActionItem.NewObject.JBossToolsWebXHTMLFile.TEXT_FILE_NAME)
+ .setText(GlobalELVariablesTest.FACELET_PROJECT_XHTML_FILE_NAME); //$NON-NLS-1$
+ bot.button(IDELabel.Button.FINISH).click(); //$NON-NLS-1$
+ bot.sleep(Timing.time3S());
+ util.waitForJobs(JobName.BUILDING_WS);
+ SWTBotEditor xhtmlEditor =
bot.editorByTitle(GlobalELVariablesTest.FACELET_PROJECT_XHTML_FILE_NAME);
+ xhtmlEditor.toTextEditor().setText("<html
xmlns=\"http://www.w3.org/1999/xhtml\"\n" +
+ "
xmlns:h=\"http://java.sun.com/jsf/html\">\n" +
+ " <body>\n" +
+ " <h:outputText value=\"#{user.name}\"/>\n" +
+ " </body>\n" +
+ "</html>");
+ xhtmlEditor.save();
+ bot.sleep(Timing.time5S());
+ assertVisualEditorContainsNodeWithValue(new
SWTBotWebBrowser(GlobalELVariablesTest.FACELET_PROJECT_XHTML_FILE_NAME, botExt),
+ GlobalELVariablesTest.elValue,
+ GlobalELVariablesTest.FACELET_PROJECT_XHTML_FILE_NAME);
+ xhtmlEditor.close();
+ SWTBotEditor jspEditor = bot.editorByTitle(VPEAutoTestCase.TEST_PAGE);
+ jspEditor.show();
+ bot.sleep(Timing.time5S());
+ assertVisualEditorContains(new SWTBotWebBrowser(VPEAutoTestCase.TEST_PAGE, botExt),
+ "INPUT",
+ new String[] {"value"},
+ new String[] {GlobalELVariablesTest.elValue},
+ VPEAutoTestCase.TEST_PAGE);
+ jspEditor.close();
+
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click();
+ SWTBotTree preferenceTree = this.bot.tree();
+ preferenceTree.expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS)
+ .expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB)
+ .select(IDELabel.PreferencesDialog.JBOSS_TOOLS_EL_VARIABLES);
+
+ SWTBotTableItem tiEL = new SWTBotTableExt(bot.table()).getTableItem(new String[]
{"Global",
+ GlobalELVariablesTest.elName,
+ GlobalELVariablesTest.elValue});
+ if (tiEL != null){
+ tiEL.select();
+ bot.sleep(Timing.time2S());
+ bot.button(IDELabel.Button.REMOVE).click();
+ }
+ bot.button(IDELabel.Button.OK).click();
+ super.tearDown();
+ }
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/GlobalELVariablesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain