[ https://issues.apache.org/jira/browse/STRATOS-1628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15020501#comment-15020501 ]
ASF GitHub Bot commented on STRATOS-1628: ----------------------------------------- Github user R-Rajkumar commented on a diff in the pull request: https://github.com/apache/stratos/pull/492#discussion_r45546693 --- Diff: components/org.apache.stratos.mock.iaas.client/src/main/java/org/apache/stratos/mock/iaas/client/MockIaasApiClient.java --- @@ -48,6 +49,20 @@ public MockIaasApiClient(String endpoint) { this.endpoint = endpoint; } + public boolean isMockIaaSReady() { + try { + URI uri = new URIBuilder(endpoint + INIT_CONTEXT).build(); + HttpResponse response = restClient.doGet(uri); + if (response != null) { + return response.getStatusCode() == 200; + } + throw new RuntimeException("An unknown error occurred"); --- End diff -- +1 > Improve the way intergration test determines whether the server is ready or > not > ------------------------------------------------------------------------------- > > Key: STRATOS-1628 > URL: https://issues.apache.org/jira/browse/STRATOS-1628 > Project: Stratos > Issue Type: Improvement > Components: Integration Framework, Mock IaaS > Reporter: Rajkumar Rajaratnam > Assignee: Rajkumar Rajaratnam > > Currently, integrations test is looking at specific log messages to determine > whether the stratos server is ready to handle request or not. Proper way > would be to check with an API whether the server is ready or not. I propose > we need to handle this in the following way. > a) exposing an API in mock API to check whether mock iaas is activated or not. > b) integration tests should be started after getting a positive response from > the above API. > As per our component start up order, the above solution will make sure that > every component is ready to handle requests. -- This message was sent by Atlassian JIRA (v6.3.4#6332)