Skip to content

Commit

Permalink
[JBIDE-14721] corrected alias used in integration test
Browse files Browse the repository at this point in the history
alias validity rules changed and the integration test has to use an
alias that fullfills these new rules. Thus changing the alias used in
the integration tests
  • Loading branch information
adietish committed Jun 3, 2013
1 parent a87c7b6 commit 61c5ca3
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public void shouldScaleDownApplication() throws Throwable {
public void shouldAddAliasToApplication() throws Throwable {
// pre-condition
IApplication application = ApplicationTestUtils.getOrCreateApplication(domain);
String alias = String.valueOf(System.currentTimeMillis());
String alias = createAlias();
// operation

application.addAlias(alias);
Expand All @@ -230,7 +230,7 @@ public void shouldAddAliasToApplication() throws Throwable {
public void shouldRemoveAliasOfApplication() throws Throwable {
// pre-condition
IApplication application = ApplicationTestUtils.getOrCreateApplication(domain);
String alias = String.valueOf(System.currentTimeMillis());
String alias = createAlias();
application.addAlias(alias);
assertThat(application.getAliases()).contains(alias);

Expand Down Expand Up @@ -272,4 +272,15 @@ public void shouldWaitForApplication() throws OpenShiftException, MalformedURLEx
assertTrue(System.currentTimeMillis() >= startTime + WAIT_TIMEOUT);
}
}

/**
* https://issues.jboss.org/browse/JBIDE-14721
*/
private String createAlias() {
return new StringBuilder(String.valueOf(System.currentTimeMillis()))
// valid alias is "/\A[a-z0-9]+(-[a-z0-9]+)*(\.[a-z0-9]+(-[a-z0-9]+)*)+\z/"
.append('.')
.append('1')
.toString();
}
}

0 comments on commit 61c5ca3

Please sign in to comment.