Search in sources :

Example 11 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-hibernate by jbosstools.

the class ProjectUtils method getPackage.

public static ProjectItem getPackage(String project, String pckg) {
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    if (pe.getProject(project).containsResource("Java Resources")) {
        return pe.getProject(project).getProjectItem("Java Resources", "src/main/java", pckg);
    }
    return pe.getProject(project).getProjectItem("src/main/java", pckg);
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)

Example 12 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class ServerAdapterWizardHandlingTest method testProjectSelectedInProjectExplorerIsPreselected.

@Test
public void testProjectSelectedInProjectExplorerIsPreselected() {
    new ProjectExplorer().selectProjects(PROJECT_NAME);
    openNewServerAdapterWizard();
    next();
    String eclipseProject = Display.syncExec(new ResultRunnable<String>() {

        @Override
        public String run() {
            return new LabeledText("Eclipse Project: ").getSWTWidget().getText();
        }
    });
    assertTrue("Selected project from workspace should be preselected", eclipseProject.equals(PROJECT_NAME));
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 13 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class PublishChangesTest method removeAdapterAndApplication.

@AfterClass
public static void removeAdapterAndApplication() {
    try {
        new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
        new ServerAdapter(Version.OPENSHIFT3, "eap-app", "Service").delete();
    } catch (OpenShiftToolsException ex) {
    // do nothing, adapter does not exists
    }
    new ProjectExplorer().getProject(PROJECT_NAME).delete(false);
    TestUtils.cleanupGitFolder(new File(GIT_REPO_DIRECTORY));
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ServerAdapter(org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) File(java.io.File) OpenShiftToolsException(org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException) AfterClass(org.junit.AfterClass)

Example 14 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer in project jbosstools-openshift by jbosstools.

the class PublishChangesTest method waitForRunningApplication.

@BeforeClass
public static void waitForRunningApplication() {
    new ProjectExplorer().deleteAllProjects(true);
    new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, "eap-app-1", ResourceState.COMPLETE, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(1000));
    OpenShiftExplorerView openShiftExplorerView = new OpenShiftExplorerView();
    OpenShiftProject project = openShiftExplorerView.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName());
    new WaitUntil(new ApplicationPodIsRunning(project), TimePeriod.LONG);
    cloneGitRepoAndImportProject();
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ApplicationPodIsRunning(org.jboss.tools.openshift.reddeer.condition.ApplicationPodIsRunning) OpenShiftProject(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) BeforeClass(org.junit.BeforeClass)

Example 15 with ProjectExplorer

use of org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer 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)

Aggregations

ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)41 Test (org.junit.Test)12 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)10 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)8 File (java.io.File)6 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)6 PropertyDialog (org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog)5 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)5 IOException (java.io.IOException)4 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)4 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)4 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)4 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)3 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)3 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)3 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)3 TextEditor (org.eclipse.reddeer.workbench.impl.editor.TextEditor)3 AfterClass (org.junit.AfterClass)3 Before (org.junit.Before)3