Author: jjankovi
Date: 2012-02-14 12:31:38 -0500 (Tue, 14 Feb 2012)
New Revision: 38719
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/condition/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/condition/NonEmptyTableCondition.java
Log:
Added NonEmptyTableCondition class
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/condition/NonEmptyTableCondition.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/condition/NonEmptyTableCondition.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/condition/NonEmptyTableCondition.java 2012-02-14
17:31:38 UTC (rev 38719)
@@ -0,0 +1,33 @@
+package org.jboss.tools.cdi.bot.test.condition;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.waits.ICondition;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+
+public class NonEmptyTableCondition implements ICondition {
+
+ private SWTBotTable table;
+
+ public NonEmptyTableCondition(SWTBotTable table) {
+ super();
+ this.table = table;
+ }
+
+ public boolean test() throws Exception {
+ try {
+ return table.rowCount() != 0;
+ } catch (WidgetNotFoundException e) {
+ }
+ return false;
+ }
+
+ public String getFailureMessage() {
+ return "Table is empty, it does not contain any table items";
+ }
+
+ public void init(SWTBot bot) {
+
+ }
+
+}
Show replies by date