當前位置: 首頁>>代碼示例>>Java>>正文


Java Require類代碼示例

本文整理匯總了Java中com.redhat.darcy.ui.annotations.Require的典型用法代碼示例。如果您正苦於以下問題:Java Require類的具體用法?Java Require怎麽用?Java Require使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Require類屬於com.redhat.darcy.ui.annotations包,在下文中一共展示了Require類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shouldReturnTrueIfRequireIsSpecifiedForAListWithASingleElementLoaded

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnTrueIfRequireIsSpecifiedForAListWithASingleElementLoaded() {
    class TestViewElement extends AbstractViewElement {
        @Require
        private List<Findable> findables;

        public TestViewElement() {
            super(mock(Locator.class));
            findables = new ArrayList<Findable>();
            findables.add(new NeverDisplayedElement());
        }
    }

    TestViewElement view = new TestViewElement();

    assertTrue("isPresent should return true if no specific requirement limit is specified for" +
            " for a list that has at least a single element present.", view.isPresent());
}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:19,代碼來源:AbstractViewElementIsPresentTest.java

示例2: shouldReturnFalseIfRequireIsSpecifiedForAListWithNoElementsLoaded

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnFalseIfRequireIsSpecifiedForAListWithNoElementsLoaded() {
    class TestViewElement extends AbstractViewElement {
        @Require
        private List<Findable> findables;

        public TestViewElement() {
            super(mock(Locator.class));
            findables = new ArrayList<Findable>();
        }
    }

    TestViewElement view = new TestViewElement();

    assertFalse("isPresent should return false if a list with no elements present is specified" +
            " required with no requirement limit.", view.isPresent());

}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:19,代碼來源:AbstractViewElementIsPresentTest.java

示例3: shouldReturnTrueIfExactNumberOfRequiredElementsArePresent

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void  shouldReturnTrueIfExactNumberOfRequiredElementsArePresent() {
    class TestViewElement extends AbstractViewElement {
        @Require(exactly = 5)
        List<Findable> findables;

        public TestViewElement() {
            super(mock(Locator.class));

            findables = new ArrayList<Findable>();

            while (findables.size() < 5) {
                findables.add(new NeverDisplayedElement());
            }
        }
    }

    TestViewElement element = new TestViewElement();

    assertTrue("isPresent should return true if a list with exactly as many elements as specified" +
            " are present.", element.isPresent());
}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:23,代碼來源:AbstractViewElementIsPresentTest.java

示例4: shouldReturnFalseIfExactNumberOfRequiredElementsAreNotPresent

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnFalseIfExactNumberOfRequiredElementsAreNotPresent() {
    class TestViewElement extends AbstractViewElement {
        @Require(exactly = 5)
        List<Findable> findables;

        public TestViewElement() {
            super(mock(Locator.class));

            findables = new ArrayList<Findable>();

            while (findables.size() < 4) {
                findables.add(new NeverDisplayedElement());
            }

            findables.add(new NeverFoundElement());
        }
    }

    TestViewElement element = new TestViewElement();

    assertFalse("isPresent should return false if a list with less than exactly as many elements as specified" +
            " are present.", element.isPresent());

}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:26,代碼來源:AbstractViewElementIsPresentTest.java

示例5: shouldReturnTrueIfAtLeastAsManyRequiredElementsArePresent

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnTrueIfAtLeastAsManyRequiredElementsArePresent() {
    class TestViewElement extends AbstractViewElement {
        @Require(atLeast = 5)
        List<Findable> findables;

        public TestViewElement() {
            super(mock(Locator.class));

            findables = new ArrayList<Findable>();

            while (findables.size() < 5) {
                findables.add(new NeverDisplayedElement());
            }

        }
    }

    TestViewElement element = new TestViewElement();

    assertTrue("isPresent should return true if at least a number of elements are present as" +
               " specified to be required.", element.isPresent());

}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:25,代碼來源:AbstractViewElementIsPresentTest.java

示例6: shouldReturnTrueIfAtMostAsManyRequiredElementsArePresent

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnTrueIfAtMostAsManyRequiredElementsArePresent() {
    class TestViewElement extends AbstractViewElement {
        @Require(atMost = 5)
        List<Findable> findables;

        public TestViewElement() {
            super(mock(Locator.class));

            findables = new ArrayList<Findable>();

            while (findables.size() < 5) {
                findables.add(new NeverDisplayedElement());
            }

        }
    }

    TestViewElement element = new TestViewElement();

    assertTrue("isPresent should return true if at most a number of elements are present as" +
            " specified to be required.", element.isPresent());

}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:25,代碼來源:AbstractViewElementIsPresentTest.java

示例7: shouldReturnTrueIfRequireIsSpecifiedForAListWithASingleElementLoaded

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnTrueIfRequireIsSpecifiedForAListWithASingleElementLoaded() {
    class TestViewElement extends AbstractViewElement {
        @Require
        private List<Element> elements;

        public TestViewElement() {
            super(mock(Locator.class));
            elements = new ArrayList<Element>();
            elements.add(new AlwaysDisplayedLabel());
        }
    }

    TestViewElement view = new TestViewElement();

    assertTrue("isDisplayed should return true if no specific requirement limit is specified for" +
            " for a list that has at least a single element displayed.", view.isDisplayed());
}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:19,代碼來源:AbstractViewElementIsDisplayedTest.java

