Examples of ClusterRead


Examples of com.vmware.bdd.apitypes.ClusterRead

      createSpec.setType(ClusterType.HDFS_MAPRED);
      createSpec.setNetworkConfig(createNetConfig(TEST_STATIC_NETWORK_NAME, staticPortgroup));
      createSpec.setDistro("bigtop");
      createSpec.setDistroVendor(Constants.DEFAULT_VENDOR);
      long jobExecutionId = clusterMgr.createCluster(createSpec);
      ClusterRead cluster =
            clusterMgr.getClusterByName(TEST_STATIC_IP_CLUSTER_NAME, false);
      Assert.assertTrue(
            cluster.getStatus() == ClusterStatus.PROVISIONING,
            "Cluster status should be PROVISIONING, but got "
                  + cluster.getStatus());
      waitTaskFinished(jobExecutionId);
      cluster = clusterMgr.getClusterByName(TEST_STATIC_IP_CLUSTER_NAME, false);
      Assert.assertTrue(
            cluster.getInstanceNum() == 5,
            "Cluster instance number should be 5, but got "
                  + cluster.getInstanceNum());
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.RUNNING,
            "Cluster status should be RUNNING, but got " + cluster.getStatus());
      checkIpRange(cluster);
      checkVcFolders(TEST_STATIC_IP_CLUSTER_NAME);
      checkVcResourePools(cluster, ConfigInfo.getSerengetiUUID() + "-"
            + TEST_STATIC_IP_CLUSTER_NAME);
      checkDiskLayout(cluster);
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterRead

      createSpec.setNetworkConfig(createNetConfig(TEST_DHCP_NETWORK_NAME, dhcpPortgroup));
      createSpec.setDistro("bigtop");
      NodeGroupCreate worker = createSpec.getNodeGroup("worker");
      worker.setInstanceNum(1);
      long jobExecutionId = clusterMgr.createCluster(createSpec);
      ClusterRead cluster =
            clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
      Assert.assertTrue(
            cluster.getStatus() == ClusterStatus.PROVISIONING,
            "Cluster status should be PROVISIONING, but got "
                  + cluster.getStatus());
      stopVmAfterStarted(vcRP + "/" + ConfigInfo.getSerengetiUUID() + "-"
            + TEST_DHCP_CLUSTER_NAME + "/" + "worker", TEST_DHCP_CLUSTER_NAME
            + "-worker-0", jobExecutionId);
      waitTaskFinished(jobExecutionId);
      cluster = clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
      Assert.assertTrue(
            cluster.getInstanceNum() == 3,
            "Cluster instance number should be 3, but got "
                  + cluster.getInstanceNum());
      Assert.assertTrue(
            cluster.getStatus() == ClusterStatus.PROVISION_ERROR,
            "Cluster status should be PROVISION_ERROR, but got "
                  + cluster.getStatus());
   }
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterRead

   @Test(groups = { "TestClusteringJobs" }, dependsOnMethods = { "testCreateClusterFailed" })
   @Transactional(propagation = Propagation.NEVER)
   public void testClusterResume() throws Exception {
      long jobExecutionId =
            clusterMgr.resumeClusterCreation(TEST_DHCP_CLUSTER_NAME);
      ClusterRead cluster =
            clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
      Assert.assertTrue(
            cluster.getStatus() == ClusterStatus.PROVISIONING,
            "Cluster status should be PROVISIONING, but got "
                  + cluster.getStatus());
      waitTaskFinished(jobExecutionId);
      cluster = clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
      Assert.assertTrue(
            cluster.getInstanceNum() == 3,
            "Cluster instance number should be 3, but got "
                  + cluster.getInstanceNum());
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.RUNNING,
            "Cluster status should be RUNNING, but got " + cluster.getStatus());
   }
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterRead

   @Test(groups = { "TestClusteringJobs" }, dependsOnMethods = { "testClusterResume" })
   @Transactional(propagation = Propagation.NEVER)
   public void testClusterResizeFailed() throws Exception {
      long jobExecutionId =
            clusterMgr.resizeCluster(TEST_DHCP_CLUSTER_NAME, "worker", 2);
      ClusterRead cluster =
            clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
      Assert.assertTrue(
            cluster.getStatus() == ClusterStatus.UPDATING,
            "Cluster status should be UPDATING, but got "
                  + cluster.getStatus());
      stopVmAfterStarted(vcRP + "/" + ConfigInfo.getSerengetiUUID() + "-"
            + TEST_DHCP_CLUSTER_NAME + "/" + "worker", TEST_DHCP_CLUSTER_NAME
            + "-worker-1", jobExecutionId);
      waitTaskFinished(jobExecutionId);
      assertTaskFailed(jobExecutionId);
      assertDefinedInstanceNum(TEST_DHCP_CLUSTER_NAME, "worker", 1);

      cluster = clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.RUNNING,
            "Cluster status should be RUNNING, but got " + cluster.getStatus());
      assertTaskFailed(jobExecutionId);
   }
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterRead

   public void testClusterResizeSuccess() throws Exception {
      stopVcVm(vcRP + "/" + ConfigInfo.getSerengetiUUID() + "-"
            + TEST_DHCP_CLUSTER_NAME + "/" + "worker",
            TEST_DHCP_CLUSTER_NAME + "-worker-0");
      long jobExecutionId = clusterMgr.resizeCluster(TEST_DHCP_CLUSTER_NAME, "worker", 2);
      ClusterRead cluster =
            clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.UPDATING,
            "Cluster status should be UPDATING, but got " + cluster.getStatus());
      waitTaskFinished(jobExecutionId);
      assertTaskSuccess(jobExecutionId);
      assertDefinedInstanceNum(TEST_DHCP_CLUSTER_NAME, "worker", 2);
      NodeEntity node =
            clusterEntityMgr.findByName(TEST_DHCP_CLUSTER_NAME, "worker",
                  TEST_DHCP_CLUSTER_NAME + "-worker-0");
      Assert.assertTrue(
            node.getStatus() == NodeStatus.POWERED_OFF,
            "Stopped vm " + TEST_DHCP_CLUSTER_NAME + "-worker-0"
                  + " status should be Powered Off, but got "
                  + node.getStatus());
      cluster = clusterMgr.getClusterByName(TEST_DHCP_CLUSTER_NAME, false);
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.RUNNING,
            "Cluster status should be RUNNING, but got " + cluster.getStatus());
   }
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterRead

   @Test(groups = { "TestClusteringJobs" }, dependsOnMethods = { "testDeleteUsedRP" })
   public void testGetClusterRead() {
      ClusterEntity cluster =
            clusterEntityMgr.findByName(TEST_STATIC_IP_CLUSTER_NAME);
      assertTrue(cluster != null);
      ClusterRead clusterRead =
            clusterEntityMgr.toClusterRead(TEST_STATIC_IP_CLUSTER_NAME);
      assertTrue("parse ClusterRead object from cluster entity should work.",
            clusterRead != null);
      logger.info((new Gson()).toJson(clusterRead));
   }
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterRead

   @Test(groups = { "TestClusteringJobs" }, dependsOnMethods = { "testDupCreateCluster" })
   @Transactional(propagation = Propagation.NEVER)
   public void testStopCluster() throws Exception {
      long jobExecutionId = clusterMgr.stopCluster(TEST_STATIC_IP_CLUSTER_NAME);

      ClusterRead cluster =
            clusterMgr.getClusterByName(TEST_STATIC_IP_CLUSTER_NAME, false);
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.STOPPING,
            "Cluster status should be STOPPING, but got " + cluster.getStatus());
      waitTaskFinished(jobExecutionId);
      cluster = clusterMgr.getClusterByName(TEST_STATIC_IP_CLUSTER_NAME, false);
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.STOPPED,
            "Cluster status should be STOPPED, but got " + cluster.getStatus());
      NodeRead node = cluster.getNodeGroups().get(0).getInstances().get(0);
      Assert.assertTrue(
            node.getStatus().equals(NodeStatus.POWERED_OFF.toString()), "Node "
                  + node.getName() + " status should be Powered Off, but got "
                  + node.getStatus());
   }
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterRead

         Assert.assertTrue(false, "Cluster stop should throw exception.");
      } catch (Exception e) {
         e.printStackTrace();
         Assert.assertTrue(true, "got expected exception.");
      }
      ClusterRead cluster =
            clusterMgr.getClusterByName(TEST_STATIC_IP_CLUSTER_NAME, false);
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.STOPPED,
            "Cluster status should be STOPPED, but got " + cluster.getStatus());
   }
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterRead

   @Transactional(propagation = Propagation.NEVER)
   public void testStartCluster() throws Exception {
      long jobExecutionId =
            clusterMgr.startCluster(TEST_STATIC_IP_CLUSTER_NAME);

      ClusterRead cluster =
            clusterMgr.getClusterByName(TEST_STATIC_IP_CLUSTER_NAME, false);
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.STARTING,
            "Cluster status should be STARTING, but got " + cluster.getStatus());
      waitTaskFinished(jobExecutionId);
      cluster = clusterMgr.getClusterByName(TEST_STATIC_IP_CLUSTER_NAME, false);
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.RUNNING,
            "Cluster status should be RUNNING, but got " + cluster.getStatus());
   }
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterRead

         Assert.assertTrue(false, "Cluster start should throw exception.");
      } catch (Exception e) {
         e.printStackTrace();
         Assert.assertTrue(true, "got expected exception.");
      }
      ClusterRead cluster =
            clusterMgr.getClusterByName(TEST_STATIC_IP_CLUSTER_NAME, false);
      Assert.assertTrue(cluster.getStatus() == ClusterStatus.RUNNING,
            "Cluster status should be RUNNING, but got " + cluster.getStatus());
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.