Package com.vmware.bdd.software.mgmt.plugin.model

Examples of com.vmware.bdd.software.mgmt.plugin.model.ClusterBlueprint


            failedMsgList.get(0));
   }

   @Test
   public void testValidateInfraSettingsBasedOnRole() {
      ClusterBlueprint blueprint = new ClusterBlueprint();
      blueprint.setHadoopStack(new HadoopStack());
      blueprint.getHadoopStack().setDistro(Constants.DEFAULT_VENDOR);

      Map<NetTrafficType, List<String>> networkConfig = new HashMap<NetTrafficType, List<String>>();

      List<String> mgtnets = new ArrayList<String>();
      mgtnets.add("nw1");
      networkConfig.put(NetTrafficType.MGT_NETWORK, mgtnets);

      List<String> hadpnets = new ArrayList<String>();
      hadpnets.add("nw2");
      networkConfig.put(NetTrafficType.HDFS_NETWORK, hadpnets);

      NodeGroupInfo master = new NodeGroupInfo();
      master.setName("master");
      master.setInstanceNum(1);
      master.setRoles(Arrays.asList(HadoopRole.HADOOP_NAMENODE_ROLE.toString(),
            HadoopRole.HADOOP_RESOURCEMANAGER_ROLE.toString()));
      NodeGroupInfo worker = new NodeGroupInfo();
      worker.setName("worker");
      worker.setRoles(Arrays.asList(HadoopRole.HADOOP_DATANODE.toString(),
            HadoopRole.HADOOP_NODEMANAGER_ROLE.toString()));
      worker.setInstanceNum(0);
      NodeGroupInfo client = new NodeGroupInfo();
      client.setName("client");
      client.setInstanceNum(0);
      client.setRoles(Arrays.asList(HadoopRole.HADOOP_CLIENT_ROLE.toString(),
            HadoopRole.HIVE_SERVER_ROLE.toString(),
            HadoopRole.HIVE_ROLE.toString()));
      List<String> failedMsgList = new ArrayList<String>();
      List<String> warningMsgList = new ArrayList<String>();
      List<NodeGroupInfo> groups = new ArrayList<NodeGroupInfo>();
      groups.add(master);
      groups.add(worker);
      groups.add(client);
      blueprint.setNodeGroups(groups);
      validator.validateGroupConfig(blueprint, failedMsgList, warningMsgList);
      assertEquals(1, failedMsgList.size());
      assertEquals("worker.instanceNum=0.", failedMsgList.get(0));
      assertEquals(0, warningMsgList.size());
   }
View Full Code Here


      NodeGroupCreate master = new NodeGroupCreate();
      master.setRoles(Arrays.asList("hadoop_namenode",
      "hadoop_jobtracker"));
      cluster.setNodeGroups(new NodeGroupCreate[] { client, worker, master });
      assertEquals(3, cluster.getNodeGroups().length);
      ClusterBlueprint blueprint = cluster.toBlueprint();
      defaultSoftwareManager.updateInfrastructure(blueprint);
      assertEquals(master.getName(), blueprint.getNodeGroups().get(0).getName());
      assertEquals(worker.getName(), blueprint.getNodeGroups().get(1).getName());
      assertEquals(client.getName(), blueprint.getNodeGroups().get(2).getName());
   }
View Full Code Here

   }

   @Test
   public void testHasComputeMasterGroup() {
      ClusterBlueprint blueprint = new ClusterBlueprint();
      HadoopStack hadoopStack = new HadoopStack();
      hadoopStack.setVendor(Constants.DEFAULT_VENDOR);
      blueprint.setHadoopStack(hadoopStack);
      NodeGroupInfo compute = new NodeGroupInfo();
      compute.setRoles(Arrays.asList(HadoopRole.HADOOP_NODEMANAGER_ROLE.toString()));
      List<NodeGroupInfo> nodeGroupInfos = new ArrayList<NodeGroupInfo>();
      nodeGroupInfos.add(compute);
      blueprint.setNodeGroups(nodeGroupInfos);
      assertFalse(defaultSoftwareManager.hasComputeMasterGroup(blueprint));
      NodeGroupInfo master = new NodeGroupInfo();
      master.setRoles(Arrays.asList(HadoopRole.HADOOP_RESOURCEMANAGER_ROLE.toString()));
      nodeGroupInfos.add(master);
      blueprint.setNodeGroups(nodeGroupInfos);
      assertTrue(defaultSoftwareManager.hasComputeMasterGroup(blueprint));
   }
