Search in sources :

Example 6 with DemoPage

use of com.github.noraui.application.page.demo.DemoPage in project NoraUi by NoraUi.

the class StepUT method testFormatMessageNullPageElement.

@Test
public void testFormatMessageNullPageElement() {
    try {
        final DemoPage demoPage = (DemoPage) Page.getInstance(DEMO_PAGE_NAME);
        final PageElement pageElement = demoPage.getPageElementByKey("fake");
        Messages.format("Message %s in %s.", pageElement, demoPage.getApplication());
    } catch (final TechnicalException e) {
        Assert.assertEquals("TechnicalException found", "Technical problem in the code Messages.formatMessage(String templateMessage, String... args) in NoraUi.", e.getMessage());
    }
}
Also used : TechnicalException(com.github.noraui.exception.TechnicalException) DemoPage(com.github.noraui.application.page.demo.DemoPage) PageElement(com.github.noraui.application.page.Page.PageElement) Test(org.junit.Test)

Example 7 with DemoPage

use of com.github.noraui.application.page.demo.DemoPage in project NoraUi by NoraUi.

the class PageUT method checkGuiceSingletonTest.

@Test
public void checkGuiceSingletonTest() throws TechnicalException {
    DemoPage demoPage1 = (DemoPage) Page.getInstance(DEMO_PAGE_NAME);
    DemoPage demoPage2 = (DemoPage) Page.getInstance(DEMO_PAGE_NAME);
    Assert.assertEquals(demoPage1, demoPage2);
}
Also used : DemoPage(com.github.noraui.application.page.demo.DemoPage) Test(org.junit.Test)

Aggregations

DemoPage (com.github.noraui.application.page.demo.DemoPage)7 Test (org.junit.Test)7 PageElement (com.github.noraui.application.page.Page.PageElement)6 TechnicalException (com.github.noraui.exception.TechnicalException)6