Author: dmaliarevich
Date: 2010-11-03 10:25:55 -0400 (Wed, 03 Nov 2010)
New Revision: 26228
Modified:
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-7381 , SwtBotTest was updated.
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-11-03
14:21:24 UTC (rev 26227)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java 2010-11-03
14:25:55 UTC (rev 26228)
@@ -16,6 +16,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
@@ -32,6 +33,7 @@
private final String INCORRECT_TABLE_VALUE = "Table value is incorrect";
//$NON-NLS-1$
private final String TOOLBAR_ICON_ENABLED = "Toolbar buttion should be
enabled"; //$NON-NLS-1$
private final String CANNOT_FIND_PROPERTY_VALUE = "Cannot find 'Property
Value' text field"; //$NON-NLS-1$
+ private final String CANNOT_FIND_RADIO_BUTTON = "Cannot find radio button with
name: "; //$NON-NLS-1$
private final String COMPLEX_TEXT = "!! HELLO ~ Input User, Name.Page ?"
//$NON-NLS-1$
+ " \r\n and some more text \r\n" //$NON-NLS-1$
+ "@ \\# vc \\$ % yy^ &*(ghg ) _l-kk+mmm\\/fdg\\ " //$NON-NLS-1$
@@ -395,6 +397,15 @@
SWTBotText fileName = bot.textWithLabel("File name:"); //$NON-NLS-1$
assertNotNull("'File Name:' text field is not found", fileName);
//$NON-NLS-1$
fileName.setText("externalize.properties"); //$NON-NLS-1$
+ /*
+ * 'Next>' button should be enabled. Press it.
+ */
+ assertTrue("(Next>) button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.NEXT_BUTTON).isEnabled());
+ bot.button(WidgetVariables.NEXT_BUTTON).click();
+ /*
+ * 'OK' button should be enabled. Press it.
+ */
assertTrue("(OK) button should be enabled.", //$NON-NLS-1$
bot.button(WidgetVariables.OK_BUTTON).isEnabled());
bot.button(WidgetVariables.OK_BUTTON).click();
@@ -582,7 +593,7 @@
*/
SWTBotText folderText = bot.textWithLabel(FOLDER_TEXT_LABEL);
assertNotNull("'" + FOLDER_TEXT_LABEL + "' text field is not
found", folderText); //$NON-NLS-1$ //$NON-NLS-2$
- assertText(JBT_TEST_PROJECT_NAME+"/WebContent/pages", folderText);
//$NON-NLS-1$
+ assertText(JBT_TEST_PROJECT_NAME+"/JavaSource", folderText); //$NON-NLS-1$
/*
* Check the file name
*/
@@ -590,6 +601,24 @@
assertNotNull("'File Name:' text field is not found", fileName);
//$NON-NLS-1$
assertText("hello.properties", fileName); //$NON-NLS-1$
/*
+ * 'Next>' button should be enabled. Press it.
+ */
+ assertTrue("(Next>) button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.NEXT_BUTTON).isEnabled());
+ bot.button(WidgetVariables.NEXT_BUTTON).click();
+ /*
+ * Check that 'manually by user' radiobutton is selected
+ */
+ SWTBotRadio rb = bot.radioInGroup(
+ JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_USER_DEFINED,
+ JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_SAVE_RESOURCE_BUNDLE);
+ assertNotNull(CANNOT_FIND_RADIO_BUTTON
+ + JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_USER_DEFINED,
+ rb);
+ assertTrue("("+JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_USER_DEFINED+")
" +
+ "radio button should be enabled.", //$NON-NLS-1$
+ rb.isSelected());
+ /*
* Create new file
*/
assertTrue("(OK) button should be enabled.", //$NON-NLS-1$
@@ -601,7 +630,7 @@
*/
editor.close();
SWTBotEditor editor2 = SWTTestExt.eclipse.openFile(
- JBT_TEST_PROJECT_NAME, "WebContent", "pages", //$NON-NLS-1$
//$NON-NLS-2$
+ JBT_TEST_PROJECT_NAME, "JavaSource", //$NON-NLS-1$
"hello.properties"); //$NON-NLS-1$
editor2.toTextEditor().selectLine(0);
String line = editor2.toTextEditor().getSelection();
@@ -658,7 +687,7 @@
*/
folderText = bot.textWithLabel(FOLDER_TEXT_LABEL);
assertNotNull("'" + FOLDER_TEXT_LABEL + "' text field is not
found", folderText); //$NON-NLS-1$ //$NON-NLS-2$
- assertText(JBT_TEST_PROJECT_NAME+"/WebContent/pages", folderText);
//$NON-NLS-1$
+ assertText(JBT_TEST_PROJECT_NAME+"/JavaSource", folderText); //$NON-NLS-1$
/*
* Check the file name
*/
@@ -666,6 +695,11 @@
assertNotNull("'File Name:' text field is not found", fileName);
//$NON-NLS-1$
assertText("hello.properties", fileName); //$NON-NLS-1$
/*
+ * 'Next>' button should be disabled.
+ */
+ assertFalse("(Next>) button should be disabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.NEXT_BUTTON).isEnabled());
+ /*
* Create new file
*/
assertFalse("(OK) button should be disabled.", //$NON-NLS-1$