コード例 #1
0
    @Before
    public void setUpValidObject() {
      cTest = new ClusterValidator();

      cluster = new Cluster();
      cluster.setDescription("a-desc");
      cluster.setName("aName");
    }
コード例 #2
0
    @Before
    public void standUp() {
      cTest = new ClusterValidator();

      cluster = new Cluster();
      cluster.setDescription("a-new-cluster");
      cluster.setName("a-cluster-name");
      cluster.setDataCenter(DataCenter.DFW);
      cluster.setUsername("username");
      cluster.setPassword("password");
    }
コード例 #3
0
ファイル: StubFactory.java プロジェクト: RamGanesh/atlas-lb
  public static Clusters getClustersDetails() {
    Cluster cluster = new Cluster();
    cluster.setDataCenter(DataCenter.DFW);
    cluster.setDescription("aDesc");
    cluster.setName("aClusterName");

    Cluster cluster2 = new Cluster();
    cluster2.setDataCenter((DataCenter) rndChoice(DataCenter.values()));
    cluster2.setDescription("aDesc");
    cluster2.setName("aSecondCluster");

    Clusters clusters = new Clusters();
    clusters.getClusters().add(cluster);
    clusters.getClusters().add(cluster2);

    return clusters;
  }
コード例 #4
0
 @Test
 public void shouldRejectUtiliztation() {
   cluster.setUtilization("1%");
   ValidatorResult result = cTest.validate(cluster, POST);
   assertFalse(resultMessage(result, POST), result.passedValidation());
 }
コード例 #5
0
 @Test
 public void shouldRejectUniqueCustomers() {
   cluster.setNumberOfUniqueCustomers(2);
   ValidatorResult result = cTest.validate(cluster, POST);
   assertFalse(resultMessage(result, POST), result.passedValidation());
 }
コード例 #6
0
 @Test
 public void shouldRejectLbConfigs() {
   cluster.setNumberOfLoadBalancingConfigurations(2);
   ValidatorResult result = cTest.validate(cluster, POST);
   assertFalse(resultMessage(result, POST), result.passedValidation());
 }
コード例 #7
0
 @Test
 public void shouldRejectNullDataCenter() {
   cluster.setDataCenter(null);
   ValidatorResult result = cTest.validate(cluster, POST);
   assertFalse(resultMessage(result, POST), result.passedValidation());
 }
コード例 #8
0
 @Test
 public void shouldRejectHostMachines() {
   cluster.setNumberOfHostMachines(2);
   ValidatorResult result = cTest.validate(cluster, PUT);
   assertFalse(resultMessage(result, PUT), result.passedValidation());
 }