diff --git a/plugins/org.eclipse.reddeer.eclipse/src/org/eclipse/reddeer/eclipse/condition/ConsoleHasLabel.java b/plugins/org.eclipse.reddeer.eclipse/src/org/eclipse/reddeer/eclipse/condition/ConsoleHasLabel.java index 1bd5e1b2d4..c2320d999e 100644 --- a/plugins/org.eclipse.reddeer.eclipse/src/org/eclipse/reddeer/eclipse/condition/ConsoleHasLabel.java +++ b/plugins/org.eclipse.reddeer.eclipse/src/org/eclipse/reddeer/eclipse/condition/ConsoleHasLabel.java @@ -26,7 +26,7 @@ public class ConsoleHasLabel extends AbstractWaitCondition { private Matcher matcher; - private static ConsoleView consoleView = null; + private ConsoleView consoleView; private String resultLabel; /** @@ -53,7 +53,7 @@ public ConsoleHasLabel(Matcher matcher) { */ @Override public boolean test() { - String consoleLabel = ConsoleHasLabel.getConsoleLabel(); + String consoleLabel = getConsoleLabel(); if (matcher.matches(consoleLabel)) { this.resultLabel = consoleLabel; return true; @@ -69,11 +69,13 @@ public String description() { return "console label matches '" + matcher ; } - private static String getConsoleLabel() { + private String getConsoleLabel() { if (consoleView == null){ consoleView = new ConsoleView(); } - consoleView.open(); + if (!consoleView.isOpen()) { + consoleView.open(); + } return consoleView.getConsoleLabel(); }