Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JBIDE-23029] impl'd requirements for connection, project, service
* impl'd requirements for connection, project, service * allow UI assertions to specify connection and project
- Loading branch information
Showing
46 changed files
with
1,608 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...hift.reddeer/src/org/jboss/tools/openshift/reddeer/condition/core/NamedResourceExist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2016 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v 1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributor: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.openshift.reddeer.condition.core; | ||
|
||
import static org.junit.Assert.assertNotNull; | ||
|
||
import org.jboss.reddeer.common.condition.AbstractWaitCondition; | ||
import org.jboss.tools.openshift.core.connection.Connection; | ||
|
||
import com.openshift.restclient.OpenShiftException; | ||
|
||
/** | ||
* Wait condition to wait for existence of a resource of a given kind and name | ||
* in the given project. The condition operates on the client-lib, not on the | ||
* UI. | ||
* | ||
* @author adietish@redhat.com | ||
* | ||
*/ | ||
public class NamedResourceExist extends AbstractWaitCondition { | ||
|
||
private final String kind; | ||
protected final String name; | ||
private String project; | ||
protected Connection connection; | ||
|
||
public NamedResourceExist(String kind, String name, String project, Connection connection) { | ||
assertNotNull(kind); | ||
assertNotNull(name); | ||
assertNotNull(connection); | ||
|
||
this.kind = kind; | ||
this.name = name; | ||
this.project = project; | ||
this.connection = connection; | ||
} | ||
|
||
@Override | ||
public boolean test() { | ||
try { | ||
connection.getResource(kind, project, name); | ||
return true; | ||
} catch(OpenShiftException e) { | ||
return false; | ||
} | ||
} | ||
|
||
@Override | ||
public String description() { | ||
return kind + " named " + name + " in project " + project + " gets available."; | ||
} | ||
} |
Oops, something went wrong.