View Full Code Here

   }

   @Test(groups = {"TestCmClusterValidator"})
   public void testSuccess() {
      try {
         ClusterBlueprint blueprint = generateBlueprint();
         CmClusterValidator validator = new CmClusterValidator();
         Assert.assertTrue(validator.validateBlueprint(blueprint));
      } catch (ValidationException e) {
         System.out.println("warning_msg_list: " + e.getWarningMsgList());
         System.out.println("error_msg_list: " + e.getFailedMsgList());
View Full Code Here

   }

   @Test(groups = {"TestCmClusterValidator"})
   public void testUnrecogRolesOfDistro() {
      try {
         ClusterBlueprint blueprint = generateBlueprint();
         blueprint.getHadoopStack().setDistro("CDH-4.0.0");
         CmClusterValidator validator = new CmClusterValidator();
         Assert.assertFalse(validator.validateBlueprint(blueprint));
      } catch (ValidationException e) {
         System.out.println("warning_msg_list: " + e.getWarningMsgList());
         System.out.println("error_msg_list: " + e.getFailedMsgList());
View Full Code Here

   }

   @Test(groups = {"TestCmClusterValidator"})
   public void testUnrecogRoles() {
      try {
         ClusterBlueprint blueprint = generateBlueprint();
         blueprint.getNodeGroups().get(0).getRoles().add("FAKE_ROLE01");
         blueprint.getNodeGroups().get(1).getRoles().add("FAKE_ROLE02");
         CmClusterValidator validator = new CmClusterValidator();
         Assert.assertFalse(validator.validateBlueprint(blueprint));
      } catch (ValidationException e) {
         System.out.println("warning_msg_list: " + e.getWarningMsgList());
         System.out.println("error_msg_list: " + e.getFailedMsgList());
View Full Code Here

   }

   @Test(groups = {"TestCmClusterValidator"})
   public void testUnrecogConfigTypes() {
      try {
         ClusterBlueprint blueprint = generateBlueprint();
         blueprint.getConfiguration().put("FAKE_CONFIG", new HashMap<String, String>());
         CmClusterValidator validator = new CmClusterValidator();
         Assert.assertTrue(validator.validateBlueprint(blueprint));
      } catch (ValidationException e) {
         System.out.println("warning_msg_list: " + e.getWarningMsgList());
         System.out.println("error_msg_list: " + e.getFailedMsgList());
View Full Code Here

   }

   @Test(groups = {"TestCmClusterValidator"})
   public void testBadConfigItems() {
      try {
         ClusterBlueprint blueprint = generateBlueprint();
         Map<String, String> hdfsConfig = (Map<String, String>) blueprint.getConfiguration().get("HDFS");
         hdfsConfig.put("fake_config_01", "value");

         Map<String, String> nnConfig = (Map<String, String>) blueprint.getNodeGroups().get(0).getConfiguration().get("HDFS_NAMENODE");
         nnConfig.put("fake_config_02", "value");

         CmClusterValidator validator = new CmClusterValidator();
         Assert.assertFalse(validator.validateBlueprint(blueprint));
      } catch (ValidationException e) {
View Full Code Here

   }

   @Test(groups = {"TestCmClusterValidator"})
   public void testMissedRoles() {
      try {
         ClusterBlueprint blueprint = generateBlueprint();
         blueprint.getNodeGroups().get(1).getRoles().remove("HDFS_DATANODE");
         blueprint.getNodeGroups().get(0).getRoles().remove("YARN_RESOURCE_MANAGER");
         CmClusterValidator validator = new CmClusterValidator();
         Assert.assertFalse(validator.validateBlueprint(blueprint));
      } catch (ValidationException e) {
         System.out.println("warning_msg_list: " + e.getWarningMsgList());
         System.out.println("error_msg_list: " + e.getFailedMsgList());
View Full Code Here

   }

   @Test(groups = {"TestCmClusterValidator"})
   public void testNnHA() {
      try {
         ClusterBlueprint blueprint = generateBlueprint();
         blueprint.getNodeGroups().get(0).getRoles().remove("HDFS_SECONDARY_NAMENODE");
         CmClusterValidator validator = new CmClusterValidator();
         Assert.assertFalse(validator.validateBlueprint(blueprint));
      } catch (ValidationException e) {
         System.out.println("warning_msg_list: " + e.getWarningMsgList());
         System.out.println("error_msg_list: " + e.getFailedMsgList());
View Full Code Here

TOP

Related Classes of com.vmware.bdd.software.mgmt.plugin.model.ClusterBlueprint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.