Skip to content

Commit

Permalink
Merge pull request #15627 from Azquelt/openapi20-wait-https
Browse files Browse the repository at this point in the history
Make OpenAPI test wait for HTTPS port to be open
  • Loading branch information
Azquelt authored Jan 25, 2021
2 parents 953fb1e + 47ac5ef commit b6b6be4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018 IBM Corporation and others.
* Copyright (c) 2018, 2021 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -84,6 +84,11 @@ public static void setUpTest() throws Exception {
assertNotNull("Server did not report that it has started",
server.waitForStringInLog("CWWKF0011I.*"));

assertNotNull("Http port not opened",
server.waitForStringInLog("CWWKO0219I.* defaultHttpEndpoint ")); // Wait for http port
assertNotNull("Https port not opened",
server.waitForStringInLog("CWWKO0219I.* defaultHttpEndpoint-ssl ")); // Wait for https port to open (this
// can sometimes take a while)
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 IBM Corporation and others.
* Copyright (c) 2020, 2021 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -61,7 +61,9 @@ public static DefaultHostListener getInstance() {
* The ServerInfo object for the default_host virtual host.
*/
public ServerInfo getDefaultHostServerInfo() {
return defaultHostServerInfo;
synchronized(defaultHostServerInfo) {
return new ServerInfo(defaultHostServerInfo);
}
}

@Activate
Expand Down Expand Up @@ -139,4 +141,4 @@ private void updateDefaultHostServerInfo(VirtualHost vhost, Map<String, Object>
Tr.event(this, tc, "Updated server information: " + defaultHostServerInfo);
}
}
}
}

0 comments on commit b6b6be4

Please sign in to comment.