Search in sources :

Example 1 with BeanProvider

use of com.github.bordertech.wcomponents.BeanProvider in project wcomponents by BorderTech.

the class WProgressBarRenderer_Test method testDoPaint.

@Test
public void testDoPaint() throws IOException, SAXException, XpathException {
    BeanProvider provider = new BeanProvider() {

        @Override
        public Object getBean(final BeanProviderBound beanProviderBound) {
            return 13;
        }
    };
    WProgressBar progressBar = new WProgressBar(WProgressBar.ProgressBarType.NORMAL, WProgressBar.UnitType.FRACTION);
    progressBar.setBeanProvider(provider);
    progressBar.setMax(33);
    assertXpathExists("//html:progress[@max='33']", progressBar);
    progressBar = new WProgressBar(WProgressBar.ProgressBarType.SMALL, WProgressBar.UnitType.PERCENTAGE);
    progressBar.setBeanProvider(provider);
    progressBar.setMax(33);
    assertXpathExists("//html:progress[@max='33' and contains(@class, 'wc-progressbar-type-small')]", progressBar);
}
Also used : BeanProvider(com.github.bordertech.wcomponents.BeanProvider) WProgressBar(com.github.bordertech.wcomponents.WProgressBar) BeanProviderBound(com.github.bordertech.wcomponents.BeanProviderBound) Test(org.junit.Test)

Aggregations

BeanProvider (com.github.bordertech.wcomponents.BeanProvider)1 BeanProviderBound (com.github.bordertech.wcomponents.BeanProviderBound)1 WProgressBar (com.github.bordertech.wcomponents.WProgressBar)1 Test (org.junit.Test)1