@Before
  public void setup() throws Exception {
    injector = Guice.createInjector(Modules.override(
        new InMemoryDefaultTestModule()).with(new MockModule()));

    injector.getInstance(GuiceJpaInitializer.class);
    injector.injectMembers(this);
    helper.createStack(stackId);
    clusters.addCluster("c1", stackId);
    cluster = clusters.getCluster("c1");
    repositoryVersion = helper.getOrCreateRepositoryVersion(stackId, stackId.getStackVersion());

    String hostName = "c6401.ambari.apache.org";
    clusters.addHost(hostName);
    setOsFamily(clusters.getHost(hostName), "redhat", "6.4");
    clusters.mapHostToCluster(hostName, "c1");

    Service service = installService("HDFS");
    addServiceComponent(service, "NAMENODE");
    addServiceComponent(service, "DATANODE");

    createNewServiceComponentHost("HDFS", "NAMENODE", hostName);
    createNewServiceComponentHost("HDFS", "DATANODE", hostName);
  }
Creates a cluster and installs HDFS with NN and DN.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ConcurrentServiceConfigVersionTest.java