Search in sources :

Example 1 with ServerAdapter

use of org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter in project jbosstools-openshift by jbosstools.

the class PublishChangesTest method verifyChangesTookEffect.

private void verifyChangesTookEffect() {
    new ServerAdapter(Version.OPENSHIFT3, "eap-app", "Service").select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.SHOW_IN_WEB_BROWSER).select();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    try {
        new WaitUntil(new BrowserContainsText("Hello"), TimePeriod.VERY_LONG);
    } catch (WaitTimeoutExpiredException ex) {
        fail("Application was not deployed successfully because it is not shown in web browser properly.");
    }
}
Also used : ServerAdapter(org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) BrowserContainsText(org.jboss.tools.openshift.reddeer.condition.BrowserContainsText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 2 with ServerAdapter

use of org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter 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 3 with ServerAdapter

use of org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter in project jbosstools-openshift by jbosstools.

the class ServerAdapterFromResourceTest method newAdapterFromResource.

private void newAdapterFromResource(Resource type, String name) {
    project.refresh();
    project.getOpenShiftResource(type, name).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    String resourceType = null;
    String selectors = name + " name=" + name;
    if (type.equals(Resource.DEPLOYMENT)) {
        resourceType = "ReplicationController";
        selectors = name + " deploymentconfig=" + serviceReq.getService().getName() + ", name=" + serviceReq.getService().getName() + ", deployment=" + name;
    } else {
        resourceType = type.toString().replaceFirst(".$", "").replaceAll(" ", "");
    }
    assertTrue("Resource should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(project.getName(), selectors).isSelected());
    try {
        new DefaultStyledText(resourceType);
    } catch (RedDeerException e) {
        fail("Resource type does not match");
    }
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(""));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
    assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, name, resourceType).test());
    adapter = new ServerAdapter(Version.OPENSHIFT3, name, resourceType);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) ServerAdapter(org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ServerAdapterExists(org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 4 with ServerAdapter

use of org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter in project jbosstools-openshift by jbosstools.

the class CreateServerAdapterTest method removeAdapterIfExists.

@After
public void removeAdapterIfExists() {
    try {
        OpenShiftUtils.killJobs();
        new ServerAdapter(Version.OPENSHIFT3, "eap-app", "Service").delete();
    } catch (OpenShiftToolsException ex) {
    // do nothing, adapter does not exists
    }
}
Also used : ServerAdapter(org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter) OpenShiftToolsException(org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException) After(org.junit.After)

Example 5 with ServerAdapter

use of org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter in project jbosstools-openshift by jbosstools.

the class DebuggingEAPAppTest method setupClass.

@BeforeClass
public static void setupClass() {
    cloneGitRepoAndImportProject();
    rebuildProject();
    doNotSuspendOnUncaughtExceptions();
    toggleAutoBuild(false);
    createServerAdapter();
    disableShowConsoleWhenOutputChanges();
    serverAdapter = new ServerAdapter(Version.OPENSHIFT3, "eap-app", "Service");
    try {
        restartServerInDebug(serverAdapter);
    } catch (WaitTimeoutExpiredException ex) {
        // try once again
        restartServerInDebug(serverAdapter);
    }
    cleanAndBuildWorkspace();
}
Also used : ServerAdapter(org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) BeforeClass(org.junit.BeforeClass)

Aggregations

ServerAdapter (org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter)7 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)5 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)5 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)3 OpenShiftToolsException (org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException)3 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)2 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)2 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)2 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)2 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)2 ServerAdapterExists (org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists)2 After (org.junit.After)2 File (java.io.File)1 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)1 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 DefaultStyledText (org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText)1 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)1 BrowserContainsText (org.jboss.tools.openshift.reddeer.condition.BrowserContainsText)1 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)1 AfterClass (org.junit.AfterClass)1