@Override
	public void startup() {
		Assert.state(started.compareAndSet(false, true), "startup should only be invoked once");

		try {
			int zooKeeperPort = SocketUtils.findAvailableServerSocket();
			logger.info("ZooKeeper port: {}", zooKeeperPort);
			zooKeeper = ServerProcessUtils.startZooKeeper(zooKeeperPort);

			int hsqlPort = SocketUtils.findAvailableServerSocket();
			logger.info("HSQL port: {}", hsqlPort);

			// create system properties to pass to HSQL starter
			Properties systemProperties = new Properties();
			systemProperties.setProperty("hsql.server.port", String.valueOf(hsqlPort));
			hsqlServer = ServerProcessUtils.startHsql(systemProperties);

			// add the ZooKeeper connect string to the properties
			// passed to HSQL; these properties will be used
			// by containers and the admin
			systemProperties.setProperty("zk.client.connect", "localhost:" + zooKeeperPort);

			// set up the system properties to be used by
			// containers created in tests
			containerSystemProperties = new Properties();
			containerSystemProperties.putAll(systemProperties);

			// generate a port for the admin and include this
			// port in system properties passed to the admin
			int adminPort = SocketUtils.findAvailableServerSocket();
			logger.info("Admin port: {}", adminPort);

			adminUrl = "http://localhost:" + adminPort;
			systemProperties.setProperty("server.port", String.valueOf(adminPort));
			adminServer = ServerProcessUtils.startAdmin(systemProperties);
		}
		catch (RuntimeException e) {
			throw e;
		}
		catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
{@inheritDoc}
<p />
Also populates the following for use in testing:
<ul>
    <li>{@link #containerSystemProperties} for use in creating
        new container processes via
        {@link org.springframework.xd.distributed.util.ServerProcessUtils#startContainer}</li>
    <li>{@link #adminUrl} for connecting to the admin server</li>
</ul>
This implementation may only be invoked once for a test suite execution.
This restriction is intended to ensure that tests execute as quickly as
possible. Starting up the test infrastructure is expensive and multiple
invocations will slow test execution down.
spring-xd-distributed-test/src/main/java/org/springframework/xd/distributed/util/DefaultDistributedTestSupport.java