use of org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException 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
}
}
use of org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException in project jbosstools-openshift by jbosstools.
the class NodeJSAppDebugTest method clean.
@After
public void clean() {
ProjectExplorer pe = new ProjectExplorer();
pe.open();
pe.deleteAllProjects();
try {
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new ServerAdapter(Version.OPENSHIFT3, OpenShiftResources.NODEJS_SERVICE).delete();
} catch (OpenShiftToolsException ex) {
// do nothing, adapter does not exists
}
}
use of org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method findOpenShiftConnection.
/**
* Finds OpenShift 3 connection based on server username parameters
*
* @param server server name
* @param username connection username
* @return openshift 3 connection object if found
*/
public OpenShift3Connection findOpenShiftConnection(String server, String username) {
OpenShiftExplorerView osExplorer = new OpenShiftExplorerView();
osExplorer.open();
if (osExplorer.connectionExists(server, username)) {
return osExplorer.getOpenShift3Connection(server, username);
} else {
throw new OpenShiftToolsException("Could not find OpenShift connection for " + server + " and " + // $NON-NLS-1$;
username);
}
}
use of org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException in project jbosstools-openshift by jbosstools.
the class OpenShiftExplorerView method getConnectionItem.
private TreeItem getConnectionItem(String server, String username) {
open();
if (username == null) {
username = TreeViewerHandler.getInstance().getNonStyledText(new DefaultTree().getItems().get(0));
}
TreeItem connectionItem = treeViewerHandler.getTreeItem(new DefaultTree(), username);
if (server != null && DatastoreOS3.AUTH_METHOD.equals(AuthenticationMethod.OAUTH)) {
if (treeViewerHandler.getStyledTexts(connectionItem)[0].equals(server)) {
return connectionItem;
} else {
throw new OpenShiftToolsException("There is no connection with specified server " + server + " and username " + username);
}
} else {
return connectionItem;
}
}
use of org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException in project jbosstools-openshift by jbosstools.
the class OpenShiftCommandLineToolsRequirement method deleteOnPathIfExists.
private void deleteOnPathIfExists(String path) {
try {
URI uri = new File(path).toURI();
LOGGER.info("Going to delete URI resources on path: " + uri.getPath());
Files.deleteIfExists(Paths.get(uri));
} catch (IOException e) {
LOGGER.error(e.getMessage());
throw new OpenShiftToolsException("Deleting files on path " + path + " was not successful, cause: " + e.getMessage());
}
}
Aggregations