Author: dmaliarevich
Date: 2010-09-02 11:49:03 -0400 (Thu, 02 Sep 2010)
New Revision: 24667
Modified:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6945 , JUnit was added
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-09-02
15:30:36 UTC (rev 24666)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java 2010-09-02
15:49:03 UTC (rev 24667)
@@ -18,6 +18,7 @@
public static final String PROPERTIES = "Properties"; //$NON-NLS-1$
public static final String OUTLINE = "Outline"; //$NON-NLS-1$
public static final String OK_BUTTON = "OK"; //$NON-NLS-1$
+ public static final String CANCEL_BUTTON = "Cancel"; //$NON-NLS-1$
public static final String NEXT_BUTTON = "Next >"; //$NON-NLS-1$
public static final String BACK_BUTTON = "< Back"; //$NON-NLS-1$
public static final String FINISH_BUTTON = "Finish"; //$NON-NLS-1$
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java 2010-09-02
15:30:36 UTC (rev 24666)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java 2010-09-02
15:49:03 UTC (rev 24667)
@@ -147,6 +147,42 @@
assertEquals("'Messages.properties' was updated incorrectly",
"User=User", line); //$NON-NLS-1$ //$NON-NLS-2$
}
+ public void testExternalizingTheSameTextAgain() throws Throwable {
+ isUnusedDialogOpened = false;
+ /*
+ * Open simple html file in order to get the VPE toolbar
+ */
+ SWTBotEditor editor = SWTTestExt.packageExplorer.openFile(JBT_TEST_PROJECT_NAME,
+ "WebContent", "pages", TEST_PAGE); //$NON-NLS-1$ //$NON-NLS-2$
+ editor.setFocus();
+
+ /*
+ * Select some text
+ */
+ editor.toTextEditor().selectRange(7, 18, 4);
+ assertEquals("Replaced text is incorrect", "User",
editor.toTextEditor().getSelection()); //$NON-NLS-1$ //$NON-NLS-2$
+ /*
+ * Get toolbar button
+ */
+ bot.toolbarButtonWithTooltip(VpeUIMessages.EXTERNALIZE_STRINGS).click();
+ bot.shell(VpeUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
+ bot.shell(VpeUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
+ isUnusedDialogOpened = true;
+
+ /*
+ * Check generated property key
+ */
+ SWTBotText defKeyText = bot.textWithLabelInGroup(
+ VpeUIMessages.EXTERNALIZE_STRINGS_DIALOG_PROPERTIES_KEY,
+ VpeUIMessages.EXTERNALIZE_STRINGS_DIALOG_PROPS_STRINGS_GROUP);
+ assertNotNull("Cannot find 'Property Key' text field", defKeyText);
//$NON-NLS-1$
+ assertText("User_1",defKeyText); //$NON-NLS-1$
+
+ bot.button(WidgetVariables.CANCEL_BUTTON).click();
+ isUnusedDialogOpened = false;
+
+ }
+
public void testExternalizeStringsDialogInXhtml() throws Throwable {
isUnusedDialogOpened = false;
/*