CommonClusterExpandPolicy { public static void expandDistro(ClusterCreate clusterConfig, IronfanStack stack) { String packagesExistStatus = stack.getPackagesExistStatus(); clusterConfig.setPackagesExistStatus(packagesExistStatus); switch (packagesExistStatus) { case "TARBALL": HadoopDistroMap map = new HadoopDistroMap(); Map<String, String> distroMap = stack.getHadoopDistroMap(); map.setTarballUrl(distroMap.get("TarballUrl")); map.setHadoopUrl(distroMap.get("HadoopUrl")); map.setHiveUrl(distroMap.get("HiveUrl")); map.setPigUrl(distroMap.get("PigUrl")); map.setHbaseUrl(distroMap.get("HbaseUrl")); map.setZookeeperUrl(distroMap.get("ZookeeperUrl")); clusterConfig.setDistroMap(map); break; case "REPO": clusterConfig.setPackageRepos(stack.getPackageRepos()); break; case "NONE": throw ClusterConfigException.MANIFEST_CONFIG_TARBALL_REPO_NONE(); case "BOTH": throw ClusterConfigException.MANIFEST_CONFIG_TARBALL_REPO_COEXIST(); } }  static void expandGroupInstanceType(NodeGroupEntity ngEntity, NodeGroupCreate group,
         Set<String> sharedPattern, Set<String> localPattern, SoftwareManager softwareManager); static void expandDistro(ClusterCreate clusterConfig,
         IronfanStack stack);  }
@Test(groups = { "TestCommonClusterExpandPolicy" }) public void testExpandDistro() { final String hadoopUrl = "apache/1.2.1/hadoop-1.2.1.tar.gz"; final String zookeeperUrl = "apache/1.2.1/zookeeper-3.4.5.tar.gz"; final String bigTopRepoUrl = "https: ClusterCreate clusterConfig = new ClusterCreate(); IronfanStack stack = new IronfanStack(); stack.setPackagesExistStatus("TARBALL"); Map<String, String> hadoopDistroMap = new HashMap<String, String>(); hadoopDistroMap.put("HadoopUrl", hadoopUrl); hadoopDistroMap.put("ZookeeperUrl", zookeeperUrl); stack.setHadoopDistroMap(hadoopDistroMap); CommonClusterExpandPolicy.expandDistro(clusterConfig, stack); assertEquals(clusterConfig.getDistroMap().getHadoopUrl(), hadoopUrl); assertEquals(clusterConfig.getDistroMap().getZookeeperUrl(), zookeeperUrl); stack.setPackagesExistStatus("REPO"); List<String> repos = new ArrayList<String>(); repos.add(bigTopRepoUrl); stack.setPackageRepos(repos); CommonClusterExpandPolicy.expandDistro(clusterConfig, stack); assertEquals(clusterConfig.getPackageRepos().get(0), bigTopRepoUrl); }