Author: dmaliarevich
Date: 2011-03-25 05:13:41 -0400 (Fri, 25 Mar 2011)
New Revision: 30026
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeAllStringsDialogTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7004 , SwtBot test mock-up, after context menu is
fixed - finish the test.
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeAllStringsDialogTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeAllStringsDialogTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeAllStringsDialogTest.java 2011-03-25
09:13:41 UTC (rev 30026)
@@ -0,0 +1,80 @@
+package org.jboss.tools.vpe.ui.bot.test.wizard;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.jst.jsp.i18n.ExternalizeAllStringsWizard;
+import org.jboss.tools.jst.jsp.i18n.ExternalizeStringsDialog;
+import org.jboss.tools.jst.jsp.messages.JstUIMessages;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+public class ExternalizeAllStringsDialogTest extends VPEAutoTestCase {
+
+ private boolean isUnusedDialogOpened = false;
+
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ SWTBotShell dlgShell = bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE);
+ dlgShell.setFocus();
+ dlgShell.close();
+ } catch (WidgetNotFoundException e) {
+ e.printStackTrace();
+ } finally {
+ isUnusedDialogOpened = false;
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return isUnusedDialogOpened;
+ }
+
+ public void _testExternalizeAllStringsDialog() throws Throwable {
+ /*
+ * Open the file
+ */
+ isUnusedDialogOpened = false;
+ SWTBotEditor editor = SWTTestExt.packageExplorer.openFile(JBT_TEST_PROJECT_NAME,
+ "WebContent", "pages", TEST_PAGE); //$NON-NLS-1$ //$NON-NLS-2$
+ editor.setFocus();
+ /*
+ * Open the dialog for the active editor
+ */
+
+ /*
+ * Select example bundle
+ */
+
+ /*
+ * Check displayed properties
+ */
+
+ /*
+ * Check next page:
+ * the table with non-externalized properties
+ */
+
+ /*
+ * Check duplicate keys
+ */
+
+ /*
+ * Check bundle name on the next page:
+ */
+
+ /*
+ * Press OK
+ */
+
+ /*
+ * Check the editor content, string should be replaced
+ */
+
+ }
+
+}