* @param port the port on which to listen for connections
* @return the return code for the operation, where <code>0</code> indicates success
*/
public int runApplication(File blueprintFile, MockFactory.BlueprintFormat format, String host, Integer port) {
// start server from blueprint
final ExecutionInstance exec =
executionService.execute(blueprintFile, format, host, port);
LOGGER.info("Starting server on port {}", exec.getPort());
// print endpoints
final StringBuilder sbEndpoints = new StringBuilder();
sbEndpoints.append("Endpoints:");
for (ResourceDefinition endpoint : exec.getEndpoints()) {
sbEndpoints.append(String.format("\r\n(%s) http://%s:%s%s",
listRequestMethods(endpoint), exec.getHost(), exec.getPort(), endpoint.getUrl()));
}
LOGGER.info(sbEndpoints.toString());
LOGGER.info("Add ?blueprint to the end of an endpoint to see its documentation");
try {