Skip to content

Commit

Permalink
[JBIDE-13675] replaced silentlyDestroyAllDomains by #destroyAllDomains
Browse files Browse the repository at this point in the history
implemented DomainTestUtils.destroyAllDomains() and replaced usage of
DomainTestUtils.silentlyDestroyAllDomains() by it so that domain deletion
errors are not swallowed any more. Domain deletion is a pre-condition
in these UserResourceIntegrationTest
  • Loading branch information
adietish committed Feb 27, 2013
1 parent ce60800 commit 1cd1465
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 3 additions & 7 deletions src/test/java/com/openshift/client/utils/DomainTestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@
*/
public class DomainTestUtils {

public static void silentlyDestroyAllDomains(IUser user) {
public static void destroyAllDomains(IUser user) {
if (user == null) {
return;
}
try {
for (IDomain domain : user.getDomains()) {
silentlyDestroy(domain);
}
} catch (Exception e) {
// e.printStackTrace();
for (IDomain domain : user.getDomains()) {
domain.destroy(true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void shouldReturnDomains() throws OpenShiftException {
@Test
public void shouldReturnNoDomains() throws OpenShiftException {
// precondition
DomainTestUtils.silentlyDestroyAllDomains(user);
DomainTestUtils.destroyAllDomains(user);
// operation
List<IDomain> domains = user.getDomains();
// verification
Expand All @@ -75,7 +75,7 @@ public void shouldReturnNoDomains() throws OpenShiftException {
public void shouldCreateDomain() throws OpenShiftException {
// pre-condition
// cannot create domain if there's already one
DomainTestUtils.silentlyDestroyAllDomains(user);
DomainTestUtils.destroyAllDomains(user);

// operation
String id = DomainTestUtils.createRandomName();
Expand Down Expand Up @@ -124,7 +124,7 @@ public void shouldReturnThatHasDomain() throws OpenShiftException {
@Test
public void shouldReturnThatHasNoDomain() throws OpenShiftException {
// precondition
DomainTestUtils.silentlyDestroyAllDomains(user);
DomainTestUtils.destroyAllDomains(user);
// operation
Boolean hasDomain = user.hasDomain();
// verification
Expand Down Expand Up @@ -154,7 +154,7 @@ public void shouldReturnThatHasntNamedDomain() throws OpenShiftException {
@Test
public void shouldReturnEmptyDomains() throws OpenShiftException {
// precondition
DomainTestUtils.silentlyDestroyAllDomains(user);
DomainTestUtils.destroyAllDomains(user);
// operation
List<IDomain> domains = user.getDomains();
// verification
Expand All @@ -169,7 +169,7 @@ public void shouldNoDefaultDomainAfterRefresh() throws OpenShiftException, FileN
assertNotNull(domain);

IUser otherUser = new TestConnectionFactory().getConnection().getUser();
DomainTestUtils.silentlyDestroyAllDomains(otherUser);
DomainTestUtils.destroyAllDomains(otherUser);
assertNull(otherUser.getDefaultDomain());

// operation
Expand Down

0 comments on commit 1cd1465

Please sign in to comment.