Author: ljelinko
Date: 2012-04-18 07:47:41 -0400 (Wed, 18 Apr 2012)
New Revision: 40282
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/matcher/console/
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/matcher/console/ConsoleOutputMatcher.java
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
Log:
Moved ConsoleOutputMatcher from portlet to swtbotext
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java 2012-04-18
11:18:21 UTC (rev 40281)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java 2012-04-18
11:47:41 UTC (rev 40282)
@@ -2,7 +2,6 @@
import org.hamcrest.Description;
import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
/**
* Checks if the console contains specified text.
@@ -12,19 +11,19 @@
*/
public class ConsoleOutputMatcher extends AbstractSWTMatcher<String> {
- private String consoleText;
+ private org.jboss.tools.ui.bot.ext.matcher.console.ConsoleOutputMatcher wrappedMatcher;
+ public ConsoleOutputMatcher() {
+ wrappedMatcher = new
org.jboss.tools.ui.bot.ext.matcher.console.ConsoleOutputMatcher();
+ }
+
@Override
public boolean matchesSafely(String item) {
- consoleText = SWTBotFactory.getConsole().getConsoleText();
- if (consoleText == null){
- throw new IllegalStateException("No console output present");
- }
- return consoleText.contains(item);
+ return wrappedMatcher.matchesSafely(item);
}
@Override
public void describeTo(Description description) {
- description.appendText("is in console output, but instead: \n" +
consoleText);
+ wrappedMatcher.describeTo(description);
}
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2012-04-18
11:18:21 UTC (rev 40281)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2012-04-18
11:47:41 UTC (rev 40282)
@@ -18,6 +18,7 @@
org.jboss.tools.ui.bot.ext.helper,
org.jboss.tools.ui.bot.ext.logging,
org.jboss.tools.ui.bot.ext.matcher,
+ org.jboss.tools.ui.bot.ext.matcher.console,
org.jboss.tools.ui.bot.ext.parts,
org.jboss.tools.ui.bot.ext.types,
org.jboss.tools.ui.bot.ext.view,
Copied:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/matcher/console/ConsoleOutputMatcher.java
(from rev 38107,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java)
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/matcher/console/ConsoleOutputMatcher.java
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/matcher/console/ConsoleOutputMatcher.java 2012-04-18
11:47:41 UTC (rev 40282)
@@ -0,0 +1,30 @@
+package org.jboss.tools.ui.bot.ext.matcher.console;
+
+import org.hamcrest.Description;
+import org.hamcrest.TypeSafeMatcher;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+
+/**
+ * Checks if the console contains specified text.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class ConsoleOutputMatcher extends TypeSafeMatcher<String> {
+
+ private String consoleText;
+
+ @Override
+ public boolean matchesSafely(String item) {
+ consoleText = SWTBotFactory.getConsole().getConsoleText();
+ if (consoleText == null){
+ throw new IllegalStateException("No console output present");
+ }
+ return consoleText.contains(item);
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendText("is in console output, but instead: \n" +
consoleText);
+ }
+}
Show replies by date