示例8: shouldReturnFalseIfRequireIsSpecifiedForAListWithNoElementsLoaded

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnFalseIfRequireIsSpecifiedForAListWithNoElementsLoaded() {
    class TestViewElement extends AbstractViewElement {
        @Require
        private List<Element> elements;

        public TestViewElement() {
            super(mock(Locator.class));
            elements = new ArrayList<Element>();
        }
    }

    TestViewElement view = new TestViewElement();

    assertFalse("isDisplayed should return false if a list with no elements displayed is specified" +
            " required with no requirement limit.", view.isDisplayed());

}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:19,代碼來源:AbstractViewElementIsDisplayedTest.java

示例9: shouldReturnTrueIfExactNumberOfRequiredElementsAreDisplayed

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void  shouldReturnTrueIfExactNumberOfRequiredElementsAreDisplayed() {
    class TestViewElement extends AbstractViewElement {
        @Require(exactly = 5)
        List<Element> elements;

        public TestViewElement() {
            super(mock(Locator.class));

            elements = new ArrayList<Element>();

            while (elements.size() < 5) {
                elements.add(new AlwaysDisplayedLabel());
            }
        }
    }

    TestViewElement element = new TestViewElement();

    assertTrue("isDisplayed should return true if a list with exactly as many elements as specified" +
            " are displayed.", element.isDisplayed());
}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:23,代碼來源:AbstractViewElementIsDisplayedTest.java

示例10: shouldReturnFalseIfExactNumberOfRequiredElementsAreNotDisplayed

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnFalseIfExactNumberOfRequiredElementsAreNotDisplayed() {
    class TestViewElement extends AbstractViewElement {
        @Require(exactly = 5)
        List<Element> elements;

        public TestViewElement() {
            super(mock(Locator.class));

            elements = new ArrayList<Element>();

            while (elements.size() < 4) {
                elements.add(new AlwaysDisplayedLabel());
            }

            elements.add(new NeverDisplayedElement());
        }
    }

    TestViewElement element = new TestViewElement();

    assertFalse("isDisplayed should return false if a list with less than exactly as many elements as specified" +
            " are displayed.", element.isDisplayed());

}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:26,代碼來源:AbstractViewElementIsDisplayedTest.java

示例11: shouldReturnTrueIfAtLeastAsManyRequiredElementsAreDisplayed

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnTrueIfAtLeastAsManyRequiredElementsAreDisplayed() {
    class TestViewElement extends AbstractViewElement {
        @Require(atLeast = 5)
        List<Element> elements;

        public TestViewElement() {
            super(mock(Locator.class));

            elements = new ArrayList<Element>();

            while (elements.size() < 5) {
                elements.add(new AlwaysDisplayedLabel());
            }

        }
    }

    TestViewElement element = new TestViewElement();

    assertTrue("isDisplayed should return true if at least a number of elements are displayed as" +
            " specified to be required.", element.isDisplayed());

}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:25,代碼來源:AbstractViewElementIsDisplayedTest.java

示例12: shouldReturnTrueIfAtMostAsManyRequiredElementsAreDisplayed

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnTrueIfAtMostAsManyRequiredElementsAreDisplayed() {
    class TestViewElement extends AbstractViewElement {
        @Require(atMost = 5)
        List<Element> elements;

        public TestViewElement() {
            super(mock(Locator.class));

            elements = new ArrayList<Element>();

            while (elements.size() < 5) {
                elements.add(new AlwaysDisplayedLabel());
            }

        }
    }

    TestViewElement element = new TestViewElement();

    assertTrue("isDisplayed should return true if at most a number of elements are displayed as" +
            " specified to be required.", element.isDisplayed());

}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:25,代碼來源:AbstractViewElementIsDisplayedTest.java

示例13: shouldReturnTrueIfRequireIsSpecifiedForAListWithASingleElementLoaded

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnTrueIfRequireIsSpecifiedForAListWithASingleElementLoaded() {
    class TestView extends AbstractView {
        @Require
        private List<Element> elements;

        public TestView() {
            elements = new ArrayList<Element>();
            elements.add(new AlwaysDisplayedLabel());
        }
    }

    TestView view = new TestView();

    assertTrue("isLoaded should return true if no specific requirement limit is specified for" +
               " for a list that has at least a single element loaded.", view.isLoaded());
}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:18,代碼來源:AbstractViewIsLoadedTest.java

示例14: shouldReturnFalseIfRequireIsSpecifiedForAListWithNoElementsLoaded

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnFalseIfRequireIsSpecifiedForAListWithNoElementsLoaded() {
    class TestView extends AbstractView {
        @Require
        private List<Element> elements;

        public TestView() {
            elements = new ArrayList<Element>();
        }
    }

    TestView view = new TestView();

    assertFalse("isLoaded should return false if a list with no elements loaded is specified" +
                " required with no requirement limit.", view.isLoaded());

}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:18,代碼來源:AbstractViewIsLoadedTest.java

示例15: shouldReturnTrueIfExactNumberOfElementsSpecifiedInListAreLoaded

import com.redhat.darcy.ui.annotations.Require; //導入依賴的package包/類
@Test
public void shouldReturnTrueIfExactNumberOfElementsSpecifiedInListAreLoaded() {
    class TestView extends AbstractView {
        @Require(exactly = 5)
        private List<Element> elements;

        public TestView() {
            elements = new ArrayList<Element>();

            while (elements.size() < 5) {
                elements.add(new AlwaysDisplayedLabel());
            }
        }
    }

    TestView view = new TestView();

    assertTrue("Should return true if an exact number of elements in a list are loaded.",
               view.isLoaded());
}
 
開發者ID:darcy-framework,項目名稱:darcy-ui,代碼行數:21,代碼來源:AbstractViewIsLoadedTest.java


注:本文中的com.redhat.darcy.ui.annotations.Require類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。