[jbosstools-commits] JBoss Tools SVN: r39682 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/validation.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Wed Mar 21 03:46:38 EDT 2012
Author: jpeterka
Date: 2012-03-21 03:46:34 -0400 (Wed, 21 Mar 2012)
New Revision: 39682
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/validation/AnnotationValidationTest.java
Log:
HB annotation validation test extended to recheck fixed state
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/validation/AnnotationValidationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/validation/AnnotationValidationTest.java 2012-03-21 07:32:12 UTC (rev 39681)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/validation/AnnotationValidationTest.java 2012-03-21 07:46:34 UTC (rev 39682)
@@ -1,9 +1,12 @@
package org.jboss.tools.hb.ui.bot.test.validation;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.hb.ui.bot.common.ProjectExplorer;
import org.jboss.tools.hb.ui.bot.test.HibernateBaseTest;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.helper.StringHelper;
import org.jboss.tools.ui.bot.ext.view.ProblemsView;
import org.junit.Test;
@@ -28,15 +31,29 @@
}
private void checkGenericGeneratorValidation() {
- ProjectExplorer.open(prj, "src",pkg);
+ String resource = "GeneratorValidationEntity.java";
+ ProjectExplorer.open(prj, "src", pkg, resource);
String desc = "No generator named \"mygen\" is defined in the persistence unit";
String path = "/" + prj + "/src/org/validation";
- String resource = "GeneratorValidationEntity.java";
String type = "JPA Problem";
SWTBotTreeItem[] items = null;
items = ProblemsView.getFilteredErrorsTreeItems(bot, desc, path, resource, type);
assertTrue(items.length == 1);
+
+ // fix
+ SWTBotEditor editor = bot.editorByTitle(resource);
+ editor.show();
+ StringHelper sh = new StringHelper(editor.toTextEditor().getText());
+ Point pos = sh.getPositionAfter("\"mygen\"");
+ editor.toTextEditor().selectRange(pos.y, pos.x, 0);
+ editor.toTextEditor().insertText("erator");
+ editor.save();
+ util.waitForAll();
+
+ // check
+ items = ProblemsView.getFilteredErrorsTreeItems(bot, desc, path, resource, type);
+ assertTrue(items.length == 0);
}
}
\ No newline at end of file
More information about the jbosstools-commits
mailing list