コード例 #1
0
  @Test
  public void testLabelAtom() throws Exception {
    setUpCloud(LABEL1 + " " + LABEL2);

    assertEquals(true, ac.canProvision(new LabelAtom(LABEL1)));
    assertEquals(true, ac.canProvision(new LabelAtom(LABEL2)));
    assertEquals(false, ac.canProvision(new LabelAtom("aaa")));
    assertEquals(true, ac.canProvision(null));
  }
コード例 #2
0
  @Test
  public void testExclusiveMode() throws Exception {
    setUpCloud(LABEL1 + " " + LABEL2, Node.Mode.EXCLUSIVE);

    assertEquals(true, ac.canProvision(new LabelAtom(LABEL1)));
    assertEquals(true, ac.canProvision(new LabelAtom(LABEL2)));
    assertEquals(false, ac.canProvision(new LabelAtom("aaa")));
    assertEquals(false, ac.canProvision(null));
  }
コード例 #3
0
  @Test
  public void testLabelExpression() throws Exception {
    setUpCloud(LABEL1 + " " + LABEL2);

    assertEquals(true, ac.canProvision(Label.parseExpression(LABEL1 + " || " + LABEL2)));
    assertEquals(true, ac.canProvision(Label.parseExpression(LABEL1 + " && " + LABEL2)));
    assertEquals(true, ac.canProvision(Label.parseExpression(LABEL1 + " || aaa")));
    assertEquals(false, ac.canProvision(Label.parseExpression(LABEL1 + " && aaa")));
    assertEquals(false, ac.canProvision(Label.parseExpression("aaa || bbb")));
    assertEquals(false, ac.canProvision(Label.parseExpression("aaa || bbb")));
  }
コード例 #4
0
  @Test
  public void testExclusiveModeEmptyLabel() throws Exception {
    setUpCloud("", Node.Mode.EXCLUSIVE);

    assertEquals(false, ac.canProvision(null));
  }
コード例 #5
0
  @Test
  public void testEmptyLabel() throws Exception {
    setUpCloud("");

    assertEquals(true, ac.canProvision(null));
  }