Search in sources :

Example 1 with GeneratorException

use of org.eclipse.nebula.widgets.nattable.dataset.generator.GeneratorException in project nebula.widgets.nattable by eclipse.

the class DataGeneratorTest method testGenerate.

@Test
public void testGenerate() {
    try {
        PricingDataBean pricingDataBean = new DataGenerator<PricingDataBean>().generate(PricingDataBean.class);
        Assert.assertNotNull(pricingDataBean);
        Assert.assertTrue(pricingDataBean.getBid() >= 0.0d);
        Assert.assertTrue(pricingDataBean.getBid() < 10000.0d);
        Assert.assertTrue(pricingDataBean.getAsk() >= 0.0d);
        Assert.assertTrue(pricingDataBean.getAsk() < 10000.0d);
        Assert.assertTrue(pricingDataBean.getClosingPrice() >= 0.0d);
        Assert.assertTrue(pricingDataBean.getClosingPrice() < 10000.0d);
        Assert.assertNotNull(pricingDataBean.getPricingSource());
    } catch (GeneratorException e) {
        e.printStackTrace();
        Assert.fail(e.getMessage() + " : " + e.getCause().getMessage());
    }
}
Also used : GeneratorException(org.eclipse.nebula.widgets.nattable.dataset.generator.GeneratorException) PricingDataBean(org.eclipse.nebula.widgets.nattable.dataset.pricing.PricingDataBean) Test(org.junit.Test)

Aggregations

GeneratorException (org.eclipse.nebula.widgets.nattable.dataset.generator.GeneratorException)1 PricingDataBean (org.eclipse.nebula.widgets.nattable.dataset.pricing.PricingDataBean)1 Test (org.junit.Test)1