Package com.vaadin.tests.server.component.slider

Source Code of com.vaadin.tests.server.component.slider.SliderTest

package com.vaadin.tests.server.component.slider;

import junit.framework.TestCase;

import org.junit.Assert;

import com.vaadin.ui.Slider;
import com.vaadin.ui.Slider.ValueOutOfBoundsException;

public class SliderTest extends TestCase {

    public void testOutOfBounds() {
        Slider s = new Slider(0, 10);
        s.setValue(0.0);
        Assert.assertEquals(0.0, s.getValue().doubleValue(), 0.001);
        s.setValue(10.0);
        Assert.assertEquals(10.0, s.getValue().doubleValue(), 0.001);
        try {
            s.setValue(20.0);
            fail("Should throw out of bounds exception");
        } catch (ValueOutOfBoundsException e) {
            // TODO: handle exception
        }

    }
}
TOP

Related Classes of com.vaadin.tests.server.component.slider.SliderTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.