Author: dmaliarevich
Date: 2010-02-22 10:42:55 -0500 (Mon, 22 Feb 2010)
New Revision: 20416
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/wizards/
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/wizards/icons/
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/wizards/icons/export_wizard.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/wizards/icons/import_wizard.gif
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/resources/storedTags.xml
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ImportUnknownTagsWizardTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2795, updating SWTBot Test, adding icons to the
wizards.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2010-02-22 14:30:21 UTC (rev 20415)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2010-02-22 15:42:55 UTC (rev 20416)
@@ -128,7 +128,7 @@
id="org.jboss.tools.vpe.editor.wizards.ExportUnknownTagsTemplatesWizard"
class="org.jboss.tools.vpe.editor.wizards.ExportUnknownTagsTemplatesWizard"
name="%exportUnknownTagsTemplatesWizardName"
- icon="icons/">
+
icon="$nl$/resources/org/jboss/tools/vpe/wizards/icons/export_wizard.gif">
<description>
%exportUnknownTagsTemplatesWizardDescription
</description>
@@ -141,7 +141,7 @@
id="org.jboss.tools.vpe.editor.wizards.ImportUnknownTagsTemplatesWizard"
class="org.jboss.tools.vpe.editor.wizards.ImportUnknownTagsTemplatesWizard"
name="%importUnknownTagsTemplatesWizardName"
- icon="icons/">
+
icon="resources/org/jboss/tools/vpe/wizards/icons/import_wizard.gif">
<description>
%importUnknownTagsTemplatesWizardDescription
</description>
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/wizards/icons/export_wizard.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/wizards/icons/export_wizard.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/wizards/icons/import_wizard.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/wizards/icons/import_wizard.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/resources/storedTags.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/resources/storedTags.xml
(rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/resources/storedTags.xml 2010-02-22
15:42:55 UTC (rev 20416)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<vpe:templates>
+ <vpe:template-taglib prefix="lib" uri="someuri"/>
+ <vpe:template-taglib prefix="taglibName"
uri="http://some/tag/uri"/>
+ <vpe:tag case-sensitive="no" name="taglibName:tagName">
+ <vpe:template children="yes" modify="no">
+ <vpe:any tag-for-display="b"/>
+ </vpe:template>
+ </vpe:tag>
+ <vpe:tag case-sensitive="no" name="lib:tag">
+ <vpe:template children="yes" modify="no">
+ <vpe:any style="s" tag-for-display="a"
value="v"/>
+ </vpe:template>
+ </vpe:tag>
+</vpe:templates>
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ImportUnknownTagsWizardTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ImportUnknownTagsWizardTest.java 2010-02-22
14:30:21 UTC (rev 20415)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ImportUnknownTagsWizardTest.java 2010-02-22
15:42:55 UTC (rev 20416)
@@ -9,10 +9,17 @@
******************************************************************************/
package org.jboss.tools.vpe.ui.bot.test.wizard;
-import org.eclipse.swtbot.swt.finder.SWTBot;
+import java.io.File;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
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;
+import org.osgi.framework.Bundle;
public class ImportUnknownTagsWizardTest extends VPEAutoTestCase {
@@ -32,19 +39,56 @@
}
public void _testImportWizard() throws Throwable {
+ /*
+ * Open wizard page
+ */
bot.menu("File").menu("Import...").click(); //$NON-NLS-1$
//$NON-NLS-2$
bot.shell("Import").activate(); //$NON-NLS-1$
SWTBotTree importTree = bot.tree();
importTree.expandNode("Other").select("Unknown tags templates");
//$NON-NLS-1$ //$NON-NLS-2$
bot.button(WidgetVariables.NEXT_BUTTON).click();
- bot.text().setText(STORED_TAGS_PATH);
+ /*
+ * Load stored tags
+ */
+ Bundle bundle = Platform.getBundle("org.jboss.tools.vpe.ui.bot.test");
//$NON-NLS-1$
+ URL url = bundle.getEntry("/resources"); //$NON-NLS-1$
+ url = FileLocator.resolve(url);
+ IPath path = new Path(url.getPath());
+ File file = path.append(STORED_TAGS_PATH).toFile();
+ assertTrue("File '" + file.getAbsolutePath() +"' does not
exist.", file.exists()); //$NON-NLS-1$ //$NON-NLS-2$
+ bot.text().setText(file.getAbsolutePath());
+ /*
+ * Check table values
+ */
+ String taglib = bot.table().cell(0, 0);
+ assertEquals("Wrong table value.", "lib:tag", taglib);
//$NON-NLS-1$ //$NON-NLS-2$
+ taglib = bot.table().cell(1, 0);
+ assertEquals("Wrong table value.", "taglibName:tagName",
taglib); //$NON-NLS-1$ //$NON-NLS-2$
+ /*
+ * Check that finish button is enabled
+ */
+ assertTrue("Finish button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.FINISH_BUTTON).isEnabled());
+ bot.sleep(5000);
+ bot.button(WidgetVariables.FINISH_BUTTON).click();
+ /*
+ * Check that templates have been added to the preference page
+ */
+ bot.menu("Window").menu("Preferences").click(); //$NON-NLS-1$
//$NON-NLS-2$
+ bot.shell("Preferences").activate(); //$NON-NLS-1$
+ importTree = bot.tree();
+ importTree.expandNode("JBoss Tools") //$NON-NLS-1$d
+ .expandNode("Web") //$NON-NLS-1$
+ .expandNode("Editors") //$NON-NLS-1$
+ .select("Visual Page Editor"); //$NON-NLS-1$
+ bot.tabItem("Templates").activate(); //$NON-NLS-1$
+ /*
+ * Check table values on the preferences page
+ */
+ taglib = bot.table().cell(0, 0);
+ assertEquals("Wrong table value.", "taglibName:tagName",
taglib); //$NON-NLS-1$ //$NON-NLS-2$
+ taglib = bot.table().cell(1, 0);
+ assertEquals("Wrong table value.", "lib:tag", taglib);
//$NON-NLS-1$ //$NON-NLS-2$
}
- protected void openPage() {
- 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$
- }
-
}