"../serengeti/WebContent/WEB-INF/spring/tx-context.xml",
"../serengeti/WebContent/WEB-INF/spring/serengeti-jobs-context.xml",
"../serengeti/WebContent/WEB-INF/spring/manager-context.xml");
context.getBean(SoftwareManagerCollector.class).loadSoftwareManagers();
clusterConfigMgr = context.getBean(ClusterConfigManager.class);
DistroManager distroMgr = Mockito.mock(DistroManager.class);
ClusteringService clusteringService =
Mockito.mock(ClusteringService.class);
mockChefServerRoles();
clusterConfigMgr.setClusteringService(clusteringService);
clusterEntityMgr =
context
.getBean("clusterEntityManager", IClusterEntityManager.class);
DistroRead distro = new DistroRead();
List<String> roles = new ArrayList<String>();
roles.add("hadoop_namenode");
roles.add("hadoop_jobtracker");
roles.add("hadoop_datanode");
roles.add("hadoop_tasktracker");
roles.add("hadoop_client");
roles.add("hive");
roles.add("hive_server");
roles.add("pig");
distro.setRoles(roles);
Mockito.when(clusteringService.getTemplateVmId()).thenReturn("vm-1234");
Mockito.when(clusteringService.getTemplateVmName()).thenReturn(
"hadoop-template");
Mockito.when(distroMgr.getDistroByName("apache")).thenReturn(distro);
Mockito.when(distroMgr.checkPackagesExistStatus("apache")).thenReturn(
PackagesExistStatus.TARBALL);
Mockito.when(
distroMgr.getPackageUrlByDistroRole("apache",
HadoopRole.HADOOP_NAMENODE_ROLE.toString())).thenReturn(
"http://localhost/distros/apache/1.0.1/hadoop-1.0.1.tar.gz");
Mockito.when(
distroMgr.getPackageUrlByDistroRole("apache",
HadoopRole.HIVE_ROLE.toString())).thenReturn(
"http://localhost/distros/apache/1.0.1/hive-0.8.1.tar.gz");
Mockito.when(
distroMgr.getPackageUrlByDistroRole("apache",
HadoopRole.PIG_ROLE.toString())).thenReturn(
"http://localhost/distros/apache/1.0.1/pig-0.9.2.tar.gz");
Mockito.when(
distroMgr.getPackageUrlByDistroRole("apache",
HadoopRole.HBASE_MASTER_ROLE.toString())).thenReturn(
"http://localhost/distros/apache/1.0.1/hbase-0.94.0.tar.gz");
Mockito.when(
distroMgr.getPackageUrlByDistroRole("apache",
HadoopRole.ZOOKEEPER_ROLE.toString())).thenReturn(
"http://localhost/distros/apache/1.0.1/zookeeper-3.4.3.tar.gz");
IResourcePoolService resPoolSvc =
context.getBean("resourcePoolService", IResourcePoolService.class);
IDatastoreService dsSvc =