public SimpleHttpSource ensureReady(int timeoutInMillis) {
		long giveUpAt = System.currentTimeMillis() + timeoutInMillis;
		String url = "http://" + host + ":" + port;
		while (System.currentTimeMillis() < giveUpAt) {
			try {
				new RestTemplate().headForHeaders(url);
				return this;
			}
			catch (Exception e) {
				try {
					Thread.sleep(100);
				}
				catch (InterruptedException e1) {
					Thread.currentThread().interrupt();
					throw new IllegalStateException(e1);
				}
			}
		}
		throw new IllegalStateException(String.format(
				"Source [%s] does not seem to be listening after waiting for %dms", this, timeoutInMillis));
	}
Ensure that the source is ready to take requests by sending http header requests for up to the timeout specified
in millisecionds, sleeping 100 ms between attempts.

@param timeoutInMillis
@return a new SimpleHttpSource
@throws IllegalStateException if can't connect to the source within the given timeout.
spring-xd-test-fixtures/src/main/java/org/springframework/xd/test/fixtures/SimpleHttpSource.java