Search in sources :

Example 1 with ConsoleView

use of org.eclipse.reddeer.eclipse.ui.console.ConsoleView in project linuxtools by eclipse.

the class ContainerLogTest method getContainerLog.

private String getContainerLog() {
    new ContextMenu().getItem("Display Log").select();
    String consoleText;
    if (mockitoIsUsed()) {
        ConsoleView consoleView = new ConsoleView();
        consoleView.open();
        consoleView = MockUtils.getConsoleViewText(CONSOLE_TEXT);
        consoleText = consoleView.getConsoleText();
    } else {
        DockerTerminal dockerTerminal = new DockerTerminal();
        dockerTerminal.activate();
        consoleText = dockerTerminal.getTextFromPage(CONTAINER_NAME);
    }
    return consoleText;
}
Also used : ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) DockerTerminal(org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu)

Example 2 with ConsoleView

use of org.eclipse.reddeer.eclipse.ui.console.ConsoleView in project jbosstools-openshift by jbosstools.

the class PublishChangesTest method changeProjectAndVerifyAutoPublish.

private void changeProjectAndVerifyAutoPublish() {
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    projectExplorer.getProject(PROJECT_NAME).select();
    ProjectItem projectItem = projectExplorer.getProject(PROJECT_NAME).getProjectItem("Java Resources", "src/main/java", "org.jboss.as.quickstarts.helloworld", "HelloService.java");
    projectItem.select();
    projectItem.open();
    TextEditor textEditor = new TextEditor("HelloService.java");
    textEditor.setText(PUBLISHED_CODE);
    textEditor.close(true);
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    new WaitUntil(new ConsoleHasNoChange(), TimePeriod.VERY_LONG);
    assertTrue("Local changes performed to project have not been autopublished, or at least rsync " + "output in console view does not contain information about sending incremental list of changes," + "specifically with changed class " + changedClass, new ConsoleView().getConsoleText().contains(changedClass));
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ProjectItem(org.eclipse.reddeer.eclipse.core.resources.ProjectItem) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 3 with ConsoleView

use of org.eclipse.reddeer.eclipse.ui.console.ConsoleView in project jbosstools-openshift by jbosstools.

the class CDKServerAdapterAbstractTest method collectConsoleOutput.

/**
 * Prints out console output via logger and returns console content
 *
 * @param log reference to logger
 * @param onFail if true then error log method is used, debug otherwise
 * @return returns console output
 */
public String collectConsoleOutput(Logger log, boolean onFail) {
    String consoleOutput = "Console is empty...";
    ConsoleView view = new ConsoleView();
    view.open();
    if (view.getConsoleText() != null) {
        new WaitWhile(new ConsoleHasNoChange(), TimePeriod.DEFAULT, false);
        consoleOutput = view.getConsoleLabel() + "\n\r" + view.getConsoleText();
        if (onFail) {
            log.info("Loggin console, called from test failure");
            log.error(consoleOutput);
        } else {
            log.info("Logging console for debugging purposes");
            log.debug(consoleOutput);
        }
    }
    return consoleOutput;
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 4 with ConsoleView

use of org.eclipse.reddeer.eclipse.ui.console.ConsoleView in project linuxtools by eclipse.

the class BrowserContentsCheck method evaluateBrowserPage.

/**
 * Evaluate page text, if it not empty or without error.
 *
 * @param browserPage
 */
private static void evaluateBrowserPage(String browserPage) {
    ConsoleView consoleView = new ConsoleView();
    consoleView.open();
    assertFalse("Browser contains text 'Status 404'\n Console output:\n" + consoleView.getConsoleText() + System.getProperty("line.separator") + "Browser contents:" + browserPage, browserPage.contains("Status 404") || browserPage.contains("404 - Not Found"));
    assertFalse("Browser contains text 'Error processing request'\n Console output:\n" + consoleView.getConsoleText() + System.getProperty("line.separator") + "Browser contents:" + browserPage, browserPage.contains("Error processing request"));
    assertFalse("Browser contains text 'Forbidden'\n Console output:\n" + consoleView.getConsoleText() + System.getProperty("line.separator") + "Browser contents:" + browserPage, browserPage.contains("Forbidden"));
}
Also used : ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView)

Example 5 with ConsoleView

use of org.eclipse.reddeer.eclipse.ui.console.ConsoleView in project linuxtools by eclipse.

the class AbstractDockerBotTest method clearConsole.

protected void clearConsole() {
    ConsoleView cview = new ConsoleView();
    cview.open();
    try {
        cview.clearConsole();
    } catch (CoreLayerException ex) {
    // swallow intentionally
    }
}
Also used : ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Aggregations

ConsoleView (org.eclipse.reddeer.eclipse.ui.console.ConsoleView)11 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)5 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)4 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)3 ConsoleHasText (org.eclipse.reddeer.eclipse.condition.ConsoleHasText)2 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)2 StringStartsWith (org.hamcrest.core.StringStartsWith)2 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)2 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)2 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)2 Test (org.junit.Test)2 Pattern (java.util.regex.Pattern)1 DockerTerminal (org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal)1 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)1 ProjectItem (org.eclipse.reddeer.eclipse.core.resources.ProjectItem)1 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)1 ContextMenu (org.eclipse.reddeer.swt.impl.menu.ContextMenu)1 DefaultToolItem (org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1