@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)); }
@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)); }
@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"))); }
@Test public void testExclusiveModeEmptyLabel() throws Exception { setUpCloud("", Node.Mode.EXCLUSIVE); assertEquals(false, ac.canProvision(null)); }
@Test public void testEmptyLabel() throws Exception { setUpCloud(""); assertEquals(true, ac.canProvision(null)); }