Author: ljelinko
Date: 2012-03-28 11:10:20 -0400 (Wed, 28 Mar 2012)
New Revision: 39893
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/example/AbstractPortletExampleGatein.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/ExampleTest.java
Log:
Added possibility to configure if test should be skiped in case an example is not found
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/example/AbstractPortletExampleGatein.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/example/AbstractPortletExampleGatein.java 2012-03-28
15:06:44 UTC (rev 39892)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/example/AbstractPortletExampleGatein.java 2012-03-28
15:10:20 UTC (rev 39893)
@@ -19,4 +19,9 @@
public String getExampleCategory() {
return "Portlet for GateIn 3.1/EPP 5.x";
}
+
+ @Override
+ protected boolean failOnMissingExample() {
+ return true;
+ }
}
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/ExampleTest.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/ExampleTest.java 2012-03-28
15:06:44 UTC (rev 39892)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/ExampleTest.java 2012-03-28
15:10:20 UTC (rev 39893)
@@ -64,8 +64,20 @@
importExample(wiz);
postImport();
executeExample();
+ } else if (failOnMissingExample()){
+ throw new AssertionError("The example " + getExampleName() + " was not
found");
}
}
+
+ /**
+ * The default behavior is to finish the thest gracefully if the example does not exist.
+ * When this behavior is not desirable, subclasses can change the behavior by overriding
this
+ * method.
+ */
+ protected boolean failOnMissingExample(){
+ return false;
+ }
+
private SWTBot existsExample() {
SWTBot wiz = open.newObject(JBossToolsProjectExamples.LABEL);
// wait for progress shell (downloading & parsing example xml)
Show replies by date