FileDocCategorySizeDatePackage
TestTwo.javaAPI DocphoneME MR2 API (J2ME)2438Wed May 02 18:00:22 BST 2007javax.microedition.lcdui

TestTwo

public class TestTwo extends TestCase

Fields Summary
Constructors Summary
Methods Summary
public voidrunTests()

        declare("testCreate");
        testCreate();
        declare("testCheckValueIndefinite");
        testCheckValueIndefinite();
        declare("testCheckValueAbove");
        testCheckValueAbove();
        declare("testCheckValueBelow");
        testCheckValueBelow();
    
public voidtestCheckValueAbove()

        Gauge g = new Gauge("GaugeTest", true, 47, 29);

        // value above top of range should get set to MAX
        g.setMaxValue(22);
        assertEquals(22, g.value);
    
public voidtestCheckValueBelow()

        Gauge g = new Gauge("GaugeTest", true, 100, 50);

        // value less than zero should get set to zero
        g.setValue(-17);
        assertEquals(0, g.value);
    
public voidtestCheckValueIndefinite()

        Gauge g = new Gauge("GaugeTest", false, 100, 50);

        // value out of range should get set to CONTINUOUS_IDLE
        g.setMaxValue(Gauge.INDEFINITE);
        assertEquals(Gauge.CONTINUOUS_IDLE, g.value);
    
public voidtestCreate()

        Gauge g = new Gauge("GaugeTest", true, 100, 50);
        assertEquals(100, g.maxValue);
        assertEquals(50, g.value);
        assertNotNull(g.gaugeLF);
        assertTrue(g.interactive);