Author: lzoubek(a)redhat.com
Date: 2010-08-30 10:42:40 -0400 (Mon, 30 Aug 2010)
New Revision: 24550
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/Editing.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/Assertions.java
Log:
esb ui bot tests : setup editing test by creating esb project, not classic java one
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/Editing.java
===================================================================
---
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/Editing.java 2010-08-30
14:37:09 UTC (rev 24549)
+++
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/Editing.java 2010-08-30
14:42:40 UTC (rev 24550)
@@ -34,7 +34,9 @@
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.ESBESBFile;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.ESBESBProject;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.JavaProject;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.parts.ObjectMultiPageEditorBot;
@@ -59,20 +61,17 @@
@BeforeClass
public static void setupProject() {
- SWTBot wiz = open.newObject(JavaProject.LABEL);
- wiz.textWithLabel(JavaProject.TEXT_PROJECT_NAME).setText(projectName);
+ SWTBot wiz = open.newObject(ActionItem.NewObject.ESBESBProject.LABEL);
+ wiz.textWithLabel(ESBESBProject.TEXT_PROJECT_NAME).setText(projectName);
wiz.button(IDELabel.Button.NEXT).click();
- open.finish(wiz, true);
- packageExplorer.show().bot().tree().select(projectName);
- wiz = open.newObject(ESBESBFile.LABEL);
- wiz.textWithLabel(ESBESBFile.TEXT_NAME).setText(configFile);
+ wiz.button(IDELabel.Button.NEXT).click();
+
+
open.finish(wiz);
- assertTrue(bot.editorByTitle(configFileFull) != null);
- assertTrue("ESB Editor opened problems",
- problems.getErrorsNode(bot) == null);
+
}
- //@AfterClass
+ @AfterClass
public static void waitAMinute() {
bot.sleep(Long.MAX_VALUE);
}
@@ -101,6 +100,8 @@
ESBProvider action = (ESBProvider) m.invoke(null, new Object[]{});
action.create(getEditor(), actionPath);
providerList.remove(action.getMenuLabel());
+ bot.sleep(TIME_1S);
+ Assertions.assertEmptyProblemsView("after "+action.getMenuLabel()+"
was added");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/Assertions.java
===================================================================
---
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/Assertions.java 2010-08-30
14:37:09 UTC (rev 24549)
+++
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/Assertions.java 2010-08-30
14:42:40 UTC (rev 24550)
@@ -8,8 +8,10 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.esb.ui.bot.tests.XmlFileValidator;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
public class Assertions {
public static void assertTreeContent(SWTBotEditor editor, String... items) {
@@ -59,4 +61,8 @@
public static void assertXmlContentExists(String xml, String xpath) {
assertXmlContentBool(xml, "count("+xpath+")=1");
}
+ public static void assertEmptyProblemsView(String message ) {
+ SWTBotTreeItem node = SWTTestExt.problems.getErrorsNode(SWTTestExt.bot);
+ assertTrue("ESB Editor has errors in 'Problems View' - "+message,node
== null);
+ }
}
Show replies by date